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: 4765 Reporter: till Assigned to:@alainfrisch Status: closed (set by @xavierleroy on 2015-12-11T18:25:17Z) Resolution: fixed Priority: normal Severity: feature Version: 3.11.0 Target version: 4.02.0+dev Fixed in version: 4.02.0+dev Category: ~DO NOT USE (was: OCaml general) Monitored by:@bobzhang abdallah mehdi @glondu@yakobowski
Bug description
let e = Not_found
let eq = function Not_found -> true | _ -> false
exception Not_found
let _ = e = Not_found (* True )
let _ = eq Not_found ( False *)
Additional information
IMHO The pattern matching behaviour seems to be the correct one. I guess the fix would be to change the equality function to handle exceptions specifically (i.e. do pointer equality on the first field).
This might require adding a new tag number for exceptions to be able to tell them apart at run time.
The text was updated successfully, but these errors were encountered:
As the reporter says, significant changes in the representation of exceptions are required to address this issue: either reserve a new tag for by-address comparison, or use Object-tagged blocks for exceptions. Postponing to the next major release (optimistically).
Original bug ID: 4765
Reporter: till
Assigned to: @alainfrisch
Status: closed (set by @xavierleroy on 2015-12-11T18:25:17Z)
Resolution: fixed
Priority: normal
Severity: feature
Version: 3.11.0
Target version: 4.02.0+dev
Fixed in version: 4.02.0+dev
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @bobzhang abdallah mehdi @glondu @yakobowski
Bug description
let e = Not_found
let eq = function Not_found -> true | _ -> false
exception Not_found
let _ = e = Not_found (* True )
let _ = eq Not_found ( False *)
Additional information
IMHO The pattern matching behaviour seems to be the correct one. I guess the fix would be to change the equality function to handle exceptions specifically (i.e. do pointer equality on the first field).
This might require adding a new tag number for exceptions to be able to tell them apart at run time.
The text was updated successfully, but these errors were encountered: