[Issue 678] Compiler accepts, for a function T[] t(), t().ptr but not t.ptr

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 26 13:56:44 PST 2010


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


bearophile_hugs at eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs at eml.cc


--- Comment #6 from bearophile_hugs at eml.cc 2010-11-26 13:55:18 PST ---
This situations will be partially cleaned up when functions/delegates calls
will require ().

The specs need to specify what's the behaviour of using the .ptr of a @property
delegate that returns an array (or that returns anything that has a ptr field):

void main() {
    @property int[] delegate() bar1 = { return [1, 2]; };
    struct Foo { int* ptr; }
    @property Foo delegate() bar2 = { return Foo(); };
    auto x1 = bar1.ptr;
    auto x2 = bar2.ptr;
}

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


More information about the Digitalmars-d-bugs mailing list