[RFC FS-1079] - (already implemented) - interaction of autogenerated .Is* properties for DU cases and signature files #760
Replies: 3 comments 7 replies
-
Is this attribute only for use in signatures? Or if it is present in the signature it must also be in the implementation? |
Beta Was this translation helpful? Give feedback.
-
I feel like this causes a problem where the contents of the .fsi file are no longer sufficient to know what the public API is; you also need to look into the .fs to find out what the generated members are. Doesn't this break optimizations where downstream files are not re-checked when you edit a .fs file that is hidden behind a .fsi? |
Beta Was this translation helpful? Give feedback.
-
Since To be fair, though, in a separate suggestion, we might want to remove that requirement (and turn it into a warning). I mean, right now, each time I use
@T-Gro I'd suggest to make the default value We may, though, allow the attribute at a higher level (assembly). That way, a library writer only has to "opt in" once, and may "opt out" for individual DUs. TLDR: I agree to (most of) your proposal here. While I usually prefer being explicit, but here you allow people to opt-in. |
Beta Was this translation helpful? Give feedback.
-
The RFC FS-1079 specifies FS-1079 :
"If a union type is in a file with a signature, that signature can entirely hide the representation of the union type, and yet still individually reveal the individual IsFoo, IsBar members. (Other generated members not covered by this RFC can't be individually revealed like this.)"
Which means that:
I would like to propose a more language supported mechanism for declaring the intent of wanting/no wanting the tester property generation from a signature file perspective, without having to manually specify it for every DU case.
This could either be in the form of a new attribute applied, or a syntactical language extension. (e.g. inspired by
with get,set
markers, which are also possible in signature files).My specific proposal to close this design gap of RFC FS-1079 would be:
cc @kerams , @Tarmil , @abelbraaksma , @dsyme , @vzarytovskii
Beta Was this translation helpful? Give feedback.
All reactions