www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7538] New: All kinds of property functions should be called before getting their types inside typeof

reply d-bugmail puremagic.com writes:
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: nobody puremagic.com
        ReportedBy: k.hara.pg gmail.com



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: -------
Feb 18 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7538


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|wrong-code                  |pull, rejects-valid



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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 02 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7538




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/1093dbe73f2414f4c03706e99888e0764b42fa65
fix Issue 7538 - All kinds of property functions should be called before
getting their types inside typeof

https://github.com/D-Programming-Language/dmd/commit/88b60e77fa9dea5487ebaa019c325910193f34aa


Issue 7538 - All kinds of property functions should be called before getting
their types inside typeof

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 10 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7538


Walter Bright <bugzilla digitalmars.com> changed:

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


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