rescript-compiler
rescript-compiler copied to clipboard
[bug] error reporting for res/resi/ conflict is hard to parse?
i guess this is pretty opinionated of me but to me, it's hard to read:
The implementation <project path>/src/utils.res
does not match the interface ../ocaml/utils.cmi:
Values do not match:
let anyToJson: (
'a,
~breakCycle: ('a, array<string>) => JSON.t=?,
~encodeBigInt: BigInt.t => JSON.t=?,
~encodeSymbol: Symbol.t => JSON.t=?,
~encodeFunction: {..} => JSON.t=?,
) => JSON.t
is not included in
let anyToJson: (
'a,
~breakCycle: ('a, array<string>) => JSON.t=?,
~encodeBigInt: BigInt.t => JSON.t=?,
~encodeSymbol: Symbol.t => JSON.t=?,
~encodeFunction: 'a => JSON.t=?,
) => JSON.t
<project path>/src/utils.resi:1:1-7:11:
Expected declaration
<project path>/src/utils.res:69:5-13:
Actual declaration
- the formatting and indentation is all weird
- it doesn't immediately tell me what the problem is
- it says something about Expected declaration which makes it even more confusin
The implementation <project path>/src/utils.res
does not match its expected interface:
Implementation:
let anyToJson: (
'a,
~breakCycle: ('a, array<string>) => JSON.t=?,
~encodeBigInt: BigInt.t => JSON.t=?,
~encodeSymbol: Symbol.t => JSON.t=?,
~encodeFunction: {..} => JSON.t=?,
) => JSON.t
Declaration:
let anyToJson: (
'a,
~breakCycle: ('a, array<string>) => JSON.t=?,
~encodeBigInt: BigInt.t => JSON.t=?,
~encodeSymbol: Symbol.t => JSON.t=?,
~encodeFunction: 'a => JSON.t=?,
) => JSON.t
~encodeFunction has the following type in implementation: {..} => JSON.t=?,
but should have this type according to interface: 'a => JSON.t=?
i don't need to see something about a .cmi file, and it's always easy enough to grep that i don't need to see line and column numbers for both implementation and declaration anyway. it's probably more common that a file is so small that reading the convoluted message costs me more time than the off-chance that the module is an absolute huge monolith to the point it'd save me time, so all in all, better to remove it.
Yeah these errors are terrible, and we will eventually get around to making them much much better and clearer. Not there yet though, but slowly inching closer!