Skip to content
Merged
Changes from 1 commit
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
38 changes: 38 additions & 0 deletions test/core/gc/type-subtyping.wast
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,23 @@
)
)

(module
(func $f (result (ref array)) unreachable)
(func (result (ref eq))
return_call $f
)
)

(assert_invalid
(module
(func $f (result (ref eq)) unreachable)
(func (result (ref array))
return_call $f
)
)
"type mismatch"
)

(module
(rec (type $f1 (sub (func))) (type (struct (field (ref $f1)))))
(rec (type $f2 (sub (func))) (type (struct (field (ref $f2)))))
Expand Down Expand Up @@ -399,6 +416,27 @@
(assert_trap (invoke "fail1") "indirect call type mismatch")
(assert_trap (invoke "fail2") "indirect call type mismatch")

(module
(type $t (func (result (ref array))))
Comment thread
CharlieTap marked this conversation as resolved.
Outdated
(table 0 funcref)
(func (result (ref eq))
i32.const 0
return_call_indirect (type $t)
Comment thread
CharlieTap marked this conversation as resolved.
Outdated
)
)

(assert_invalid
(module
(type $t (func (result (ref eq))))
(table 0 funcref)
(func (result (ref array))
i32.const 0
return_call_indirect (type $t)
)
)
"type mismatch"
)

(module
(rec (type $f1 (sub (func))) (type (struct (field (ref $f1)))))
(rec (type $f2 (sub (func))) (type (struct (field (ref $f2)))))
Expand Down
Loading