Bug 12439 – Can't access to property call result if the call is in parantheses
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-03-22T01:56:00Z
Last change time
2014-05-08T08:31:44Z
Keywords
rejects-valid
Assigned to
nobody
Creator
verylonglogin.reg
Comments
Comment #0 by verylonglogin.reg — 2014-03-22T01:56:00Z
This code should compile:
---
struct S1 { int i; }
struct S2
{ @property S1 s1() { return S1(); } }
void main()
{
S2 s2;
auto x = (s2.s1).i; // line 9
}
---
main.d(9): Error: need 'this' for 's1' of type '@property S1()'
---
Same for non-property functions if called without parantheses.
Comment #1 by verylonglogin.reg — 2014-05-08T08:31:44Z
Issue 12688 is a duplicate of this one but as it's already fixed mark this one as a duplicate.
*** This issue has been marked as a duplicate of issue 12688 ***