moonc crashes when using |> to inserts the first argument of the tuple struct constructor (at least 2 arguments).
cmd
moonc compile example.mbt -w -unused_constructor
Code
// example.mbt
priv struct Tuple2(Int, Int,)
// Int can be replaced by any type
fn main {
// error!
let _ = 1 |> Tuple2(1)
// no error.
// let _ = Tuple2(1) <| 1
// let _ = Tuple2(1, 1)
}
Environment
- OS: Windows
- OS distribution and/or version: 11
- CPU Architecture: x86_64
<versions>
moon 0.1.20260608 (60bc8c3 2026-06-08) ~\.moon\bin\moon.exe
moonc v0.10.0+e66899a54 (2026-06-09) ~\.moon\bin\moonc.exe
moonrun 0.1.20260608 (60bc8c3 2026-06-08) ~\.moon\bin\moonrun.exe
Feature flags enabled: rr_moon_mod,rr_moon_pkg
Error output
-- --
/ // / __--------_
/ // /_/ \
--- - \ __
/ X / ____ / )
*_________/__/_____/______/ `--
Oops, the compiler has encountered an unexpected situation.
This is a bug in the compiler.
A bug report containing the error description and relevant code would be
greatly appreciated. You can submit the bug report here:
https://github.com/moonbitlang/moonbit-docs/issues/new?template=ice.md
Error: File "moonc.ml", line 282495, characters 24-30: Assertion failed
Compiler args: moonc compile example.mbt -w -unused_constructor
moonc version: v0.10.0+e66899a54
moonccrashes when using|>to inserts the first argument of the tuple struct constructor (at least 2 arguments).cmd
Code
Environment
Error output