Skip to content

Commit b53b05a

Browse files
committed
pass null expressions and fix auth() in right expr of binary expr
1 parent 6cd53a5 commit b53b05a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/sdk/src/z3-expression-transformer.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,12 @@ export class Z3ExpressionTransformer {
326326

327327
let left = this.transform(expr.left);
328328
let right = isBooleanLiteral(expr.right) ? `${expr.right.value}` : this.transform(expr.right);
329+
330+
// TODO: improve handling of null expressions
331+
if (isNullExpr(expr.right)) {
332+
return `${this.withArgs(left)} ${expr.operator} ${right}`;
333+
}
334+
329335
// if (isMemberAccessExpr(expr.left) && !isAuthInvocation(expr.left)) {
330336
// left = `args.${left}`;
331337
// }
@@ -344,7 +350,7 @@ export class Z3ExpressionTransformer {
344350
? `(${left}?.id)`
345351
: `((${this.withArgs(left)}?.id || ${this.withArgs(left)}Id))`;
346352
right = isAuthInvocation(expr.right)
347-
? `(${right}.id)`
353+
? `(${right}?.id)`
348354
: `((${this.withArgs(right)}?.id || ${this.withArgs(right)}Id))`;
349355
let assertion = `${left} ${expr.operator} ${right}`;
350356

0 commit comments

Comments
 (0)