8a883fa54d
Leaves some in parser test: pkg/front_end/parser_testcases/error_recovery/keyword_named_formal_parameter_prime.dart TEST=Refactoring, covered by existing tests. Change-Id: I7a83ef95df3cbd283878b3685b5c747bd89a1b16 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256125 Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Lasse Nielsen <lrn@google.com>
21 lines
484 B
Dart
21 lines
484 B
Dart
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
class Foo {
|
|
int? field;
|
|
int? bar(int? x) {}
|
|
}
|
|
|
|
main() {
|
|
Foo foo = new Foo();
|
|
foo.field = 5;
|
|
foo.bar(6);
|
|
|
|
test_nullable_function_type_formal_param(f: () => 2);
|
|
}
|
|
|
|
int test_nullable_function_type_formal_param({int f()? = null}) {
|
|
return f?.call() ?? -1;
|
|
}
|