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 @@ -1921,15 +1921,13 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
19211921 NoType
19221922 }
19231923
1924- pt match {
1925- case pt : TypeVar
1926- if untpd.isFunctionWithUnknownParamType(tree) && ! calleeType.exists =>
1927- // try to instantiate `pt` if this is possible. If it does not
1928- // work the error will be reported later in `inferredParam`,
1929- // when we try to infer the parameter type.
1930- isFullyDefined(pt, ForceDegree .flipBottom)
1931- case _ =>
1932- }
1924+ if pt.existsPart(_.isInstanceOf [TypeVar ], StopAt .Static )
1925+ && untpd.isFunctionWithUnknownParamType(tree)
1926+ && ! calleeType.exists then
1927+ // try to instantiate `pt` if this is possible. If it does not
1928+ // work the error will be reported later in `inferredParam`,
1929+ // when we try to infer the parameter type.
1930+ isFullyDefined(pt, ForceDegree .flipBottom)
19331931
19341932 val (protoFormals, resultTpt) = decomposeProtoFunction(pt, params.length, tree.srcPos)
19351933
You can’t perform that action at this time.
0 commit comments