September 04, 2012 [Issue 8620] New: Possible circular reference | ||||
---|---|---|---|---|
| ||||
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@puremagic.com ReportedBy: moonburntm@gmail.com --- Comment #0 from Josh <moonburntm@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: ------- |
September 05, 2012 [Issue 8620] Possible circular reference | ||||
---|---|---|---|---|
| ||||
Posted in reply to Josh | http://d.puremagic.com/issues/show_bug.cgi?id=8620 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla@digitalmars.com Resolution| |WONTFIX --- Comment #1 from Walter Bright <bugzilla@digitalmars.com> 2012-09-04 23:07:19 PDT --- There's no way the compiler can detect, in the general case, infinite recursion at runtime. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation