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: 4766 Reporter: pveber Status: closed (set by @garrigue on 2009-04-10T06:33:49Z) Resolution: fixed Priority: normal Severity: major Fixed in version: 3.11.1+dev Category: ~DO NOT USE (was: OCaml general)
Bug description
Consider the following session with ocaml 3.11 interpreter :
Objective Caml version 3.11.0
class virtual ['a] c =
object (s : 'a)
method virtual m : 'b
end
;;
class virtual ['a] c :
object ('a) constraint 'a = < m : 'b; .. > method virtual m : 'b end
let o =
object (s :'a)
inherit ['a] c
method m = 42
end;;
val o : 'a c as 'a = ...
o#m;;
: 'a =
It seems that the typing of instance o is incorrect, and should rather be something like 'a c as 'a constraint 'a = < m : int; .. >. I did not find any previous report of this problem. The behaviour is the same on ocaml 3.10.2.
BTW: thanks for your excellent work on ocaml, and all the very instructive messages sent by the caml dev team on caml-list.
The text was updated successfully, but these errors were encountered:
The real problem was in the way abbreviations were simplified in
Ctype.normalize_type.
Concretely, ('a c as 'a) does not accurately define a type, since it can describe any instance of itself too...
Original bug ID: 4766
Reporter: pveber
Status: closed (set by @garrigue on 2009-04-10T06:33:49Z)
Resolution: fixed
Priority: normal
Severity: major
Fixed in version: 3.11.1+dev
Category: ~DO NOT USE (was: OCaml general)
Bug description
Consider the following session with ocaml 3.11 interpreter :
class virtual ['a] c =
object (s : 'a)
method virtual m : 'b
end
;;
class virtual ['a] c :
object ('a) constraint 'a = < m : 'b; .. > method virtual m : 'b end
let o =
val o : 'a c as 'a = ...
o#m;;
It seems that the typing of instance o is incorrect, and should rather be something like 'a c as 'a constraint 'a = < m : int; .. >. I did not find any previous report of this problem. The behaviour is the same on ocaml 3.10.2.
BTW: thanks for your excellent work on ocaml, and all the very instructive messages sent by the caml dev team on caml-list.
The text was updated successfully, but these errors were encountered: