type pattern

A pattern that tests a value's type and, if it matches, gives the converted value a name, as in if (boxed is int n).

In more detail

It replaces a type check followed by a cast. is null and is not null are the everyday null checks.

Related terms

Taught in

References