Misleading Unreachable case
report in ensuring
. Bug or feature?
#22615
Labels
area:pattern-matching
area:reporting
Error reporting including formatting, implicit suggestions, etc
better-errors
Issues concerned with improving confusing/unhelpful diagnostic messages
itype:enhancement
stat:cannot reproduce
stat:needs minimization
Needs a self contained minimization
Compiler version
scalac 3.6.3
sbt: 1.10.7 with the following options in
build.sbt
:Minimized example
Output Error/Warning message
Note: I get this warning only when compiling with
sbt
. If I compile withscalac -Wall
there is no warning!Why this Error/Warning was not helpful
The message
Unreachable case
is unhelpful because theNone
case in theensuring
construct is in fact reachable. This can easily be seen by replacingcase None => true
withcase None => { assert(false); true }
and callf(0)
.Suggested improvement
I think this is a bug in the type-inferencer. I did not file a bug report, because I wasn't sure if I had not overlooked some subtle feature of the typing system.
The text was updated successfully, but these errors were encountered: