Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Anton Trunov <anton.a.trunov@gmail.com>
  • Loading branch information
Gusarich and anton-trunov authored Sep 24, 2024
1 parent c57c623 commit de4387b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/types/__snapshots__/resolveStatements.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ Line 9, col 5:
`;

exports[`resolveStatements should fail statements for stmt-augmented-assgn-int 1`] = `
"<unknown>:5:5: Type error: Augmented assignment &&= is only allowed for Bool types
"<unknown>:5:5: Type error: Augmented assignment &&= is only allowed for Bool type
Line 5, col 5:
4 | let a: Int = 1;
> 5 | a &&= 1;
Expand Down
4 changes: 2 additions & 2 deletions src/types/resolveStatements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,14 +377,14 @@ function processStatements(
if (s.op === "&&" || s.op === "||") {
if (expressionType.name !== "Bool") {
throwCompilationError(
`Type error: Augmented assignment ${s.op}= is only allowed for Bool types`,
`Type error: Augmented assignment ${s.op}= is only allowed for Bool type`,
s.loc,
);
}
} else {
if (expressionType.name !== "Int") {
throwCompilationError(
`Type error: Augmented assignment ${s.op}= is only allowed for Int types`,
`Type error: Augmented assignment ${s.op}= is only allowed for Int type`,
s.loc,
);
}
Expand Down

0 comments on commit de4387b

Please sign in to comment.