Skip to content

Commit 92f5806

Browse files
Update error message
1 parent 940b011 commit 92f5806

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

compiler/src/dotty/tools/dotc/core/MatchTypeTrace.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ object MatchTypeTrace:
100100
| ${casesText(cases)}"""
101101
case EmptyScrutinee(scrut) =>
102102
i""" failed since selector $scrut
103-
| is uninhabited."""
103+
| is uninhabited (there are no values of that type)."""
104104
case Stuck(scrut, stuckCase, otherCases) =>
105105
i""" failed since selector $scrut
106106
| does not match ${caseText(stuckCase)}

tests/neg/matchtype-seq.check

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ longer explanation available when compiling with `-explain`
257257
| Note: a match type could not be fully reduced:
258258
|
259259
| trying to reduce Test.T9[(Nothing, String)]
260+
| failed since selector (Nothing, String)
261+
| is uninhabited (there are no values of that type).
260262

261263
longer explanation available when compiling with `-explain`
262264
-- [E007] Type Mismatch Error: tests/neg/matchtype-seq.scala:106:40 ----------------------------------------------------
@@ -268,6 +270,8 @@ longer explanation available when compiling with `-explain`
268270
| Note: a match type could not be fully reduced:
269271
|
270272
| trying to reduce Test.T9[(String, Nothing)]
273+
| failed since selector (String, Nothing)
274+
| is uninhabited (there are no values of that type).
271275

272276
longer explanation available when compiling with `-explain`
273277
-- [E007] Type Mismatch Error: tests/neg/matchtype-seq.scala:107:37 ----------------------------------------------------
@@ -279,6 +283,8 @@ longer explanation available when compiling with `-explain`
279283
| Note: a match type could not be fully reduced:
280284
|
281285
| trying to reduce Test.T9[(Int, Nothing)]
286+
| failed since selector (Int, Nothing)
287+
| is uninhabited (there are no values of that type).
282288

283289
longer explanation available when compiling with `-explain`
284290
-- [E007] Type Mismatch Error: tests/neg/matchtype-seq.scala:108:37 ----------------------------------------------------
@@ -290,6 +296,8 @@ longer explanation available when compiling with `-explain`
290296
| Note: a match type could not be fully reduced:
291297
|
292298
| trying to reduce Test.T9[(Nothing, Int)]
299+
| failed since selector (Nothing, Int)
300+
| is uninhabited (there are no values of that type).
293301

294302
longer explanation available when compiling with `-explain`
295303
-- [E007] Type Mismatch Error: tests/neg/matchtype-seq.scala:109:29 ----------------------------------------------------

0 commit comments

Comments
 (0)