Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Error message confusing for the beginner when a type escapes its scope. #6171
Original bug ID: 6171
I'd only had to deal with this error when using the module system until now -- I hadn't realised how easily it could be encountered with a single reference.
The first line of the message in particular is rather confusing:
let x = ref 
type t = A
let store () =
feast:~ john$ ocamlc mess.ml
Perhaps skip the first line of the error message since it's confusing and add a clarification -- something like "A type can only be used after it has been introduced."?
Comment author: @garrigue
Reporting of unification errors is fundamentally broken: it is hard to see where the error comes from, and specific cases are poorly handled.
Comment author: @lpw25
It wouldn't help much in this case, but could the error at least mention the type that it tried to unify t with, rather than t itself.
So, for example:
This information is often quite useful, and I don't think it would be hard to expose.