0e5624a083
Closes #41282 Change-Id: I39d0bf8a35e635e860f4bf810ee37e00950e3a8f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142364 Reviewed-by: Dmitry Stefantsov <dmitryas@google.com> Commit-Queue: Johnni Winther <johnniwinther@google.com>
21 lines
483 B
Dart
21 lines
483 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;
|
|
}
|