Cannot return byref after assigning to value from an array
Open
Feature Request
Needs-RFC
- Dominant language
- F#
- Stars
- 4.3k
- Forks
- 876
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 131
Description
Please provide a succinct description of the issue.
**Repro steps**
```fsharp
let f () =
let xs = Array.zeroCreate 128
let x = &xs.[0]
&x
```
**Expected behavior**
Compiles
**Actual behavior**
Errors on `&x`
**Known workarounds**
```fsharp
let g () =
let xs = Array.zeroCreate 128
&xs.[0]
let f () =
let x = &g ()
&x
```
Contributor guide
Assessment
This issue has not been assessed yet.