tact-lang / tact

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

Make sure SendParameters's mode value makes sense #180

Open anton-trunov opened 4 months ago

anton-trunov commented 4 months ago

For instance,

SendParameters{
    ...
    mode: SendRemainingValue + SendRemainingValue, 
    ...
}

should result in a compilation error.

Ideally, arithmetics should be excluded here at all and the mode field should have its own unique type. But it looks like an idea for Tact 2.0, because we break backwards compatibility in this case.

Gusarich commented 4 months ago

Actually it would make sense to move from + to | operation for applying flags because it literally sets specific bit to 1, and in that case applying the same flag multiple times won't change anything

anton-trunov commented 4 months ago

This is indeed a nice suggestion for the current implementation!