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