[Issue 14391] New: Assigning to module results in unhelpful error message

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Apr 1 17:51:12 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=14391

          Issue ID: 14391
           Summary: Assigning to module results in unhelpful error message
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: diagnostic
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: thecybershadow at gmail.com

/// a.d ///

module a;
int a;

/// b.d ///

import a;
void main()
{
    a = 42;
}

///////////


Compiler says:

b.d(4,5): Error: a is not an lvalue

Ideally, it should say something along:

b.d(4,5): Error: cannot assign to module "a", did you mean "a.a" of type "int"?

--


More information about the Digitalmars-d-bugs mailing list