Version 2.10.0-55.0.dev
Merge commit '011270887b7d1121bcb0f2cdc3bb6d95508af724' into 'dev'
diff --git a/DEPS b/DEPS
index 0353d74..94da789 100644
--- a/DEPS
+++ b/DEPS
@@ -44,7 +44,7 @@
# co19 is a cipd package. Use update.sh in tests/co19[_2] to update these
# hashes. It requires access to the dart-build-access group, which EngProd
# has.
- "co19_rev": "12eb7bb3dd199c817babce7eb65266b90eb8deca",
+ "co19_rev": "28b7e665580cecdf64bc3c81c5b4ed137380c33d",
"co19_2_rev": "e48b3090826cf40b8037648f19d211e8eab1b4b6",
# The internal benchmarks to use. See go/dart-benchmarks-internal
diff --git a/pkg/analyzer/lib/error/error.dart b/pkg/analyzer/lib/error/error.dart
index 21485aa..3030d6d 100644
--- a/pkg/analyzer/lib/error/error.dart
+++ b/pkg/analyzer/lib/error/error.dart
@@ -465,7 +465,6 @@
FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_EXTENDS,
FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_IMPLEMENTS,
FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_WITH,
- HintCode.ASSIGNMENT_OF_DO_NOT_STORE,
HintCode.CAN_BE_NULL_AFTER_NULL_AWARE,
HintCode.DEAD_CODE,
HintCode.DEAD_CODE_CATCH_FOLLOWING_CATCH,
diff --git a/pkg/analyzer/lib/src/dart/ast/extensions.dart b/pkg/analyzer/lib/src/dart/ast/extensions.dart
index 0854bf3..fd66ae4 100644
--- a/pkg/analyzer/lib/src/dart/ast/extensions.dart
+++ b/pkg/analyzer/lib/src/dart/ast/extensions.dart
@@ -3,29 +3,8 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/src/dart/ast/ast.dart';
-extension ElementExtension on Element {
- /// Return `true` if this element, the enclosing class (if there is one), or
- /// the enclosing library, has been annotated with the `@doNotStore`
- /// annotation.
- bool get hasOrInheritsDoNotStore {
- if (hasDoNotStore) {
- return true;
- }
- var ancestor = enclosingElement;
- if (ancestor is ClassElement || ancestor is ExtensionElement) {
- if (ancestor.hasDoNotStore) {
- return true;
- }
- ancestor = ancestor.enclosingElement;
- }
- return ancestor is CompilationUnitElement &&
- ancestor.enclosingElement.hasDoNotStore;
- }
-}
-
extension ListOfFormalParameterExtension on List<FormalParameter> {
Iterable<FormalParameterImpl> get asImpl {
return cast<FormalParameterImpl>();
diff --git a/pkg/analyzer/lib/src/dart/error/hint_codes.dart b/pkg/analyzer/lib/src/dart/error/hint_codes.dart
index 212ad92..b9ce65f 100644
--- a/pkg/analyzer/lib/src/dart/error/hint_codes.dart
+++ b/pkg/analyzer/lib/src/dart/error/hint_codes.dart
@@ -15,14 +15,6 @@
*/
class HintCode extends AnalyzerErrorCode {
/**
- * Users should not assign values marked `@doNotStore`.
- */
- static const HintCode ASSIGNMENT_OF_DO_NOT_STORE = HintCode(
- 'ASSIGNMENT_OF_DO_NOT_STORE',
- "'{0}' is marked 'doNotStore' and shouldn't be assigned to a field.",
- correction: "Try removing the assignment.");
-
- /**
* When the target expression uses '?.' operator, it can be `null`, so all the
* subsequent invocations should also use '?.' operator.
*/
diff --git a/pkg/analyzer/lib/src/error/best_practices_verifier.dart b/pkg/analyzer/lib/src/error/best_practices_verifier.dart
index f010244..6eff16b 100644
--- a/pkg/analyzer/lib/src/error/best_practices_verifier.dart
+++ b/pkg/analyzer/lib/src/error/best_practices_verifier.dart
@@ -13,7 +13,6 @@
import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/dart/element/type_provider.dart';
import 'package:analyzer/error/listener.dart';
-import 'package:analyzer/src/dart/ast/extensions.dart';
import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/dart/element/inheritance_manager3.dart';
import 'package:analyzer/src/dart/element/member.dart' show ExecutableMember;
@@ -336,37 +335,6 @@
field.name,
[field.name, overriddenElement.enclosingElement.name]);
}
-
- var expression = field.initializer;
-
- Element element;
- if (expression is PropertyAccess) {
- element = expression.propertyName.staticElement;
- // Tear-off.
- if (element is FunctionElement || element is MethodElement) {
- element = null;
- }
- } else if (expression is MethodInvocation) {
- element = expression.methodName.staticElement;
- } else if (expression is Identifier) {
- element = expression.staticElement;
- // Tear-off.
- if (element is FunctionElement || element is MethodElement) {
- element = null;
- }
- }
- if (element != null) {
- if (element.isSynthetic) {
- element = (element as PropertyAccessorElement).variable;
- }
- if (element.hasOrInheritsDoNotStore) {
- _errorReporter.reportErrorForNode(
- HintCode.ASSIGNMENT_OF_DO_NOT_STORE,
- expression,
- [element.name],
- );
- }
- }
}
} finally {
_inDeprecatedMember = wasInDeprecatedMember;
diff --git a/pkg/analyzer/lib/src/test_utilities/mock_packages.dart b/pkg/analyzer/lib/src/test_utilities/mock_packages.dart
index 88d5bc0..28eeeae 100644
--- a/pkg/analyzer/lib/src/test_utilities/mock_packages.dart
+++ b/pkg/analyzer/lib/src/test_utilities/mock_packages.dart
@@ -25,7 +25,6 @@
library meta;
const _AlwaysThrows alwaysThrows = const _AlwaysThrows();
-const _DoNotStore doNotStore = _DoNotStore();
const _Factory factory = const _Factory();
const Immutable immutable = const Immutable();
const _Literal literal = const _Literal();
@@ -37,19 +36,16 @@
const _Sealed sealed = const _Sealed();
const _VisibleForTesting visibleForTesting = const _VisibleForTesting();
-class _AlwaysThrows {
- const _AlwaysThrows();
-}
-class _DoNotStore {
- const _DoNotStore();
-}
-class _Factory {
- const _Factory();
-}
class Immutable {
final String reason;
const Immutable([this.reason]);
}
+class _AlwaysThrows {
+ const _AlwaysThrows();
+}
+class _Factory {
+ const _Factory();
+}
class _Literal {
const _Literal();
}
diff --git a/pkg/analyzer/test/src/diagnostics/assignment_of_do_not_store_test.dart b/pkg/analyzer/test/src/diagnostics/assignment_of_do_not_store_test.dart
deleted file mode 100644
index 18d1264..0000000
--- a/pkg/analyzer/test/src/diagnostics/assignment_of_do_not_store_test.dart
+++ /dev/null
@@ -1,166 +0,0 @@
-// 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.
-
-import 'package:analyzer/src/error/codes.dart';
-import 'package:test_reflective_loader/test_reflective_loader.dart';
-
-import '../dart/resolution/context_collection_resolution.dart';
-
-main() {
- defineReflectiveSuite(() {
- defineReflectiveTests(AssignmentOfDoNotStoreTest);
- });
-}
-
-@reflectiveTest
-class AssignmentOfDoNotStoreTest extends PubPackageResolutionTest {
- @override
- void setUp() {
- super.setUp();
- writeTestPackageConfigWithMeta();
- }
-
- test_classMemberGetter() async {
- await assertErrorsInCode('''
-import 'package:meta/meta.dart';
-
-class A {
- @doNotStore
- String get v => '';
-}
-
-class B {
- String f = A().v;
-}
-''', [
- error(HintCode.ASSIGNMENT_OF_DO_NOT_STORE, 106, 5),
- ]);
- }
-
- test_classMemberVariable() async {
- await assertErrorsInCode('''
-import 'package:meta/meta.dart';
-
-class A{
- @doNotStore
- final f = '';
-}
-
-class B {
- String f = A().f;
-}
-''', [
- error(HintCode.ASSIGNMENT_OF_DO_NOT_STORE, 99, 5),
- ]);
- }
-
- test_classStaticGetter() async {
- await assertErrorsInCode('''
-import 'package:meta/meta.dart';
-
-class A {
- @doNotStore
- static String get v => '';
-}
-
-class B {
- String f = A.v;
-}
-''', [
- error(HintCode.ASSIGNMENT_OF_DO_NOT_STORE, 113, 3),
- ]);
- }
-
- test_classStaticVariable() async {
- await assertErrorsInCode('''
-import 'package:meta/meta.dart';
-
-class A{
- @doNotStore
- static final f = '';
-}
-
-class B {
- String f = A.f;
-}
-''', [
- error(HintCode.ASSIGNMENT_OF_DO_NOT_STORE, 106, 3),
- ]);
- }
-
- test_functionAssignment() async {
- await assertNoErrorsInCode('''
-import 'package:meta/meta.dart';
-
-@doNotStore
-String g(int i) => '';
-
-class C {
- String Function(int) f = g;
-}
-''');
- }
-
- test_functionReturnValue() async {
- await assertErrorsInCode('''
-import 'package:meta/meta.dart';
-
-@doNotStore
-String getV() => '';
-
-class A {
- final f = getV();
-}
-''', [
- error(HintCode.ASSIGNMENT_OF_DO_NOT_STORE, 90, 6),
- ]);
- }
-
- test_methodReturnValue() async {
- await assertErrorsInCode('''
-import 'package:meta/meta.dart';
-
-class A {
- @doNotStore
- String getV() => '';
-}
-
-class B {
- final f = A().getV();
-}
-''', [
- error(HintCode.ASSIGNMENT_OF_DO_NOT_STORE, 106, 10),
- ]);
- }
-
- test_topLevelGetter() async {
- await assertErrorsInCode('''
-import 'package:meta/meta.dart';
-
-@doNotStore
-String get v => '';
-
-class A {
- final f = v;
-}
-''', [
- error(HintCode.ASSIGNMENT_OF_DO_NOT_STORE, 89, 1),
- ]);
- }
-
- test_topLevelVariable() async {
- await assertErrorsInCode('''
-import 'package:meta/meta.dart';
-
-@doNotStore
-final v = '';
-
-class A {
- final f = v;
-}
-''', [
- error(HintCode.ASSIGNMENT_OF_DO_NOT_STORE, 83, 1),
- ]);
- }
-}
diff --git a/pkg/analyzer/test/src/diagnostics/test_all.dart b/pkg/analyzer/test/src/diagnostics/test_all.dart
index 5495e4e..9d1aa5b 100644
--- a/pkg/analyzer/test/src/diagnostics/test_all.dart
+++ b/pkg/analyzer/test/src/diagnostics/test_all.dart
@@ -22,7 +22,6 @@
import 'argument_type_not_assignable_test.dart' as argument_type_not_assignable;
import 'assert_in_redirecting_constructor_test.dart'
as assert_in_redirecting_constructor;
-import 'assignment_of_do_not_store_test.dart' as assignment_of_do_not_store;
import 'assignment_to_const_test.dart' as assignment_to_const;
import 'assignment_to_final_local_test.dart' as assignment_to_final_local;
import 'assignment_to_final_no_setter_test.dart'
@@ -653,7 +652,6 @@
annotation_with_non_class.main();
argument_type_not_assignable.main();
assert_in_redirecting_constructor.main();
- assignment_of_do_not_store.main();
assignment_to_const.main();
assignment_to_final_local.main();
assignment_to_final_no_setter.main();
diff --git a/tools/VERSION b/tools/VERSION
index d90ea8e..6f3f0cf 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 10
PATCH 0
-PRERELEASE 54
+PRERELEASE 55
PRERELEASE_PATCH 0
\ No newline at end of file