-
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
[4.14] Type [> Cycle ] is not compatible with type [> Cycle ] #10773
Comments
Cycle ] is not compatible with type [>
Cycle ]
This is a change of behavior introduced by 6e5b863 in #8516. The capnp-rpc code can be reduced to: class type ct = object
method m : [> `A]
end
class virtual c = object (self: 'self)
method m = `A
method fix = (self :> ct)
end The unbound type variable in the definition of the method |
Having another looks, a similar example is rejected in previous version of OCaml class always_rejected = object (self)
method x = None
method me = (self :> < x: 'a. 'a option ; .. > )
end so the pre-4.14 behavior for polymorphic variants is really brittle. |
After talking with @Octachron who seems to think this change of behaviour is expected. I’ve sent a fix to the package affected by this change (mirage/capnp-rpc#244) However we agreed that the error message should at least be improved a little from:
to something like:
or similar, to help users encountering this issue enderstanding that the issue is not in the type-checker but a the type-system limitation. |
I still plan to address this issue at some point. However, printing the |
I got this error when compiling capnp-rpc.1.2.1 with the 4.14 branch (3f170f3)
The text was updated successfully, but these errors were encountered: