Bug 16695 – variadic argument static array can't use template arg as size

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2016-11-16T23:25:00Z
Last change time
2016-11-20T20:55:20Z
Keywords
rejects-valid
Assigned to
nobody
Creator
code.viator

Comments

Comment #0 by code.viator — 2016-11-16T23:25:34Z
struct X(size_t S) { float[S] data; void set(T)(T[S] vals...) { foreach (i; 0 .. S) data[i] = float(vals[i]); } } void main() { X!3 a; a.set([1,2,3]); a.set(1,2,3); // line 16 } % rdmd bug_notvisible_ct_arg.d bug_notvisible_ct_arg.d(16): Error: undefined identifier 'S' bug_notvisible_ct_arg.d(16): Error: template bug_notvisible_ct_arg.X!3LU.X.set cannot deduce function from argument types !()(int, int, int), candidates are: bug_notvisible_ct_arg.d(5): bug_notvisible_ct_arg.X!3LU.X.set(T)(T[S] vals...) Failed: ["dmd", "-v", "-c", "-of/tmp/.rdmd-1000/rdmd-bug_notvisible_ct_arg.d-2A14CCA7EDA1E925EDEE8C25A4D7639E/objs/bug_notvisible_ct_arg.o", "bug_notvisible_ct_arg.d", "-I."] % dmd --version DMD64 D Compiler v2.072.0 system Linux 4.8.6-201.fc24.x86_64
Comment #1 by code.viator — 2016-11-20T20:51:01Z
Forget what I report this 3 years before. duplicate of https://issues.dlang.org/show_bug.cgi?id=11118
Comment #2 by ag0aep6g — 2016-11-20T20:55:20Z
(In reply to Oleg B from comment #1) > Forget what I report this 3 years before. > duplicate of https://issues.dlang.org/show_bug.cgi?id=11118 Closing this issue as a DUPLICATE of that one then. *** This issue has been marked as a duplicate of issue 11118 ***