I think the one pain area I come across frequently is with
Belt.Option.getExn
My main quip is that it is impossible to tell where the exn is thrown. There is no line number, or code reference provided. If I could pass a custom exception, like getExn(#CUSTOM_ERROR_MESSAGE)
In my team I have noticed that the code example coming first often buries the text description of the error. I wonder if having the summary first would help new rescripters
I’ve just spent 15 minutes to realize what’s wrong, and it’s a component with 2 arguments. But I remember I’ve spent around an hour for a component with 15 arguments, had to delete it and start writing from scratch.
I think the one error that I face very often during refactoring is the “something somewhere” error, and while I understand what causes it now, there’s been more than a couple times I’ve had to go through and add explicit types all over the place to track down why something somewhere thinks this should be something else
Don’t know if it’s possible, but if the error message can include a small snippet of where the assumption is being made it would really help understanding why that’s happening
“dead” is a specific programming term, used often in the phrase “dead code analysis”, so I think it was probably used here in that context. Precision of language is quite important here because the compiler can’t know your future plans for a given piece of code.
I was looking for this feedback. I’m having a hardtime with this, so many times. This is not helping in my use case, I see “signature mismatch” and I end up comparing myself directly in the codebase.
Could color highlighting be a thing for specific parts of the signature mismatches?
I believe the error message itself is explicit enough (and with the whole signatures printed), it’s just painful to deal with.
This functor has type
(
T: {
module Query: {
module Raw: {
type t
}
type t
type t_variables
let query: string
let unsafe_fromJson: Js.Json.t => Raw.t
}
},
) => {
let call: (~variables: T.Query.t_variables) => Promise.t<
result<T.Query.Raw.t, string>,
>
}
The parameter cannot be eliminated in the result type.
Please bind the argument to a module identifier. ReScript
I’ve came across another confusing error message. I think adding quotes for the field name will make the error message readable, but maybe we can make something more.
Here’s one that just caught me off guard for like half an hour. I have a manually curried function and couldn’t understand why my pipe wasn’t working
let decode = decoder => data =>
decoder(data)->Result.map(x => "foo" ++ x)
let result = json->decode(decoder)
This uncurried function has type
(
'o => RescriptCore.Result.t<string, 'p>,
) => 'o => RescriptCore.Result.t<string, 'p>
It is applied with 2 arguments but it requires 1.