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
On Thu, Aug 13, 2015 at 4:04 PM, Seth Tisue [email protected]
wrote:
here's the input code:
~/dotty % cat S.scala
trait T { def foo: Int = 3 }
trait T1 extends T { override def foo = super.foo }
trait T2 extends T { override def foo = super.foo }
object C extends T2 with T1 {
def main(args: Array[String]) = ()
}
with Scala 2.11.7, no error:
~/dotty % /usr/local/scala-2.11.7/bin/scalac S.scala
~/dotty % java -classpath . C
but with Dotty:
~/dotty % rm *.class
~/dotty % bin/dotc S.scala
~/dotty % java -classpath . C
Exception in thread "main" java.lang.ClassFormatError: Duplicate method name&signature in class file C$
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
...
CFR shows what the problem is:
~/dotty % cfr-decompiler C$.class
...
public final class C$
implements T,
T2,
T1 {
public static final C$ MODULE$;
public static {
new C$();
}
public C$() {
MODULE$ = this;
}
@Override
public /* synthetic */ int super$foo() {
return super.foo();
}
@Override
public /* synthetic */ int super$foo() {
return super.foo();
}
@Override
public int foo() {
return super.foo();
}
public void main(String[] args) {
}
}
note the two identical super$foo methods.
—
Reply to this email directly or view it on GitHub #756.
here's the input code:
with Scala 2.11.7, no error:
but with Dotty:
the problem is that the generated code has two identical methods named
super$foo
:The text was updated successfully, but these errors were encountered: