Unclear purpose of DefaultValue in struct types #13949
Unanswered
NinoFloris
asked this question in
Q&A
Replies: 0 comments
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.
-
DefaultValue(false)
seems to be fairly devoid of purpose in combination with structs.Testing some variations for #13498 I can't help but notice it's not very usable.
It only seems to enable the following, rather pointless, code:
Completely preventing constructors from participating in even the tiniest bit of init.
Maybe the litmus test should be: can I write my own System.Nullable (or some other more complex struct 'DU') type in F# (excluding the runtime box/unbox support for the sake of argument).
Beta Was this translation helpful? Give feedback.
All reactions