This PR reworks some of the extraction logic for case paths and exposes a @_spi(Reflection) helper for projecting the associated value of any enum into an existential Any. We can eliminate a bunch of work we're currently doing by always projecting into the field type described by the runtime and then we can further attempt to cast to the extracted payload.
Fixes #83.
There are probably some performance improvements that can be made, but the benchmarks appear to perform as well as they do on main.
This PR reworks some of the extraction logic for case paths and exposes a
@_spi(Reflection)
helper for projecting the associated value of any enum into an existentialAny
. We can eliminate a bunch of work we're currently doing by always projecting into the field type described by the runtime and then we can further attempt to cast to the extracted payload.Fixes #83.
There are probably some performance improvements that can be made, but the benchmarks appear to perform as well as they do on
main
./cc @mayoff