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
No warning for partly evaluated functions at toplevel #6236
Comments
Comment author: @garrigue Intentionally, let _ = expr does not cause any warning. |
Comment author: @alainfrisch What about a new warning on all "let _ = ..." bindings? In my opinion, even for local bindings, it is bad style. |
Comment author: @damiendoligez Please let us not multiply coding-style warnings that could easily be implemented by an external tool. In this case, even emacs should be able to warn you. |
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc. |
This has been fixed by #1974, released in OCaml 4.08:
|
Original bug ID: 6236
Reporter: gmelquiond
Status: acknowledged (set by @damiendoligez on 2013-11-30T22:28:26Z)
Resolution: open
Priority: normal
Severity: feature
Version: 4.00.1
Category: typing
Bug description
let f ~a b = failwith b
let _ = f "success"
The compiler emits no warning about the last line not being executed completely. The bug looks obvious on this testcase, but it is mind-boggling on a larger piece of code spanning several files. (We had it occur in Why3 recently.)
So it would be great if warning 5 ("this function application is partial, maybe some arguments are missing") was also emitted for anonymous let-statements at top level. (I know that, if "let ()" had been used instead, the compiler would have complained loudly.)
The text was updated successfully, but these errors were encountered: