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

types private #8450

Closed
vicuna opened this issue Jan 20, 2004 · 1 comment
Closed

types private #8450

vicuna opened this issue Jan 20, 2004 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Jan 20, 2004

Original bug ID: 2048
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Bonjour,

Si on définit:
module type S = sig type t = private A | B end

Alors:
module A : S = struct type t = A | B type s = t end
marche bien

Mais:
module A : S = struct type s = A | B type t = s end;;
échoue avec:

Signature mismatch:
Modules do not match: sig type s = A | B and t = s end is not included in S
Type declarations do not match:
type t = s
is not included in
type t = private A | B

C'est un peu surprenant, ce sous-typage qui n'est pas invariant par
egalité, même si ça peut se comprendre. Est-ce un bug ?

Alain

@vicuna
Copy link
Author

vicuna commented Feb 14, 2004

Comment author: administrator

The error has nothing to do with "private". Given the type system for modules,
"type t = A | B" and "type t = s" are never subtype of one another, regardless
of how s is defined. This isn't likely to change. -XL, 2004-02-14

@vicuna vicuna closed this as completed Feb 14, 2004
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant