dmd/compiler/test/fail_compilation/fail116.d
2022-07-09 18:53:07 +02:00

16 lines
417 B
D

/*
TEST_OUTPUT:
---
fail_compilation/fail116.d(11): Error: undefined identifier `x`
fail_compilation/fail116.d(16): Error: template instance `square!1.2` does not match template declaration `square(_error_ x)`
---
*/
// https://issues.dlang.org/show_bug.cgi?id=405
// typeof in TemplateParameterList causes compiletime segmentfault
template square(typeof(x) x)
{
const square = x * x;
}
const b = square!(1.2);