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

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

Issue 1837523002: Fixes for using _DeferredClassElement and SDK summary. (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
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/element_resolver.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 9088d1672a33e8e37aab474215b1bde40165f7b0..214b4f4db108ca3c069a867161ba7d24cf400cf3 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -679,11 +679,7 @@ class ClassElementImpl extends ElementImpl implements ClassElement {
visitedClasses.add(this);
}
try {
- ClassElement superclass = supertype.element;
- if (superclass is ClassElementHandle) {
- superclass = (superclass as ClassElementHandle).actualElement;
- }
- constructorsToForward = (superclass as ClassElementImpl)
+ constructorsToForward = getImpl(supertype.element)
._computeMixinAppConstructors(visitedClasses);
} finally {
visitedClasses.removeLast();
@@ -745,10 +741,10 @@ class ClassElementImpl extends ElementImpl implements ClassElement {
_internalLookUpGetter(getterName, library, includeThisClass);
while (getter != null && getter.isAbstract) {
Element definingClass = getter.enclosingElement;
- if (definingClass is! ClassElementImpl) {
+ if (definingClass is! ClassElement) {
return null;
}
- getter = (definingClass as ClassElementImpl)
+ getter = getImpl(definingClass)
._internalLookUpGetter(getterName, library, false);
}
return getter;
@@ -908,6 +904,18 @@ class ClassElementImpl extends ElementImpl implements ClassElement {
}
return false;
}
+
+ /**
+ * Return the [ClassElementImpl] of the given [classElement]. May throw an
+ * exception if the [ClassElementImpl] cannot be provided (should not happen
+ * though).
+ */
+ static ClassElementImpl getImpl(ClassElement classElement) {
+ if (classElement is ClassElementHandle) {
+ return getImpl(classElement.actualElement);
+ }
+ return classElement as ClassElementImpl;
+ }
}
/**
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/element_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698