Remove unused methods from TypeAnalyzerErrors.

Change-Id: If98171798dc5fc4563c0c63e3ec70f56fa323799
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270227
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
Konstantin Shcheglov 2022-11-17 02:21:48 +00:00 committed by Commit Queue
parent 9e922093da
commit 9b4be3b388
4 changed files with 1 additions and 138 deletions

View file

@ -1587,15 +1587,7 @@ abstract class TypeAnalyzerErrors<
required RecordPatternField<Node, Pattern> duplicate,
});
/// Called when [pattern] declares variable [duplicate] that has the same
/// [name] as the [original] variable.
void duplicateVariablePattern({
required String name,
required Variable original,
required Variable duplicate,
});
/// Called when both branches have variables with the [name], both these
/// Called when both branches have variables with the same name, but these
/// variables either don't have the same finality, or their `NORM` types
/// are not structurally equal.
void inconsistentJoinedPatternVariable({
@ -1603,42 +1595,6 @@ abstract class TypeAnalyzerErrors<
required Variable component,
});
/// Called if a single variable is bound using two different types within the
/// same pattern, or between two patterns in a set of case clauses that share
/// a body.
///
/// [pattern] is the variable pattern that was being processed at the time the
/// inconsistency was discovered, and [type] is its type (which might have
/// been inferred). [previousPattern] is the previous variable pattern that
/// was binding the same variable, and [previousType] is its type.
void inconsistentMatchVar(
{required Pattern pattern,
required Type type,
required Pattern previousPattern,
required Type previousType});
/// Called if a single variable is bound both with an explicit type and with
/// an implicit type within the same pattern, or between two patterns in a set
/// of case clauses that share a body.
///
/// [pattern] is the variable pattern that was being processed at the time the
/// inconsistency was discovered. [previousPattern] is the previous variable
/// pattern that was binding the same variable.
///
/// TODO(paulberry): the spec might be changed so that this is not an error
/// condition. See https://github.com/dart-lang/language/issues/2424.
void inconsistentMatchVarExplicitness(
{required Pattern pattern, required Node previousPattern});
/// Called when one of the branches has the [variable] with the [name], but
/// the other branch does not.
void logicalOrPatternBranchMissingVariable({
required Node node,
required bool hasInLeft,
required String name,
required Variable variable,
});
/// Called if the static type of a condition is not assignable to `bool`.
void nonBooleanCondition(Expression node);

View file

@ -2783,26 +2783,6 @@ class _MiniAstErrors
);
}
@override
void inconsistentMatchVar(
{required Node pattern,
required Type type,
required Node previousPattern,
required Type previousType}) {
_recordError(
'inconsistentMatchVar(pattern: ${pattern.errorId}, type: ${type.type}, '
'previousPattern: ${previousPattern.errorId}, '
'previousType: ${previousType.type})');
}
@override
void inconsistentMatchVarExplicitness(
{required Node pattern, required Node previousPattern}) {
_recordError(
'inconsistentMatchVarExplicitness(pattern: ${pattern.errorId}, '
'previousPattern: ${previousPattern.errorId})');
}
@override
void logicalOrPatternBranchMissingVariable({
required Node node,

View file

@ -91,15 +91,6 @@ class SharedTypeAnalyzerErrors
);
}
@override
void duplicateVariablePattern({
required String name,
required PromotableElement original,
required PromotableElement duplicate,
}) {
// TODO: implement duplicateVariablePattern
}
@override
void inconsistentJoinedPatternVariable({
required PromotableElement variable,
@ -109,35 +100,6 @@ class SharedTypeAnalyzerErrors
throw UnimplementedError();
}
@override
void inconsistentMatchVar(
{required AstNode pattern,
required DartType type,
required AstNode previousPattern,
required DartType previousType}) {
throw UnimplementedError('TODO(paulberry)');
}
@override
void inconsistentMatchVarExplicitness(
{required AstNode pattern, required AstNode previousPattern}) {
throw UnimplementedError('TODO(paulberry)');
}
@override
void logicalOrPatternBranchMissingVariable({
required covariant BinaryPatternImpl node,
required bool hasInLeft,
required String name,
required PromotableElement variable,
}) {
_errorReporter.reportErrorForNode(
CompileTimeErrorCode.MISSING_VARIABLE_PATTERN,
hasInLeft ? node.rightOperand : node.leftOperand,
[variable.name],
);
}
@override
void nonBooleanCondition(Expression node) {
throw UnimplementedError('TODO(paulberry)');

View file

@ -66,15 +66,6 @@ class SharedTypeAnalyzerErrors
throw new UnimplementedError('TODO(scheglov)');
}
@override
void duplicateVariablePattern({
required String name,
required VariableDeclaration original,
required VariableDeclaration duplicate,
}) {
// TODO(scheglov): implement duplicateVariablePattern
}
@override
void inconsistentJoinedPatternVariable({
required VariableDeclaration variable,
@ -84,32 +75,6 @@ class SharedTypeAnalyzerErrors
throw new UnimplementedError('TODO(scheglov)');
}
@override
void inconsistentMatchVar(
{required Node pattern,
required DartType type,
required Node previousPattern,
required DartType previousType}) {
throw new UnimplementedError('TODO(paulberry)');
}
@override
void inconsistentMatchVarExplicitness(
{required Node pattern, required Node previousPattern}) {
throw new UnimplementedError('TODO(paulberry)');
}
@override
void logicalOrPatternBranchMissingVariable({
required Node node,
required bool hasInLeft,
required String name,
required VariableDeclaration variable,
}) {
// TODO(scheglov): implement logicalOrPatternBranchMissingVariable
throw new UnimplementedError('TODO(scheglov)');
}
@override
void nonBooleanCondition(Expression node) {
throw new UnimplementedError('TODO(paulberry)');