|Anonymous | Login | Signup for a new account||2018-10-19 04:13 CEST|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0007837||OCaml||typing||public||2018-08-10 16:02||2018-08-13 19:57|
|Target Version||Fixed in Version|
|Summary||0007837: Add warning for [f ?a ~b] and similar|
|Description||Warning 16 covers cases where an optional argument is at the end of a function type, where it cannot be erased.|
In 0007836 it was determined that if the optional argument is followed by only labeled arguments, warning 16 does not apply because the special case for total application *can* erase the optional argument.
let f ?a ~b = ()
the function call
(and not f ~b:()) will succeed in erasing ?a.
However, under the circumstances of enabling warning 6 (label was omitted in the application of function) and warnings to errors, it is again statically impossible to call f without the optional argument.
I would like to propose a separate warning for this case, with a message similar to:
Warning #: this optional argument can only be erased by totally applying the function while omitting all labels
and if possible, enabling warning 6 should imply this hypothetical new warning.
|Tags||No tags attached.|
edited on: 2018-08-11 13:56
I am a bit skeptical about adding a new warning for this. What about triggering warning 16 in this situation if warning 6 is active and made into an error?
This is certainly a solution, but I'm wary of making the semantics of warnings depend on the state of other warnings.
Additionally, warning 6/-Werr is at the call site, whereas this is at the definition point, so it might not be consistent between the two.
|2018-08-10 16:02||jtsang||New Issue|
|2018-08-11 13:56||nojebar||Note Added: 0019300|
|2018-08-11 13:56||nojebar||Note Edited: 0019300||View Revisions|
|2018-08-13 19:57||jtsang||Note Added: 0019304|
|Copyright © 2000 - 2011 MantisBT Group|