Relax function subtyping between optional and non-optional parameters #7777
Labels
area-language
Dart language related items (some items might be better tracked at github.com/dart-lang/language).
closed-duplicate
Closed in favor of an existing report
type-enhancement
A request for a change that isn't a bug
I just checked in this patch: https://codereview.chromium.org/11794051/
This changes a line of code from:
process.onExit = completer.complete;
to:
process.onExit = (exitCode) => completer.complete(exitCode);
You'll note this appears to be a pointless lambda that just forwards. The reason is that Completer.complete takes an optional argument, and the type of process.onExit here has a mandatory positional argument. The original code thus fails in checked mode with a type error.
Peter saw this patch and said:
> FYI. Lars and I talked about this yesterday. I think we should change the subtype rule. You should file a bug.
And here it is.
The text was updated successfully, but these errors were encountered: