digitalmars.D.bugs - ambiguous variadic function call not rejected by dmd 0.131 (win32)
-
zwang
(10/10)
Sep 19 2005
- Derek Parnell (8/19) Sep 19 2005 But using the rules for specialization, the f(0,0) is an exact match so ...
- Derek Parnell (14/25) Sep 20 2005 But a more problematic issue is that "f(0, 'a')" fails to compile.
<code>
void f(...){}
void f(int i, ...){}
void f(int i, int j){}
void main(){
f(0, 0);
}
</code>
The call "f(0,0)" matches all three definitions of function f, which
should not compile.
Sep 19 2005
On Tue, 20 Sep 2005 14:20:52 +0800, zwang wrote:
<code>
void f(...){}
void f(int i, ...){}
void f(int i, int j){}
void main(){
f(0, 0);
}
</code>
The call "f(0,0)" matches all three definitions of function f, which
should not compile.
But using the rules for specialization, the f(0,0) is an exact match so it
compiles.
--
Derek
(skype: derek.j.parnell)
Melbourne, Australia
20/09/2005 4:48:28 PM
Sep 19 2005
On Tue, 20 Sep 2005 14:20:52 +0800, zwang wrote:
<code>
void f(...){}
void f(int i, ...){}
void f(int i, int j){}
void main(){
f(0, 0);
}
</code>
The call "f(0,0)" matches all three definitions of function f, which
should not compile.
But a more problematic issue is that "f(0, 'a')" fails to compile.
test.d(5): function test.f called with argument types:
(int,char)
matches both:
test.f(...)
and:
test.f(int,int)
And I can't work out how to get it to call 'f(int, ...)' if I want to.
--
Derek
(skype: derek.j.parnell)
Melbourne, Australia
20/09/2005 4:58:35 PM
Sep 20 2005









Derek Parnell <derek psych.ward> 