@zenstackhq/language 3.0.0-beta.31 → 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.js
CHANGED
|
@@ -6704,6 +6704,9 @@ var ExpressionValidator = class {
|
|
|
6704
6704
|
case "BinaryExpr":
|
|
6705
6705
|
this.validateBinaryExpr(expr, accept);
|
|
6706
6706
|
break;
|
|
6707
|
+
case "UnaryExpr":
|
|
6708
|
+
this.validateUnaryExpr(expr, accept);
|
|
6709
|
+
break;
|
|
6707
6710
|
}
|
|
6708
6711
|
}
|
|
6709
6712
|
validateMemberAccessExpr(expr, accept) {
|
|
@@ -6845,6 +6848,13 @@ var ExpressionValidator = class {
|
|
|
6845
6848
|
break;
|
|
6846
6849
|
}
|
|
6847
6850
|
}
|
|
6851
|
+
validateUnaryExpr(expr, accept) {
|
|
6852
|
+
if (expr.operand.$resolvedType && expr.operand.$resolvedType.decl !== "Boolean") {
|
|
6853
|
+
accept("error", `operand of "${expr.operator}" must be of Boolean type`, {
|
|
6854
|
+
node: expr.operand
|
|
6855
|
+
});
|
|
6856
|
+
}
|
|
6857
|
+
}
|
|
6848
6858
|
validateCollectionPredicate(expr, accept) {
|
|
6849
6859
|
if (!expr.$resolvedType) {
|
|
6850
6860
|
accept("error", "collection predicate can only be used on an array of model type", {
|