Skip to content

Commit 67b6fe2

Browse files
authored
[test] Unify error messages in gc and exception tests (#2023)
1 parent f92667e commit 67b6fe2

File tree

9 files changed

+17
-17
lines changed

9 files changed

+17
-17
lines changed

interpreter/valid/valid.ml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ let rec check_instr (c : context) (e : instr) (s : infer_resulttype) : infer_ins
769769
require (i < Lib.List32.length fts) e.at
770770
("unknown field " ^ I32.to_string_u i);
771771
let FieldT (mut, st) = Lib.List32.nth fts i in
772-
require (mut == Var) e.at "field is immutable";
772+
require (mut == Var) e.at "immutable field";
773773
let t = unpacked_storagetype st in
774774
[RefT (Null, UseHT (Def (type_ c x))); t] --> [], []
775775

@@ -811,7 +811,7 @@ let rec check_instr (c : context) (e : instr) (s : infer_resulttype) : infer_ins
811811

812812
| ArraySet x ->
813813
let FieldT (mut, st) = array_type c x in
814-
require (mut == Var) e.at "array is immutable";
814+
require (mut == Var) e.at "immutable array";
815815
let t = unpacked_storagetype st in
816816
[RefT (Null, UseHT (Def (type_ c x))); NumT I32T; t] --> [], []
817817

@@ -821,19 +821,19 @@ let rec check_instr (c : context) (e : instr) (s : infer_resulttype) : infer_ins
821821
| ArrayCopy (x, y) ->
822822
let FieldT (mutd, std) = array_type c x in
823823
let FieldT (_muts, sts) = array_type c y in
824-
require (mutd = Var) e.at "array is immutable";
824+
require (mutd = Var) e.at "immutable array";
825825
require (match_storagetype c.types sts std) e.at "array types do not match";
826826
[RefT (Null, UseHT (Def (type_ c x))); NumT I32T; RefT (Null, UseHT (Def (type_ c y))); NumT I32T; NumT I32T] --> [], []
827827

828828
| ArrayFill x ->
829829
let FieldT (mut, st) = array_type c x in
830-
require (mut = Var) e.at "array is immutable";
830+
require (mut = Var) e.at "immutable array";
831831
let t = unpacked_storagetype st in
832832
[RefT (Null, UseHT (Def (type_ c x))); NumT I32T; t; NumT I32T] --> [], []
833833

834834
| ArrayInitData (x, y) ->
835835
let FieldT (mut, st) = array_type c x in
836-
require (mut = Var) e.at "array is immutable";
836+
require (mut = Var) e.at "immutable array";
837837
let () = data c y in
838838
let t = unpacked_storagetype st in
839839
require (is_numtype t || is_vectype t) x.at
@@ -842,7 +842,7 @@ let rec check_instr (c : context) (e : instr) (s : infer_resulttype) : infer_ins
842842

843843
| ArrayInitElem (x, y) ->
844844
let FieldT (mut, st) = array_type c x in
845-
require (mut = Var) e.at "array is immutable";
845+
require (mut = Var) e.at "immutable array";
846846
let rt = elem c y in
847847
require (match_valtype c.types (RefT rt) (unpacked_storagetype st)) x.at
848848
("type mismatch: element segment's type " ^ string_of_reftype rt ^

test/core/exceptions/tag.wast

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@
5353
)
5454
(tag (import "M" "tag") (type $t2))
5555
)
56-
"incompatible import"
56+
"incompatible import type"
5757
)
5858

5959
(assert_unlinkable
6060
(module
6161
(type $t (func))
6262
(tag (import "M" "tag") (type $t))
6363
)
64-
"incompatible import"
64+
"incompatible import type"
6565
)

test/core/gc/array.wast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@
296296
(array.set $a (local.get $a) (i32.const 0) (i64.const 1))
297297
)
298298
)
299-
"array is immutable"
299+
"immutable array"
300300
)
301301

302302
(assert_invalid

test/core/gc/array_copy.wast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
(array.copy $a $b (local.get $1) (i32.const 0) (local.get $2) (i32.const 0) (i32.const 0))
1212
)
1313
)
14-
"array is immutable"
14+
"immutable array"
1515
)
1616

1717
(assert_invalid

test/core/gc/array_fill.wast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
(array.fill $a (local.get $1) (i32.const 0) (local.get $2) (i32.const 0))
1111
)
1212
)
13-
"array is immutable"
13+
"immutable array"
1414
)
1515

1616
(assert_invalid

test/core/gc/array_init_data.wast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
(array.init_data $a $d1 (local.get $1) (i32.const 0) (i32.const 0) (i32.const 0))
1313
)
1414
)
15-
"array is immutable"
15+
"immutable array"
1616
)
1717

1818
(assert_invalid

test/core/gc/array_init_elem.wast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
(array.init_elem $a $e1 (local.get $1) (i32.const 0) (i32.const 0) (i32.const 0))
1313
)
1414
)
15-
"array is immutable"
15+
"immutable array"
1616
)
1717

1818
(assert_invalid

test/core/gc/struct.wast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
(struct.set $s 0 (local.get $s) (i64.const 1))
137137
)
138138
)
139-
"field is immutable"
139+
"immutable field"
140140
)
141141

142142

test/core/return_call_indirect.wast

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -551,9 +551,9 @@
551551
;; return_call_indirect expects funcref type but receives externref
552552
(assert_invalid
553553
(module
554-
(type (func))
555-
(table 10 externref)
556-
(func $return-call-indirect (return_call_indirect (type 0) (i32.const 0)))
554+
(type (func))
555+
(table 10 externref)
556+
(func $return-call-indirect (return_call_indirect (type 0) (i32.const 0)))
557557
)
558558
"type mismatch"
559559
)

0 commit comments

Comments
 (0)