Skip to content
Discussion options

You must be logged in to vote

Do I need to do something else?

That code will not work since the size of the enum isn't known at compile time (and the type literally could be System.Enum not a subclass), so there's no way to know which == to call. You can replace the above with default(TEnum).Equals(myEnum) though.

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by YairHalberstadt
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #2694 on November 02, 2020 08:43.