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

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

Issue 2966603002: Minor fixes to for-loop type inference (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/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 1293511b19a8f154d576f5671d16478e508c4ee5..8957ac05ead5ba8d16e2cea1c354f43854235e55 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
@@ -759,8 +759,10 @@ class KernelForStatement extends ForStatement implements KernelStatement {
void _inferStatement(KernelTypeInferrer inferrer) {
inferrer.listener.forStatementEnter(this);
variables.forEach(inferrer.inferStatement);
- inferrer.inferExpression(
- condition, inferrer.coreTypes.boolClass.rawType, false);
+ if (condition != null) {
+ inferrer.inferExpression(
+ condition, inferrer.coreTypes.boolClass.rawType, false);
+ }
for (var update in updates) {
inferrer.inferExpression(update, null, false);
}
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/body_builder.dart ('k') | pkg/front_end/testcases/inference/for_loop_empty_condition.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698