Skip to content

Commit 4c61dae

Browse files
Merge pull request #14961 from dotty-staging/fix-14932
Fix outer reference detection in class parents
2 parents ef16034 + 2df52b9 commit 4c61dae

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@ object ExplicitOuter {
278278
)
279279
case _ => false
280280
}
281-
def hasOuterPrefix(tp: Type) = tp match {
281+
def hasOuterPrefix(tp: Type): Boolean = tp.stripped match {
282+
case AppliedType(tycon, _) => hasOuterPrefix(tycon)
282283
case TypeRef(prefix, _) => isOuterRef(prefix)
283284
case _ => false
284285
}

tests/pos/i14932.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
trait Core {
2+
class Base[T]()
3+
}
4+
5+
class Module(val core: Core) {
6+
object Indirection {
7+
class Extension[T]() extends core.Base[T]()
8+
}
9+
}

0 commit comments

Comments
 (0)