Bug 6259 – Regression(2.054 beta): Property getters returning ref const() cause setters to be hidden

Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-07-06T12:41:00Z
Last change time
2011-08-03T20:56:23Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
sludwig

Comments

Comment #0 by sludwig — 2011-07-06T12:41:23Z
The following source will produce the following error on DMD 2.054beta: bug1.d(10): Error: s.prop is not mutable --- struct S { private int m_prop; ref const(int) prop() { return m_prop; } void prop(int v) { m_prop = v; } } void test() { S s; s.prop = 1; } ---
Comment #1 by sludwig — 2011-07-06T12:47:30Z
Just noticed that the difference to DMD 2.053 and prev. is that the ref const() getter was not matched for assignments but is now. Declaring the property setter first makes the code compile again, which seems wrong, as there should be no reason for the declaration order to matter.
Comment #2 by yebblies — 2011-07-12T05:56:19Z
Comment #3 by braddr — 2011-08-03T20:56:23Z
*** This issue has been marked as a duplicate of issue 6398 ***