let ffff = ValueNone cannot be passed as inref without a type annotation or a mutable binding.
Repro steps
Provide the steps required to reproduce the problem:
https://sharplab.io/#v2:DYLgZgzgPsCmAuACAHogFATxIglgOwCdYwAeANQENgBXWAeQAd4cB7PE/eAPi4EpEAvOl4BYAFDi4SDMMHjECxFMRhBiSjVgBlFgFtYiAIzzFy3dXgUARnBWqhG2gDk2sEwuVgvax/Sat2Ti4AOl8XPDcxRSUEO28HKmdXd0QU1AAyMDTETKyoxQyvPOjCovFxIA
let x (y: inref<ValueOption<int>>) = ()
let y () =
let f = ValueSome 1
let mutable ff = ValueNone
let fff = ValueOption<int>.ValueNone
let ffff = ValueNone
x &f
x &ff
x &fff
x &ffff // <-- error
Expected behavior
Compiles.
Actual behavior
error FS3236: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address.
Known workarounds
Mutable binding, type annotatation.
Related information
Provide any related information (optional):
SDK 11.0.100-preview.3.26207.106
let ffff = ValueNonecannot be passed asinrefwithout a type annotation or a mutable binding.Repro steps
Provide the steps required to reproduce the problem:
https://sharplab.io/#v2:DYLgZgzgPsCmAuACAHogFATxIglgOwCdYwAeANQENgBXWAeQAd4cB7PE/eAPi4EpEAvOl4BYAFDi4SDMMHjECxFMRhBiSjVgBlFgFtYiAIzzFy3dXgUARnBWqhG2gDk2sEwuVgvax/Sat2Ti4AOl8XPDcxRSUEO28HKmdXd0QU1AAyMDTETKyoxQyvPOjCovFxIA
Expected behavior
Compiles.
Actual behavior
error FS3236: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address.Known workarounds
Mutable binding, type annotatation.
Related information
Provide any related information (optional):
SDK 11.0.100-preview.3.26207.106