Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003748OCaml-OCaml generalpublic2005-08-05 21:062016-12-06 22:13
Reporteradministrator 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
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: aorleans-104-1-15-86.w80-11.abo.wanadoo.fr (80.11.35.86)


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 test.ml
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
(0016669)
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


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker