Skip to content

Handle `Variant::Get` for types not supported by the `Variant`

Previously, if you called Get on a Variant with a type that is not in the list of types supported by the Variant, that would attempt to look up the type at index -1 and could spin the compiler into an endless loop.

Instead, check for the case where you are attempting to get a type from the Variant not listed in its templat arguments. In this case, instead of producing a compiler error, produce a runtime error. Although this increases the possibility that a bad compile path is being generated, it simplifies creating templated code that produces cases we don't care about.

Merge request reports