tact-lang / tact

Tact compiler main repository
https://tact-lang.org
MIT License
267 stars 53 forks source link

Implement `fromCell` and `fromSlice` methods for structs #418

Open Gusarich opened 4 days ago

Gusarich commented 4 days ago

Closes #344

Gusarich commented 4 days ago

Just realised that I didn't add any negative tests for struct parsing

Gusarich commented 2 days ago

@anton-trunov do you mean a user-defined function with the same name - fromCell or fromSlice?

I think it should work the same way as it works for all other built-ins such as toCell for structs, and set, get and del for maps.

anton-trunov commented 2 days ago

@Gusarich Yep. Because right now this shadowing is allowed and it overrides the generated code.

Gusarich commented 2 days ago

@Gusarich Yep. Because right now this shadowing is allowed and it overrides the generated code.

Should we forbid such shadowing for all built-in functions?

UPD: oh, we actually wanted to do this already, but only implemented throwing errors for global.ts: #351

anton-trunov commented 2 days ago

Yeah, we do not allow any form of shadowing in Tact. And if we do, it's a bug

anton-trunov commented 2 days ago

btw, there is some merge conflicts

Gusarich commented 1 day ago

Yeah, we do not allow any form of shadowing in Tact. And if we do, it's a bug

In this case maybe we should create a separate issue about that and resolve that in another PR?

anton-trunov commented 1 day ago

In this case maybe we should create a separate issue about that and resolve that in another PR?

Yeah, there are issues like that, for instance #307. There is a special tag for those https://github.com/tact-lang/tact/labels/scope%3A%20var-scope