[Issue 12439] New: Can't access to property call result if the call is in parantheses

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 22 01:56:25 PDT 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12439

           Summary: Can't access to property call result if the call is in
                    parantheses
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: verylonglogin.reg at gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin.reg at gmail.com> 2014-03-22 12:56:00 MSK ---
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.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list