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

Unified Diff: pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart

Issue 1413613010: Normalize type masks to use the least upper instantiated subclass/type. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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
Index: pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
diff --git a/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart b/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
index 17c53c6a8d3588314396bf725d0da1d5614e4dda..884ca97d42aabd55d8432e1445fa866aafa05133 100644
--- a/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
+++ b/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
@@ -644,7 +644,17 @@ class SimpleTypeInferrerVisitor<T>
}
});
}
- returnType = types.nonNullExact(cls);
+ if (analyzedElement.isGenerativeConstructor && cls.isAbstract) {
+ if (compiler.world.isInstantiated(cls)) {
+ returnType = types.nonNullSubclass(cls);
Siggi Cherem (dart-lang) 2015/11/03 21:01:57 same here - why not nonNullExact?
Johnni Winther 2015/11/06 13:43:23 Updated to use nonNullExact if [cls] is directly i
+ } else {
+ // TODO(johnniwinther): Avoid analyzing [analyzedElement] in this
+ // case; it's never called.
+ returnType = types.nonNullEmpty();
+ }
+ } else {
+ returnType = types.nonNullExact(cls);
+ }
} else {
signature.forEachParameter((LocalParameterElement element) {
locals.update(element, inferrer.typeOfElement(element), node);

Powered by Google App Engine
This is Rietveld 408576698