[Issue 12688] New: Strange error if function call is in brackets

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu May 1 03:49:20 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=12688

          Issue ID: 12688
           Summary: Strange error if function call is in brackets
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: temtaime at gmail.com

import std.stdio;

struct S {
    int foo() @property { return 1; }
}

void main() {
    S s;
    s.foo.writeln; // ok
    (s.foo).writeln; // Error: need 'this' for 'foo' of type '@property int()'
}

--


More information about the Digitalmars-d-bugs mailing list