Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005847OCamlOCaml typingpublic2012-12-05 14:252012-12-05 20:59
Reporterguesdon 
Assigned Tofrisch 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionsuspended 
PlatformOSOS Version
Product Version4.00.2+dev 
Target VersionFixed in Version 
Summary0005847: module T1 = T2 does not result in (module T1) = (module T2) as types
DescriptionThe following code:

module type T1 = sig end

let foo t =
  let module T = (val t : T1) in
  ()
;;

module type T2 = T1

let bar (t : (module T2)) = foo t;;

gives the following error message:

File "mtype.ml", line 11, characters 32-33:
Error: This expression has type (module T2)
       but an expression was expected of type (module T1)

I expected T2 to be equal to T1 but it doesn't seem to the case. Am I missing something ?
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0008569)
frisch (developer)
2012-12-05 16:39

The equality of packages types is based on the path equivalence of module types. In other words, we use nominal typing for first-class modules. This is the current expected behavior. Maybe it will be relaxed in the future, but there is no concrete plans to do so.
(0008572)
guesdon (manager)
2012-12-05 20:59

Ok. Sorry, I missed it in the doc (I see it now).

- Issue History
Date Modified Username Field Change
2012-12-05 14:25 guesdon New Issue
2012-12-05 15:04 gasche Summary module T1 = T2 does not result in T1 = T2 => module T1 = T2 does not result in (module T1) = (module T2) as types
2012-12-05 16:39 frisch Note Added: 0008569
2012-12-05 16:39 frisch Status new => resolved
2012-12-05 16:39 frisch Resolution open => suspended
2012-12-05 16:39 frisch Assigned To => frisch
2012-12-05 20:59 guesdon Note Added: 0008572


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker