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
Module inclusion check and constraint in type declarations #7703
Comments
Comment author: @gasche I don't understand the type-checking of "constraints" very well. When are they applied? When experimenting with this question, in general it looks safe because the constraint is substituted for the type. For example, if you write module type Get = sig then the inferred signature is actually val get : [< `A of int ] t -> int (instead of a polymorphic ('a . 'a t -> int)) so there is no way to cause mischief by injecting a `B later. On the other hand, the following would be unsound and must be rejected: module Test : sig Checking the implementation of |
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc. |
Without any feedback, I propose we keep rejecting such forms and close this. |
Closing as suggested. |
Original bug ID: 7703
Reporter: igarnier
Assigned to: @garrigue
Status: feedback (set by @garrigue on 2018-01-05T05:07:34Z)
Resolution: open
Priority: low
Severity: feature
Platform: x86_64
OS: Linux
Version: 4.06.0
Category: typing
Monitored by: @Drup @gasche
Bug description
It seems that the subtyping relation induced by the following constraints is not taken into account in the module inclusion check process. The following example (courtesy of Gabriel Radanne) doesn't type check.
module M
: sig type +'a t = [<
A |
B ] as 'a end= struct type +'a t = [< `A ] as 'a end
The text was updated successfully, but these errors were encountered: