digitalmars.D.bugs - Bugs with overloaded variadic functions
- BCS (24/24) Jan 08 2007 Two odd bugs
Two odd bugs import std.stdio; class Foo { this(int i, float f){writef(" Foo(i,f) ");} this(float f) {writef(" Foo(f) ");} } void fn(int i, Foo f...){writef(" fn(i,Foo...) ");} void fn(Foo f...) {writef(" fn(Foo...) ");} void main() { int i = 0; float f = 0; //matches: // Foo(i,f) fn(i,Foo...) fn(i,i,f); // BUG fails with "matches both" error //matches: // Foo(f) fn(i,Foo...) // Foo(i,f) fn(Foo...) fn(i,f); // BUG passes and does match >1 //matches: // Foo(f) fn(Foo...) fn(f); //OK }
Jan 08 2007