Chromium Code Reviews| Index: pkg/compiler/lib/src/universe/element_world_builder.dart |
| diff --git a/pkg/compiler/lib/src/universe/element_world_builder.dart b/pkg/compiler/lib/src/universe/element_world_builder.dart |
| index 75ae5c96c8a84775e41d52d73701c546f334ea22..ff45d6e6c46fbabf181bb54928cffd31c31e1473 100644 |
| --- a/pkg/compiler/lib/src/universe/element_world_builder.dart |
| +++ b/pkg/compiler/lib/src/universe/element_world_builder.dart |
| @@ -64,10 +64,15 @@ class ElementResolutionWorldBuilder extends ResolutionWorldBuilderBase { |
| ConstructorElement target = constructor.effectiveTarget; |
| ResolutionInterfaceType targetType = |
| constructor.computeEffectiveTargetType(instance.type); |
| - Instantiation kind = Instantiation.DIRECTLY_INSTANTIATED; |
| - if (target.enclosingClass.isAbstract) { |
| - // If target is a factory constructor on an abstract class. |
| - kind = Instantiation.UNINSTANTIATED; |
| + Instantiation kind = Instantiation.UNINSTANTIATED; |
| + ClassElement cls = target.enclosingClass; |
| + bool isNative = _nativeBasicData.isNativeClass(cls); |
| + if (!cls.isAbstract || isNative) { |
|
Siggi Cherem (dart-lang)
2017/05/02 20:10:24
minor nit, might be a bit more readable to not dup
Johnni Winther
2017/05/03 09:06:52
Done.
|
| + if (isNative) { |
| + kind = Instantiation.ABSTRACTLY_INSTANTIATED; |
| + } else { |
| + kind = Instantiation.DIRECTLY_INSTANTIATED; |
| + } |
| } |
| infoFor(targetType.element) |
| .addInstantiation(target, targetType, kind); |