Skip to content

Commit 41b7ca7

Browse files
committed
Add comment.
1 parent ba663f7 commit 41b7ca7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
547547

548548
// Warning: The following lines are dirty and fragile. We record that auto-tupling was demanded as
549549
// 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.
551551
// This crucially relies on he fact that `proto` is used only in a single call of `adapt`,
552552
// otherwise we would get possible cross-talk between different `adapt` calls using the same
553553
// 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 =>
604604
} {
605605
(failedVal, failedState) =>
606606
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.
607611
tryWithImplicitOnQualifier(fun1, originalProto).getOrElse(
608612
if (proto eq originalProto) fail
609613
else tryWithImplicitOnQualifier(fun1, proto).getOrElse(fail))

0 commit comments

Comments
 (0)