Skip to content

Remove the ?check operator #9097

@DartBot

Description

@DartBot

This issue was originally filed by ladicek@gmail.com


I propose to remove ?check operator (I believe it's called "argument existence test" or something like that in the spec).

Reason: in a sense, it allows optional parameters to have two observable values at the same time. If used, this affects API a lot, but there's no way for the API user to know. And there's no way to opt out. I personally believe that any function using this operator forms an ill-designed API.

Also, it breaks the way people were forwarding parameters to other functions for decades -- and there's even a proposal to add special syntax for that. Having to use special syntax just to forward parameters is highly error-prone and is likely to lead to style rules like "always use this forwarding syntax, 'cause you can't never know".

If this is deemed absolutely necessary (I've heard that maybe the DOM requires it), then I'd propose removing the possibility of optional parameters having two simultaneous values, and instead adding a possibility for optional parameters having no value. I believe this concept is much easier to grasp, and it would have to be visible on the API level (so that possible issues can be detected early).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).closed-duplicateClosed in favor of an existing report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions