Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: pkg/analyzer/lib/src/dart/element/element.dart

Issue 2781443003: Fix #28120, strong mode allows field overrides (Closed)
Patch Set: fix Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/compile_time_error_code_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/element/element.dart
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart
index cb194b0261d713bb450c24e07da64898b70516fb..768bcefeda405208ad0bef9c8f434d7924d3312f 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -2521,12 +2521,6 @@ class ElementAnnotationImpl implements ElementAnnotation {
static String _REQUIRED_VARIABLE_NAME = "required";
/**
- * The name of the top-level variable used to mark a member as intended to be
- * overridden.
- */
- static String _VIRTUAL_VARIABLE_NAME = "virtual";
-
- /**
* The element representing the field, variable, or constructor being used as
* an annotation.
*/
@@ -2635,18 +2629,6 @@ class ElementAnnotationImpl implements ElementAnnotation {
element.library?.name == _META_LIB_NAME;
/**
- * Return `true` if this annotation marks the associated member as supporting
- * overrides.
- *
- * This is currently used by fields in Strong Mode, as other members are
- * already virtual-by-default.
- */
- bool get isVirtual =>
- element is PropertyAccessorElement &&
- element.name == _VIRTUAL_VARIABLE_NAME &&
- element.library?.name == _META_LIB_NAME;
-
- /**
* Get the library containing this annotation.
*/
Source get librarySource => compilationUnit.librarySource;
@@ -4273,14 +4255,7 @@ class FieldElementImpl extends PropertyInducingElementImpl
}
@override
- bool get isVirtual {
- for (ElementAnnotationImpl annotation in metadata) {
- if (annotation.isVirtual) {
- return true;
- }
- }
- return false;
- }
+ bool get isVirtual => true;
@override
ElementKind get kind => ElementKind.FIELD;
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/compile_time_error_code_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698