Support consuming IL(C#)-defined generic T with AllowByRefLike anti-constraint
Implements https://github.com/dotnet/fsharp/issues/16800 Follows https://github.com/dotnet/runtime/blob/main/docs/design/features/byreflike-generics.md Builds upon: https://github.com/fsharp/fslang-design/blob/main/FSharp-4.5/FS-1053-span.md
Deserves a (small) RFC update: https://github.com/fsharp/fslang-design/pull/787
:heavy_exclamation_mark: Release notes required
:white_check_mark: Found changes and release notes in following paths:
[!WARNING] No PR link found in some release notes, please consider adding it.
Change path Release notes path Description src/Compilerdocs/release-notes/.FSharp.Compiler.Service/9.0.100.md No current pull request URL (https://github.com/dotnet/fsharp/pull/17597) found, please consider adding it
Shall we add tests for builders? Classic and resumable? Since a bunch of continuations are getting codegened there as well as inlining and state machines.
Shall we add tests for builders? Classic and resumable? Since a bunch of continuations are getting codegened there as well as inlining and state machines.
We don't propagate that generic anti-constraint to F# code, it really is only allowed for an ILCall expression. Any specific idea in mind?
You mean like a generic builder, where the typar instantion would be e.g. MyBuilder<IEnumrable<Span<byte>>> ?
Or using a them inside a CE ?
I am thinking of some sensible real-world-like usecase involving a builder. If anyone has an idea, I can definitely put it together as a test case (in this case, one we would fully run and let verify via the runtime)
Or using a them inside a CE ?
Mostly this, generic builders are less of a concern, I think.
I am thinking of some sensible real-world-like usecase involving a builder. If anyone has an idea, I can definitely put it together as a test case (in this case, one we would fully run and let verify via the runtime)
For example, if we have a collection builder and we define a bind or yieldfrom for some source with the type of (source: seq<ReadOnlySpan<int>>). I wonder what would we codegen in this case.