Skip to content

Commit 118cda2

Browse files
authored
Merge pull request #8226 from dotty-staging/fix-#8219
Fix #8219: Use translucent supertype to decide AnyKindedness
2 parents 4764ae1 + c0341d3 commit 118cda2

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ object Types {
275275
@tailrec def loop(tp: Type): Boolean = tp match {
276276
case tp: TypeRef =>
277277
val sym = tp.symbol
278-
if (sym.isClass) sym == defn.AnyKindClass else loop(tp.superType)
278+
if (sym.isClass) sym == defn.AnyKindClass else loop(tp.translucentSuperType)
279279
case tp: TypeProxy =>
280280
loop(tp.underlying)
281281
case _ =>

tests/neg/i8219.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
object O{
2+
opaque type T[X <: AnyKind] = X
3+
}
4+
def m(x: O.T[AnyKind]) = x // error

0 commit comments

Comments
 (0)