| 1 |
;; RUN: wast --assert default --snapshot tests/snapshots % -f gc,cm-gc |
| 2 |
|
| 3 |
(component |
| 4 |
(type $list (list string)) |
| 5 |
|
| 6 |
(core type $string (array i8)) |
| 7 |
(core type $list (array (ref $string))) |
| 8 |
(core type $ty (func (param (ref $list)))) |
| 9 |
|
| 10 |
(import "i" (instance $i |
| 11 |
(export "ty" (type $list' (eq $list))) |
| 12 |
(export "f" (func (param "x" $list'))))) |
| 13 |
(core func (canon lower (func $i "f") gc string-encoding=utf8 (core-type $ty))) |
| 14 |
) |
| 15 |
|
| 16 |
(assert_invalid |
| 17 |
(component |
| 18 |
(type $list (list string)) |
| 19 |
|
| 20 |
(core type $ty (func (param i32))) |
| 21 |
|
| 22 |
(import "i" (instance $i |
| 23 |
(export "ty" (type $list' (eq $list))) |
| 24 |
(export "f" (func (param "x" $list'))))) |
| 25 |
(core func (canon lower (func $i "f") gc string-encoding=utf8 (core-type $ty))) |
| 26 |
) |
| 27 |
"expected to lower component `list` type into `(ref null? (array ...))`, but found `i32`" |
| 28 |
) |