- Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Description
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.fcI'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:
#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); } Gusarich
Metadata
Metadata
Assignees
Labels
No labels