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

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

Issue 2849363003: Fix Instantiation equivalence (Closed)
Patch Set: Updated cf. comment 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..0dc73b239c3f71be9472db79c573574451820cce 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.
+ ClassElement cls = target.enclosingClass;
+ bool isNative = _nativeBasicData.isNativeClass(cls);
+ Instantiation kind;
+ if (isNative) {
+ kind = Instantiation.ABSTRACTLY_INSTANTIATED;
+ } else if (cls.isAbstract) {
kind = Instantiation.UNINSTANTIATED;
+ } 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