diff --git a/org.lflang.tests/src/org/lflang/tests/compiler/LinguaFrancaValidationTest.java b/org.lflang.tests/src/org/lflang/tests/compiler/LinguaFrancaValidationTest.java index 12e8a7b227..a13d38df49 100644 --- a/org.lflang.tests/src/org/lflang/tests/compiler/LinguaFrancaValidationTest.java +++ b/org.lflang.tests/src/org/lflang/tests/compiler/LinguaFrancaValidationTest.java @@ -906,8 +906,8 @@ public void nonzeroAfterMustHaveUnits() throws Exception { " b = new X()", " a.y -> b.x after 1", "}"); - validator.assertError(parseWithoutError(testCase), LfPackage.eINSTANCE.getTime(), - null, "Missing or invalid time unit."); + validator.assertError(parseWithoutError(testCase), LfPackage.eINSTANCE.getConnection(), + null, "Missing time unit."); } diff --git a/org.lflang/src/org/lflang/validation/LFValidator.java b/org.lflang/src/org/lflang/validation/LFValidator.java index cb96759e4a..5d487af35a 100644 --- a/org.lflang/src/org/lflang/validation/LFValidator.java +++ b/org.lflang/src/org/lflang/validation/LFValidator.java @@ -363,10 +363,10 @@ public void checkConnection(Connection connection) { // Check the after delay if (connection.getDelay() != null) { final var delay = connection.getDelay(); - if (delay instanceof ParameterReference || delay instanceof Time) { + if (delay instanceof ParameterReference || delay instanceof Time || delay instanceof Literal) { checkExpressionAsTime(delay, Literals.CONNECTION__DELAY); } else { - error("After delays can only be given by time literals or paramters.", + error("After delays can only be given by time literals or parameters.", Literals.CONNECTION__DELAY); } }