Skip to content

Flexible fixed, optional and named argument method signatures #17101

Closed
@DartBot

Description

@DartBot

This issue was originally filed by @rbishop-bah


This is a suggestion for consideration for Dart 2.0

I'd like to be able to do something like this:

myMethod(dynamic a, [String b], {num q, num r, num s}, Point p, {String str}, [num z], List aList) {...}

I'd like to be able to combine fixed, optional and optional-named arguments in any combination I think is appropriate for the method I'm writing and have the analyzer/compiler/editor enforce the use of proper signatures.

myMethod("a", "b", r:7, point, str:"hello", 12, []);
myMethod("a", q:7, r:5, point, [11]);
myMethod("a", point, str:"goodbye", null);

all valid. Etc. Many combinations possible.

Issue #7056 is similar.

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 reporttype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions