mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 16:41:07 +00:00
Remove hack from KernelTypeInferrer.inferInitializer.
Now that all constructor initializers created by BodyBuilder implement KernelInitializer, we no longer need a hack to skip initializers that don't. R=scheglov@google.com Review-Url: https://codereview.chromium.org/2992423002 .
This commit is contained in:
parent
41170b0a15
commit
6855bd28f8
|
@ -2195,19 +2195,14 @@ class KernelTypeInferrer extends TypeInferrerImpl {
|
|||
|
||||
@override
|
||||
void inferInitializer(Initializer initializer) {
|
||||
if (initializer is KernelInitializer) {
|
||||
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).
|
||||
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.
|
||||
}
|
||||
KernelInitializer kernelInitializer = initializer;
|
||||
return kernelInitializer._inferInitializer(this);
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
Loading…
Reference in a new issue