March 26, 2012 [Issue 3731] Derived class implicitly convertible to base class with arbitrary change of constancy | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tomasz Sowiński | http://d.puremagic.com/issues/show_bug.cgi?id=3731 --- Comment #10 from Steven Schveighoffer <schveiguy@yahoo.com> 2012-03-26 03:11:50 PDT --- (In reply to comment #9) > (In reply to comment #1) > > The solution would be to make it illegal to have a mutable class reference to the base class. > > No, because a Zmienna is perfectly allowed to be mutable. It's Stala that isn't. I think you misunderstand. I don't mean because Stala exists, Zmienna should be prevented from being mutable, even for cases where Stala is not involved. I mean, it should be illegal to have a mutable Stala reference point at a Zmienna. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
March 26, 2012 [Issue 3731] Derived class implicitly convertible to base class with arbitrary change of constancy | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tomasz Sowiński | http://d.puremagic.com/issues/show_bug.cgi?id=3731 --- Comment #11 from Stewart Gordon <smjg@iname.com> 2012-03-26 03:57:16 PDT --- (In reply to comment #10) > I think you misunderstand. I don't mean because Stala exists, Zmienna should be prevented from being mutable, even for cases where Stala is not involved. I mean, it should be illegal to have a mutable Stala reference point at a Zmienna. I haven't misunderstood. There's no such thing as a mutable Stala reference. Because Stala is an immutable class, any reference to a Stala is automatically immutable. See for yourself: ----- void main() { Stala st = new Stala(5); pragma(msg, typeof(st)); // immutable(Stala) st = new Stala(4); // errors, because st is immutable Zmienna zm = st; // accepts-invalid } ----- The bug is that DMD allows the implicit conversion of immutable(Stala) to Zmienna. It's just mb_id in my last example. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
April 16, 2012 [Issue 3731] Derived class implicitly convertible to base class with arbitrary change of constancy | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tomasz Sowiński | http://d.puremagic.com/issues/show_bug.cgi?id=3731 Steven Schveighoffer <schveiguy@yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |doob@me.com --- Comment #13 from Steven Schveighoffer <schveiguy@yahoo.com> 2012-04-16 05:30:03 PDT --- *** Issue 7920 has been marked as a duplicate of this issue. *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
April 19, 2012 [Issue 3731] Derived class implicitly convertible to base class with arbitrary change of constancy | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tomasz Sowiński | http://d.puremagic.com/issues/show_bug.cgi?id=3731 Steven Schveighoffer <schveiguy@yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jmdavisProg@gmx.com --- Comment #14 from Steven Schveighoffer <schveiguy@yahoo.com> 2012-04-19 04:52:11 PDT --- *** Issue 7939 has been marked as a duplicate of this issue. *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
July 18, 2012 [Issue 3731] Derived class implicitly convertible to base class with arbitrary change of constancy | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tomasz Sowiński | http://d.puremagic.com/issues/show_bug.cgi?id=3731 --- Comment #15 from github-bugzilla@puremagic.com 2012-07-18 00:08:12 PDT --- Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/65f12c80d383bd655aec1f53510fd4ae201b3b79 Fix Issue 3731 - Can implicitly cast an immutable reference to a derived class to a mutable reference to a base class. Ensure the modifier conversion is valid before allowing an implicit conversion to a base class. https://github.com/D-Programming-Language/dmd/commit/bf982fac38051e34d365d972ff847983cb73848a Merge pull request #125 from yebblies/issue3731 Issue 3731 - Can implicitly cast an immutable reference to a derived class -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
July 18, 2012 [Issue 3731] Derived class implicitly convertible to base class with arbitrary change of constancy | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tomasz Sowiński | http://d.puremagic.com/issues/show_bug.cgi?id=3731 Don <clugdbug@yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |clugdbug@yahoo.com.au Resolution| |FIXED -- 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