Closed
Description
While working on reducing the size for WinRT component using NativeAOT, we found some numeric stuff being kept:
Quoting @MichalStrehovsky on Discord:
"Looks like the Convert.ToSingle call in ConvertOrWidenPrimitivesEnumsAndPointersIfPossible is an overkill, we don't need code to parse floats since conversion from string to single would have been disallowed"
This is the entire set that needs to be supported:
. Calling into convert just calls IConvertible methods so instead of the subset, one gets conversions from everything that was allocated in the app and supports IConvertible (that's why you getstring -> double
conversions). I don't know if there's a better mechanism in the BCL. One could just inline conversions for the whole matrix since there is an upper bound but that may not pass Jan's code review. If you can find a more narrow codepath in the BCL that handles the subset, that would be a good fix"
Opening this issue for tracking. @jkotas do you happen to know whether there's already some helper we can reuse here, or do you have any suggestions on how we could remove that dependency on Convert.*
calls? Would hardcoding all possible combinations be acceptable, or something else? 🙂
Metadata
Metadata
Assignees
Type
Projects
Status
No status