Open scabug opened 11 years ago
Imported From: https://issues.scala-lang.org/browse/SI-6414?orig=1 Reporter: marius a. eriksen (mariusae) Affected Versions: 2.9.1, 2.10.0-M7 See #3452
marius a. eriksen (mariusae) said: This is x.java:
class Foo {
public static void main(String[] args) {
C c = new C();
c = c.b().a();
}
}
@paulp said: This is a variation of #3452.
closing stale backend tickets; comment/reopen if you have evidence this is still applicable
No more crash at least, both cases the java code no longer compiles.
When using traits that are F-bounded:
The bridge methods generated in
C
are:Note that these are typed returning
A
andB
objects instead ofC
. This makes it impossible to write, in Java:Though it works in Scala (I suspect due to ScalaSigs).
However, when a throwaway type parameter is introduced on each method:
It works, I suspect due to the fact that this furnishes the bridges with java signatures:
Producing divergent java signatures, and so attempting to actually run the above code (which now compiles) results in a runtime error: