summaryrefslogtreecommitdiff
path: root/tests/delegates/lambda-mixed-instance-static.vala
blob: f25d08a18ea2da3631eda1c8dd49f80e843ad0ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[CCode (has_target = false)]
delegate int FooFunc (int i);

delegate int BarFunc (int i);

void func (FooFunc f, BarFunc b) {
	assert (f (42) == 42);
	assert (b (23) == 4711);
}

void main () {
	int global = 4711;

	func (
		(i) => { assert (i == 42); return i; },
		(i) => { assert (i == 23); return global; }
	);
}