The following compiles:
open System
let f (r: {| S: Span<int> |})= r.S.Length
f {| S=Span<int>.Empty |}
It should not compile, because r is reference type, thus violating the rules of ByRefLike structs.
Given that we cannot declare a ByRefLike struct anonymous record, ByReflike types such as Span should not be allowed inside of an anonymous record at all.
The following compiles:
It should not compile, because
ris reference type, thus violating the rules ofByRefLikestructs.Given that we cannot declare a ByRefLike struct anonymous record, ByReflike types such as
Spanshould not be allowed inside of an anonymous record at all.