Skip to content

Commit 24c20d4

Browse files
stereotype441commit-bot@chromium.org
authored andcommitted
Lock down FfiCode.type to ErrorType.COMPILE_TIME_ERROR.
Previously, the FfiCode constructor allowed the error type to be overridden, but no use of that constructor actually took advantage of it. Hardcoding the type of all FFI error codes makes the implementation of error codes more uniform, which helps pave the way for code generation. If in the future, we decide that we actually need some FFI error codes to have different error types than others, we can always add the functionality back in. Change-Id: I5061281089aeba0185fd8ebaa08a82482e91f2ca Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214070 Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Paul Berry <[email protected]>
1 parent 684e8cf commit 24c20d4

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,6 @@ class FfiCode extends AnalyzerErrorCode {
383383
uniqueName: 'SUBTYPE_OF_STRUCT_CLASS_IN_WITH',
384384
);
385385

386-
@override
387-
final ErrorType type;
388-
389386
/// Initialize a newly created error code to have the given [name]. If
390387
/// [uniqueName] is provided, then it will be used to construct the unique
391388
/// name for the code, otherwise the name will be used to construct the unique
@@ -401,10 +398,8 @@ class FfiCode extends AnalyzerErrorCode {
401398
bool hasPublishedDocs = false,
402399
required String message,
403400
required String name,
404-
ErrorType type = ErrorType.COMPILE_TIME_ERROR,
405401
String? uniqueName,
406-
}) : type = type,
407-
super(
402+
}) : super(
408403
correction: correction,
409404
hasPublishedDocs: hasPublishedDocs,
410405
message: message,
@@ -414,4 +409,7 @@ class FfiCode extends AnalyzerErrorCode {
414409

415410
@override
416411
ErrorSeverity get errorSeverity => type.severity;
412+
413+
@override
414+
ErrorType get type => ErrorType.COMPILE_TIME_ERROR;
417415
}

0 commit comments

Comments
 (0)