Match
sealed case class Match(selector: Tree, cases: List[(List[IntLiteral], Tree)], default: Tree)(tpe: Type)(pos: Position) extends Tree
A break-free switch (without fallthrough behavior).
Unlike a JavaScript switch, it can be used in expression position.
It supports alternatives explicitly (hence the List[IntLiteral]
in
cases), whereas in a switch one would use the fallthrough behavior to
implement alternatives.
(This is not a pattern matching construct like in Scala.)
trait Serializable
trait Product
trait Equals
class Tree
trait TreeOrJSSpread
class IRNode
class Object
trait Matchable
class Any