From 23a1a1aacc0dd14767ca8c53a034b7c6bb4acf52 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Tue, 6 Aug 2024 20:01:54 -0400 Subject: [parser] Fix bug when printing type builder errors (#6817) The type index from the TypeBuilder error was mapped to a file location incorrectly, resulting in an assertion failure. Fixes #6816. --- src/parser/parse-2-typedefs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/parser') diff --git a/src/parser/parse-2-typedefs.cpp b/src/parser/parse-2-typedefs.cpp index 90a84941d..97ba247bd 100644 --- a/src/parser/parse-2-typedefs.cpp +++ b/src/parser/parse-2-typedefs.cpp @@ -34,7 +34,7 @@ Result<> parseTypeDefs( if (auto* err = built.getError()) { std::stringstream msg; msg << "invalid type: " << err->reason; - return ctx.in.err(decls.typeDefs[err->index].pos, msg.str()); + return ctx.in.err(decls.subtypeDefs[err->index].pos, msg.str()); } types = *built; // Record type names on the module and in typeNames. -- cgit v1.2.3