File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -110,9 +110,14 @@ object Checking {
110
110
* A test case is neg/i2771.scala.
111
111
*/
112
112
def checkKindRank (arg : Tree , paramBounds : TypeBounds )(implicit ctx : Context ): Tree = {
113
+ def result (tp : Type ): Type = tp match {
114
+ case tp : HKTypeLambda => tp.resultType
115
+ case tp : TypeProxy => result(tp.superType)
116
+ case _ => defn.AnyType
117
+ }
113
118
def kindOK (argType : Type , boundType : Type ): Boolean =
114
119
! argType.isHK ||
115
- boundType.isHK && kindOK(argType.resultType, boundType.resultType )
120
+ boundType.isHK && kindOK(result( argType), result( boundType) )
116
121
if (kindOK(arg.tpe, paramBounds.hi)) arg
117
122
else errorTree(arg, em " ${arg.tpe} takes type parameters " )
118
123
}
You can’t perform that action at this time.
0 commit comments