Skip to content

Commit

Permalink
Merge pull request #313 from fsharp/dsyme-patch-90
Browse files Browse the repository at this point in the history
Integrate feedback to span RFC
  • Loading branch information
dsyme committed Jun 7, 2018
2 parents 0bff3b7 + bb23d74 commit 76cadaa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions FSharp-4.5/FS-1053-span.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ type S(count1: int, count2: int) =

`IsReadOnly` is not added to F# struct types automatically, you must add it manually.

Note that `[<IsReadOnly>]` does not imply `[<Struct>]` both attributes have to be specified.

Using `IsReadOnly` attribute on a struct which has a mutable field will give an error.

#### ByRefLike structs
Expand All @@ -320,17 +322,17 @@ type S(count1: int, count2: int) =
member x.Count2 = count2
```

ByRefLike structs can have byref members, e.g.
ByRefLike structs can have IsByRefLike members, e.g.
```fsharp
open System.Runtime.CompilerServices
[<IsByRefLike; Struct>]
type S(count1: byref<int>, count2: byref<int>) =
type S(count1: Span<int>, count2: Span<int>) =
member x.Count1 = count1
member x.Count2 = count2
```

Note that `[<ReadOnly>]` does not imply `[<Struct>]` both attributes have to be specified.
Note that `[<IsByRefLike>]` does not imply `[<Struct>]` both attributes have to be specified.

#### No special treatment of `stackalloc`

Expand Down

0 comments on commit 76cadaa

Please sign in to comment.