You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
traitA {
deffoo:Intdefbar:Int
}
caseclassB( foo: Int )( bar: Int ) extendsA
fails with compiler error: "class B needs to be abstract, since method bar in trait A of type => Int is not defined"
Explicitly adding a 'val' for the 'bar' field makes the code compilable:
caseclassB( foo: Int )( valbar:Int ) extendsA
Not sure if this is by design. I discovered this when trying to store the element type of an array into a case class using a secondary parameter list with an implicit ClassManifest[T]. Having automatic field generation for the secondary parameter list seems to be useful for such cases.
The text was updated successfully, but these errors were encountered:
fails with compiler error: "class B needs to be abstract, since method bar in trait A of type => Int is not defined"
Explicitly adding a 'val' for the 'bar' field makes the code compilable:
Not sure if this is by design. I discovered this when trying to store the element type of an array into a case class using a secondary parameter list with an implicit ClassManifest[T]. Having automatic field generation for the secondary parameter list seems to be useful for such cases.
The text was updated successfully, but these errors were encountered: