Variant module

unwrap

procedureextensionsince 0.29.0Source

The T payload; asserts that T is the live case. Use get when the case is not certain.

Example↗
#import "Extensions/Variant";

id := variant(Variant(s64, string), cast(s64) 5);
assert(unwrap(id, s64) == 5);
unwrap :: (v: $V/Variant, $T: Type) -> T

Parameters

v: $V/Variant
$T: Type

Returns

T

See also