Skip to content
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

Variance information on private type abbreviations is not checked for module subtyping #5993

vicuna opened this issue Apr 19, 2013 · 1 comment


Copy link

@vicuna vicuna commented Apr 19, 2013

Original bug ID: 5993
Reporter: @garrigue
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2015-12-11T18:18:39Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.01.0+dev
Fixed in version: 4.00.2+dev
Category: typing

Bug description

The following code is accepted by the compiler:

module M : sig type -'a t = private int end = struct type +'a t = private int end

The type system is still sound, since the variance must respect the manifest type,
and the problem is mitigated by the fact the parameter cannot become bivariant,
but when used with objects or polymorphic variants as index, this may still break
the intended semantics for phantom types.

Copy link

@vicuna vicuna commented Apr 20, 2013

Comment author: @garrigue

Fixed in trunk and 4.00, revisions 13580 and 13581.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants