summaryrefslogtreecommitdiff
path: root/tnslc/tests/proper_calling.tnsl
blob: 4480b31ad1cd96fbd1ea5e8406fbaace47fbac14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
struct CallMe {
    int a, b
}

/; method CallMe
    /; call_two (int a, b) [int]
        return a + b + self.a + self.b
    ;/

    /; call_three (int a, b, c) [int]
        return self.call_two(a, b) + self.call_two(a, b) + c
    ;/

    /; call_four (int a, b, c, d) [int]
        return self.call_three(a, b, c) + self.call_three(b, c, d)
    ;/

;/

/; main [int]
    CallMe cm
    cm.a = 0
    cm.b = 0
    return cm.call_four(2, 0, 0, 1)
;/