Replies: 1 comment 1 reply
-
This isn't really possible, partially due to how constant fields work in the runtime and partially due to how the compiler consumes them. A special pattern syntax allowing matching against non-constants is probably a more feasible ask. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I'm enjoying playing with the new math generics introduced in .Net 6 Preview 7, and wondering if there is a possibility to support compile-time constants such as
T.One
,T.Zero
, etc. I was prototyping some math helpers and ran into this issue when trying to combine with switch expressions. For example:If this is helpful as a ticket, please let me know and I'll create one. @tannergooding
Thanks!
David
Beta Was this translation helpful? Give feedback.
All reactions