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

--- Comment #0 from 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; // 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:
------- You are receiving this mail because: -------

Reply via email to