-
Notifications
You must be signed in to change notification settings - Fork 802
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Compiler's bug: Field initialization order of record #212
Comments
This repros in F# 4.0. Worth noting that the "A C B" order is the only permutation that results in out-of-order initialization. |
forki
added a commit
to forki/visualfsharp
that referenced
this issue
Feb 4, 2015
forki
added a commit
to forki/visualfsharp
that referenced
this issue
Feb 4, 2015
forki
added a commit
to forki/visualfsharp
that referenced
this issue
Feb 4, 2015
forki
added a commit
to forki/visualfsharp
that referenced
this issue
Feb 4, 2015
forki
added a commit
to forki/visualfsharp
that referenced
this issue
Feb 4, 2015
forki
added a commit
to forki/visualfsharp
that referenced
this issue
Feb 4, 2015
forki
added a commit
to forki/visualfsharp
that referenced
this issue
Feb 5, 2015
forki
added a commit
to forki/visualfsharp
that referenced
this issue
Feb 5, 2015
forki
added a commit
to forki/visualfsharp
that referenced
this issue
Feb 5, 2015
@forki - any progress (or lessons) for your attempted fix for this or should we try again? thanks |
I think only the new tests are useful. the fix itself was not correct. |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Description
Maybe I've found a F# compiler's bug, which is demonstrated in .NET Fiddle. https://dotnetfiddle.net/pLFzQE
I expected that each field initialization of record is evaluated in order, but it isn't.
I checked a spec document of F# 3.0 out, and I found "6.9.11 Evaluating Record Expressions" says
that "Each expression e1 … en is evaluated in order". So, I'm afraid this behavior below is a compiler's bug.
Repro Steps
Expected/Actual
I expected the above program prints:
1
2
3
but, actually:
2
1
3
Version
F# 3.0 (FSharp.Core, 4.3.0.0), .NET Framework 4.5
The text was updated successfully, but these errors were encountered: