www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6805] New: Can't use a type from opDispatch template

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6805

           Summary: Can't use a type from opDispatch template
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: verylonglogin.reg gmail.com



---
---
struct T {
    template opDispatch(string name)
    {
        alias int Type;
    }
}

pragma(msg, T.opDispatch!("xxx"), " ", T.xxx); //(T).opDispatch!("xxx")
(T).opDispatch!("xxx")
pragma(msg, T.opDispatch!("xxx").Type, " ", T.xxx.Type); //int int
pragma(msg, is(T.opDispatch!("xxx").Type), " ", is(Flag.xxx.Type)); //true
false

template U(T) { }

void main() {
    T.opDispatch!("xxx").Type i1; //ok
    T.xxx.Type i2; //Error: T.xxx.Type is used as a type

    alias U!(T.opDispatch!("xxx").Type) U1; //ok
    alias U!(T.xxx.Type) U2; //Error: template instance U!(int) does not match
template declaration U(T)
}
---

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 12 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6805


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch, rejects-valid
           Platform|Other                       |All
         OS/Version|Windows                     |All



https://github.com/D-Programming-Language/dmd/pull/447

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 13 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6805


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED



11:38:45 PST ---
https://github.com/D-Programming-Language/dmd/commit/24a34bba42fd48f191086c353bc2e61f93f0b950

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