Skip to content

Files

Latest commit

 

History

History
37 lines (26 loc) · 634 Bytes

avoid_redundant_argument_values.md

File metadata and controls

37 lines (26 loc) · 634 Bytes

Pattern: Use of redundant argument value

Issue: -

Description

Avoid redundant argument values.

DON'T declare arguments with values that match the defaults for the corresponding parameter.

Example of incorrect code:

void f({bool valWithDefault = true, bool val}) {
 ...
}

void main() {
 f(valWithDefault: true);
}

Example of correct code:

void f({bool valWithDefault = true, bool val}) {
 ...
}

void main() {
 f(valWithDefault: false);
 f();
}

Further Reading