[Issue 15209] New: redundant error message on invalid field access
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Thu Oct 15 19:47:07 PDT 2015
    
    
  
https://issues.dlang.org/show_bug.cgi?id=15209
          Issue ID: 15209
           Summary: redundant error message on invalid field access
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: diagnostic
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: k.hara.pg at gmail.com
Test case:
----
class C1 { int x; }
struct S1 { alias y = C1.x; }
struct S2 { int x; }
class C2 { alias y = S2.x; }
void main()
{
    S1 s1;
    s1.y = 10;  // Line 10: invalid field variable access
    auto c2 = new C2();
    c2.y = 10;  // Line 13: invalid field variable access
}
Output:
----
test.d(10): Error: struct test.S1 'x' is not a member
test.d(10): Error: need 'this' for 'x' of type 'int'
test.d(13): Error: need 'this' for 'x' of type 'int'
The error "is not a member" at line 10 is redundant.
--
    
    
More information about the Digitalmars-d-bugs
mailing list