Skip to content

Commit 869ccd9

Browse files
committed
move test to simplify
1 parent 8ddfbd6 commit 869ccd9

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,7 @@ trait Inferencing { this: Typer =>
384384
// `qualifying`.
385385

386386
val ownedVars = state.ownedVars
387-
if ((ownedVars ne locked) && !ownedVars.isEmpty &&
388-
!tree.isInstanceOf[Applications.IntegratedTypeArgs] // suppress interpolation in the middle of an extension method application
389-
) {
387+
if ((ownedVars ne locked) && !ownedVars.isEmpty) {
390388
val qualifying = ownedVars -- locked
391389
if (!qualifying.isEmpty) {
392390
typr.println(i"interpolate $tree: ${tree.tpe.widen} in $state, owned vars = ${state.ownedVars.toList}%, %, previous = ${locked.toList}%, % / ${state.constraint}")

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2206,7 +2206,11 @@ class Typer extends Namer
22062206

22072207
/** Interpolate and simplify the type of the given tree. */
22082208
protected def simplify(tree: Tree, pt: Type, locked: TypeVars)(implicit ctx: Context): tree.type = {
2209-
if (!tree.denot.isOverloaded) // for overloaded trees: resolve overloading before simplifying
2209+
if (!tree.denot.isOverloaded &&
2210+
// for overloaded trees: resolve overloading before simplifying
2211+
!tree.isInstanceOf[Applications.IntegratedTypeArgs]
2212+
// don't interpolatie in the middle of an extension method application
2213+
)
22102214
if (!tree.tpe.widen.isInstanceOf[MethodOrPoly] // wait with simplifying until method is fully applied
22112215
|| tree.isDef) // ... unless tree is a definition
22122216
{

0 commit comments

Comments
 (0)