Skip to content
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

Fix FS0052 warnings #1543

Merged
merged 1 commit into from
Sep 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/fsharp/FSharp.Core/local.fs
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,12 @@ module internal List =
let mutable ie = dict.GetEnumerator()
if not (ie.MoveNext()) then []
else
let res = freshConsNoTail (keyf ie.Current.Key, ie.Current.Value)
let current = ie.Current
let res = freshConsNoTail (keyf current.Key, current.Value)
let mutable cons = res
while ie.MoveNext() do
let cons2 = freshConsNoTail (keyf ie.Current.Key, ie.Current.Value)
let current = ie.Current
let cons2 = freshConsNoTail (keyf current.Key, current.Value)
setFreshConsTail cons cons2
cons <- cons2
setFreshConsTail cons []
Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/FSharp.Core/map.fs
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ namespace Microsoft.FSharp.Collections
let rec loop () =
let m1 = e1.MoveNext()
let m2 = e2.MoveNext()
(m1 = m2) && (not m1 || ((e1.Current.Key = e2.Current.Key) && (Unchecked.equals e1.Current.Value e2.Current.Value) && loop()))
(m1 = m2) && (not m1 || let e1c, e2c = e1.Current, e2.Current in ((e1c.Key = e2c.Key) && (Unchecked.equals e1c.Value e2c.Value) && loop()))
loop()
| _ -> false

Expand Down
4 changes: 2 additions & 2 deletions src/fsharp/FSharp.Core/printf.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ module internal PrintfImpl =
mi.Invoke(null, args)

let buildPlainFinal(args : obj[], argTypes : Type[]) =
let mi = typeof<Specializations<'S, 'Re, 'Res>>.GetMethod("Final" + (argTypes.Length.ToString()), NonPublicStatics)
let mi = typeof<Specializations<'S, 'Re, 'Res>>.GetMethod("Final" + (let x = argTypes.Length in x.ToString()), NonPublicStatics)
#if DEBUG
verifyMethodInfoWasTaken mi
#else
Expand All @@ -1103,7 +1103,7 @@ module internal PrintfImpl =
mi.Invoke(null, args)

let buildPlainChained(args : obj[], argTypes : Type[]) =
let mi = typeof<Specializations<'S, 'Re, 'Res>>.GetMethod("Chained" + ((argTypes.Length - 1).ToString()), NonPublicStatics)
let mi = typeof<Specializations<'S, 'Re, 'Res>>.GetMethod("Chained" + (let x = (argTypes.Length - 1) in x.ToString()), NonPublicStatics)
#if DEBUG
verifyMethodInfoWasTaken mi
#else
Expand Down
6 changes: 3 additions & 3 deletions src/fsharp/FSharp.Core/reflect.fs
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ module internal Impl =
let args = a.ConstructorArguments
let flags =
match args.Count with
| 1 -> ((args.[0].Value :?> SourceConstructFlags), 0, 0)
| 2 -> ((args.[0].Value :?> SourceConstructFlags), (args.[1].Value :?> int), 0)
| 3 -> ((args.[0].Value :?> SourceConstructFlags), (args.[1].Value :?> int), (args.[2].Value :?> int))
| 1 -> ((let x = args.[0] in x.Value :?> SourceConstructFlags), 0, 0)
| 2 -> ((let x = args.[0] in x.Value :?> SourceConstructFlags), (let x = args.[1] in x.Value :?> int), 0)
| 3 -> ((let x = args.[0] in x.Value :?> SourceConstructFlags), (let x = args.[1] in x.Value :?> int), (let x = args.[2] in x.Value :?> int))
| _ -> (enum 0, 0, 0)
res <- Some flags
res
Expand Down