The compiler panics with assert!(idx == 0) in hlir/ast.rs:825 when a macro with a declared tuple return type has a garbled body that produces a single value.
MRE:
module 0x42::M {
macro fun f($x: u64): (u64, u64) {
($, $x)
}
fun test() {
let (_a, _b) = f!(1);
}
}
Reproduce steps:
cd external-crates/move
cargo +nightly run --release -p move-compiler --bin move-check -- mre/mre_hlir_ast_825.move
Output:
thread 'main' panicked at crates/move-compiler/src/hlir/ast.rs:825:17:
assertion failed: idx == 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expected behavior: a diagnostic error about the malformed macro body or type mismatch.
Git commit: 1a27af4
Build: release
cargo 1.91.0-nightly (840b83a10 2025-07-30)
rustc 1.91.0-nightly (3672a55b7 2025-08-13)