Bug 7359 – Template function with typesafe variadic rejects more than one string arguments
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-01-24T04:54:00Z
Last change time
2012-01-24T11:31:50Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0 by k.hara.pg — 2012-01-24T04:54:11Z
bool foo(T)(T[] a ...) {
return true;
}
void main() {
assert(foo(1,1,1,1,1,1)); // OK
assert(foo("abc")); // OK, T == immutable(char)
assert(foo("abc","abc","abc","abc")); // NG, T should be deduced to string
}