diff --git a/src/grammar/grammar.ts b/src/grammar/grammar.ts index 79e8296a3..b3fdbdc17 100644 --- a/src/grammar/grammar.ts +++ b/src/grammar/grammar.ts @@ -571,7 +571,15 @@ semantics.addOperation("astOfDeclaration", { semantics.addOperation("astOfStatement", { // TODO: process StatementBlock - StatementLet(_letKwd, id, _colon, type, _equals, expression, _semicolon) { + StatementLet_withType( + _letKwd, + id, + _colon, + type, + _equals, + expression, + _semicolon, + ) { checkVariableName(id.sourceString, createRef(id)); return createNode({ @@ -582,6 +590,16 @@ semantics.addOperation("astOfStatement", { ref: createRef(this), }); }, + StatementLet_withoutType(_arg0, arg1, _arg2, arg3, _arg4) { + checkVariableName(arg1.sourceString, createRef(arg1)); + + return createNode({ + kind: "statement_let_no_type", + name: arg1.sourceString, + expression: arg3.resolve_expression(), + ref: createRef(this), + }); + }, StatementReturn(_returnKwd, optExpression, _semicolon) { return createNode({ kind: "statement_return", @@ -830,16 +848,6 @@ semantics.addOperation("astOfType", { ref: createRef(this), }); }, - StatementLet_withoutType(arg0, arg1, arg2, arg3, arg4) { - checkVariableName(arg1.sourceString, createRef(arg1)); - - return createNode({ - kind: "statement_let_no_type", - name: arg1.sourceString, - expression: arg3.resolve_expression(), - ref: createRef(this), - }); - }, Type_regular(typeId) { return createNode({ kind: "type_ref_simple", diff --git a/src/test/feature-local-type-inference.spec.ts b/src/test/feature-local-type-inference.spec.ts index d44b95d52..4eb90af16 100644 --- a/src/test/feature-local-type-inference.spec.ts +++ b/src/test/feature-local-type-inference.spec.ts @@ -13,7 +13,6 @@ describe('feature-local-type-inference', () => { const system = await ContractSystem.create(); const treasure = system.treasure('treasure'); const contract = system.open(await LocalTypeInferenceTester.fromInit()); - const tracker = system.track(contract.address); await contract.send(treasure, { value: toNano('10') }, { $$type: 'Deploy', queryId: 0n }); await system.run();