@zenstackhq/language 3.0.0-beta.32 → 3.0.0-beta.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +10 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -6740,6 +6740,9 @@ var ExpressionValidator = class {
|
|
|
6740
6740
|
case "BinaryExpr":
|
|
6741
6741
|
this.validateBinaryExpr(expr, accept);
|
|
6742
6742
|
break;
|
|
6743
|
+
case "UnaryExpr":
|
|
6744
|
+
this.validateUnaryExpr(expr, accept);
|
|
6745
|
+
break;
|
|
6743
6746
|
}
|
|
6744
6747
|
}
|
|
6745
6748
|
validateMemberAccessExpr(expr, accept) {
|
|
@@ -6881,6 +6884,13 @@ var ExpressionValidator = class {
|
|
|
6881
6884
|
break;
|
|
6882
6885
|
}
|
|
6883
6886
|
}
|
|
6887
|
+
validateUnaryExpr(expr, accept) {
|
|
6888
|
+
if (expr.operand.$resolvedType && expr.operand.$resolvedType.decl !== "Boolean") {
|
|
6889
|
+
accept("error", `operand of "${expr.operator}" must be of Boolean type`, {
|
|
6890
|
+
node: expr.operand
|
|
6891
|
+
});
|
|
6892
|
+
}
|
|
6893
|
+
}
|
|
6884
6894
|
validateCollectionPredicate(expr, accept) {
|
|
6885
6895
|
if (!expr.$resolvedType) {
|
|
6886
6896
|
accept("error", "collection predicate can only be used on an array of model type", {
|