[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
Fri Jan 27 14:44:23 PST 2012


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



--- Comment #8 from timon.gehr at gmx.ch 2012-01-27 14:44:19 PST ---
This rule should work satisfactory:

- The compiler is required to resolve inout such that the behavior is as if
there were four (five, with inout(const(T)) enhancement in place) separate
overloads. This could be implemented similar to how you propose it, by adding
all of the versions to the overload set, or by using some insights to speed up
the process (not very hard)

- If there would be an ambiguity between the different pseudo overloads:
-- If one of the remaining multiple possibilities is the const version, drop it
-- If one of the possibilities is the inout version, drop it
(-- If one of the remaining multiple possibilities is the inout const version,
drop it)
-- If mutable and immutable are remaining possible matches for inout, resolve
inout to mutable.
-- otherwise resolve inout to what is left.

- Allow direct conversion of the return type to any of the versions of inout
that still match after implicit conversions of the arguments in place.

- An inout function is considered to be less specialized than a corresponding
non-inout one.

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