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

typing error : The implementation does not match the interface #5622

Closed
vicuna opened this issue May 24, 2012 · 3 comments
Closed

typing error : The implementation does not match the interface #5622

vicuna opened this issue May 24, 2012 · 3 comments

Comments

@vicuna
Copy link

vicuna commented May 24, 2012

Original bug ID: 5622
Reporter: @bobzhang
Assigned to: @protz
Status: closed (set by @xavierleroy on 2015-12-11T18:04:42Z)
Resolution: not a bug
Priority: high
Severity: crash
Category: typing

Bug description

I attached the file(ocaml 3.12.1)
I have a deadline next week, I would appreicate
if anyone could give me some hints. (maybe I am wrong, the type system
of Object layer is nontrivial to me)

Steps to reproduce

ocamlc -c type_error_ppo.ml

File attachments

@vicuna
Copy link
Author

vicuna commented May 24, 2012

Comment author: @protz

I'm not getting any type error running this on a recent trunk build. Maybe you could copy/paste the error message?

@vicuna
Copy link
Author

vicuna commented May 24, 2012

Comment author: @protz

Also, the bug tracker is for problems with ocaml itself. If you need help, I suggest posting a question on Stack Overflow which has an excellent OCaml community, or to the caml-list as a last resort.

Thanks,

jonathan

@vicuna
Copy link
Author

vicuna commented May 24, 2012

Comment author: @bobzhang

The error message is attached

File "type_error_ppo.ml", line 1, characters 0-1:
Error: The implementation type_error_ppo.ml
       does not match the interface (inferred signature):
       Modules do not match:
         sig
           class map :
             object ('a)
               method float : float -> float
               method int : int -> int
               method m_list : ('a -> 'b -> 'c) -> 'b m_list -> 'c m_list
               method string : string -> string
               method tree : ('a -> 'd -> 'e) -> 'd tree -> 'e tree
               method twice : ('a -> 'f -> 'g) -> 'f twice -> 'g twice
               method unknown : 'h -> 'h
             end
         end
       is not included in
         sig
           class map :
             object ('a)
               method float : float -> float
               method int : int -> int
               method m_list : ('a -> 'b -> 'c) -> 'b m_list -> 'c m_list
               method string : string -> string
               method tree : ('a -> 'd -> 'e) -> 'd tree -> 'e tree
               method twice : ('a -> 'f -> 'g) -> 'f twice -> 'g twice
               method unknown : 'h -> 'h
             end
         end
       Class declarations do not match:
         class map :
           object ('a)
             method float : float -> float
             method int : int -> int
             method m_list : ('a -> 'b -> 'c) -> 'b m_list -> 'c m_list
             method string : string -> string
             method tree : ('a -> 'd -> 'e) -> 'd tree -> 'e tree
             method twice : ('a -> 'f -> 'g) -> 'f twice -> 'g twice
             method unknown : 'h -> 'h
           end
       does not match
         class map :
           object ('a)
             method float : float -> float
             method int : int -> int
             method m_list : ('a -> 'b -> 'c) -> 'b m_list -> 'c m_list
             method string : string -> string
             method tree : ('a -> 'd -> 'e) -> 'd tree -> 'e tree
             method twice : ('a -> 'f -> 'g) -> 'f twice -> 'g twice
             method unknown : 'h -> 'h
           end
       The method twice has type
         'a 'b.
           ((< float : float -> float; int : int -> int;
               m_list : 'e 'f. ('d -> 'e -> 'f) -> 'e m_list -> 'f m_list;
               string : string -> string;
               tree : 'g 'h. ('d -> 'g -> 'h) -> 'g tree -> 'h tree;
               twice : 'a 'b. 'c; unknown : 'i. 'i -> 'i; .. >
             as 'd) ->
            'a -> 'b) ->
           'a twice -> 'b twice as 'c
       but is expected to have type
         'j 'k. ('d -> 'j -> 'k) -> 'j twice -> 'k twice
       Type 'a twice = 'a is not compatible with type 'j twice = 'j

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant