Files
sdk/pkg/front_end/testcases/nnbd/null_shorting_cascade.dart
T
Johnni Winther 6e85f3337a [cfe] Support null-aware cascade
Change-Id: I1db4125b4469e6a8b6adc5ec6e4dcafc0a26da4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124680
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-14 12:39:16 +00:00

20 lines
462 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 Class {
Class method() => this;
}
extension Extension on Class {
Class extensionMethod() => this;
}
main() {
Class? c;
c?..method();
c?..method()..method();
c?..extensionMethod();
c?..extensionMethod()..extensionMethod();
}