You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
F# compiler bug in release mode in VS2015 Update 1 #759
In F# compound loops where the sequences are defined locally, in release mode only, F# generates a compile-time error saying that the name of the sequence being looped over is not found, generating error FS0971: Undefined value. Bizarrely this seems to be the case only when the outer loop is over the elements of a set.
I am using Visual Studio 2015 Update 1 RTM - 14.0.24720.00
I have managed to repro this in a few simple lines of code. Please see below.
f you do need to get your code to compile and you are using Update 1, it appears sufficient to place something benign prior to any loop where this problem is occurring, like this:
// do something that doesn't get optimized away
let workaround() = null |> ignore
let configure () =
let aSequence = Microsoft.FSharp.Core.Operators.(..) 3 4
let aString = new string('a',3)
workaround()
for _ in aSequence do
System.Console.WriteLine(aString)
configure ()
That said I really hope a fix is made available as soon as possible.
Obviously these calls should be removed as soon as a fix release is made available.
Activity
mjmckp commentedon Dec 3, 2015
Replacing 'set' with 'seq' above also causes the compile error.
dsyme commentedon Dec 3, 2015
This is the same as the bug fixed by #756. Let's use this as the tracking issue for the problem.
KevinRansom commentedon Dec 4, 2015
Fix merged:
commit:
c1e0bc8
PR:
#759
KevinRansom commentedon Dec 4, 2015
Thank you for reporting this. The fix is in, it will be in the next release of Visual F#.
dsyme commentedon Dec 5, 2015
f you do need to get your code to compile and you are using Update 1, it appears sufficient to place something benign prior to any loop where this problem is occurring, like this:
That said I really hope a fix is made available as soon as possible.
Obviously these calls should be removed as soon as a fix release is made available.
workaround compiler bug. dotnet/fsharp#759 (comment)
workaround compiler bug. dotnet/fsharp#759 (comment)
workaround compiler bug. dotnet/fsharp#759 (comment)
workaround compiler bug. dotnet/fsharp#759 (comment)
workaround compiler bug. dotnet/fsharp#759 (comment)
workaround compiler bug. dotnet/fsharp#759 (comment)