e981c6fdbc
Fasta desugares some expressions differently in void contexts, so to be on the safe side, we should test that null-aware invocations and property accesses work in both void and non-void contexts. R=sigmund@google.com Review-Url: https://codereview.chromium.org/2948843002 .
18 lines
394 B
Dart
18 lines
394 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 = c?. /*@target=C::f*/ f();
|
|
c?. /*@target=C::f*/ f();
|
|
}
|
|
|
|
main() {}
|