File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -1929,15 +1929,13 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
19291929 NoType
19301930 }
19311931
1932- pt.stripNull() match {
1933- case pt : TypeVar
1934- if untpd.isFunctionWithUnknownParamType(tree) && ! calleeType.exists =>
1935- // try to instantiate `pt` if this is possible. If it does not
1936- // work the error will be reported later in `inferredParam`,
1937- // when we try to infer the parameter type.
1938- isFullyDefined(pt, ForceDegree .flipBottom)
1939- case _ =>
1940- }
1932+ if pt.existsPart(_.isInstanceOf [TypeVar ], StopAt .Static )
1933+ && untpd.isFunctionWithUnknownParamType(tree)
1934+ && ! calleeType.exists then
1935+ // try to instantiate `pt` if this is possible. If it does not
1936+ // work the error will be reported later in `inferredParam`,
1937+ // when we try to infer the parameter type.
1938+ isFullyDefined(pt, ForceDegree .flipBottom)
19411939
19421940 val (protoFormals, resultTpt) = decomposeProtoFunction(pt, params.length, tree.srcPos)
19431941
You can’t perform that action at this time.
0 commit comments