@@ -547,7 +547,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
547
547
548
548
// Warning: The following lines are dirty and fragile. We record that auto-tupling was demanded as
549
549
// a side effect in adapt. If it was, we assume the tupled proto-type in the rest of the application,
550
- // until, possibly, we have to fall back to insert an implicit on thq qualifier.
550
+ // until, possibly, we have to fall back to insert an implicit on the qualifier.
551
551
// This crucially relies on he fact that `proto` is used only in a single call of `adapt`,
552
552
// otherwise we would get possible cross-talk between different `adapt` calls using the same
553
553
// prototype. A cleaner alternative would be to return a modified prototype from `adapt` together with
@@ -604,6 +604,10 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
604
604
} {
605
605
(failedVal, failedState) =>
606
606
def fail = { failedState.commit(); failedVal }
607
+ // Try once with original prototype and once (if different) with tupled one.
608
+ // The reason we need to try both is that the decision whether to use tupled
609
+ // or not was already taken but might have to be revised when an implicit
610
+ // is inserted on the qualifier.
607
611
tryWithImplicitOnQualifier(fun1, originalProto).getOrElse(
608
612
if (proto eq originalProto) fail
609
613
else tryWithImplicitOnQualifier(fun1, proto).getOrElse(fail))
0 commit comments