]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gdc.test/compilable/test9639.d
d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / compilable / test9639.d
CommitLineData
b4c522fa
IB
1class A { this(A) {} }
2class B {}
3class C {}
4
5// two sibling nested functions in main
6typeof(null) foo(alias fn)(A a) { fn(a); return foo!fn(B.init); }
7typeof(null) foo(alias fn)(B b) { return foo!fn(A.init); }
8
9// three sibling nested functions in main
10typeof(null) bar(alias fn)(A a) { fn(a); return bar!fn(B.init); }
11typeof(null) bar(alias fn)(B b) { return bar!fn(C.init); }
12typeof(null) bar(alias fn)(C c) { return bar!fn(A.init); }
13
14void main()
15{
16 A a;
17 foo!((stuff){ new A(a); })(a);
18 bar!((stuff){ new A(a); })(a);
19}