You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
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
The text was updated successfully, but these errors were encountered: