Skip to content

Commit a165b6f

Browse files
committed
change instantiated check
1 parent fa9cfd6 commit a165b6f

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4485,18 +4485,14 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
44854485
val containsUninst = new TypeAccumulator[Boolean]:
44864486
def apply(need: Boolean, tp: Type): Boolean =
44874487
need || tp.match
4488-
case tvar: TypeVar =>
4489-
ctx.typerState.constraint.contains(tvar) || tvar.instanceOpt.isInstanceOf[TypeVar]
4490-
case _ =>
4491-
foldOver(need, tp)
4488+
case tvar: TypeVar => !tvar.isInstantiated
4489+
case _ => foldOver(need, tp)
44924490
if (pt1 `ne` pt)
44934491
&& (pt1 ne sharpenedPt)
44944492
&& !ctx.mode.is(Mode.ImplicitExploration)
4495-
&& !ctx.mode.is(Mode.TypevarsMissContext)
44964493
&& !containsUninst(false, formal)
44974494
&& !isFullyDefined(formal, ForceDegree.none) then
4498-
try NoViewsAllowed.constrainResult(tree.symbol, wtp, pt1)
4499-
catch case ex: TyperState.BadTyperStateAssertion => report.error(s"Bad typer state: ${ex.getMessage}", tree.srcPos.endPos)
4495+
NoViewsAllowed.constrainResult(tree.symbol, wtp, pt1)
45004496
val arg = inferImplicitArg(formal, tree.span.endPos)
45014497

45024498
lazy val defaultArg = findDefaultArgument(argIndex)

0 commit comments

Comments
 (0)