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



--- Comment #11 from Stewart Gordon <s...@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: -------

Reply via email to