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

with type t = 'a constraint 'a = ... #3388

Closed
vicuna opened this issue Jun 11, 2002 · 2 comments
Closed

with type t = 'a constraint 'a = ... #3388

vicuna opened this issue Jun 11, 2002 · 2 comments
Assignees
Labels
Milestone

Comments

@vicuna
Copy link

vicuna commented Jun 11, 2002

Original bug ID: 1196
Reporter: administrator
Assigned to: @garrigue
Status: closed (set by @garrigue on 2012-07-12T00:08:17Z)
Resolution: fixed
Priority: normal
Severity: minor
Target version: 4.01.0+dev
Fixed in version: 3.09.0
Category: ~DO NOT USE (was: OCaml general)

Bug description

Bonjour,

ceci avait été abordé il y a quelques temps dans la mailing liste;
même si ce genre de foncteur ne peux pas être appliqué (aucun
module ne correspond à l'interface), il semblerait plus normale de
le refuser.

module Blop (M : sig type t end with type t='a constraint 'a = [> A]) : sig val y : [ A] end
= struct let x : M.t = C 1 let y = (x :> [ A]) end

@vicuna
Copy link
Author

vicuna commented Jun 12, 2002

Comment author: administrator

Cette signature me semble incorrecte.

module type S = sig type t end with type t='a constraint 'a = [> `A];;

module type S = sig type t = [> `A] end

Il me semble que le patch suivant dans Typedecl.transl_with_constraint
resoud le probleme.
Y avait-il une raison pour ne pas le faire jusqu'a` present?

Jacques

Index: typing/typedecl.ml

RCS file: /net/pauillac/caml/repository/csl/typing/typedecl.ml,v
retrieving revision 1.51
diff -c -r1.51 typedecl.ml
*** typedecl.ml 2002/04/18 07:27:46 1.51
--- typedecl.ml 2002/06/12 02:21:07


*** 587,592 ****
--- 587,594 ----
type_variance = [];
}
in

  • if Ctype.closed_type_decl decl <> None then
  • raise(Error(sdecl.ptype_loc, Unbound_type_var));
    
    let decl =
    {decl with type_variance =
    compute_variance_decl env decl (sdecl.ptype_variance, sdecl.ptype_loc)} in

@vicuna
Copy link
Author

vicuna commented Jul 12, 2012

Comment author: @garrigue

Actually it was already fixed in 3.05.

@vicuna vicuna closed this as completed Jul 12, 2012
@vicuna vicuna added this to the 4.01.0 milestone Mar 14, 2019
@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

2 participants