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: 6174 Reporter: ckeller Assigned to:@garrigue Status: closed (set by @xavierleroy on 2015-12-11T18:24:17Z) Resolution: fixed Priority: normal Severity: major Version: 4.00.1 Fixed in version: 4.01.1+dev Category: ~DO NOT USE (was: OCaml general) Monitored by:@gasche
Bug description
The OCaml compiler seems to loop on the following program (which I also attached):
type _ t = C : ((('a -> 'o) -> 'o) -> ('b -> 'o) -> 'o) t
let f : type a o. ((a -> o) -> o) t -> (a -> o) -> o =
fun C k -> k (fun x -> x)
Additional information
It loops as well with the version 4.02.0dev+trunk installed with opam.
After some debugging, the loop appears in the 'lower_args' function while type-checking the application (in Typecore.type_expect_, case Pexp_apply).
There is the following equalities "o = ex#2 -> ex#1" where "ex#1 = ex#2 -> ex#1". Each expansion of ex#1 allocates an new 'type_expr', and the 'seen' list is infinitely growing.
Still, I do not understand why the following generalisation is accepted:
type _ t = C : ((('a -> 'o) -> 'o) -> ('b -> 'o) -> 'o) t
let f = fun C -> ()
let f1 : type a o. ((a -> o) -> o) t -> unit = f (* refused )
let f2 : type a o. ((a -> o) -> o) t -> unit = fun C -> () ( accepted *)
Fixed in 4.01 and trunk, revisions 14246-14248.
In 4.01 only the non-rectypes case is fixed (was due to a typo).
Trunk fully fixes the problem, by ensuring that the abbreviation cache is not cleared in the middle of a potentially recursive traversal (some other cases may still be there).
Original bug ID: 6174
Reporter: ckeller
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2015-12-11T18:24:17Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 4.00.1
Fixed in version: 4.01.1+dev
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @gasche
Bug description
The OCaml compiler seems to loop on the following program (which I also attached):
type _ t = C : ((('a -> 'o) -> 'o) -> ('b -> 'o) -> 'o) t
let f : type a o. ((a -> o) -> o) t -> (a -> o) -> o =
fun C k -> k (fun x -> x)
Additional information
It loops as well with the version 4.02.0dev+trunk installed with opam.
File attachments
The text was updated successfully, but these errors were encountered: