Files
sdk/pkg/front_end/testcases/inference/null_aware_method_invocation.dart
T
Johnni Winther 40d75d733b [cfe] Refactor if-null and null-aware property access
Change-Id: I19a50b7d56b63c96f24daf8aaf975e0748e29cf8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116340
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-09-19 17:17:10 +00:00

19 lines
480 B
Dart

// Copyright (c) 2017, 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.
/*@testedFeatures=inference*/
library test;
class C {
int f() => null;
}
g(C c) {
var /*@ type=int* */ x = /*@ type=C* */ /*@target=Object::==*/ c
?. /*@target=C::f*/ f();
/*@ type=C* */ /*@target=Object::==*/ c?. /*@target=C::f*/ f();
}
main() {}