Skip to content

Commit 9971608

Browse files
authored
Merge pull request #119 from rajdakin/rec-tag-fix
Fixed tags with recursive type definitions
2 parents eca06cf + 5d03dba commit 9971608

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

interpreter/valid/valid.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ let check_memory_type (c : context) (mt : memory_type) at =
205205

206206
let check_tag_type (c : context) (et : tag_type) at =
207207
match et with
208-
| TagT dt -> check_func_type c (as_func_str_type (expand_def_type dt)) at
208+
| TagT dt -> let _ft = as_func_str_type (expand_def_type dt) in ()
209209

210210
let check_global_type (c : context) (gt : global_type) at =
211211
let GlobalT (_mut, t) = gt in

test/core/tag.wast

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@
2121
;; "non-empty tag result type"
2222
;; )
2323

24+
;; Mutually recursive types
25+
(module
26+
(rec
27+
(type $f (func (param (ref null $c))))
28+
(type $c (cont $f))
29+
)
30+
(tag (type $f))
31+
)
2432

2533
;; Link-time typing
2634

0 commit comments

Comments
 (0)