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,12 +1807,13 @@ 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 ])
1810
+ if (! tree.denot.isOverloaded) // for overloaded trees: resolve overloading before simplifying
1811
+ if (! tree.tpe.widen.isInstanceOf [MethodOrPoly ] // wait with simplifying until method is fully applied
1812
+ || tree.isDef) // ... unless tree is a definition
1813
+ {
1813
1814
interpolateTypeVars(tree, pt, locked)
1814
- tree.overwriteType(tree.tpe.simplified) // ??? can we move in?
1815
- }
1815
+ tree.overwriteType(tree.tpe.simplified)
1816
+ }
1816
1817
tree
1817
1818
}
1818
1819
You can’t perform that action at this time.
0 commit comments