[Issue 18477] New: -run isn't DRY and leads to unexpected errors
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Tue Feb 20 18:45:51 UTC 2018
    
    
  
https://issues.dlang.org/show_bug.cgi?id=18477
          Issue ID: 18477
           Summary: -run isn't DRY and leads to unexpected errors
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: greensunny12 at gmail.com
For -run the order matters which is very un-intuitive and violates DRY.
---
cat << EOF > test.d
import std.stdio;
void main()
{
    writeln("Hello D", __FILE__);
    import bar;
    foo();
}
EOF
cat << EOF > bar.d
void foo(){}
EOF
----
> dmd -run test.d bar.d
test.o:test.d:function _Dmain: error: undefined reference to '_D3bar3fooFZv'
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
> dmd bar.d -run test.d
Hello Dtest.d
See also: https://issues.dlang.org/show_bug.cgi?id=18476
--
    
    
More information about the Digitalmars-d-bugs
mailing list