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

Unified Diff: pkg/compiler/lib/src/universe/element_world_builder.dart

Issue 2849363003: Fix Instantiation equivalence (Closed)
Patch Set: Created 3 years, 8 months 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
« no previous file with comments | « no previous file | tests/compiler/dart2js/kernel/closed_world2_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | tests/compiler/dart2js/kernel/closed_world2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698