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: 6256 Reporter: sebmondet Assigned to:@garrigue Status: closed (set by @xavierleroy on 2015-12-11T18:25:23Z) Resolution: not a bug Priority: normal Severity: major Version: 4.01.0 Category: typing
Bug description
This code used to compile fine with 4.00.1:
module type T = sig
type t
val f : t -> ([> A | B ] -> t) -> t
end
module Tt : T = struct
type t = [ A | B ]
let f t g = g (t :> [> A | B])
end
but with 4.01.0, I get:
Error: Signature mismatch:
Modules do not match:
sig
type t = [ A | B ]
val f : ([> A | B ] as 'a) -> ('a -> 'b) -> 'b
end
is not included in
T
Values do not match:
val f : ([> A | B ] as 'a) -> ('a -> 'b) -> 'b
is not included in
val f : t -> ([> A | B ] -> t) -> t
PS: Is there a more future proof work-around that does not imply expanding a match-with? like this:
module Tt : T = struct
type t = [ A | B ]
let f t g =
match t with
| A -> g A
| B -> g B
end
The text was updated successfully, but these errors were encountered:
Original bug ID: 6256
Reporter: sebmondet
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2015-12-11T18:25:23Z)
Resolution: not a bug
Priority: normal
Severity: major
Version: 4.01.0
Category: typing
Bug description
This code used to compile fine with 4.00.1:
module type T = sig
type t
val f : t -> ([>
A |
B ] -> t) -> tend
module Tt : T = struct
type t = [
A |
B ]let f t g = g (t :> [>
A |
B])end
but with 4.01.0, I get:
Error: Signature mismatch:
Modules do not match:
sig
type t = [
A |
B ]val f : ([>
A |
B ] as 'a) -> ('a -> 'b) -> 'bend
is not included in
T
Values do not match:
val f : ([>
A |
B ] as 'a) -> ('a -> 'b) -> 'bis not included in
val f : t -> ([>
A |
B ] -> t) -> tPS: Is there a more future proof work-around that does not imply expanding a match-with? like this:
module Tt : T = struct
type t = [
A |
B ]let f t g =
match t with
|
A -> g
A|
B -> g
Bend
The text was updated successfully, but these errors were encountered: