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

funny error message -- fixed #3356

Closed
vicuna opened this issue May 18, 2002 · 1 comment
Closed

funny error message -- fixed #3356

vicuna opened this issue May 18, 2002 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented May 18, 2002

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

Bug description

Yesterday I reported a funny message when testing the inclusion of
module types. Maybe the reason for the wrong error message is the following:
Look at a part of the call-graph for Includemod.signature

    signature
        |
signature_components
        |
  modtype_infos
        |
check_modtype_equiv

This could be wrong because check_modtype_equiv is testing for
equivalence (that is inclusion in both direction) and not for
inclusion in only one direction. The attached patch should fix
this. I hope this is helpful.

pfitzen

--- ocaml-3.04-work/typing/includemod.ml Sat May 18 01:21:20 2002
+++ ocaml-3.04/typing/includemod.ml Thu Dec 28 14:07:27 2000
@@ -273,18 +273,19 @@
(Tmodtype_abstract, Tmodtype_abstract) -> ()
| (Tmodtype_manifest mty1, Tmodtype_abstract) -> ()
| (Tmodtype_manifest mty1, Tmodtype_manifest mty2) ->

  •    check_modtype env mty1 mty2
    
  •    check_modtype_equiv env mty1 mty2
    
    | (Tmodtype_abstract, Tmodtype_manifest mty2) ->
  •    check_modtype env (Tmty_ident(Pident id)) mty2
    
  •    check_modtype_equiv env (Tmty_ident(Pident id)) mty2
    
    with Error reasons ->
    raise(Error(Modtype_infos(id, info1, info2) :: reasons))

-and check_modtype env mty1 mty2 =
+and check_modtype_equiv env mty1 mty2 =
match

  • modtypes env Subst.identity mty1 mty2
  • (modtypes env Subst.identity mty1 mty2,
  • modtypes env Subst.identity mty2 mty1)
    
    with
  • Tcoerce_none -> ()
  • | _ -> raise(Error [Modtype_permutation])
  • (Tcoerce_none, Tcoerce_none) -> ()
  • | (_, _) -> raise(Error [Modtype_permutation])

(* Simplified inclusion check between module types *)



@vicuna
Copy link
Author

vicuna commented Jun 18, 2002

Comment author: administrator

see #3355. Proposed fix is incorrect.

@vicuna vicuna closed this as completed Jun 18, 2002
@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