From 11ada63fbb7ba982c92f22fa1fb0e39cebe3f194 Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Fri, 18 Feb 2022 10:08:13 -0800 Subject: Include type names in error messages from building (#4517) Instead of just reporting the type index that causes an error when building types, report the name of the responsible type when parsing the text format. --- test/lit/parse-bad-supertype.wast | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 test/lit/parse-bad-supertype.wast (limited to 'test') diff --git a/test/lit/parse-bad-supertype.wast b/test/lit/parse-bad-supertype.wast new file mode 100644 index 000000000..3a50efecf --- /dev/null +++ b/test/lit/parse-bad-supertype.wast @@ -0,0 +1,9 @@ +;; Test that an invalid supertype results in a useful error message + +;; RUN: not wasm-opt %s -all --nominal 2>&1 | filecheck %s + +;; CHECK: Fatal: Invalid type: Heap type has an invalid supertype at type $sub +(module + (type $super (struct_subtype i32 data)) + (type $sub (struct_subtype i64 $super)) +) \ No newline at end of file -- cgit v1.2.3