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

Unified Diff: pkg/compiler/lib/src/serialization/modelz.dart

Issue 1994613004: Handle use of constant constructors with default values. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment Created 4 years, 7 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
Index: pkg/compiler/lib/src/serialization/modelz.dart
diff --git a/pkg/compiler/lib/src/serialization/modelz.dart b/pkg/compiler/lib/src/serialization/modelz.dart
index 3c10292cf4e2079c6d044f9dc1d819f0af9b7bb2..f721eb17d400258bff929f4cc35f82eb832f9cb1 100644
--- a/pkg/compiler/lib/src/serialization/modelz.dart
+++ b/pkg/compiler/lib/src/serialization/modelz.dart
@@ -1108,6 +1108,9 @@ abstract class ConstructorElementZ extends DeserializedElementZ
ConstructorElement get definingConstructor => null;
@override
+ bool get hasEffectiveTarget => true;
+
+ @override
ConstructorElement get effectiveTarget {
if (_effectiveTarget == null) {
_effectiveTarget =
@@ -1256,7 +1259,7 @@ class ForwardingConstructorElementZ extends ElementZ
@override
InterfaceType computeEffectiveTargetType(InterfaceType newType) {
- return enclosingClass.thisType;
+ return enclosingClass.thisType.substByContext(newType);
}
@override
@@ -1269,6 +1272,9 @@ class ForwardingConstructorElementZ extends ElementZ
ConstantConstructor get constantConstructor => null;
@override
+ bool get hasEffectiveTarget => true;
+
+ @override
ConstructorElement get effectiveTarget => this;
@override
@@ -1405,6 +1411,9 @@ abstract class FieldElementZ extends DeserializedElementZ
}
@override
+ bool get hasConstant => true;
+
+ @override
ConstantExpression get constant {
_ensureConstant();
return _constant;
@@ -1852,6 +1861,9 @@ abstract class ParameterElementZ extends DeserializedElementZ
bool get isConst => false;
@override
+ bool get hasConstant => true;
+
+ @override
ConstantExpression get constant {
if (isOptional) {
if (_constant == null) {
@@ -1980,6 +1992,9 @@ class LocalVariableElementZ extends DeserializedElementZ
}
@override
+ bool get hasConstant => true;
+
+ @override
ConstantExpression get constant {
if (isConst) {
return _constant;
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution.dart ('k') | tests/compiler/dart2js/serialization/analysis_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698