Open nodakai opened 1 year ago
This is reasonable, marking as approved-in-principle
Should this perhaps include constant fields as well? I've long been wondering why we cannot create an SRTP function that utilizes Int32.MaxValue
, which can be useful in quite a few math functions.
@vzarytovskii, I saw you started this in #16481. This probably needs an RFC, no? What do you think how we should define "all fields" from this proposal? Ideally, "all" is "all" ;).
I propose we
enhance SRTP to uniformly support all properties and fields, irrespective of being from C# or F#.
https://stackoverflow.com/questions/75741761/srtp-member-constraits-cant-see-raw-fields-of-c-sharp-classes
F# Project
Lib0.fsproj
C# Project
Lib1.csproj
F# Project
Test1.fsproj
The existing way of approaching this problem in F# is
defining F# wrappers for each C# class with fields? Can be quite verbose, error-prone
Pros and Cons
The advantages of making this adjustment to F# are
better interoperability with a wider .NET ecosystem which is predominantly C#-based
The disadvantages of making this adjustment to F# are
additional work and code required to make it happen
Extra information
Estimated cost (XS, S, M, L, XL, XXL):
No idea, maybe L?
Related suggestions:
671 #1307
Affidavit (please submit!)
Please tick these items by placing a cross in the box:
Please tick all that apply:
For Readers
If you would like to see this issue implemented, please click the :+1: emoji on this issue. These counts are used to generally order the suggestions by engagement.