Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"equal: functional value" should issue a warning #3748

Closed
vicuna opened this issue Aug 5, 2005 · 1 comment
Closed

"equal: functional value" should issue a warning #3748

vicuna opened this issue Aug 5, 2005 · 1 comment

Comments

@vicuna
Copy link

vicuna commented Aug 5, 2005

Original bug ID: 3748
Reporter: administrator
Status: closed (set by @mshinwell on 2016-12-06T21:13:09Z)
Resolution: won't fix
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_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.

@vicuna
Copy link
Author

vicuna commented Dec 6, 2016

Comment author: @mshinwell

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant