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 2deb866175d19f5a9d5adf3fd87a243db8db4a12..922ae068073ade58b01a79f842cda00232558377 100644 |
--- a/pkg/compiler/lib/src/constants/expressions.dart |
+++ b/pkg/compiler/lib/src/constants/expressions.dart |
@@ -870,9 +870,18 @@ class BinaryConstantExpression extends ConstantExpression { |
@override |
ConstantValue evaluate( |
Environment environment, ConstantSystem constantSystem) { |
- return constantSystem.lookupBinary(operator).fold( |
- left.evaluate(environment, constantSystem), |
- right.evaluate(environment, constantSystem)); |
+ ConstantValue leftValue = left.evaluate(environment, constantSystem); |
+ ConstantValue rightValue = right.evaluate(environment, constantSystem); |
+ switch (operator.kind) { |
+ case BinaryOperatorKind.NOT_EQ: |
+ BoolConstantValue equals = |
+ constantSystem.equal.fold(leftValue, rightValue); |
+ return equals.negate(); |
+ default: |
+ return constantSystem |
+ .lookupBinary(operator) |
+ .fold(leftValue, rightValue); |
+ } |
} |
ConstantExpression apply(NormalizedArguments arguments) { |