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

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

Issue 896573003: Match body modifiers in incremental resolver. (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 b00994697e83121d626609acf6166eaa5a9b7497..152bb47beb1de9d28eafdd7acb59a2f941f11821 100644
--- a/pkg/analyzer/lib/src/generated/incremental_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
@@ -272,6 +272,7 @@ class DeclarationMatcher extends RecursiveAstVisitor {
_assertCompatibleParameters(
node.functionExpression.parameters,
element.parameters);
+ _assertBodyModifiers(node.functionExpression.body, element);
// matches, update the existing element
ExecutableElement newElement = node.element;
node.name.staticElement = element;
@@ -345,6 +346,7 @@ class DeclarationMatcher extends RecursiveAstVisitor {
_assertEquals(node.isStatic, element.isStatic);
_assertSameType(node.returnType, element.returnType);
_assertCompatibleParameters(node.parameters, element.parameters);
+ _assertBodyModifiers(node.body, element);
_removedElements.remove(element);
// matches, update the existing element
node.name.staticElement = element;
@@ -422,6 +424,15 @@ class DeclarationMatcher extends RecursiveAstVisitor {
_assertSameTypes(nodes, types);
}
+ /**
+ * Asserts that [body] has async / generator modifiers compatible with the
+ * given [element].
+ */
+ void _assertBodyModifiers(FunctionBody body, ExecutableElementImpl element) {
+ _assertEquals(body.isSynchronous, element.isSynchronous);
+ _assertEquals(body.isGenerator, element.isGenerator);
+ }
+
void _assertCombinators(List<Combinator> nodeCombinators,
List<NamespaceCombinator> elementCombinators) {
// prepare shown/hidden names in the 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