Skip to content

Commit 3a30bb4

Browse files
authored
[wildcard-variables] Add unnamed optional parameters and their default values. (#3880)
1 parent f62423f commit 3a30bb4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

working/wildcards/feature-specification.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,16 @@ class B extends A {
357357
}
358358
```
359359

360+
### Unnamed optional parameters
361+
362+
```dart
363+
int foo([int _]) => 3; // OK.
364+
```
365+
366+
An optional unnamed parameter, that's not an initializing or super parameter,
367+
is allowed to have no default value, even if its type is non-nullable. We
368+
will stop producing a compile time error for this case.
369+
360370
### Extension types
361371

362372
An extension type declaration has a `<representationDeclaration>`

0 commit comments

Comments
 (0)