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

Unified Diff: pkg/analyzer/lib/src/generated/incremental_resolver.dart

Issue 847173002: Match some constructor-based annotations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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/incremental_resolver_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/incremental_resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/incremental_resolver.dart b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
index faf79dd1a7fa6bf06be579d2f4046c108091bec0..42e9b89512918e72bd87b0414972c548ed8a4b63 100644
--- a/pkg/analyzer/lib/src/generated/incremental_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
@@ -515,13 +515,20 @@ class DeclarationMatcher extends RecursiveAstVisitor {
}
void _assertSameAnnotation(Annotation node, ElementAnnotation annotation) {
- _assertNull(node.arguments);
Element element = annotation.element;
- _assertTrue(element is PropertyAccessorElement);
- _assertTrue(node.name is SimpleIdentifier);
- String nodeName = node.name.name;
- String elementName = element.displayName;
- _assertEquals(nodeName, elementName);
+ if (element is ConstructorElement) {
+ _assertTrue(node.name is SimpleIdentifier);
+ _assertNull(node.constructorName);
+ TypeName nodeType = new TypeName(node.name, null);
+ _assertSameType(nodeType, element.returnType);
+ // TODO(scheglov) validate arguments
+ }
+ if (element is PropertyAccessorElement) {
+ _assertTrue(node.name is SimpleIdentifier);
+ String nodeName = node.name.name;
+ String elementName = element.displayName;
+ _assertEquals(nodeName, elementName);
+ }
}
void _assertSameAnnotations(AnnotatedNode node, Element element) {
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/incremental_resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698