diff options
author | 2024-07-17 20:24:18 +0200 | |
---|---|---|
committer | 2024-07-17 20:24:18 +0200 | |
commit | 06e8ea084b3cfd1ff9d2502138838b502a5652a1 (patch) | |
tree | 54a092ab1ee9a1f8fd03fba1d7bd0413a8b86069 /subprojects/language/src/main/java/tools | |
parent | fix(docs): example code (diff) | |
download | refinery-06e8ea084b3cfd1ff9d2502138838b502a5652a1.tar.gz refinery-06e8ea084b3cfd1ff9d2502138838b502a5652a1.tar.zst refinery-06e8ea084b3cfd1ff9d2502138838b502a5652a1.zip |
fix(language): disallow error predicate assertions
We don't process error predicate assertions in ModelInitializer, so let's forbid
them entirely.
Diffstat (limited to 'subprojects/language/src/main/java/tools')
-rw-r--r-- | subprojects/language/src/main/java/tools/refinery/language/validation/ProblemValidator.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/subprojects/language/src/main/java/tools/refinery/language/validation/ProblemValidator.java b/subprojects/language/src/main/java/tools/refinery/language/validation/ProblemValidator.java index aef1e71d..ace9f3dd 100644 --- a/subprojects/language/src/main/java/tools/refinery/language/validation/ProblemValidator.java +++ b/subprojects/language/src/main/java/tools/refinery/language/validation/ProblemValidator.java | |||
@@ -504,6 +504,11 @@ public class ProblemValidator extends AbstractProblemValidator { | |||
504 | acceptError(message, assertion, ProblemPackage.Literals.ABSTRACT_ASSERTION__RELATION, 0, | 504 | acceptError(message, assertion, ProblemPackage.Literals.ABSTRACT_ASSERTION__RELATION, 0, |
505 | SHADOW_RELATION_ISSUE); | 505 | SHADOW_RELATION_ISSUE); |
506 | } | 506 | } |
507 | if (ProblemUtil.isError(relation)) { | ||
508 | var message = "Assertions for error predicates are not supported."; | ||
509 | acceptError(message, assertion, ProblemPackage.Literals.ABSTRACT_ASSERTION__RELATION, 0, | ||
510 | UNSUPPORTED_ASSERTION_ISSUE); | ||
511 | } | ||
507 | int argumentCount = assertion.getArguments().size(); | 512 | int argumentCount = assertion.getArguments().size(); |
508 | checkArity(assertion, ProblemPackage.Literals.ABSTRACT_ASSERTION__RELATION, argumentCount); | 513 | checkArity(assertion, ProblemPackage.Literals.ABSTRACT_ASSERTION__RELATION, argumentCount); |
509 | } | 514 | } |