Rune - Fix array passing, optimize constant array indices
[rune.git] / tests / defaults3.d
1 #!/usr/local/bin/rune -x
2 #
3 # Test self-referencing argument defaults
4
5 import "sys";
6 import <stdio>;
7
8 class Fubar {
9         int a;
10 }
11
12 int
13 main(int ac, char **av)
14 {
15         Fubar q;
16
17         q.a = 44;
18         q.testfunc(3);
19 }
20
21 method
22 void
23 Fubar.testfunc(int expect, int x = 1, int y = x + 2, int z = this.a + 23)
24 {
25         stdio.stdout->format("y is (%d): %d\n", expect, y);
26         stdio.stdout->format("z is (67): %d\n", z);
27 }