7f1f32904c
.. when the property already exist for the non-nullable type. Change-Id: Ic083de134ea73592de4d68fb3ecc06ddf8398d65 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152331 Reviewed-by: Dmitry Stefantsov <dmitryas@google.com> Commit-Queue: Johnni Winther <johnniwinther@google.com>
21 lines
474 B
Dart
21 lines
474 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 A {
|
|
String text = "";
|
|
}
|
|
|
|
extension on A? {
|
|
String get text => "Lily was here";
|
|
}
|
|
|
|
void main() {
|
|
A? a = null;
|
|
expect("Lily was here", a.text);
|
|
}
|
|
|
|
expect(expected, actual) {
|
|
if (expected != actual) throw 'Expected $expected, actual $actual';
|
|
}
|