Skip to content

Commit 5344b06

Browse files
committed
Refine error message
1 parent b8098ce commit 5344b06

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/src/dotty/tools/dotc/transform/TypeTestsCasts.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,12 @@ object TypeTestsCasts {
186186
if res1.isEmpty && res2.isEmpty then res1
187187
else if res2.isEmpty then
188188
if isCheckDefinitelyFalse(tp1, P) then res2
189-
else i"it cannot be checked against the type $tp1"
189+
else res1
190190
else if res1.isEmpty then
191191
if isCheckDefinitelyFalse(tp2, P) then res1
192-
else i"it cannot be checked against the type $tp2"
192+
else res2
193193
else
194-
i"it cannot be checked against the type $tp2"
194+
res1
195195

196196
case _ =>
197197
// always false test warnings are emitted elsewhere

0 commit comments

Comments
 (0)