We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
try-catch
Consider the following FunC contract:
#pragma version =0.4.4; #pragma allow-post-modification; #pragma compute-asm-ltr; _ %testTryCatch() method_id(130441) { try { throw(1042); } catch (_, $e) { return $e; } } () recv_internal(int msg_value, cell in_msg_cell, slice in_msg) impure { throw(130); }
Compilation succeeds.
I get the following compilation error:
test.fc:11:1: error: previous function return type int cannot be unified with implicit end-of-block return type (): cannot unify type () with int } ^
$ ./func-mac-arm64 test.fc
I'm using this version of FunC: https://github.com/ton-blockchain/ton/releases/download/v2024.06/func-mac-arm64
If I add an unreachable return statement, compilation succeeds:
return
#pragma version =0.4.4; #pragma allow-post-modification; #pragma compute-asm-ltr; _ %testTryCatch() method_id(130441) { try { throw(1042); } catch (_, $e) { return $e; } return 239; ;; <-- added unreachable code } () recv_internal(int msg_value, cell in_msg_cell, slice in_msg) impure { throw(130); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Consider the following FunC contract:
Compilation succeeds.
I get the following compilation error:
I'm using this version of FunC: https://github.com/ton-blockchain/ton/releases/download/v2024.06/func-mac-arm64
If I add an unreachable
return
statement, compilation succeeds:The text was updated successfully, but these errors were encountered: