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: 3506 Reporter: administrator Status: closed Resolution: not a bug Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Benjamin Monate
Version: 3.08.2
OS: Linux
Submission from: is002447.saclay.cea.fr (132.166.134.145)
Bonjour,
Le programme suivant est refusé par le typage :
===pb.mli====
type t
val f : (t -> unit) ref
===pb.ml=====
let f = ref (fun _ -> raise Not_found)
type t = TOP
ocamlc -c pb.mli
ocamlc -c pb.ml
The implementation pb.ml does not match the interface pb.cmi:
Values do not match:
val f : ('_a -> '_b) ref
is not included in
val f : (t -> unit) ref
Si on inverse la déclaration de f et de t dans pb.ml, le typage réussit.
Est-ce bien un bug ?
Cordialement
The text was updated successfully, but these errors were encountered:
Full_Name: Benjamin Monate
Le programme suivant est refusé par le typage :
===pb.mli====
type t
val f : (t -> unit) ref
===pb.ml=====
let f = ref (fun _ -> raise Not_found)
type t = TOP
Ce n'est pas un bug. La reference f etant typee de facon monomorphe, elle est
sensee avoir un type defini au moment de sa definition, ce qui n'est pas le cas
ici.
On a le meme comportement au toplevel:
!f TOP;;
This expression has type t but is here used with type 'a
The type constructor t would escape its scope
Original bug ID: 3506
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Benjamin Monate
Version: 3.08.2
OS: Linux
Submission from: is002447.saclay.cea.fr (132.166.134.145)
Bonjour,
Le programme suivant est refusé par le typage :
===pb.mli====
type t
val f : (t -> unit) ref
===pb.ml=====
let f = ref (fun _ -> raise Not_found)
type t = TOP
ocamlc -c pb.mli
ocamlc -c pb.ml
The implementation pb.ml does not match the interface pb.cmi:
Values do not match:
val f : ('_a -> '_b) ref
is not included in
val f : (t -> unit) ref
Si on inverse la déclaration de f et de t dans pb.ml, le typage réussit.
Est-ce bien un bug ?
Cordialement
The text was updated successfully, but these errors were encountered: