diff --git a/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala b/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala index a7f8421f51d0..0a9798226d76 100644 --- a/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala +++ b/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala @@ -278,7 +278,8 @@ object ExplicitOuter { ) case _ => false } - def hasOuterPrefix(tp: Type) = tp match { + def hasOuterPrefix(tp: Type): Boolean = tp.stripped match { + case AppliedType(tycon, _) => hasOuterPrefix(tycon) case TypeRef(prefix, _) => isOuterRef(prefix) case _ => false } diff --git a/tests/pos/i14932.scala b/tests/pos/i14932.scala new file mode 100644 index 000000000000..8fff627fc3d7 --- /dev/null +++ b/tests/pos/i14932.scala @@ -0,0 +1,9 @@ +trait Core { + class Base[T]() +} + +class Module(val core: Core) { + object Indirection { + class Extension[T]() extends core.Base[T]() + } +} \ No newline at end of file