isValid property

bool get isValid

Return true iff this Union2 has type X1 or X2.

Implementation

bool get isValid => value is X1 || value is X2;