Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
module T1 = T2 does not result in (module T1) = (module T2) as types #5847
Original bug ID: 5847
The following code:
module type T1 = sig end
let foo t =
module type T2 = T1
let bar (t : (module T2)) = foo t;;
gives the following error message:
File "mtype.ml", line 11, characters 32-33:
I expected T2 to be equal to T1 but it doesn't seem to the case. Am I missing something ?
Comment author: @alainfrisch
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.