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

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

Issue 2961723002: Remove hack from KernelTypePromoter.isPromotionCandidate. (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698