Skip to content

_addOption has a fuzzy arrow warning #31

Closed
@leafpetersen

Description

@leafpetersen

The implementation of addFlag in lib/src/arg_parser.dart relies on the deprecated fuzzy arrow feature to allow the passing of a callback of type bool -> void where a callback of type dynamic -> void is expected (in the call to _addOption). Nothing in the latter contract prevents calling the callback with something that is not a bool.

This code should be updated. Since the eventual all of the callback is done dynamically anyway, it might be most appropriate to simply change the type of the callback in the _addOption function to either Function, or Null -> void.

More context here.

dart-lang/sdk#29630

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions