[Issue 9596] New: Ambiguous match is incorrectly hidden by additional lesser match
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Feb 26 06:36:36 PST 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9596
Summary: Ambiguous match is incorrectly hidden by additional
lesser match
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Keywords: accepts-invalid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: k.hara.pg at gmail.com
--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2013-02-26 06:36:34 PST ---
>From std.traits.AssocArrayTypeOf.
In the below, 'x' and 'y' are both ambiguous each other if it is called with
shared(int)[int] argument, but that will be hidden by adding lesser match 'z'.
void idzp1(K, V)(inout( V [K])) { pragma(msg, "x:", V); }
void idzp1(K, V)(inout(shared(V) [K])) { pragma(msg, "y:", V); }
void idzp2(K, V)(inout( V [K])) { pragma(msg, "x:", V); }
void idzp2(K, V)(inout( const(V) [K])) { pragma(msg, "z:", V); }
void idzp3(K, V)(inout(shared(V) [K])) { pragma(msg, "y:", V); }
void idzp3(K, V)(inout( const(V) [K])) { pragma(msg, "z:", V); }
void idzp4(K, V)(inout( V [K])) { pragma(msg, "x:", V); }
void idzp4(K, V)(inout(shared(V) [K])) { pragma(msg, "y:", V); }
void idzp4(K, V)(inout( const(V) [K])) { pragma(msg, "z:", V); }
void idzp5(K, V)(inout(shared(V) [K])) { pragma(msg, "y:", V); }
void idzp5(K, V)(inout( V [K])) { pragma(msg, "x:", V); }
void idzp5(K, V)(inout( const(V) [K])) { pragma(msg, "z:", V); }
void main()
{
shared(int)[int] aa;
idzp1(aa); // make "matches more than one declaration" error, OK
idzp2(aa); // matches "x", OK
idzp3(aa); // matches "y", OK
// these means: x == y, x > z, y > z
idzp4(aa); // should be ambiguous with x and y, but incorrectly matches x
idzp5(aa); // should be ambiguous with x and y, but incorrectly matches y
}
--
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