Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Make tuple expression type errors more specific #5347
Original bug ID: 5347
Currently, the error message generated by OCaml in case of an ill-typed tuple expression is less specific than the error message generated in case of an analogous ill-typed variant expression. For example:
let x: int * int = 1, "Hello";;
type ('a, 'b) pair = Pair of 'a * 'b;;
type ('a, 'b) pair = Pair of 'a * 'b
let x: (int, int) pair = Pair (1, "Hello");;
Notice that the error message for the tuple does not indicate which element is ill-typed, whereas the error message for the variant does.
Since I use lots of long tuples in my code, it would be very useful if OCaml gave more specific error messages in case of ill-typed tuple expressions.