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

           Summary: Better @property management by chained functions
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-11-09 20:24:15 PST ---
I think this code is correct:


@property int[] foo() {
    return [1, 2];
}
int[] bar(int[] a) {
    return a;
}
void main() {
    bar(foo); // OK
    foo.bar(); // line 9, Error
}



But DMD 2.057head gives:
test.d(9): Error: function expected before (), not bar(foo()) of type int[]


This makes the usage of D language less uniform, because code like this is
refused (and sometimes you can't replace an array attribute by a @property
getter because of this):

auto sortedAKeys = a.keys.sort(); // error

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

Reply via email to