File tree 2 files changed +11
-6
lines changed
compiler/src/dotty/tools/dotc/typer
2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -300,13 +300,9 @@ class Typer extends Namer
300
300
if (isSelfDenot(defDenot)) curOwner.enclosingClass.thisType
301
301
else {
302
302
val effectiveOwner =
303
- if (curOwner.isTerm && defDenot.symbol.isType)
303
+ if (curOwner.isTerm && defDenot.symbol.maybeOwner. isType)
304
304
// Don't mix NoPrefix and thisType prefixes, since type comparer
305
- // would not detect types to be compatible. Note: If we replace the
306
- // 2nd condition by `defDenot.symbol.maybeOwner.isType` we get lots
307
- // of failures in the `tastyBootstrap` test. Trying to compile these
308
- // files in isolation works though.
309
- // TODO: Investigate why that happens.
305
+ // would not detect types to be compatible.
310
306
defDenot.symbol.owner
311
307
else
312
308
curOwner
Original file line number Diff line number Diff line change
1
+ class A
2
+ trait Bar [X ] {
3
+ // same for `val foo: X = ???`
4
+ def foo : X = ???
5
+ }
6
+ // same for `class Foo(...)...`
7
+ trait Foo (val a : A ) extends Bar [a.type ] {
8
+ val same : a.type = foo
9
+ }
You can’t perform that action at this time.
0 commit comments