Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 2592

Record in list decomposed in a single step needs type hint, is this a bug?

$
0
0

Amazing discoveries. And even this does not compile outside of the function. But it does inside:

// breaks
let {a, b} = Definition.getRecord()

let doIt = () => {
  // compiles
  let {a, b} = Definition.getRecord()
}

This feels even a bigger contradiction to me, and it only involves records, no lists.

That said, I encounter many cases where accessing a record field (or decomposition) fails to compile and needs a type hint. But the type should otherwise be known at that point. I intuitively feel that these should all compile. But I cannot wrap my head around it what exactly is happening here.

I’ll think about this further. Meanwhile, if anyone knows the reason… please do tell! :slight_smile:


Viewing all articles
Browse latest Browse all 2592

Trending Articles