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
Welcome to Scala.next (pre-alpha, git-hash: 06d3f7a) (JavaHotSpot(TM) 64-BitServerVM, Java1.8.0_65).
Type in expressions to have them evaluated.
Type:help for more information.
scala>classA[T](valx:T)
defined classA
scala>classB[T](overridevalx:T) extendsA[T](x)
--Error: <console> ------------------------------------------------------------5|classB[T](overridevalx:T) extendsA[T](x)
|^| overriding value x in classA of typeT;
| method x of type=>T has incompatible type
Removing the override val keywords in B makes it compile, but it's not always possible (e.g. for case classes).
The text was updated successfully, but these errors were encountered:
This works in Scalac, but not in Dotty:
Dotty complains:
Removing the
override val
keywords inB
makes it compile, but it's not always possible (e.g. for case classes).The text was updated successfully, but these errors were encountered: