Remove lazyEqualEqual()

It is not used de-facto, and I don't know that we have semantics for it.

Change-Id: I450b164a96b1a16b89b85811e84338110abbae99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286342
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
Konstantin Shcheglov 2023-03-02 17:09:54 +00:00 committed by Commit Queue
parent a8afc781b4
commit fbb6185449
2 changed files with 1 additions and 66 deletions

View file

@ -614,7 +614,7 @@ class ConstantVisitor extends UnifyingAstVisitor<DartObjectImpl> {
} else if (operatorType == TokenType.CARET) {
return _dartObjectComputer.eagerXor(node, leftResult, rightResult);
} else if (operatorType == TokenType.EQ_EQ) {
return _dartObjectComputer.lazyEqualEqual(node, leftResult, rightResult);
return _dartObjectComputer.equalEqual(node, leftResult, rightResult);
} else if (operatorType == TokenType.GT) {
return _dartObjectComputer.greaterThan(node, leftResult, rightResult);
} else if (operatorType == TokenType.GT_EQ) {
@ -1768,19 +1768,6 @@ class DartObjectComputer {
return null;
}
DartObjectImpl? lazyEqualEqual(Expression node, DartObjectImpl? leftOperand,
DartObjectImpl? rightOperand) {
if (leftOperand != null && rightOperand != null) {
try {
return leftOperand.lazyEqualEqual(
_typeSystem, _featureSet, rightOperand);
} on EvaluationException catch (exception) {
_errorReporter.reportErrorForNode(exception.errorCode, node);
}
}
return null;
}
DartObjectImpl? lazyOr(BinaryExpression node, DartObjectImpl? leftOperand,
DartObjectImpl? Function() rightOperandComputer) {
if (leftOperand != null) {

View file

@ -605,46 +605,6 @@ class DartObjectImpl implements DartObject {
);
}
/// Return the result of invoking the '==' operator on this object with the
/// [rightOperand].
///
/// Throws an [EvaluationException] if the operator is not appropriate for an
/// object of this kind.
DartObjectImpl lazyEqualEqual(
TypeSystemImpl typeSystem,
FeatureSet featureSet,
DartObjectImpl rightOperand,
) {
if (isNull || rightOperand.isNull) {
return DartObjectImpl(
typeSystem,
typeSystem.typeProvider.boolType,
isNull && rightOperand.isNull
? BoolState.TRUE_STATE
: BoolState.FALSE_STATE,
);
}
if (featureSet.isEnabled(Feature.patterns)) {
if (state is DoubleState || hasPrimitiveEquality(featureSet)) {
return DartObjectImpl(
typeSystem,
typeSystem.typeProvider.boolType,
state.equalEqual(typeSystem, rightOperand.state),
);
}
} else {
if (isBoolNumStringOrNull) {
return DartObjectImpl(
typeSystem,
typeSystem.typeProvider.boolType,
state.equalEqual(typeSystem, rightOperand.state),
);
}
}
throw EvaluationException(
CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING);
}
/// Return the result of invoking the '||' operator on this object with the
/// [rightOperand].
///
@ -1765,18 +1725,6 @@ abstract class InstanceState {
return rightOperand!.convertToBool();
}
/// Return the result of invoking the '==' operator on this object with the
/// [rightOperand].
///
/// Throws an [EvaluationException] if the operator is not appropriate for an
/// object of this kind.
BoolState lazyEqualEqual(
TypeSystemImpl typeSystem,
InstanceState rightOperand,
) {
return isIdentical(typeSystem, rightOperand);
}
/// Return the result of invoking the '||' operator on this object with the
/// [rightOperand].
///