[Issue 7355] inout incorrectly resolved if the same type has both mutable and immutable parts

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jan 26 09:07:25 PST 2012


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



--- Comment #3 from timon.gehr at gmx.ch 2012-01-26 09:07:23 PST ---
(In reply to comment #2)
> (In reply to comment #1)
> > My understanding is, each inout deduction from a function argument just like
> > pattern matching.
> > 
> > Parameter type:   inout(          int *)*
> >  Argument type: mutable(immutable(int)*)*  // mutable(...) is pseudo modifier
> > --> 'inout' is deduced to 'mutable'.
> 
> The compiler should either fail to match, since inout wildcard is not applying
> to the immutable, or if it does match, it should treat foo as:
> 
> int** foo(int **x) { return x; }
> 
> This should fail to be able to be called with immutable(int)**.
> 
> The assert should fail because the typeof should resolve to Error.
> 
> I think this bug is invalid.

The typeof resolves to error because inout resolves to immutable.

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