mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00

The default arg might depend on another TemplateParameter, in which case it is required to copy the AST, otherwise different instances of the template might be falsy considered equal.
42 lines
889 B
D
42 lines
889 B
D
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/b23686.d(107): Error: undefined identifier `eFN1`, did you mean template `eFN0()()`?
|
|
fail_compilation/b23686.d(107): Error: `mixin(_error_)` does not give a valid type
|
|
fail_compilation/b23686.d(115): while looking for match for `eload!(int, 1)`
|
|
fail_compilation/b23686.d(121): Error: undefined identifier `FNwtf`
|
|
fail_compilation/b23686.d(121): Error: `mixin(_error_)` does not give a valid type
|
|
fail_compilation/b23686.d(126): while looking for match for `load!"wtf"`
|
|
---
|
|
*/
|
|
module b23686;
|
|
|
|
#line 100
|
|
|
|
//-------------------
|
|
|
|
void eFN0()()
|
|
{
|
|
}
|
|
|
|
void eload(I, I name, alias T = mixin("eFN" ~ name.stringof))()
|
|
{
|
|
T!()();
|
|
}
|
|
|
|
void test2()
|
|
{
|
|
eload!(int,0)();
|
|
eload!(int,1)();
|
|
}
|
|
|
|
//-------------------
|
|
|
|
void FNfoo() {}
|
|
void load(string name, alias T = mixin("FN" ~ name))() {}
|
|
|
|
void test1()
|
|
{
|
|
load!"foo"();
|
|
load!"wtf"();
|
|
}
|