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: 4580 Reporter:@yallop Assigned to:@garrigue Status: closed (set by @garrigue on 2010-04-27T07:17:15Z) Resolution: fixed Priority: normal Severity: major Version: 3.10.2 Fixed in version: 3.11+dev Category: ~DO NOT USE (was: OCaml general) Related to:#4623
Bug description
The following code causes OCaml (e.g. ocamlc or ocamlopt) to fail with
Fatal error: exception Stack_overflow
type 'a s = 'a
module M : sig
type 'a t = private 'a s
constraint 'a = [< A] end = struct type 'a t = 'a s constraint 'a = [< A]
end
The text was updated successfully, but these errors were encountered:
With CVS trunk, this definition is accepted at toplevel, but causes the following problem if put in .ml without .mli and compiled with ocamlc:
File "foo.ml", line 1, characters 0-1:
Error: The implementation foo.ml
does not match the interface (inferred signature):
Modules do not match:
sig type 'a t = 'a M.t constraint 'a = [< A ] end is not included in sig type 'a t = private 'a s constraint 'a = [< A ] end
Type declarations do not match:
type 'a t = 'a M.t constraint 'a = [< A ] is not included in type 'a t = private 'a s constraint 'a = [< A ]
The second problem (reported by Xavier) is similar to PR4623, and was fixed for 3.11 in includecore.ml. (Looks like I missed the 1st report with my holidays..)
The first bug is specific to 3.10 (doesn't occur in 3.11).
With the CVS version it no longer causes a stack overflow... just a non-terminating computation. Should look into it.
Note that it is fundamentally different: it is a private row in 3.10, but a private abbreviation in 3.11. While the 3.11 semantics makes sense (use a private abbreviation to hide the representation of t), the 3.10 semantics does not make sense in this example: it should just be equivalent to writing "type 'a t = private [< `A]", which works ok. So this is really only about making the compiler terminate even on meaningless code.
Original bug ID: 4580
Reporter: @yallop
Assigned to: @garrigue
Status: closed (set by @garrigue on 2010-04-27T07:17:15Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 3.10.2
Fixed in version: 3.11+dev
Category: ~DO NOT USE (was: OCaml general)
Related to: #4623
Bug description
The following code causes OCaml (e.g. ocamlc or ocamlopt) to fail with
Fatal error: exception Stack_overflow
type 'a s = 'a
module M : sig
type 'a t = private 'a s
constraint 'a = [<
A] end = struct type 'a t = 'a s constraint 'a = [<
A]end
The text was updated successfully, but these errors were encountered: