[Issue 6233] New: Compiler lists wrong module in an expression error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jun 30 18:56:08 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6233

           Summary: Compiler lists wrong module in an expression error
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrej.mitrovich at gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2011-06-30 18:51:11 PDT ---
This happened in real code due to a mishap where I've accidentally removed the
name of a function in a function call.

.\test.d:

module test;
import bar.barmod;

void main()
{
    (FALSE);  // used to be Foo(FALSE);
}
void Foo(BOOL) { }

.\bar\barmod.d:

module bar.barmod;

alias int BOOL;
enum : BOOL {
    FALSE = 0,
    TRUE  = 1
}

$ dmd test.d -I.
bar\barmod.d(5): Error: long has no effect in expression (0)

In my case it pointed the error to the WinAPI library, that was a real WTF
moment and it took me a while before I spotted where the syntax error really
was.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list