[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 07:56:54 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7355
Steven Schveighoffer <schveiguy at yahoo.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |schveiguy at yahoo.com
--- Comment #2 from Steven Schveighoffer <schveiguy at yahoo.com> 2012-01-26 07:56:53 PST ---
(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.
--
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