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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/body_builder.dart

Issue 2963703002: Add type inference of annotations. (Closed)
Patch Set: Created 3 years, 6 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/front_end/lib/src/fasta/source/diet_listener.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/kernel/body_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
index b5c15b1689d10cc2272984a28c0ab08244401649..a03bce05389964355fae1c2106110d13dd46a564 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -446,6 +446,7 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
pop(); // Modifiers.
List annotations = pop();
if (annotations != null) {
+ _typeInferrer.inferMetadata(annotations);
ahe 2017/06/28 07:39:49 Can you move all these calls to endMetadataStar? A
Paul Berry 2017/06/28 12:15:59 I could do that now, but it would not work in the
Field field = fields.first.target;
// The first (and often only field) will not get a clone.
annotations.forEach(field.addAnnotation);
@@ -589,6 +590,7 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
KernelFunctionBuilder builder = member;
builder.body = body;
Member target = builder.target;
+ _typeInferrer.inferMetadata(annotations);
for (Expression annotation in annotations ?? const []) {
target.addAnnotation(annotation);
}
@@ -615,6 +617,13 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
}
}
+ @override
+ List<Expression> finishMetadata() {
+ List<Expression> expressions = pop();
+ _typeInferrer.inferMetadata(expressions);
+ return expressions;
+ }
+
void finishConstructor(
KernelConstructorBuilder builder, AsyncMarker asyncModifier) {
/// Quotes below are from [Dart Programming Language Specification, 4th
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/source/diet_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698