Files
sdk/pkg/front_end/testcases/nnbd/nullable_param.dart
T
Johnni Winther 0e5624a083 [cfe] Handle static typing of nullable access to Object members
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>
2020-04-06 09:22:00 +00:00

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;
}