Summary: -property should give an error for invalid property
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD

--- Comment #0 from Jonathan M Davis <> 2012-05-29 22:36:00 
PDT ---
This code compiles with -property:

struct S
    @property void prop()

void main()

It makes no sense that it would. prop returns nothing, so it can't be used as a
getter, and it takes nothing, so it can't be used as a setter. Neither

S s;
auto a = s.prop;


s.prop = a;

would compile, so there's no point in letting prop compile with @property.
Another example would be a function like

struct S
    @property void prop(int a, int b)

It can't possibly be used as a property function either. I'd argue that any
such function should be considered an error as long as it's marked as @property
and the -property flag is used.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to