❔ ✅ Generics 'where' : Limitations of what types are allows
When I'm specifying what types are allowed, is it possible to say anything about what types are not allowed.
For example, I've got 2 use cases here:
Are either of this possible in C# at compile time?
6 Replies
no they are not
at least not easily expressible, there might be a technically possible hacky way but im not sure
pretty sure there isn't
okay - thanks. I'll have to just be careful with how I use these functions then
do runtime checks on them
Yup - that's what I'm adding now
Thanks
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.