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

           Summary: All kinds of property functions should be called
                    before getting their types inside typeof
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: k.hara...@gmail.com


--- Comment #0 from Kenji Hara <k.hara...@gmail.com> 2012-02-18 07:48:12 PST ---
Test case;
----
@property int foo(){ return 1; }
@property int bar()(){ return 2; }
@property int baz(T)(){ return 2; }

struct S
{
    @property int foo(){ return 1; }
    @property int bar()(){ return 2; }
    @property int baz(T)(){ return 2; }
}

void main()
{
    static assert(is(typeof(foo) == int));          // OK
    static assert(is(typeof(bar) == int));          // failed
    static assert(is(typeof(baz!int) == int));      // OK

    S s;
    static assert(is(typeof(s.foo) == int));        // OK
    static assert(is(typeof(s.bar) == int));        // failed
    static assert(is(typeof(s.baz!int) == int));    // OK
}

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

Reply via email to