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

nativeThrowWhen usage leads to a FunC compilation error #449

Closed
anton-trunov opened this issue Jun 21, 2024 · 3 comments · Fixed by #451
Closed

nativeThrowWhen usage leads to a FunC compilation error #449

anton-trunov opened this issue Jun 21, 2024 · 3 comments · Fixed by #451
Assignees
Labels
kind: bug Something isn't working or isn't right scope: stdlib The Tact standard library (src/stdlib)
Milestone

Comments

@anton-trunov
Copy link
Member

anton-trunov commented Jun 21, 2024

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);
^

@anton-trunov anton-trunov added kind: bug Something isn't working or isn't right scope: codegen Code generation, a.k.a. compiler backend (src/generator) labels Jun 21, 2024
@Gusarich
Copy link
Member

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

@anton-trunov
Copy link
Member Author

anton-trunov commented Jun 21, 2024

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

@anton-trunov anton-trunov added scope: stdlib The Tact standard library (src/stdlib) and removed scope: codegen Code generation, a.k.a. compiler backend (src/generator) labels Jun 21, 2024
@novusnota
Copy link
Member

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working or isn't right scope: stdlib The Tact standard library (src/stdlib)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants