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 {
211
211
212
212
/** Is self type of kind "*"? */
213
213
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
+ }
215
218
216
219
/** If self type is higher-kinded, its result type, otherwise NoType.
217
220
* 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 {
799
799
800
800
/** Check that `tpt` does not define a higher-kinded type */
801
801
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) {
803
803
// be more lenient with missing type params in Java,
804
804
// needed to make pos/java-interop/t1196 work.
805
805
errorTree(tpt, MissingTypeParameterFor (tpt.tpe))
You can’t perform that action at this time.
0 commit comments