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

interaction classes / foncteurs #2531

Closed
vicuna opened this issue Jul 21, 2000 · 1 comment
Closed

interaction classes / foncteurs #2531

vicuna opened this issue Jul 21, 2000 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Jul 21, 2000

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

Bug description

Je suis tombé sur un comportement bizarre du typeur d'OCaml 3.00+7
lorsqu'on mélange classes et foncteurs:

module A = struct class c = object method m = 1 end end;;

module A : sig class c : object method m : int end end

(new A.c)#m;;

  • : int = 1

    (* Jusqu'ici, tout va bien. Maintenant, ajoutons un foncteur. *)

module F(X: sig class c : object method m : int end end) =

struct
  class d = object (self) inherit X.c  method n = 1 + self#m end
end;;

module F :
functor (X : sig class c : object method m : int end end) ->
sig class d : object method m : int method n : int end end

module B = F(A);;

module B : sig class d : object method m : int method n : int end end

(* Ça va bien aussi.  Mais: *)

(new B.d)#n;;

This expression has type d
It has no method n

(* Allo?  Mais quel est le type de (new B.d) ? *)

new B.d;;

  • : d =

    (* Ce "d" me semble fortement libre! *)

Ce que je ne comprends pas, c'est pourquoi le "recalage" de c en A.c
marche pour A, alors que d n'est pas "recalé" en B.d.

  • Xavier
@vicuna
Copy link
Author

vicuna commented Jul 27, 2000

Comment author: administrator

Bug introduced 2000-05-16, fixed 2000-07-27 by Xavier (problem in
typing/subst.ml)

@vicuna vicuna closed this as completed Jul 27, 2000
@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