Use single InstanceState.lazyEqualEqual()
R=brianwilkerson@google.com Change-Id: I74e36c5b1a98cff0429a1cb77452f53a59cee9e1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179120 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
committed by
commit-bot@chromium.org
parent
353b35cc4e
commit
b0db6d38c0
@@ -93,14 +93,6 @@ class BoolState extends InstanceState {
|
||||
return value == null ? UNKNOWN_VALUE : rightOperand.convertToBool();
|
||||
}
|
||||
|
||||
@override
|
||||
BoolState lazyEqualEqual(
|
||||
TypeSystemImpl typeSystem,
|
||||
InstanceState rightOperand,
|
||||
) {
|
||||
return isIdentical(typeSystem, rightOperand);
|
||||
}
|
||||
|
||||
@override
|
||||
BoolState lazyOr(InstanceState Function() rightOperandComputer) {
|
||||
if (value == true) {
|
||||
@@ -1088,14 +1080,6 @@ class DoubleState extends NumState {
|
||||
return BoolState.FALSE_STATE;
|
||||
}
|
||||
|
||||
@override
|
||||
BoolState lazyEqualEqual(
|
||||
TypeSystemImpl typeSystem,
|
||||
InstanceState rightOperand,
|
||||
) {
|
||||
return isIdentical(typeSystem, rightOperand);
|
||||
}
|
||||
|
||||
@override
|
||||
BoolState lessThan(InstanceState rightOperand) {
|
||||
assertNumOrNull(rightOperand);
|
||||
@@ -1274,14 +1258,6 @@ class FunctionState extends InstanceState {
|
||||
return BoolState.FALSE_STATE;
|
||||
}
|
||||
|
||||
@override
|
||||
BoolState lazyEqualEqual(
|
||||
TypeSystemImpl typeSystem,
|
||||
InstanceState rightOperand,
|
||||
) {
|
||||
return isIdentical(typeSystem, rightOperand);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() => _element == null ? "-unknown-" : _element.name;
|
||||
}
|
||||
@@ -1359,14 +1335,6 @@ class GenericState extends InstanceState {
|
||||
return BoolState.from(this == rightOperand);
|
||||
}
|
||||
|
||||
@override
|
||||
BoolState lazyEqualEqual(
|
||||
TypeSystemImpl typeSystem,
|
||||
InstanceState rightOperand,
|
||||
) {
|
||||
return isIdentical(typeSystem, rightOperand);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
StringBuffer buffer = StringBuffer();
|
||||
@@ -1610,7 +1578,9 @@ abstract class InstanceState {
|
||||
BoolState lazyEqualEqual(
|
||||
TypeSystemImpl typeSystem,
|
||||
InstanceState rightOperand,
|
||||
);
|
||||
) {
|
||||
return isIdentical(typeSystem, rightOperand);
|
||||
}
|
||||
|
||||
/// Return the result of invoking the '||' operator on this object with the
|
||||
/// [rightOperand].
|
||||
@@ -2023,14 +1993,6 @@ class IntState extends NumState {
|
||||
return BoolState.FALSE_STATE;
|
||||
}
|
||||
|
||||
@override
|
||||
BoolState lazyEqualEqual(
|
||||
TypeSystemImpl typeSystem,
|
||||
InstanceState rightOperand,
|
||||
) {
|
||||
return isIdentical(typeSystem, rightOperand);
|
||||
}
|
||||
|
||||
@override
|
||||
BoolState lessThan(InstanceState rightOperand) {
|
||||
assertNumOrNull(rightOperand);
|
||||
@@ -2290,14 +2252,6 @@ class ListState extends InstanceState {
|
||||
return BoolState.from(this == rightOperand);
|
||||
}
|
||||
|
||||
@override
|
||||
BoolState lazyEqualEqual(
|
||||
TypeSystemImpl typeSystem,
|
||||
InstanceState rightOperand,
|
||||
) {
|
||||
return isIdentical(typeSystem, rightOperand);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
StringBuffer buffer = StringBuffer();
|
||||
@@ -2373,14 +2327,6 @@ class MapState extends InstanceState {
|
||||
return BoolState.from(this == rightOperand);
|
||||
}
|
||||
|
||||
@override
|
||||
BoolState lazyEqualEqual(
|
||||
TypeSystemImpl typeSystem,
|
||||
InstanceState rightOperand,
|
||||
) {
|
||||
return isIdentical(typeSystem, rightOperand);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
StringBuffer buffer = StringBuffer();
|
||||
@@ -2440,14 +2386,6 @@ class NullState extends InstanceState {
|
||||
return BoolState.from(rightOperand is NullState);
|
||||
}
|
||||
|
||||
@override
|
||||
BoolState lazyEqualEqual(
|
||||
TypeSystemImpl typeSystem,
|
||||
InstanceState rightOperand,
|
||||
) {
|
||||
return isIdentical(typeSystem, rightOperand);
|
||||
}
|
||||
|
||||
@override
|
||||
BoolState logicalNot() {
|
||||
throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
|
||||
@@ -2525,14 +2463,6 @@ class SetState extends InstanceState {
|
||||
return BoolState.from(this == rightOperand);
|
||||
}
|
||||
|
||||
@override
|
||||
BoolState lazyEqualEqual(
|
||||
TypeSystemImpl typeSystem,
|
||||
InstanceState rightOperand,
|
||||
) {
|
||||
return isIdentical(typeSystem, rightOperand);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
StringBuffer buffer = StringBuffer();
|
||||
@@ -2617,14 +2547,6 @@ class StringState extends InstanceState {
|
||||
return BoolState.FALSE_STATE;
|
||||
}
|
||||
|
||||
@override
|
||||
BoolState lazyEqualEqual(
|
||||
TypeSystemImpl typeSystem,
|
||||
InstanceState rightOperand,
|
||||
) {
|
||||
return isIdentical(typeSystem, rightOperand);
|
||||
}
|
||||
|
||||
@override
|
||||
IntState stringLength() {
|
||||
if (value == null) {
|
||||
@@ -2684,14 +2606,6 @@ class SymbolState extends InstanceState {
|
||||
return BoolState.FALSE_STATE;
|
||||
}
|
||||
|
||||
@override
|
||||
BoolState lazyEqualEqual(
|
||||
TypeSystemImpl typeSystem,
|
||||
InstanceState rightOperand,
|
||||
) {
|
||||
return isIdentical(typeSystem, rightOperand);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() => value == null ? "-unknown-" : "#$value";
|
||||
}
|
||||
@@ -2746,14 +2660,6 @@ class TypeState extends InstanceState {
|
||||
return BoolState.FALSE_STATE;
|
||||
}
|
||||
|
||||
@override
|
||||
BoolState lazyEqualEqual(
|
||||
TypeSystemImpl typeSystem,
|
||||
InstanceState rightOperand,
|
||||
) {
|
||||
return isIdentical(typeSystem, rightOperand);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return _type?.getDisplayString(withNullability: true) ?? '-unknown-';
|
||||
|
||||
Reference in New Issue
Block a user