From 3a2f6851c5db42fa163122291903cf57dbf15022 Mon Sep 17 00:00:00 2001 From: Nick Battle Date: Sun, 26 Nov 2023 13:03:46 +0000 Subject: [PATCH] Improve curried measure error --- .../vdmj/tc/definitions/TCExplicitFunctionDefinition.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vdmj/src/main/java/com/fujitsu/vdmj/tc/definitions/TCExplicitFunctionDefinition.java b/vdmj/src/main/java/com/fujitsu/vdmj/tc/definitions/TCExplicitFunctionDefinition.java index d189c62db..b9a50395c 100644 --- a/vdmj/src/main/java/com/fujitsu/vdmj/tc/definitions/TCExplicitFunctionDefinition.java +++ b/vdmj/src/main/java/com/fujitsu/vdmj/tc/definitions/TCExplicitFunctionDefinition.java @@ -440,6 +440,11 @@ else if (this.typeParams != null && efd.typeParams != null detail2(mname.getName(), mtype.parameters, "Expected", type.parameters); } } + else if (isCurried && !(mtype.result instanceof TCFunctionType)) + { + mname.report(3303, "Measure parameters different to function"); + detail2(mname.getName(), mtype, "Expected", type.getMeasureType(mtype.result)); + } else if (!TypeComparator.compatible(mtype.parameters, type.parameters)) { mname.report(3303, "Measure parameters different to function");