Skip to content

Commit 8db070e

Browse files
stereotype441Commit Queue
authored andcommitted
[messages] Make some internal classes abstract.
Makes the classes `DiagnosticCodeImpl` and `LintCodeWithExpectedTypes` abstract. These classes are never concretely instantiated (only derived classes are), and they are private to the analyzer and linter so they should not be concretely instantiated by clients either. Making these classes abstract makes the class hierarchy for diagnostics easier to reason about. Change-Id: I6a6a696489d5a33dabcba48988a8473f0e819a85 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/460860 Commit-Queue: Paul Berry <paulberry@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
1 parent 1aba73d commit 8db070e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/_fe_analyzer_shared/lib/src/base/errors.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ abstract class DiagnosticCode {
317317
String toString() => uniqueName;
318318
}
319319

320-
class DiagnosticCodeImpl extends DiagnosticCode {
320+
abstract class DiagnosticCodeImpl extends DiagnosticCode {
321321
@override
322322
final DiagnosticType type;
323323

pkg/analyzer/lib/src/dart/error/lint_codes.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class LintCode extends DiagnosticCode {
5555

5656
/// Private subtype of [LintCode] that supports runtime checking of parameter
5757
/// types.
58-
class LintCodeWithExpectedTypes extends DiagnosticCodeWithExpectedTypes
58+
abstract class LintCodeWithExpectedTypes extends DiagnosticCodeWithExpectedTypes
5959
implements LintCode {
6060
const LintCodeWithExpectedTypes({
6161
required super.name,

0 commit comments

Comments
 (0)