[Issue 4224] New: alias this and opDispatch
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Sun May 23 03:07:17 PDT 2010
    
    
  
http://d.puremagic.com/issues/show_bug.cgi?id=4224
           Summary: alias this and opDispatch
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: pelle.mansson at gmail.com
--- Comment #0 from Pelle Månsson <pelle.mansson at gmail.com> 2010-05-23 03:07:15 PDT ---
This structure:
struct A(T) {
    T[string] table;
    alias table this;
    T opDispatch(string s)() {
        return table[s];
    }
}
void main() {
    A!int a;
    a["i"] = 4;
    writeln(a.i);
}
Gives the error:
test.d(56): Error: undefined identifier module test.i
I expected a.i to go to opDispatch when i was not found otherwise.
-- 
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