June 19, 2012
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: nobody@puremagic.com
        ReportedBy: tommitissari@hotmail.com


--- Comment #0 from Tommi <tommitissari@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: -------
June 20, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8266


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2012-06-20 00:35:15 PDT ---
Works in 2.060head.

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