6e4e12922a
This change has been discussed for 8+ years and it would of course be preferred to be added as an instance method, but since that is a breaking change I added it as an extension as discussed here: https://github.com/dart-lang/sdk/issues/24644#issuecomment-1241695835 Change-Id: Iebb9f300e449920ae8891abac88f30b271321661 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258541 Commit-Queue: Lasse Nielsen <lrn@google.com> Reviewed-by: Nate Bosch <nbosch@google.com> Reviewed-by: Lasse Nielsen <lrn@google.com>
30 lines
957 B
Dart
30 lines
957 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.
|
|
|
|
/*library: scope=[
|
|
async.dart.FutureExtensions,
|
|
core.dart.DateTimeCopyWith,
|
|
core.dart.EnumByName,
|
|
core.dart.EnumName,
|
|
origin.dart.Extension,
|
|
origin.dart.GenericExtension]*/
|
|
|
|
// ignore: uri_does_not_exist
|
|
import 'dart:test';
|
|
|
|
main() {
|
|
"".instanceMethod();
|
|
"".genericInstanceMethod<int>(0);
|
|
"".instanceProperty = "".instanceProperty;
|
|
Extension.staticMethod();
|
|
Extension.genericStaticMethod<int>(0);
|
|
Extension.staticProperty = Extension.staticProperty;
|
|
true.instanceMethod();
|
|
true.genericInstanceMethod<int>(0);
|
|
true.instanceProperty = true.instanceProperty;
|
|
GenericExtension.staticMethod();
|
|
GenericExtension.genericStaticMethod<int>(0);
|
|
GenericExtension.staticProperty = GenericExtension.staticProperty;
|
|
}
|