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

Storage vars cannot be initialized by struct instances #400

Closed
byakuren-hijiri opened this issue Jun 11, 2024 · 0 comments · Fixed by #432
Closed

Storage vars cannot be initialized by struct instances #400

byakuren-hijiri opened this issue Jun 11, 2024 · 0 comments · Fixed by #432
Assignees
Labels
bug Something isn't working or isn't right found-by-tact-fuzzer Bugs or issues found by the WIP Tact compiler fuzzer scope: const-eval The constant and partial evaluation optimization mechanisms typechecker
Milestone

Comments

@byakuren-hijiri
Copy link
Contributor

byakuren-hijiri commented Jun 11, 2024

The following snippet cannot be compiled:

struct A {
    a: Bool;
}
contract Test {
    s: A = A {a: false};
}
"<unknown>:13:14: Expected constant value, got A

Note that if all the above initializing expressions move to init() and use assignment, everything works.

Related: #284

@byakuren-hijiri byakuren-hijiri added enhancement New feature or request found-by-tact-fuzzer Bugs or issues found by the WIP Tact compiler fuzzer labels Jun 11, 2024
@anton-trunov anton-trunov added this to the v1.4.0 milestone Jun 12, 2024
@anton-trunov anton-trunov added bug Something isn't working or isn't right typechecker and removed enhancement New feature or request labels Jun 12, 2024
@anton-trunov anton-trunov changed the title Fields cannot be initialized by struct instances Storage vars cannot be initialized by struct instances Jun 16, 2024
@anton-trunov anton-trunov added the scope: const-eval The constant and partial evaluation optimization mechanisms label Jun 16, 2024
@anton-trunov anton-trunov changed the title Storage vars cannot be initialized by struct instances Storage vars cannot be initialized by struct instances and emptyMap Jun 16, 2024
@anton-trunov anton-trunov changed the title Storage vars cannot be initialized by struct instances and emptyMap Storage vars cannot be initialized by struct instances, emptyMap, and slices Jun 16, 2024
@Gusarich Gusarich self-assigned this Jun 17, 2024
@anton-trunov anton-trunov changed the title Storage vars cannot be initialized by struct instances, emptyMap, and slices Storage vars cannot be initialized by struct instances Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working or isn't right found-by-tact-fuzzer Bugs or issues found by the WIP Tact compiler fuzzer scope: const-eval The constant and partial evaluation optimization mechanisms typechecker
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants