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

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

Issue 2994533002: Perform type inference on constructor field initializer expressions. (Closed)
Patch Set: Created 3 years, 4 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/kernel/kernel_shadow_ast.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
index a70cede998894ca4420b9a606e2871708abb2e90..ef96e93926947b22f5d4636df3b3db5c49bbe6d1 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
@@ -690,6 +690,19 @@ class KernelField extends Field implements KernelMember {
}
}
+/// Concrete shadow object representing a field initializer in kernel form.
+class KernelFieldInitializer extends FieldInitializer
+ implements KernelInitializer {
+ KernelFieldInitializer(Field field, Expression value) : super(field, value);
+
+ @override
+ void _inferInitializer(KernelTypeInferrer inferrer) {
+ inferrer.listener.fieldInitializerEnter(this);
+ inferrer.inferExpression(value, field.type, false);
+ inferrer.listener.fieldInitializerExit(this);
+ }
+}
+
/// Concrete shadow object representing a for-in loop in kernel form.
class KernelForInStatement extends ForInStatement implements KernelStatement {
final bool _declaresVariable;

Powered by Google App Engine
This is Rietveld 408576698