From de4387b04485568eec621ba18e034e8d9ee6cdc4 Mon Sep 17 00:00:00 2001 From: Daniil Sedov Date: Tue, 24 Sep 2024 21:57:21 +0300 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Anton Trunov --- src/types/__snapshots__/resolveStatements.spec.ts.snap | 2 +- src/types/resolveStatements.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/types/__snapshots__/resolveStatements.spec.ts.snap b/src/types/__snapshots__/resolveStatements.spec.ts.snap index 6da2c083a..721ab53b6 100644 --- a/src/types/__snapshots__/resolveStatements.spec.ts.snap +++ b/src/types/__snapshots__/resolveStatements.spec.ts.snap @@ -796,7 +796,7 @@ Line 9, col 5: `; exports[`resolveStatements should fail statements for stmt-augmented-assgn-int 1`] = ` -":5:5: Type error: Augmented assignment &&= is only allowed for Bool types +":5:5: Type error: Augmented assignment &&= is only allowed for Bool type Line 5, col 5: 4 | let a: Int = 1; > 5 | a &&= 1; diff --git a/src/types/resolveStatements.ts b/src/types/resolveStatements.ts index 2e11b9a50..92986f36f 100644 --- a/src/types/resolveStatements.ts +++ b/src/types/resolveStatements.ts @@ -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, ); }