Skip to content

Commit f510690

Browse files
committed
Small optimization
1 parent 0400253 commit f510690

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ object Inferencing {
4545

4646
/** Instantiate selected type variables `tvars` in type `tp` */
4747
def instantiateSelected(tp: Type, tvars: List[Type])(implicit ctx: Context): Unit =
48-
new IsFullyDefinedAccumulator(new ForceDegree.Value(tvars.contains, minimizeAll = true)).process(tp)
48+
if (tvars.nonEmpty)
49+
new IsFullyDefinedAccumulator(new ForceDegree.Value(tvars.contains, minimizeAll = true)).process(tp)
4950

5051
/** Instantiate any type variables in `tp` whose bounds contain a reference to
5152
* one of the parameters in `tparams` or `vparamss`.

0 commit comments

Comments
 (0)