[Issue 8620] New: Possible circular reference

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 4 08:16:42 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8620

           Summary: Possible circular reference
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: moonburntm at gmail.com


--- Comment #0 from Josh <moonburntm at gmail.com> 2012-09-04 08:17:18 PDT ---
---code
import std.stdio;

struct itemType
{
    @property double value() { return value; }

    this(double value)
    {
        this.itemValue = value;
    }

    private:
        double itemValue;
}

void main()
{
    itemType item = itemType(0.05);
    writeln(item.value); //this line fails
}
---

---compile
dmd code.d //Works fine
---

---run
code.exe //Segfault
---

Surely, this shouldn't compile, as the property is either trying to return
itself or it's somehow thinking there is a value variable which doesn't exist.

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


More information about the Digitalmars-d-bugs mailing list