You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5847 Reporter:@zoggy Assigned to:@alainfrisch Status: resolved (set by @alainfrisch on 2012-12-05T15:39:30Z) Resolution: suspended Priority: normal Severity: minor Version: 4.00.2+dev Category: typing
Bug description
The 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 ?
The text was updated successfully, but these errors were encountered:
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.
Original bug ID: 5847
Reporter: @zoggy
Assigned to: @alainfrisch
Status: resolved (set by @alainfrisch on 2012-12-05T15:39:30Z)
Resolution: suspended
Priority: normal
Severity: minor
Version: 4.00.2+dev
Category: typing
Bug description
The 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 ?
The text was updated successfully, but these errors were encountered: