aboutsummaryrefslogtreecommitdiff
path: root/test/data/nested-fns.yx
blob: 3f60f5b55babe88e61eeee6274e7be91fc8d0528 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
fn1 :: () int {
	/* You can create and use nested functions */
	fn2 :: () int {
		return fn1() * fn1();

		/* Nested functions shadow parent functions */
		fn1 :: () int {
			return 42;
		}
	}

	return fn2();
}