Include generic constraints joined by OR #9345
Replies: 4 comments 1 reply
-
Something like this would be much more easily managed by an analyzer that can determine if the attribute is applied correctly to the target field or property. |
Beta Was this translation helpful? Give feedback.
-
Generic constraints are for enabling additional operations. |
Beta Was this translation helpful? Give feedback.
-
I think NumericBox can be constrained by |
Beta Was this translation helpful? Give feedback.
-
Is not |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Consider the following example:
The following is ok to compiler but it is wrong
Consider the possibility of using generics constraints with "or", like this:
Now the compiler can make some type-checks for us:
Beta Was this translation helpful? Give feedback.
All reactions