Index: pkg/compiler/lib/src/constants/expressions.dart |
diff --git a/pkg/compiler/lib/src/constants/expressions.dart b/pkg/compiler/lib/src/constants/expressions.dart |
index 17f333ac785d6f95de149677e97d265053ccd50e..66b175e6c28fe7c2cbc058e6c1b0488f85d8fe1f 100644 |
--- a/pkg/compiler/lib/src/constants/expressions.dart |
+++ b/pkg/compiler/lib/src/constants/expressions.dart |
@@ -29,6 +29,7 @@ enum ConstantExpressionKind { |
CONSTRUCTED, |
DEFERRED, |
DOUBLE, |
+ DUMMY, |
ERRONEOUS, |
FUNCTION, |
IDENTICAL, |
@@ -334,6 +335,35 @@ class ErroneousConstantExpression extends ConstantExpression { |
bool _equals(ErroneousConstantExpression other) => true; |
} |
+// TODO(johnniwinther): Avoid the need for this class. |
+class SyntheticConstantExpression extends ConstantExpression { |
+ final SyntheticConstantValue value; |
+ |
+ SyntheticConstantExpression(this.value); |
+ |
+ @override |
+ ConstantValue evaluate(Environment environment, |
+ ConstantSystem constantSystem) { |
+ return value; |
+ } |
+ |
+ @override |
+ int _computeHashCode() => 13 * value.hashCode; |
+ |
+ accept(ConstantExpressionVisitor visitor, [context]) { |
+ throw "unsupported"; |
+ } |
+ |
+ @override |
+ bool _equals(SyntheticConstantExpression other) { |
+ return value == other.value; |
+ } |
+ |
+ ConstantExpressionKind get kind => ConstantExpressionKind.DUMMY; |
+} |
+ |
+ |
+ |
/// A boolean, int, double, string, or null constant. |
abstract class PrimitiveConstantExpression extends ConstantExpression { |
/// The primitive value of this contant expression. |