-
Notifications
You must be signed in to change notification settings - Fork 21
AbstractMethodError when base class method overloads generic method from trait #8681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Imported From: https://issues.scala-lang.org/browse/SI-8681?orig=1 |
@retronym said (edited on Jun 26, 2014 7:58:07 AM UTC): public class Test {
interface SimpleTrait<T> {
int myMethod(T t);
default void doIt(T t) {
myMethod(t);
}
}
static abstract class SimpleClass<T> implements SimpleTrait<T> {
public int myMethod(String t) { return 5; }
}
static class BadClass extends SimpleClass<String> {}
public static void main(String... args) {
new BadClass().doIt("");
}
}
|
same in 2.12.4 |
Not fixed in Scala 2.13.5, and not fixed in Scala 3.0.0-RC1 either. |
Possibly related to #12209 and scala/scala3#10079 see for another case where variance causes confusion of this kind. I think it's a conceptual problem - we check for overriding pairs on method definition but both this and the ticket I linked show that we may have to do it also in subclasses. But I can't tell if that is practical. |
Repro steps:
The text was updated successfully, but these errors were encountered: