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

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

Issue 2998573002: Add type inference for invalid constructor initializers. (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 e7c14771223e7888abebdbc5479e212dde8e962d..af7fb715430a28bd3cb529063f626adc924a5216 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
@@ -1019,6 +1019,19 @@ class KernelIntLiteral extends IntLiteral implements KernelExpression {
}
}
+/// Concrete shadow object representing an invalid initializer in kernel form.
+class KernelInvalidInitializer extends LocalInitializer
+ implements KernelInitializer {
+ KernelInvalidInitializer(VariableDeclaration variable) : super(variable);
+
+ @override
+ void _inferInitializer(KernelTypeInferrer inferrer) {
+ inferrer.listener.invalidInitializerEnter(this);
+ inferrer.inferExpression(variable.initializer, null, false);
+ inferrer.listener.invalidInitializerExit(this);
+ }
+}
+
/// Concrete shadow object representing a non-inverted "is" test in kernel form.
class KernelIsExpression extends IsExpression implements KernelExpression {
KernelIsExpression(Expression operand, DartType type) : super(operand, type);

Powered by Google App Engine
This is Rietveld 408576698