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 fdf482503c6d6125677133de2e8af656b6911e17..d47684145b24c2f64a4905fab7531f62faed53f8 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 |
@@ -2134,15 +2134,9 @@ class KernelTypePromoter extends TypePromoterImpl { |
@override |
bool isPromotionCandidate(VariableDeclaration variable) { |
- if (variable is KernelVariableDeclaration) { |
- return !variable._isLocalFunction; |
- } else { |
- // Hack to deal with the fact that BodyBuilder still creates raw |
- // VariableDeclaration objects sometimes. |
- // TODO(paulberry): get rid of this once the type parameter is |
- // KernelVariableDeclaration. |
- return true; |
- } |
+ assert(variable is KernelVariableDeclaration); |
+ KernelVariableDeclaration kernelVariableDeclaration = variable; |
+ return !kernelVariableDeclaration._isLocalFunction; |
} |
@override |