Ask TS to re-check that A1 extends A2. And if it fails, A2 will be enforced anyway. Can also be used to add constraints on parameters.
A1
A2
to check against
to cast to
A1 | A2
import {A} from 'ts-toolbelt' type test0 = A.Cast<'42', string> // '42' type test1 = A.Cast<'42', number> // number
Ask TS to re-check that
A1
extendsA2
. And if it fails,A2
will be enforced anyway. Can also be used to add constraints on parameters.