blob: 5576e30b3de1701ef48557c4951f182181524e0d (
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
26
27
28
29
30
31
32
33
34
35
36
37
|
typedef A1 = (int x, int y);
typedef A2 = (int x, int y);
() test() {
var A1 a1;
var A2 a2;
var (int x, int y) b;
var (int x, int y, bool z) c;
var (int, int) d;
var (int, bool) e;
var (int p, int q) f;
var (int p, short q) g;
/* ERRORS: types referenced by name are different => error */
a1 = a2;
a2 = a1;
/* ERRORS: different lengths of structs */
b = c;
c = b;
d = c;
c = d;
/* ERRORS: different types */
d = e;
e = d;
/* ERRORS: different member names */
f = b;
b = f;
// member types that are subtypes
// (member types must be equal)
f = g; // ERROR
}
|