-
Notifications
You must be signed in to change notification settings - Fork 790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mutable use bindings permitted by the F# compiler #535
Comments
It's by spec but I'd be happy to emit a warning in this case. Could you add an entry to http://fslang.uservoice.com? I'll mark it as approved for a future edition of the language. |
Closing this since it's now recoded on uservoice (and approved) |
@eiriktsarpalis An update on this: I believe mutable use bindings may be needed for F# in the case that the "disposable" type is a struct. For example, a struct enumerator of a |
I just noticed that the F# compiler permits mutable use bindings:
Running
test
will cause "bar" to be printed. This feels wrong and the sentiment was corroborated by the fact that C# explicitly prevents it:which produces the compiler error:
I checked the F# spec, but couldn't find any explicit mention of mutable use bindings.
Is this a compiler bug then?
The text was updated successfully, but these errors were encountered: