Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003748OCaml~DO NOT USE (was: OCaml general)public2005-08-05 21:062016-12-06 22:13
Assigned To 
StatusclosedResolutionwon't fix 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0003748: "equal: functional value" should issue a warning
DescriptionFull_Name: Henri
Version: 3.08.2
OS: linux
Submission from: (

Equality is not defined for functional values, but, in the following code:

let _ =
  let f x = x in
  let g x = x in
  exit (if f = g then 1 else 2)

seamaster% ocamlopt -o test
seamaster% ./test
Fatal error: exception Invalid_argument("equal: functional value")

The compiler should know that the type of f (and g) is arrow and should at least
issue a warning or even an error, instead of compiling silently and raising an
Invalid_argument at runtime.

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
shinwell (developer)
2016-12-06 22:12

I think any progress with polymorphic comparison is likely to tend towards deprecation rather than enhancement.

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue
2016-12-06 22:12 shinwell Note Added: 0016669
2016-12-06 22:13 shinwell Status acknowledged => closed
2016-12-06 22:13 shinwell Resolution open => won't fix
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-03 17:55 doligez Category -OCaml general => -(deprecated) general
2017-03-03 18:01 doligez Category -(deprecated) general => ~deprecated (was: OCaml general)
2017-03-06 17:04 doligez Category ~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker