FSharp.TypeProviders.SDK
FSharp.TypeProviders.SDK copied to clipboard
Promote mutables to refs when captured by closures
Need to check on the erased case. But for the generated case
<@
let mutable a = 0
let f() = a <- a + 1
f()
a
@>
will return 0. In the short term there should at least be an error.
Otherwise perhaps the best place to fix this would be in QuotationSimplifier
. Each mutable let could traverse down its body to check for references and then rewrite the Expr
with a ref
type if needed.