D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 5524 - [CTFE] Trouble with typesafe variadic function
Summary: [CTFE] Trouble with typesafe variadic function
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2011-02-04 10:30 UTC by bearophile_hugs
Modified: 2011-03-01 17:15 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2011-02-04 10:30:31 UTC
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