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

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

Issue 2995553002: Implement type inference for asserts in 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 6f0141ed8f84319321b11c79e0d8ab3476178610..6a8e9e1a2a1e003efe092bff44b5b1e78b72d489 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
@@ -90,6 +90,23 @@ class KernelAsExpression extends AsExpression implements KernelExpression {
}
}
+/// Concrete shadow object representing an assert initializer in kernel form.
+class KernelAssertInitializer extends LocalInitializer
+ implements KernelInitializer {
+ /// The assert statement performing the check
+ AssertStatement _statement;
+
+ KernelAssertInitializer(VariableDeclaration variable, this._statement)
+ : super(variable);
+
+ @override
+ void _inferInitializer(KernelTypeInferrer inferrer) {
+ inferrer.listener.assertInitializerEnter(this);
+ inferrer.inferStatement(_statement);
+ inferrer.listener.assertInitializerExit(this);
+ }
+}
+
/// Concrete shadow object representing an assertion statement in kernel form.
class KernelAssertStatement extends AssertStatement implements KernelStatement {
KernelAssertStatement(Expression condition,

Powered by Google App Engine
This is Rietveld 408576698