Bug 4706 – Overloading auto return w/ non-auto return = strange error msg

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-08-21T12:24:00Z
Last change time
2011-06-23T12:08:10Z
Keywords
rejects-valid
Assigned to
nobody
Creator
dsimcha

Comments

Comment #0 by dsimcha — 2010-08-21T12:24:22Z
struct Foo(T) { @property auto ref front() { return T.init; } @property void front(T num) {} } void main() { Foo!int foo; auto a = foo.front; foo.front = 2; } test9.d(6): Error: cannot overload both property and non-property functions test9.d(6): Error: cannot overload both property and non-property functions Strangely enough, changing the setter overload to the following fixes the problem: @property auto front(T num) {} Marking this one as minor because it's trivial to work around and hard to trigger.
Comment #1 by bugzilla — 2011-06-23T12:08:10Z