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
Clearly there is a bug here, but I don't know whether the bug is that both should compile or that neither should. If protected[this] is supposed to turn off variance checks like private[this] does, I don't see it in the spec. So I'm supposing neither should compile.
// bug.scala:6: error: covariant type A occurs in contravariant position in type => (A) => CC[A] of method super$$f// override protected[this] def f = super.f// ^// one error found
Clearly there is a bug here, but I don't know whether the bug is that both should compile or that neither should. If protected[this] is supposed to turn off variance checks like private[this] does, I don't see it in the spec. So I'm supposing neither should compile.
The following fails with a variance error:
If we change C2 to a class, it compiles.
The text was updated successfully, but these errors were encountered: