Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/reporting/messages.scala
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ class TypeMismatch(val found: Type, expected: Type, val inTree: Option[untpd.Tre
val (found2, expected2) =
if (found1 frozen_<:< expected1) || reported.fbounded then (found, expected)
else (found1, expected1)
val (foundStr, expectedStr) = Formatting.typeDiff(found2, expected2)
val (foundStr, expectedStr) = Formatting.typeDiff(found2.normalized, expected2.normalized)
i"""|Found: $foundStr
|Required: $expectedStr${reported.notes}"""
end msg
Expand Down
7 changes: 7 additions & 0 deletions tests/neg/i22333.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- [E007] Type Mismatch Error: tests/neg/i22333.scala:5:33 -------------------------------------------------------------
5 |val _ = Container[(1,2,3)].guard((6, 8): Tuple.Tail[(5, 6, 8)]) // error
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| Found: ((6 : Int), (8 : Int))
| Required: ((2 : Int), (3 : Int))
|
| longer explanation available when compiling with `-explain`
5 changes: 5 additions & 0 deletions tests/neg/i22333.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

class Container[Rs <: Tuple]:
def guard(a: Tuple.Tail[Rs]): Unit = ()

val _ = Container[(1,2,3)].guard((6, 8): Tuple.Tail[(5, 6, 8)]) // error