It’s really bugging me that the VS 2010 IDE isn’t barking at me for trying to pass Nothing through a method parameter that takes an user-defined enum. Instead, it’s passing 0 through to the method. c# would never allow this. Is there some module-level modifier I can add like option strict that will force the IDE to not allow these types of implicit conversions?
It’s really bugging me that the VS 2010 IDE isn’t barking at me for
Share
Sadly, no.
But you can assign values to your enumeration members while skipping
0(or use a placeholder namedNoneor something like that), and at least handle this case at run time.