You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 7837 Reporter: jtsang Status: new Resolution: open Priority: normal Severity: feature Category: typing Monitored by:@nojb
Bug description
Warning 16 covers cases where an optional argument is at the end of a function type, where it cannot be erased.
In #7836 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.
I.e. for
let f ?a ~b = ()
the function call
f ()
(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.
The text was updated successfully, but these errors were encountered:
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 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.
Original bug ID: 7837
Reporter: jtsang
Status: new
Resolution: open
Priority: normal
Severity: feature
Category: typing
Monitored by: @nojb
Bug description
Warning 16 covers cases where an optional argument is at the end of a function type, where it cannot be erased.
In #7836 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.
I.e. for
let f ?a ~b = ()
the function call
f ()
(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.
The text was updated successfully, but these errors were encountered: