--- Comment #11 from Steven Schveighoffer <> 2011-11-10 
13:22:28 PST ---
(In reply to comment #10)
> (In reply to comment #9)
> > inout's primary focus is transferring the type modifier from the arguments 
> > to
> > the return type.  Merging it with a possible external immutable type is
> > secondary.
> > 
> > I think inout(const(T)) should resolve as we've discussed.  The enhancement 
> > is
> > that immutable(T) and inout(T) should be implicitly castable to
> > inout(const(T)).  
> See specification of inout:
> "The inout forms a wildcard that stands in for any of mutable, const or
> immutable. When the function is called, the inout of the return type is 
> changed
> to whatever the mutable, const, or immutable status of the argument type to 
> the
> parameter inout was."
> If inout(const(T)) is parsed as const(T) then the inout does not form a
> wildcard that can stand for immutable. Contradiction with the language
> specification. That is a bug.

You may be misunderstanding me.  I agree this is a bug.  I'll try to be

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.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to