[RFC FS-1079 Discussion] - Make .Is* discriminated union properties visible from F# #517
Replies: 5 comments 11 replies
-
There's one drawback listed
TPSDK allows one to hide |
Beta Was this translation helpful? Give feedback.
-
I have a somewhat strong opinion that the feature should only work if an attribute specific to this feature is added on the DU. If this restriction cause a problem, it is possible to work around it with extension static members, and having this by default on DU comes with the drawback of making it too idiomatic F# code, removing a fair share of the "safety" feeling when pattern matching is used more pervasively. Any one share that opinion? What are the motivations to not have this restriction? |
Beta Was this translation helpful? Give feedback.
-
Some comments on this
I'll add this to the RFC |
Beta Was this translation helpful? Give feedback.
-
Some secondary thoughts on this
|
Beta Was this translation helpful? Give feedback.
-
I've started to see the feature show up in VS Preview, I feel the one odd thing is having the property available on single case DUs. Are we considering this should be the case? |
Beta Was this translation helpful? Give feedback.
-
RFC https://github.com/fsharp/fslang-design/blob/master/RFCs/FS-1079-union-properties-visible.md
Suggestion fsharp/fslang-suggestions#222
Beta Was this translation helpful? Give feedback.
All reactions