Closed
Description
In certain cases, when referencing a prop that does not exist, the loc information seems to get lost.
E.g. for
module A = {
@react.component
let make = () => React.null
}
@react.component
let make = () => <A someProp={<div />} />
the error message does not show in which line the error occurred:
This record expression is expected to have type A.props
The field someProp does not belong to type A.props
and the error is shown in VS Code like this:
Compare with this case which works fine:
module A = {
@react.component
let make = () => React.null
}
@react.component
let make = () => <A someProp="test" />
It gives
6 │ @react.component
7 │ let make = () => <A someProp="test" />
8 │
This record expression is expected to have type A.props
The field someProp does not belong to type A.props