File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -1063,7 +1063,16 @@ object Denotations {
10631063 info.asSeenFrom(pre, owner),
10641064 if (symbol.is(Opaque ) || this .prefix != NoPrefix ) pre else this .prefix)
10651065
1066- if (! owner.membersNeedAsSeenFrom(pre) || symbol.is(NonMember )) this
1066+ // Tt could happen that we see the symbol with prefix `this` as a member a different class
1067+ // through a self type and that it then has a different info. In this case we have to go
1068+ // through the asSeenFrom to switch the type back. Test case is pos/i9352.scala.
1069+ def hasOriginalInfo : Boolean = this match
1070+ case sd : SymDenotation => true
1071+ case _ => info eq symbol.info
1072+
1073+ if ! owner.membersNeedAsSeenFrom(pre) && ((pre ne owner.thisType) || hasOriginalInfo)
1074+ || symbol.is(NonMember )
1075+ then this
10671076 else derived(symbol.info)
10681077 }
10691078 }
Original file line number Diff line number Diff line change 1+ abstract class Foo [B ] extends Bar [B ]
2+
3+ trait Bar [A ]:
4+ self : Foo [A ] =>
5+
6+ def foo : Unit = bar(??? )
7+ def bar (f : A ) : Unit
8+
You can’t perform that action at this time.
0 commit comments