From 0e66dd989c8ad49a067905cc00005dd9280e3dd9 Mon Sep 17 00:00:00 2001 From: Arne Keller Date: Thu, 22 Feb 2024 14:08:14 +0100 Subject: [PATCH] Fix position info for equality expr errors --- .../main/java/de/uka/ilkd/key/speclang/njml/Translator.java | 1 + .../de/uka/ilkd/key/speclang/njml/exceptional/TypeError.java | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/key.core/src/main/java/de/uka/ilkd/key/speclang/njml/Translator.java b/key.core/src/main/java/de/uka/ilkd/key/speclang/njml/Translator.java index 15de4187522..ab4cc23f04a 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/speclang/njml/Translator.java +++ b/key.core/src/main/java/de/uka/ilkd/key/speclang/njml/Translator.java @@ -573,6 +573,7 @@ public SLExpression visitEqualityexpr(JmlParser.EqualityexprContext ctx) { if (floatResult != null) { return floatResult; } + exc.updatePosition(ctx.getStart()); if (tok.getText().equals("==")) { result = termFactory.eq(result, expr.get(i)); } else { diff --git a/key.core/src/test/resources/de/uka/ilkd/key/speclang/njml/exceptional/TypeError.java b/key.core/src/test/resources/de/uka/ilkd/key/speclang/njml/exceptional/TypeError.java index 8d57c617ce2..1be9fbf4568 100644 --- a/key.core/src/test/resources/de/uka/ilkd/key/speclang/njml/exceptional/TypeError.java +++ b/key.core/src/test/resources/de/uka/ilkd/key/speclang/njml/exceptional/TypeError.java @@ -1,8 +1,7 @@ // exceptionClass: RuntimeException // msgContains: Error in equality-expression -// position: 12/17 +// position: 11/19 // verbose: true -// broken: true // It's not the best of error messages ... // and there is no file location information