Skip to content

Commit ccea1fc

Browse files
committed
TEST: Print diffs with previous inference
1 parent 4c44e64 commit ccea1fc

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,10 +1507,13 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
15071507
if knownFormal && !formal.isExactlyNothing then
15081508
formal
15091509
else
1510-
inferredFromTarget(param, formal, calleeType, paramIndex).orElse(
1511-
if knownFormal then formal
1512-
else errorType(AnonymousFunctionMissingParamType(param, tree, formal), param.srcPos)
1513-
)
1510+
val fromTarget = inferredFromTarget(param, formal, calleeType, paramIndex)
1511+
if fromTarget.exists then
1512+
if knownFormal && (fromTarget ne formal) then
1513+
println(i"DIFF for param $i of $tree with pt = $pt, formal = $formal, from target = $fromTarget")
1514+
fromTarget
1515+
else if knownFormal then formal
1516+
else errorType(AnonymousFunctionMissingParamType(param, tree, formal), param.srcPos)
15141517
val paramTpt = untpd.TypedSplice(
15151518
(if knownFormal then InferredTypeTree() else untpd.TypeTree())
15161519
.withType(paramType.translateFromRepeated(toArray = false))

0 commit comments

Comments
 (0)