Skip to content

revert 'use mutable' warning#1400

Merged
KevinRansom merged 2 commits into
dotnet:masterfrom
dsyme:revert-4
Aug 3, 2016
Merged

revert 'use mutable' warning#1400
KevinRansom merged 2 commits into
dotnet:masterfrom
dsyme:revert-4

Conversation

@dsyme

@dsyme dsyme commented Aug 2, 2016

Copy link
Copy Markdown
Contributor

In #1277 we added a warning for use mutable x = ...

However it turns out that use mutable ... is useful in F# when the disposable type is a struct. This occurs when an iterator is a struct type, e.g.

open System.Collections.Generic

let f (x: List<'T>) = 
    use mutable d = x.GetEnumerator()
    while (d.MoveNext() ) do 
       ()
    ()

We should revert the warning on use mutable for this reason

@KevinRansom

Copy link
Copy Markdown
Contributor

@dsyme,
Thank you for this contribution

Kevin

@KevinRansom KevinRansom merged commit 26229e7 into dotnet:master Aug 3, 2016
@liboz liboz mentioned this pull request Aug 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants