www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4224] New: alias this and opDispatch

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: pelle.mansson gmail.com


--- Comment #0 from Pelle Månsson <pelle.mansson 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: -------
May 23 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4224


Simen Kjaeraas <simen.kjaras gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |simen.kjaras gmail.com
         Resolution|                            |DUPLICATE


--- Comment #1 from Simen Kjaeraas <simen.kjaras gmail.com> 2010-11-30 03:19:42
PST ---
*** This issue has been marked as a duplicate of issue 4989 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 30 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4224


Steven Schveighoffer <schveiguy yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |schveiguy yahoo.com
         Resolution|DUPLICATE                   |


--- Comment #2 from Steven Schveighoffer <schveiguy yahoo.com> 2010-11-30
05:24:46 PST ---
This should be the original bug, not 4989

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 30 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4224



--- Comment #3 from Steven Schveighoffer <schveiguy yahoo.com> 2010-11-30
05:25:15 PST ---
*** Issue 4989 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 30 2010
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4224


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |DUPLICATE


--- Comment #4 from Kenji Hara <k.hara.pg gmail.com> 2011-10-23 22:20:39 PDT ---
*** This issue has been marked as a duplicate of issue 6434 ***

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