Index: pkg/compiler/lib/src/constants/values.dart |
diff --git a/pkg/compiler/lib/src/constants/values.dart b/pkg/compiler/lib/src/constants/values.dart |
index 69c89cf06d5d84e7d2796969f6089a9551c8efe1..9a53dc5b68f3036f3195f965475f00a348be41f9 100644 |
--- a/pkg/compiler/lib/src/constants/values.dart |
+++ b/pkg/compiler/lib/src/constants/values.dart |
@@ -32,7 +32,7 @@ abstract class ConstantValueVisitor<R, A> { |
R visitConstructed(ConstructedConstantValue constant, A arg); |
R visitType(TypeConstantValue constant, A arg); |
R visitInterceptor(InterceptorConstantValue constant, A arg); |
- R visitDummy(DummyConstantValue constant, A arg); |
+ R visitSynthetic(SyntheticConstantValue constant, A arg); |
R visitDeferred(DeferredConstantValue constant, A arg); |
} |
@@ -80,7 +80,7 @@ abstract class ConstantValue { |
/// expression from the value so the unparse of these is best effort. |
/// |
/// For the synthetic constants, [DeferredConstantValue], |
- /// [DummyConstantValue], [InterceptorConstantValue] the unparse is |
+ /// [SyntheticConstantValue], [InterceptorConstantValue] the unparse is |
/// descriptive only. |
String unparse(); |
@@ -603,30 +603,32 @@ class InterceptorConstantValue extends ConstantValue { |
} |
} |
-// TODO(johnniwinther): Remove this class. |
-class DummyConstantValue extends ConstantValue { |
- final ti.TypeMask typeMask; |
+class SyntheticConstantValue extends ConstantValue { |
+ final payload; |
+ final kind; |
- DummyConstantValue(this.typeMask); |
+ SyntheticConstantValue(this.kind, this.payload); |
bool get isDummy => true; |
bool operator ==(other) { |
- return other is DummyConstantValue |
- && typeMask == other.typeMask; |
+ return other is SyntheticConstantValue |
+ && payload == other.payload; |
} |
- get hashCode => typeMask.hashCode; |
+ get hashCode => payload.hashCode * 17 + kind.hashCode; |
List<ConstantValue> getDependencies() => const <ConstantValue>[]; |
- accept(ConstantValueVisitor visitor, arg) => visitor.visitDummy(this, arg); |
+ accept(ConstantValueVisitor visitor, arg) { |
+ return visitor.visitSynthetic(this, arg); |
+ } |
DartType getType(CoreTypes types) => const DynamicType(); |
- String unparse() => 'dummy($typeMask)'; |
+ String unparse() => 'synthetic($kind, $payload)'; |
- String toStructuredString() => 'DummyConstant($typeMask)'; |
+ String toStructuredString() => 'SyntheticConstant($kind, $payload)'; |
} |
class ConstructedConstantValue extends ObjectConstantValue { |