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

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

Issue 2658483002: Fix summary handling of invalid annotations of the form `@a.b.c`. (Closed)
Patch Set: Created 3 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
Index: pkg/analyzer/lib/src/summary/summarize_ast.dart
diff --git a/pkg/analyzer/lib/src/summary/summarize_ast.dart b/pkg/analyzer/lib/src/summary/summarize_ast.dart
index 6d885ef5021fca01fbb22d0629969c624234d084..ed52f79e1e931192b1351e3bc6c0c734a5f6e686 100644
--- a/pkg/analyzer/lib/src/summary/summarize_ast.dart
+++ b/pkg/analyzer/lib/src/summary/summarize_ast.dart
@@ -53,19 +53,19 @@ class _ConstExprSerializer extends AbstractConstExprSerializer {
@override
void serializeAnnotation(Annotation annotation) {
+ Identifier name = annotation.name;
+ EntityRefBuilder constructor;
+ if (name is PrefixedIdentifier && annotation.constructorName == null) {
+ constructor =
+ serializeConstructorRef(null, name.prefix, null, name.identifier);
+ } else {
+ constructor = serializeConstructorRef(
+ null, annotation.name, null, annotation.constructorName);
+ }
if (annotation.arguments == null) {
- assert(annotation.constructorName == null);
- serialize(annotation.name);
+ references.add(constructor);
+ operations.add(UnlinkedExprOperation.pushReference);
} else {
- Identifier name = annotation.name;
- EntityRefBuilder constructor;
- if (name is PrefixedIdentifier && annotation.constructorName == null) {
- constructor =
- serializeConstructorRef(null, name.prefix, null, name.identifier);
- } else {
- constructor = serializeConstructorRef(
- null, annotation.name, null, annotation.constructorName);
- }
serializeInstanceCreation(constructor, annotation.arguments);
}
}

Powered by Google App Engine
This is Rietveld 408576698