[Issue 6930] combined type of immutable(T) and inout(T) should be inout(const(T))

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 10 13:42:31 PST 2011


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



--- Comment #13 from Steven Schveighoffer <schveiguy at yahoo.com> 2011-11-10 13:41:52 PST ---
(In reply to comment #12)
> (In reply to comment #11)
> > You may be misunderstanding me.  I agree this is a bug.  I'll try to be
> > clearer:
> > 
> > 1. inout(const(T)) should resolve to const(T) or immutable(T) upon exit from
> > inout scope.  That it resolves to const(T) right now is a bug.
> > 
> > 2. immutable(T) and inout(T) can legally implicitly cast to inout(const(T)). 
> > This is an enhancement.
> 
> Hm ok. I believe you are right for a possible interpretation of the language
> spec. It states that nothing converts implicitly to inout, that immutable and
> inout convert to const but it does not make any mention of what converts to
> inout const. Ergo it is contradictory and we are both right.
> 
> But 1. is not worth fixing if 2. is not implemented, therefore the bugfix
> implies the enhancement. =)

2 can be forced with a cast.  1 cannot be worked around.

-- 
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