]>
Commit | Line | Data |
---|---|---|
b4c522fa IB |
1 | class A { this(A) {} } |
2 | class B {} | |
3 | class C {} | |
4 | ||
5 | // two sibling nested functions in main | |
6 | typeof(null) foo(alias fn)(A a) { fn(a); return foo!fn(B.init); } | |
7 | typeof(null) foo(alias fn)(B b) { return foo!fn(A.init); } | |
8 | ||
9 | // three sibling nested functions in main | |
10 | typeof(null) bar(alias fn)(A a) { fn(a); return bar!fn(B.init); } | |
11 | typeof(null) bar(alias fn)(B b) { return bar!fn(C.init); } | |
12 | typeof(null) bar(alias fn)(C c) { return bar!fn(A.init); } | |
13 | ||
14 | void main() | |
15 | { | |
16 | A a; | |
17 | foo!((stuff){ new A(a); })(a); | |
18 | bar!((stuff){ new A(a); })(a); | |
19 | } |