[Issue 21077] New: Order of evaluation of associative array is compiler-dependent
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Sat Jul 25 22:06:53 UTC 2020
    
    
  
https://issues.dlang.org/show_bug.cgi?id=21077
          Issue ID: 21077
           Summary: Order of evaluation of associative array is
                    compiler-dependent
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: pro.mathias.lang at gmail.com
```
import std.stdio;
int foo () { static int i; return ++i; }
void main ()
{
    writeln([ foo(): foo(), foo(): foo() ]);
}
```
```
% dmd -run ooe.d
[2:4, 1:3]
% ldc2 -run ooe.d
[3:4, 1:2]
```
GDC also does something different.
--
    
    
More information about the Digitalmars-d-bugs
mailing list