The compiler panics with internal error: entered unreachable code in src/codegen/expression.rs:3813 (emit_function_call's catch-all arm) when an empty tuple destructure () = builtin(...) is lowered with a void-returning builtin (e.g. print) on the RHS.
MRE:
contract C {
function f() public {
() = print("x");
}
}
Reproduce: save as mre.sol, run solang compile --target polkadot mre.sol.
Output:
thread 'main' panicked at src/codegen/expression.rs:3813:14:
internal error: entered unreachable code
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expected behavior: sema rejects the empty-tuple destructure (no values to assign) with a proper diagnostic, instead of letting the malformed assignment reach codegen.
Reproduces on solana, polkadot, evm. The same panic does NOT trigger when the RHS is a user-defined void function (() = g() is rejected cleanly), only when the RHS is a void builtin like print.
Git commit: 901bfb9
Build: release
rustc 1.96.0-nightly (562dee482 2026-03-21)
The compiler panics with
internal error: entered unreachable codeinsrc/codegen/expression.rs:3813(emit_function_call's catch-all arm) when an empty tuple destructure() = builtin(...)is lowered with a void-returning builtin (e.g.print) on the RHS.MRE:
Reproduce: save as
mre.sol, runsolang compile --target polkadot mre.sol.Output:
Expected behavior: sema rejects the empty-tuple destructure (no values to assign) with a proper diagnostic, instead of letting the malformed assignment reach codegen.
Reproduces on
solana,polkadot,evm. The same panic does NOT trigger when the RHS is a user-defined void function (() = g()is rejected cleanly), only when the RHS is a void builtin likeprint.Git commit: 901bfb9
Build: release
rustc 1.96.0-nightly (562dee482 2026-03-21)