Skip to content

Commit b213f24

Browse files
authored
Merge pull request #6099 from dotty-staging/fix-#6083
Fix #6083: Dealias before kind checking
2 parents beea2b5 + 127ac60 commit b213f24

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,10 @@ class TypeApplications(val self: Type) extends AnyVal {
211211

212212
/** Is self type of kind "*"? */
213213
def hasSimpleKind(implicit ctx: Context): Boolean =
214-
typeParams.isEmpty && !self.hasAnyKind
214+
typeParams.isEmpty && !self.hasAnyKind || {
215+
val alias = self.dealias
216+
(alias ne self) && alias.hasSimpleKind
217+
}
215218

216219
/** If self type is higher-kinded, its result type, otherwise NoType.
217220
* Note: The hkResult of an any-kinded type is again AnyKind.

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)