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
When overriding a method from the self type of a trait the return type is not checked so this compiles:
traitA {
defa:Int
}
traitB { self: A=>overridedefa:String="Well this should not compile"
}
The compile error happens when B is used:
scala>classCextendsAwithB
<console>:9:error: overriding method a in traitA of type=>Int;
method a in traitB of type=>String has incompatible typeclassCextendsAwithB
^
The compile error should already happen when defining B as the method overrides nothing.
The text was updated successfully, but these errors were encountered:
When overriding a method from the self type of a trait the return type is not checked so this compiles:
The compile error happens when
B
is used:The compile error should already happen when defining
B
as the method overrides nothing.The text was updated successfully, but these errors were encountered: