digitalmars.D.bugs - [Issue 7369] New: Inout constructor causes compiler to reject invariant
- d-bugmail puremagic.com (28/28) Jan 25 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7369
- d-bugmail puremagic.com (13/13) Jan 27 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7369
- d-bugmail puremagic.com (10/10) Jan 28 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7369
- d-bugmail puremagic.com (9/15) Jan 28 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7369
- d-bugmail puremagic.com (8/8) Jan 29 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7369
- d-bugmail puremagic.com (10/10) Jan 29 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7369
http://d.puremagic.com/issues/show_bug.cgi?id=7369 Summary: Inout constructor causes compiler to reject invariant Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: smjg iname.com struct TestStruct { invariant() {} this(int data) inout {} } ---------- bad_invariant.d(2): Error: function bad_invariant.TestStruct.__invariant () is not callable using argument types () ---------- (DMD 2.057 Win32) Removing the constructor removes the error. Changing the struct to a class makes no difference. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 25 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7369 yebblies <yebblies gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |yebblies gmail.com Well, what should happen? You can't call a non-const invariant from a const function (or immutable or inout). The same issue exists with shared constructors. If anyone has a solution, we can use it to solve issue 519 as well. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 27 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7369 invariant() const {} doesn't compile. Though I've just found that const invariant() {} does. But why aren't invariants automatically const? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 28 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7369invariant() const {} doesn't compile. Though I've just found that const invariant() {} does.That's looks like another bug. Would you like to file it?But why aren't invariants automatically const?Probably the same reason in and out contracts aren't const... but at least there's a trivial workaround. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 28 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7369 Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/3c138718365541cde67abbdcfc031d755c3a7969 fix Issue 7369 - Inout constructor causes compiler to reject invariant -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 29 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7369 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla digitalmars.com Resolution| |FIXED -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 29 2012