http://d.puremagic.com/issues/show_bug.cgi?id=8266

           Summary: Calling a function in pseudo-member syntax fails to
                    deduce template argument type that uses alias this
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: tommitiss...@hotmail.com


--- Comment #0 from Tommi <tommitiss...@hotmail.com> 2012-06-19 06:46:09 PDT ---
module main;

struct MyStruct
{
    int _value;
}

struct MyStructWithAliasThis
{
    int _value;
    alias _value this;
}

int main(string[] argv)
{
    int n;
    float f;
    MyStruct ms;
    MyStructWithAliasThis mswat;

    assertTypesAreSame!(int)(n);  // #0: OK
    n.assertTypesAreSame!(int)(); // #1: OK

    assertTypesAreSame!(float)(f);  // #2: OK
    f.assertTypesAreSame!(float)(); // #3: OK

    assertTypesAreSame!(MyStruct)(ms);  // #4: OK
    ms.assertTypesAreSame!(MyStruct)(); // #5: OK

    assertTypesAreSame!(MyStructWithAliasThis)(mswat);  // #6: OK
    mswat.assertTypesAreSame!(MyStructWithAliasThis)(); // #7

    return 0;
}

void assertTypesAreSame(T1, T2)(T2 t2)
{
    static assert(is(T1 == T2)); // #8
}

// #7: instantiated from here: assertTypesAreSame!(MyStructWithAliasThis,int)
// #8: Error: static assert  (is(MyStructWithAliasThis == int)) is false

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

Reply via email to