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

Unified Diff: pkg/analyzer/lib/src/summary/link.dart

Issue 1944733002: Support references to static getters in the summary linker. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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/summary/prelink.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/link.dart
diff --git a/pkg/analyzer/lib/src/summary/link.dart b/pkg/analyzer/lib/src/summary/link.dart
index 18960c0489e0a7c1cf73eb2fa1e41bf7e512f26e..e68b5dfff37e9ace384f5118fb2ac45442681b4f 100644
--- a/pkg/analyzer/lib/src/summary/link.dart
+++ b/pkg/analyzer/lib/src/summary/link.dart
@@ -271,6 +271,9 @@ abstract class ClassElementForLink
hasBeenInferred = !enclosingElement.isInBuildUnit;
@override
+ List<PropertyAccessorElementForLink> get accessors;
+
+ @override
ConstructorElementForLink get asConstructor => unnamedConstructor;
@override
@@ -323,6 +326,12 @@ abstract class ClassElementForLink
_containedNames[field.name] = field;
}
}
+ for (PropertyAccessorElementForLink accessor in accessors) {
+ if (accessor.isStatic && !accessor.isSynthetic) {
+ // TODO(paulberry): add synthetic elements too?
+ _containedNames[accessor.name] = accessor;
+ }
+ }
// TODO(paulberry): add methods.
}
return _containedNames.putIfAbsent(
@@ -3461,7 +3470,7 @@ abstract class ParameterParentElementForLink implements Element {
* linking.
*/
abstract class PropertyAccessorElementForLink
- implements PropertyAccessorElementImpl {
+ implements PropertyAccessorElementImpl, ReferenceableElementForLink {
void link(CompilationUnitElementInBuildUnit compilationUnit);
}
@@ -3482,6 +3491,18 @@ class PropertyAccessorElementForLink_Executable extends ExecutableElementForLink
unlinkedExecutable);
@override
+ ConstructorElementForLink get asConstructor => null;
+
+ @override
+ ConstVariableNode get asConstVariable => null;
+
+ @override
+ DartType get asStaticType => returnType;
+
+ @override
+ TypeInferenceNode get asTypeInferenceNode => null;
+
+ @override
PropertyAccessorElementForLink_Executable get correspondingGetter =>
variable.getter;
@@ -3498,6 +3519,15 @@ class PropertyAccessorElementForLink_Executable extends ExecutableElementForLink
UnlinkedExecutableKind.getter ? ElementKind.GETTER : ElementKind.SETTER;
@override
+ DartType buildType(DartType getTypeArgument(int i),
+ List<int> implicitFunctionTypeIndices) =>
+ DynamicTypeImpl.instance;
+
+ @override
+ ReferenceableElementForLink getContainedName(String name) =>
+ UndefinedElementForLink.instance;
+
+ @override
noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
@override
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/prelink.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698