tact-lang / tact

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

`nativeThrowWhen` usage leads to a FunC compilation error #449

Closed anton-trunov closed 1 week ago

anton-trunov commented 1 week ago

Compilation of the following contract

contract Foo {
    get fun foo(): Int {
        nativeThrowWhen(130, true);
        return 42;
    }
}

fails with

error: undefined function throw_when, defining a global function of unknown type throw_when(130, true); ^

Gusarich commented 1 week ago

It would also be great to rename it to nativeThrowIf but it would break backward compatibility

anton-trunov commented 1 week ago

It looks like nobody has used it before, so we can actually do it. And it would be more consistent with FunC

novusnota commented 1 week ago

It looks like nobody has used it before

It wasn't in the docs before and it has no usages on GitHub, so that checks out :)