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

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

Issue 1893703002: Support for a.b.c.d extract property sequence. (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/test/src/summary/resynthesize_ast_test.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 a4b896dd97198bba49ec40695821f1fd7ed2a6e6..3d8068a5a14fdd32ffb94e19932065635ca01e13 100644
--- a/pkg/analyzer/lib/src/summary/link.dart
+++ b/pkg/analyzer/lib/src/summary/link.dart
@@ -3277,7 +3277,7 @@ class ParameterElementForLink implements ParameterElementImpl {
* linking.
*/
abstract class PropertyAccessorElementForLink
- implements PropertyAccessorElementImpl {
+ implements PropertyAccessorElementImpl, ReferenceableElementForLink {
void link(CompilationUnitElementInBuildUnit compilationUnit);
}
@@ -3334,6 +3334,15 @@ class PropertyAccessorElementForLink_Variable
PropertyAccessorElementForLink_Variable(this._variable, this.isSetter);
@override
+ DartType get asStaticType => returnType;
+
+ @override
+ TypeInferenceNode get asTypeInferenceNode {
+ // TODO(scheglov) is this correct?
Paul Berry 2016/04/15 21:15:52 Yes, I believe this is correct, but only because o
+ return null;
+ }
+
+ @override
Element get enclosingElement => _variable.enclosingElement;
@override
@@ -3381,6 +3390,19 @@ class PropertyAccessorElementForLink_Variable
return const [];
}
+ ReferenceableElementForLink getContainedName(String name) {
+ DartType type = returnType;
+ if (type is InterfaceType) {
+ PropertyAccessorElement getter =
+ type.lookUpGetter(name, _variable.compilationUnit.library);
+ print('getter: $getter');
Paul Berry 2016/04/15 21:15:52 Looks like temporary debugging code; should be rem
+ if (getter is PropertyAccessorElementForLink) {
+ return getter;
+ }
+ }
+ return new NonstaticMemberElementForLink(null);
+ }
+
@override
bool isAccessibleIn(LibraryElement library) =>
!Identifier.isPrivateName(name) || identical(this.library, library);
@@ -4077,6 +4099,14 @@ class VariableElementForLink
DynamicTypeImpl.instance;
ReferenceableElementForLink getContainedName(String name) {
+ DartType type = asStaticType;
+ if (type is InterfaceType) {
+ PropertyAccessorElement getter =
+ type.lookUpGetter(name, compilationUnit.library);
+ if (getter is PropertyAccessorElementForLink) {
+ return getter;
+ }
+ }
return new NonstaticMemberElementForLink(_constNode);
}
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_ast_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698