Closed
Description
As in the title:
scala> def m(s: Int | Float | String) = s match {
case _: Int => ; case _: Float => ; case _: String => ; }
def m(s: Int | Float | String): Unit
scala> type OrAlias = Int | Float
defined type alias OrAlias
scala> def m(s: OrAlias | String) = s match {
case _: Int => ; case _: Float => ; case _: String => ; }
-- [E028] Pattern Match Exhaustivity Warning: <console> ------------------------
5 |def m(s: OrAlias | String) = s match {
| ^
| match may not be exhaustive.
|
| It would fail on: _: OrAlias
6 | case _: Int => ; case _: Float => ; case _: String => ; }
def m(s: OrAlias | String): Unit