File tree 3 files changed +24
-1
lines changed
compiler/src/dotty/tools/backend/jvm 3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -607,7 +607,8 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
607
607
val names = tp.memberNames(takeAllFilter).toSeq.sorted
608
608
val buffer = mutable.ListBuffer [Symbol ]()
609
609
names.foreach { name =>
610
- buffer ++= tp.memberBasedOnFlags(name, required, excluded)
610
+ // lookup members at erasure: lampepfl/dotty#12753
611
+ buffer ++= atPhase(erasurePhase)(tp.memberBasedOnFlags(name, required, excluded))
611
612
.alternatives.sortBy(_.signature)(Signature .lexicographicOrdering).map(_.symbol)
612
613
}
613
614
buffer.toList
Original file line number Diff line number Diff line change
1
+ trait C [This <: C [This ]]
2
+
3
+ trait COps [This <: C [This ]] {
4
+ def t : This
5
+ def foo (x : Int ): This = t
6
+ def bar : Object = " "
7
+ }
8
+
9
+ class D extends C [D ] {
10
+ def x = 1
11
+ }
12
+ object D extends COps [D ] {
13
+ def t = new D
14
+ override def foo (x : Int ): D = super .foo(x)
15
+ override def bar : String = " "
16
+ }
Original file line number Diff line number Diff line change
1
+ public class Test {
2
+ public static void main (String [] args ) {
3
+ if (D .foo (1 ).x () != 1 || !D .bar ().isEmpty ())
4
+ throw new RuntimeException ("" );
5
+ }
6
+ }
You can’t perform that action at this time.
0 commit comments