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); |