File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff 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.
Original file line number Diff line number Diff 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.dealias. hasSimpleKind && ! ctx.compilationUnit.isJava) {
802+ if (! tpt.tpe.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))
You can’t perform that action at this time.
0 commit comments