Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support constants initialization dependency #229

Closed
byakuren-hijiri opened this issue Apr 3, 2024 · 1 comment
Closed

Support constants initialization dependency #229

byakuren-hijiri opened this issue Apr 3, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request found-by-tact-fuzzer Bugs or issues found by the WIP Tact compiler fuzzer has dependency Some other issues need to be resolved first scope: const-eval The constant and partial evaluation optimization mechanisms
Milestone

Comments

@byakuren-hijiri
Copy link
Contributor

byakuren-hijiri commented Apr 3, 2024

Consider the following example:

const _0: Int = 1;
const _1: Int = _0 + 1;

Compilation output:

Tact compilation failed
Error: contract.tact:4:16: Cannot reduce expression to a constant integer
Line 4, col 16:
  3 | const _0: Int = 1;
> 4 | const _1: Int = _0 + 1;

Expected: successful compilation as the value of _0 is known in compile time.

Related to #195.

The fix should support the following case:

const x: Int? = 42;
const f: Bool = x == null; // evaluates to false
@byakuren-hijiri byakuren-hijiri added the enhancement New feature or request label Apr 3, 2024
@anton-trunov anton-trunov added the scope: const-eval The constant and partial evaluation optimization mechanisms label Apr 4, 2024
@byakuren-hijiri byakuren-hijiri added the found-by-tact-fuzzer Bugs or issues found by the WIP Tact compiler fuzzer label Apr 4, 2024
@anton-trunov anton-trunov self-assigned this Jun 21, 2024
@anton-trunov anton-trunov added this to the v1.5.0 milestone Jun 21, 2024
@anton-trunov anton-trunov added the has dependency Some other issues need to be resolved first label Jun 21, 2024
@anton-trunov
Copy link
Member

Resolved in #664

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request found-by-tact-fuzzer Bugs or issues found by the WIP Tact compiler fuzzer has dependency Some other issues need to be resolved first scope: const-eval The constant and partial evaluation optimization mechanisms
Projects
None yet
Development

No branches or pull requests

3 participants