cfad47cfa3/t3compiler/tads3/test/data/setsc.t

4b825dc642cb6eb9a060e54bf8d69288fbee4904cfad47cfa334b206c65f22086bcc5d63e6f70944
1
#include <tads.h>
2
3
class A: object
4
    name = 'class A'
5
    prop1 { "A.prop1... "; inherited(); }
6
;
7
8
class B: object
9
    name = 'class B'
10
    prop1 { "B.prop1... "; inherited(); }
11
;
12
13
class C: object
14
    name = 'class C'
15
    prop1 { "C.prop1... "; inherited(); }
16
;
17
18
class D: A, B, C
19
    name = 'class D'
20
    prop1 { "D.prop1... "; inherited(); }
21
;
22
23
objA: A;
24
objB: B;
25
objC: C;
26
objD: D;
27
28
main(args)
29
{
30
    local obj;
31
32
    test('objA', objA);
33
    test('objB', objB);
34
    test('objC', objC);
35
    test('objD', objD);
36
37
    obj = new D();
38
    test('new D', obj);
39
40
    objD.setSuperclassList([TadsObject]);
41
    test('objD modified to [TadsObject]', objD);
42
43
    objD.setSuperclassList([A, C]);
44
    test('objD modified to [A, C]', objD);
45
46
    obj.setSuperclassList([B, C]);
47
    test('new D modified to [B, C]', obj);
48
}
49
50
test(id, obj)
51
{
52
    "<<id>>:
53
    \n\t<<obj.name>>
54
    \n\t<<obj.prop1>>
55
    \b";
56
}