Debian Codegraph @

tests/cli/gc/gc-rec-groups-invalid.wast

raw
1 ;; RUN: wast --assert default --snapshot tests/snapshots %
2
3 ;; --enable-gc
4
5 (assert_invalid
6 (module
7 (rec
8 (type $t1 (struct (field (ref $t2))))
9 (type $t2 (struct (field (ref $t3)))) ;; <--- unknown type
10 )
11
12 (rec
13 (type $t3 (struct (field (ref $t4))))
14 (type $t4 (sub $t2 (struct (field (ref $t3)))))
15 )
16 )
17 "unknown type"
18 )
19
20 (assert_invalid
21 (module
22 (rec
23 (type $t1 (struct (field (ref $t2))))
24 (type $t2 (sub (struct (field (ref $t1)))))
25 )
26
27 (rec
28 (type $t3 (struct (field (ref $t4))))
29 (type $t4 (sub $t2 (struct (field (ref $t3)))))
30 )
31 )
32 "sub type must match super type")