Skip to content

Commit

Permalink
Merge branch 'main' into pmakhnev/fix-non-mutable-function-generation
Browse files Browse the repository at this point in the history
  • Loading branch information
i582 authored Jan 28, 2025
2 parents eb9b5ec + 587c5de commit 8e36cae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions dev-docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Make `msg_bounced` last parameter of `*_contract_router_internal` for better code generation: PR [#1585](https://github.com/tact-lang/tact/pull/1585)
- Inline `*_contract_init` function: PR [#1589](https://github.com/tact-lang/tact/pull/1589)
- Better error message for `unresolved name` error: PR [#1595](https://github.com/tact-lang/tact/pull/1595)
- Better error message for `unresolved global function` error: PR [#1610](https://github.com/tact-lang/tact/pull/1610)

### Fixed

Expand Down
6 changes: 3 additions & 3 deletions src/types/__snapshots__/resolveStatements.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1603,7 +1603,7 @@ exports[`resolveStatements should fail statements for var-scope-nested-block-sta
`;

exports[`resolveStatements should fail statements for var-scope-no-toString-global-fun1 1`] = `
"<unknown>:7:9: Static function "toString" does not exist
"<unknown>:7:9: Cannot find global function "toString"
6 | init() {
> 7 | toString(); // non-existent function
^~~~~~~~~~
Expand All @@ -1612,7 +1612,7 @@ exports[`resolveStatements should fail statements for var-scope-no-toString-glob
`;

exports[`resolveStatements should fail statements for var-scope-no-toString-global-fun2 1`] = `
"<unknown>:6:12: Static function "toString" does not exist. Perhaps you meant to call ".toString(...)" extension function?
"<unknown>:6:12: Cannot find global function "toString", did you mean "self.toString()"?
5 | extends fun toString(self: WrappedInt): Int {
> 6 | return toString(self.x);
^~~~~~~~~~~~~~~~
Expand All @@ -1621,7 +1621,7 @@ exports[`resolveStatements should fail statements for var-scope-no-toString-glob
`;

exports[`resolveStatements should fail statements for var-scope-no-valueOf-global-fun 1`] = `
"<unknown>:4:5: Static function "valueOf" does not exist
"<unknown>:4:5: Cannot find global function "valueOf"
3 | fun foo(x: Int) {
> 4 | valueOf(x);
^~~~~~~~~~
Expand Down
4 changes: 2 additions & 2 deletions src/types/resolveExpression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -560,13 +560,13 @@ function resolveStaticCall(
) !== undefined
) {
throwCompilationError(
`Static function ${idTextErr(exp.function)} does not exist. Perhaps you meant to call ".${idText(exp.function)}(...)" extension function?`,
`Cannot find global function ${idTextErr(exp.function)}, did you mean "self.${idText(exp.function)}()"?`,
exp.loc,
);
}

throwCompilationError(
`Static function ${idTextErr(exp.function)} does not exist`,
`Cannot find global function ${idTextErr(exp.function)}`,
exp.loc,
);
}
Expand Down

0 comments on commit 8e36cae

Please sign in to comment.