Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Gusarich committed Jun 12, 2024
1 parent 07bf0e4 commit 637339f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/grammar/grammar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ semantics.addOperation<ASTNode>("astOfStatement", {
return createNode({
kind: "statement_let_no_type",
name: arg1.sourceString,
expression: arg3.resolve_expression(),
expression: arg3.astOfExpression(),
ref: createRef(this),
});
},
Expand Down
2 changes: 1 addition & 1 deletion src/types/resolveStatements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ function processStatements(
const expressionType = getExpType(ctx, s.expression);

// Add variable to statement context
if (sctx.vars[s.name]) {
if (sctx.vars.has(s.name)) {
throwError(`Variable already exists: ${s.name}`, s.ref);
}
sctx = addVariable(s.name, expressionType, sctx);
Expand Down

0 comments on commit 637339f

Please sign in to comment.