Open
Description
Destructuring optional struct fields generates invalid FunC code, resulting in a compilation error:
Tact snippet triggering the issue:
struct Inner {
x: Int;
}
message Outer {
inner: Inner?;
}
contract Test {
receive(msg: Outer) {
let Outer { inner } = msg;
dump(inner!!.x);
}
}
Compiler error:
Function '$inner' does not exist in imported FunC sources
Cause:
The Tact compiler incorrectly generates FunC code when destructuring optional struct fields, causing references to non-existent accessor functions.
Expected:
The compiler should handle optional struct destructuring correctly and emit valid FunC code.
LLM Fuzzing discovery (see #3123)