-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Identify mismatched class type parameters and class parameters by ordinal in error messages. #12671
Conversation
For context: classes can have type parameters and also term/function parameters: (* definition: *)
class ['a, 'b] ty = fun p n -> object
method foo : ('a * 'b) * int = (p, n)
end;;
(* inferred signature: *)
class ['a, 'b] ty : 'a * 'b -> int -> object
method foo : ('a * 'b) * int
end Here Questions for @smuenzel:
|
dcc4e7c
to
a2a3fe8
Compare
Both questions have the same answer:
Here, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved, but see small questions about the implementation in inline comments, to clarify before merging.
a2a3fe8
to
3c4f2a6
Compare
Thanks for the review! I wonder if allowing class arrow type declarations in addition to the current class body type declarations would be a good thing. It's certainly confusing that |
Merged, thanks! I was also surprised that |
The current error message for class type parameter mismatches looks like this:
This patch identifies the type parameter: