Skip to content

Fixed tags with recursive type definitions #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion interpreter/valid/valid.ml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ let check_memory_type (c : context) (mt : memory_type) at =

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

let check_global_type (c : context) (gt : global_type) at =
let GlobalT (_mut, t) = gt in
Expand Down
8 changes: 8 additions & 0 deletions test/core/tag.wast
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
;; "non-empty tag result type"
;; )

;; Mutually recursive types
(module
(rec
(type $f (func (param (ref null $c))))
(type $c (cont $f))
)
(tag (type $f))
)

;; Link-time typing

Expand Down