Closed
Description
Description
Enum.GetUnderlyingType
currently always does a runtime lookup even when the type is always known, for example due to being a generic parameter. This makes fast generic specialization on enums impossible, unless you specialize on their size, which in turn makes you loose information about the sign.
Having this optimized would make #70167 much more useful since currently you have no fast way to check if the conversion is safe.
Configuration
Core CLR 6.0.322.12309 on amd64 on SharpLab
Regression?
I don't think so, but haven't checked other runtimes.
Data
category:cq
theme:basic-cq
skill-level:intermediate
cost:medium
impact:small