copyOfStruct error when setting a property returned from a function
Open
Area-Compiler-Checking
Area-Compiler-Checking-Byref
Bug
Impact-Medium
- Dominant language
- F#
- Stars
- 4.3k
- Forks
- 876
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 131
Description
See also https://github.com/dotnet/fsharp/issues/8069 which is being treated as a duplicate of this
```
module Bug
type Q() =
member val t = 0 with get, set
let f c x = c () <- x
let q = Q()
f (fun _ -> q.t) 2
```
```
1>C:\Users\Marko\Source\Repos\Lithe\Lithe\bug.fs(6,13): error FS0971: Undefined value 'copyOfStruct : 'a ref'
```
This only gives me an error at build time, not in VS.
Contributor guide
Assessment
This issue has not been assessed yet.