mlton
mlton copied to clipboard
Strange SplitTypes coercion
Hi there. I was trying to implement a B-Tree at this repository but the insMany function in the .sml file caused a compilation error with MLton:
MLton 20210117 raised: Fail: SplitTypes.TypeInfo.coerce: Strange coercion: () coerced to word32 in val x_0: (word32) vector = prim Vector_vector[word32] (unit_0) in L_0 in insMany_0
This error occurred on two machines: a Raspberry Pi 5 and a Mac M2 (with the latest commit tested on the Raspberry Pi, and the 2021 version from the error message tested on the Mac).
I don't have an X86 machine with me to test if this is exclusively an error with MLton's ARM output unfortunately.
The error isn't raised when the insMany function is removed from the sole .sml file in the repository so I tried replacing it with a mutable while loop, but the while-loop version caused the error to be raised again.