I propose we do something about the situation described here: dotnet/runtime#116497 , which was triggered by a desired change in the BCL to make mutable generic ICollection interfaces implement IReadOnlyCollection types. This change now has a PR suggesting its revert, until F# makes it easier to consumer and/or to workaround.
Causing:
type C<'T> =
interface ICollection<'T> with
// members omitted for clarity
member s.Count = s.Count
/* --------------^^^^^ error FS0361: The override 'get_Count: unit -> int' implements more than one abstract slot
, e.g. 'ICollection.get_Count() : int' and 'IReadOnlyCollection.get_Count() : int' */
The existing way of approaching this problem in F# is to know to explicitly declare implemented interfaces in case of slot conflicts.
Pros and Cons
The advantages of making this adjustment to F# are : Decrease chances of a BCL/C# change causing a source-break for F# programs.
The disadvantages of making this adjustment to F# are : It is a change.
Extra information
Estimated cost (XS, S, M, L, XL, XXL):
Related suggestions: (put links to related suggestions here)
Affidavit (please submit!)
Please tick these items by placing a cross in the box:
- [x ] This is not a question (e.g. like one you might ask on StackOverflow) and I have searched StackOverflow for discussions of this issue
- [ x] This is a language change and not purely a tooling change (e.g. compiler bug, editor support, warning/error messages, new warning, non-breaking optimisation) belonging to the compiler and tooling repository
- [ x] This is not something which has obviously "already been decided" in previous versions of F#. If you're questioning a fundamental design decision that has obviously already been taken (e.g. "Make F# untyped") then please don't submit it
- [ x] I have searched both open and closed suggestions on this site and believe this is not a duplicate
Please tick all that apply:
For Readers
If you would like to see this issue implemented, please click the 👍 emoji on this issue. These counts are used to generally order the suggestions by engagement.
I propose we do something about the situation described here: dotnet/runtime#116497 , which was triggered by a desired change in the BCL to make mutable generic ICollection interfaces implement IReadOnlyCollection types. This change now has a PR suggesting its revert, until F# makes it easier to consumer and/or to workaround.
Causing:
The existing way of approaching this problem in F# is to know to explicitly declare implemented interfaces in case of slot conflicts.
Pros and Cons
The advantages of making this adjustment to F# are : Decrease chances of a BCL/C# change causing a source-break for F# programs.
The disadvantages of making this adjustment to F# are : It is a change.
Extra information
Estimated cost (XS, S, M, L, XL, XXL):
Related suggestions: (put links to related suggestions here)
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 👍 emoji on this issue. These counts are used to generally order the suggestions by engagement.