I've added a test to pending/run/castsingleton.scala:
object Test extends Application { case class L(); object N extends L(); def empty(xs : L) : Unit = xs match { case x@N => println(x); println(x); } empty(L()) }
The problem is that the compiler inserts a cast of xs to N.type, which is unsound: The pattern match will succeed for any L, because N == L().
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4