Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion compiler/src/dotty/tools/dotc/typer/Inferencing.scala
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,9 @@ trait Inferencing { this: Typer =>
// `qualifying`.

val ownedVars = state.ownedVars
if ((ownedVars ne locked) && !ownedVars.isEmpty) {
if ((ownedVars ne locked) && !ownedVars.isEmpty &&
!tree.isInstanceOf[Applications.IntegratedTypeArgs] // suppress interpolation in the middle of an extension method application
) {
val qualifying = ownedVars -- locked
if (!qualifying.isEmpty) {
typr.println(i"interpolate $tree: ${tree.tpe.widen} in $state, owned vars = ${state.ownedVars.toList}%, %, previous = ${locked.toList}%, % / ${state.constraint}")
Expand Down
11 changes: 11 additions & 0 deletions tests/pos/i6734.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
object Bug {

def (ab: (A, B)) pipe2[A, B, Z](f: (A, B) => Z): Z = f(ab._1, ab._2)

def (a: A) leftErr[A, B](b: B): A = (a, b).pipe2((a, b) => a) //Did not compile before.
def (a: A) leftOk1[A, B](b: B): A = Tuple2(a, b).pipe2((a, b) => a) //Compiles
def (a: A) leftOk2[A, B](b: B): A = {
val t = (a, b)
t.pipe2((a, b) => a) //Compiles
}
}