Skip to content

Commit 58f628c

Browse files
authored
Merge pull request #4668 from forejtv/forejtv/invariant-message
Print a more helpful message in Java bytecode parsing invariant violation
2 parents d9a5113 + aab30cb commit 58f628c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

jbmc/src/java_bytecode/java_bytecode_language.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,11 @@ static void infer_opaque_type_fields(
345345
// Not present here: check the superclass.
346346
INVARIANT(
347347
!class_type->bases().empty(),
348-
"class '" + id2string(class_symbol->name)
349-
+ "' (which was missing a field '" + id2string(component_name)
350-
+ "' referenced from method '" + id2string(method.name)
351-
+ "') should have an opaque superclass");
348+
"class '" + id2string(class_symbol->name) +
349+
"' (which was missing a field '" + id2string(component_name) +
350+
"' referenced from method '" + id2string(method.name) +
351+
"' of class '" + id2string(parse_tree.parsed_class.name) +
352+
"') should have an opaque superclass");
352353
const auto &superclass_type = class_type->bases().front().type();
353354
class_symbol_id = superclass_type.get_identifier();
354355
class_type = &to_java_class_type(ns.follow(superclass_type));

0 commit comments

Comments
 (0)