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: 3705 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
(* Hi, The following code prints the following, then dies
class ['a] redButton = object (self : 'a redButtonTy)
^^^^^^^^^^^^^^^^^^^^^^^
This pattern cannot match self: it only matches values of type Fatal error:
exception Stack_overflow
*)
class virtual ['a] widget = object
method virtual raw : 'a
end
class type ['a] button = object
constraint 'a = [> ]
method press : unit
method raw : 'a
end
class ['a] button = object (self)
inherit ['a] widget
method raw = `Button (self :> 'foo button)
method press = prerr_endline "pressed"
end
class type ['a] redButtonIntf =
object
constraint 'a = [> `RedButton of 'a redButtonIntf ]
method light : unit
method press : unit
method raw : 'a
end
class ['a] redButton = object (self : 'a redButtonIntf)
inherit ['a] button
method raw = `RedButton self
method light = prerr_endline "button lit"
end
The text was updated successfully, but these errors were encountered:
Hi, The following code prints the following, then dies
class ['a] redButton = object (self : 'a redButtonTy)
^^^^^^^^^^^^^^^^^^^^^^^
This pattern cannot match self: it only matches values of type Fatal error:
exception Stack_overflow
Indeed, there was a stupid bug in the error reporting code specific to this
case.
Of course, this doesn't make your code less wrong :-)
Original bug ID: 3705
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Ethan Aubin
Version: 3.08.3
OS: linux
Submission from: c-24-60-21-144.hsd1.ma.comcast.net (24.60.21.144)
(* Hi, The following code prints the following, then dies
class ['a] redButton = object (self : 'a redButtonTy)
^^^^^^^^^^^^^^^^^^^^^^^
This pattern cannot match self: it only matches values of type Fatal error:
exception Stack_overflow
*)
class virtual ['a] widget = object
method virtual raw : 'a
end
class type ['a] button = object
constraint 'a = [> ]
method press : unit
method raw : 'a
end
class ['a] button = object (self)
inherit ['a] widget
method raw = `Button (self :> 'foo button)
method press = prerr_endline "pressed"
end
class type ['a] redButtonIntf =
object
constraint 'a = [> `RedButton of 'a redButtonIntf ]
method light : unit
method press : unit
method raw : 'a
end
class ['a] redButton = object (self : 'a redButtonIntf)
inherit ['a] button
method raw = `RedButton self
method light = prerr_endline "button lit"
end
The text was updated successfully, but these errors were encountered: