Skip to content

Commit f6efb00

Browse files
committed
Update byrefs.md
1 parent de09546 commit f6efb00

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/fsharp/language-reference/byrefs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ A "`byref`-like" struct in F# is a stack-bound value type. It is never allocated
179179
* They cannot be static or instance members of a class or normal struct.
180180
* They cannot be captured by any closure construct (`async` methods or lambda expressions).
181181
* They cannot be used as a generic parameter.
182-
* Starting with F# 9, this restriction is relaxed if the generic parameter is defined in C# using the allows ref struct anti-constraint. F# can instantiate such generics in types and methods with byref-like types. As a few examples, this affects BCL delegate types (Action<>,Func<>), interfaces (IEnumerable<>,IComparable<>) and generic arguments with a user-provided accumulator function (String.string Create<TState>(int length, TState state, SpanAction<char, TState> action)).
182+
* Starting with F# 9, this restriction is relaxed if the generic parameter is defined in C# using the allows ref struct anti-constraint. F# can instantiate such generics in types and methods with byref-like types. As a few examples, this affects BCL delegate types (`Action<>`, `Func<>`), interfaces (`IEnumerable<>`, `IComparable<>`) and generic arguments with a user-provided accumulator function (`String.string Create<TState>(int length, TState state, SpanAction<char, TState> action)`).
183183
* It is impossible to author generic code supporting byref-like types in F#.
184184

185185
This last point is crucial for F# pipeline-style programming, as `|>` is a generic function that parameterizes its input types. This restriction may be relaxed for `|>` in the future, as it is inline and does not make any calls to non-inlined generic functions in its body.

0 commit comments

Comments
 (0)