Skip to content

Commit

Permalink
formatDiffImpl will not show "normalized from" info if before/after i…
Browse files Browse the repository at this point in the history
…s identical
  • Loading branch information
tribbloid committed Sep 10, 2023
1 parent 12d4d23 commit a6f5681
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -472,13 +472,19 @@ trait SplainFormattingExtension extends typechecker.splain.SplainFormatting with
val only = normalized.head
val result = formatType(only, top)

val based = Seq(found, req).distinct.map { tt =>
formatTypeRaw(tt, top)
}.distinct
val basedOn = Seq(found, req).distinct
.map { tt =>
formatTypeRaw(tt, top)
}
.distinct
.flatMap { ft =>
if (ft == result) None
else Some("normalized from" -> ft)
}

Reduction(
result,
based.map(v => "normalized from" -> v)
basedOn
).index()

result
Expand All @@ -490,7 +496,7 @@ trait SplainFormattingExtension extends typechecker.splain.SplainFormatting with
formatDiffSpecial(left, right, top).getOrElse(formatDiffSimple(left, right))
}

val extra = Seq(
val basedOn = Seq(
"left side reduced from" -> Seq(found, left),
"right side reduced from" -> Seq(req, right)
)
Expand All @@ -508,7 +514,7 @@ trait SplainFormattingExtension extends typechecker.splain.SplainFormatting with

Reduction(
result,
extra
basedOn
).index()

result
Expand Down

0 comments on commit a6f5681

Please sign in to comment.