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
|
@override
|
||||||
void inferInitializer(Initializer initializer) {
|
void inferInitializer(Initializer initializer) {
|
||||||
if (initializer is KernelInitializer) {
|
assert(initializer is KernelInitializer);
|
||||||
// Use polymorphic dispatch on [KernelInitializer] to perform whatever
|
// Use polymorphic dispatch on [KernelInitializer] to perform whatever
|
||||||
// kind of type inference is correct for this kind of initializer.
|
// kind of type inference is correct for this kind of initializer.
|
||||||
// TODO(paulberry): experiment to see if dynamic dispatch would be better,
|
// TODO(paulberry): experiment to see if dynamic dispatch would be better,
|
||||||
// so that the type hierarchy will be simpler (which may speed up "is"
|
// so that the type hierarchy will be simpler (which may speed up "is"
|
||||||
// checks).
|
// checks).
|
||||||
return initializer._inferInitializer(this);
|
KernelInitializer kernelInitializer = initializer;
|
||||||
} else {
|
return kernelInitializer._inferInitializer(this);
|
||||||
// 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.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
Loading…
Reference in a new issue