Skip to content

Commit fb13bc7

Browse files
committed
Fix #6083: Dealias before kind checking
1 parent b537220 commit fb13bc7

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Checking.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ trait Checking {
799799

800800
/** Check that `tpt` does not define a higher-kinded type */
801801
def checkSimpleKinded(tpt: Tree)(implicit ctx: Context): Tree =
802-
if (!tpt.tpe.hasSimpleKind && !ctx.compilationUnit.isJava) {
802+
if (!tpt.tpe.dealias.hasSimpleKind && !ctx.compilationUnit.isJava) {
803803
// be more lenient with missing type params in Java,
804804
// needed to make pos/java-interop/t1196 work.
805805
errorTree(tpt, MissingTypeParameterFor(tpt.tpe))

tests/pos/i6083.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
type K[T <: AnyKind] = T
2+
val a: K[Int] = 1
3+
val b: K[List][Int] = Nil

0 commit comments

Comments
 (0)