File tree 1 file changed +6
-5
lines changed
compiler/src/dotty/tools/dotc/typer
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -1807,11 +1807,12 @@ class Typer extends Namer
1807
1807
1808
1808
/** Interpolate and simplify the type of the given tree. */
1809
1809
protected def simplify (tree : Tree , pt : Type , locked : TypeVars )(implicit ctx : Context ): tree.type = {
1810
- if (! tree.denot.isOverloaded) {
1811
- // for overloaded trees: resolve overloading before simplifying
1812
- if (tree.isDef || ! tree.tpe.widen.isInstanceOf [MethodOrPoly ])
1813
- interpolateTypeVars(tree, pt, locked)
1814
- tree.overwriteType(tree.tpe.simplified) // ??? can we move in?
1810
+ if (tree.isDef || // always simplify types of definitions
1811
+ ! tree.denot.isOverloaded || // for overloaded trees: resolve overloading before simplifying
1812
+ ! tree.tpe.widen.isInstanceOf [MethodOrPoly ]) // wait with simplifying until method is fully applied
1813
+ {
1814
+ interpolateTypeVars(tree, pt, locked)
1815
+ tree.overwriteType(tree.tpe.simplified)
1815
1816
}
1816
1817
tree
1817
1818
}
You can’t perform that action at this time.
0 commit comments