mlton icon indicating copy to clipboard operation
mlton copied to clipboard

Strange SplitTypes coercion

Open hummy123 opened this issue 2 months ago • 1 comments

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.

hummy123 avatar May 05 '24 23:05 hummy123