www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18477] New: -run isn't DRY and leads to unexpected errors


          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 puremagic.com
          Reporter: greensunny12 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;
cat << EOF > bar.d
void foo(){}

 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 --
Feb 20 2018