summaryrefslogtreecommitdiff
path: root/test/files/neg/virtpatmat_reach_null.scala
blob: 6314a5b1d84ac0d9bf583f712b8c1f06f08d19e4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
sealed abstract class Const {
  final def excludes(other: Const) =
    (this, other) match {
      case (_, NullConst)                 =>
      case (NullConst, _)                 =>
      case (_: ValueConst, _: ValueConst) =>
      case (_: ValueConst, _: TypeConst)  =>
      case (_: TypeConst,  _: ValueConst) =>
      case (_: TypeConst,  _: TypeConst)  =>
      case (null, _)                      =>
      case (_, null)                      =>
      case null                           =>
      case _                              =>  // unreachable
    }
}

sealed class TypeConst extends Const
sealed class ValueConst extends Const
case object NullConst extends Const