[Issue 1390] Implicit Instantiation: delegate args from variadic template argument
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Aug 8 13:11:04 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=1390
RazvanN <razvan.nitu1305 at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |razvan.nitu1305 at gmail.com
Resolution|--- |INVALID
--- Comment #2 from RazvanN <razvan.nitu1305 at gmail.com> ---
This is not a valid bug report. Variadic template parameters are expanded only
if there are no other trailing parameters. If you rewrite the code in the
second comment to:
void bug1390a(A,U)(void delegate(U,A) dg, A arg)
{}
void bug1390(A,U...)(void delegate(A, U) dg, A arg) // A was swapped with U in
// the delegate definition
{}
struct FooStruct {
void foo(uint i,char c) {}
}
void bar1390() {
auto temp = new FooStruct;
bug1390a!(char,uint)(&temp.foo, 'c');
bug1390a (&temp.foo, 'c');
bug1390!(uint, char)(&temp.foo, 'c'); // uint was swapped with char
bug1390 (&temp.foo, 'c');
}
Then the code compiles.
Closing as WONTFIX.
--
More information about the Digitalmars-d-bugs
mailing list