mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
24 lines
374 B
D
24 lines
374 B
D
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/fail7751.d(15): Error: no constructor for `Foo`
|
|
fail_compilation/fail7751.d(23): Error: template instance `fail7751.foo!int` error instantiating
|
|
---
|
|
*/
|
|
class Foo(T)
|
|
{
|
|
T x;
|
|
Foo y;
|
|
}
|
|
auto foo(T)(T x, Foo!T y=null)
|
|
{
|
|
return new Foo!T(x, y);
|
|
}
|
|
void bar(U)(U foo, U[] spam=[])
|
|
{
|
|
spam ~= [];
|
|
}
|
|
void main()
|
|
{
|
|
bar(foo(0));
|
|
}
|