Bug 5524 – [CTFE] Trouble with typesafe variadic function

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2011-02-04T10:30:00Z
Last change time
2011-03-01T17:15:27Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2011-02-04T10:30:31Z
Andrej Mitrovic has found this D2 code produces errors: import std.path : join; enum rootdir = r"C:\Path\"; enum testdir = join(rootdir, "simple"); void main() {} I have reduced that bug to: int foo(int x, int y, int[] more...) { return 0; } enum r = foo(0, 0); void main() {} DMD 2.051 prints: test.d(4): Error: variable __arrayArg1 is used before initialization test.d(4): Error: cannot evaluate foo(0,0,(int[0u] __arrayArg1 = void; , cast(int[])__arrayArg1)) at compile time test.d(4): Error: cannot evaluate foo(0,0,(int[0u] __arrayArg1 = void; , cast(int[])__arrayArg1)) at compile time
Comment #1 by clugdbug — 2011-03-01T17:15:27Z