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

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

Issue 1773803002: Validation of `@mustCallSuper` overrides. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
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 584f797d755272a2b1e32f74654d3cb8030a1b83..310e4e9625c9f97b6ef57718a46df0fc12f55c1c 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -1601,6 +1601,12 @@ class ElementAnnotationImpl implements ElementAnnotation {
static String _META_LIB_NAME = "meta";
/**
+ * The name of the top-level variable used to mark a method as requiring
+ * overriders to call super.
+ */
+ static String _MUST_CALL_SUPER_VARIABLE_NAME = "mustCallSuper";
+
+ /**
* The name of the top-level variable used to mark a method as being expected
* to override an inherited method.
*/
@@ -1667,6 +1673,12 @@ class ElementAnnotationImpl implements ElementAnnotation {
}
@override
+ bool get isMustCallSuper =>
+ element is PropertyAccessorElement &&
+ element.name == _MUST_CALL_SUPER_VARIABLE_NAME &&
+ element.library?.name == _META_LIB_NAME;
+
+ @override
bool get isOverride =>
element is PropertyAccessorElement &&
element.name == _OVERRIDE_VARIABLE_NAME &&

Powered by Google App Engine
This is Rietveld 408576698