Hi tsnobip, thanks for your reply!
I did a minimal version to demonstrate the issue:
module Definition = {
type t = {
a: string,
b: string,
}
let getRecord = () => {a: "", b: ""}
let getList = () => (getRecord(), 42)
}
let doIt = () => {
// compiles
let (x, y) = Definition.getList()
let {a, b} = x
// compiles
let {a, b} = Definition.getRecord()
// breaks
let ({a, b}, y) = Definition.getList()
/*
The record field a can't be found.
If it's defined in another module or file, bring it into scope by:
- Prefixing it with said module name: TheModule.a
- Or specifying its type: let theValue: TheModule.theType = {a: VALUE}
*/
}