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

module type of struct include Bar end exposes %s#row when Bar contains private row types #6985

vicuna opened this issue Sep 9, 2015 · 1 comment


Copy link

@vicuna vicuna commented Sep 9, 2015

Original bug ID: 6985
Reporter: labichn
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2017-02-16T14:14:55Z)
Resolution: fixed
Priority: low
Severity: minor
Platform: x86_64
OS: GNU/Linux
OS Version: 4.1.6-1
Version: 4.02.3
Fixed in version: 4.03.0+dev / +beta1
Category: ~DO NOT USE (was: OCaml general)
Related to: #7438
Monitored by: @gasche @yallop @hcarty

Bug description

See steps to reproduce for a minimal example.

The module type of struct include Bar end idiom to get a strengthened version of the Bar module's signature does not act as expected when Bar contains private row variables (both PV and open obj). The module type contains an additional type, named rtype#row (where rtype is the type with the private row variable).

The obvious workaround is to avoid the module type of sugar.

This misbehavior is consistent from 3.12.1 up.

Steps to reproduce

module Foo
(Bar : sig type a = private [> A ] end) (Baz : module type of struct include Bar end) = struct end module Bazoinks = struct type a = [ A ] end
module Bug = Foo(Bazoinks)(Bazoinks)
File "", line 7, characters 27-35:
Error: Signature mismatch:
Modules do not match:
sig type a = [ A ] end is not included in sig type a = Bazoinks.a end The type a#row' is required but not provided
File "", line 2, characters 13-37: Expected declaration

Copy link

@vicuna vicuna commented Sep 10, 2015

Comment author: @garrigue

Fixed in trunk at revision 16413.

Mtype.strengthen_sig should remove #row components, as the corresponding private types are converted to aliases.

@vicuna vicuna closed this as completed Feb 16, 2017
@vicuna vicuna added the bug label Mar 20, 2019
Octachron added a commit that referenced this issue May 3, 2021
#6985 extended: ghost row types should stay hidden
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants