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

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

Issue 2992423002: Remove hack from KernelTypeInferrer.inferInitializer. (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
« 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 af7fb715430a28bd3cb529063f626adc924a5216..449c8329d1f59bd9d45369b96340fbdd50bf06ac 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
@@ -2191,19 +2191,14 @@ class KernelTypeInferrer extends TypeInferrerImpl {
@override
void inferInitializer(Initializer initializer) {
- if (initializer is KernelInitializer) {
- // Use polymorphic dispatch on [KernelInitializer] to perform whatever
- // kind of type inference is correct for this kind of initializer.
- // TODO(paulberry): experiment to see if dynamic dispatch would be better,
- // so that the type hierarchy will be simpler (which may speed up "is"
- // checks).
- return initializer._inferInitializer(this);
- } else {
- // Encountered an initializer type for which type inference is not yet
- // implemented, so just skip it for now.
- // TODO(paulberry): once the BodyBuilder uses shadow classes for
- // everything, this case should no longer be needed.
- }
+ assert(initializer is KernelInitializer);
+ // Use polymorphic dispatch on [KernelInitializer] to perform whatever
+ // kind of type inference is correct for this kind of initializer.
+ // TODO(paulberry): experiment to see if dynamic dispatch would be better,
+ // so that the type hierarchy will be simpler (which may speed up "is"
+ // checks).
+ KernelInitializer kernelInitializer = initializer;
+ return kernelInitializer._inferInitializer(this);
}
@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