to be honest I don’t understand how the first example can even compile:
let doIt = () => {
// compiles
let (x, y) = Definition.getList()
let {a, b} = x
}
given it wouldn’t compile when not inside a function:
let (x, y) = Definition.getList()
let {a, b} = x
About why this happens, well ReScript type system follows Hindley-Milner type inference algorithm, I’m not sure what corner case leads to this phenomenon, but you’re more than welcome to fix it if you can!