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

Unified Diff: pkg/front_end/lib/src/fasta/type_inference/type_inferrer.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
Index: pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
index d7761fe769be537f40c18f8dbbf2bbf56fd30536..a44e76fada8c41e63ca20e98eedfc4301a719108 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
@@ -217,6 +217,9 @@ abstract class TypeInferrer {
/// Performs type inference on the given constructor initializer.
void inferInitializer(Initializer initializer);
+ /// Performs type inference on the given metadata annotations.
+ void inferMetadata(List<Expression> annotations);
+
/// Performs type inference on the given function parameter initializer
/// expression.
void inferParameterInitializer(Expression initializer, DartType declaredType);
@@ -774,6 +777,15 @@ abstract class TypeInferrerImpl extends TypeInferrer {
return typeNeeded ? function.functionType : null;
}
+ @override
+ void inferMetadata(List<Expression> annotations) {
+ if (annotations != null) {
+ for (var annotation in annotations) {
+ inferExpression(annotation, null, false);
+ }
+ }
+ }
+
/// Performs the core type inference algorithm for method invocations (this
/// handles both null-aware and non-null-aware method invocations).
DartType inferMethodInvocation(

Powered by Google App Engine
This is Rietveld 408576698