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 <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
diff --git a/pkg/analyzer/lib/src/dart/error/ffi_code.dart b/pkg/analyzer/lib/src/dart/error/ffi_code.dart
index d8600d8..d011515 100644
--- a/pkg/analyzer/lib/src/dart/error/ffi_code.dart
+++ b/pkg/analyzer/lib/src/dart/error/ffi_code.dart
@@ -383,9 +383,6 @@
     uniqueName: 'SUBTYPE_OF_STRUCT_CLASS_IN_WITH',
   );
 
-  @override
-  final ErrorType type;
-
   /// Initialize a newly created error code to have the given [name]. If
   /// [uniqueName] is provided, then it will be used to construct the unique
   /// name for the code, otherwise the name will be used to construct the unique
@@ -401,10 +398,8 @@
     bool hasPublishedDocs = false,
     required String message,
     required String name,
-    ErrorType type = ErrorType.COMPILE_TIME_ERROR,
     String? uniqueName,
-  })  : type = type,
-        super(
+  }) : super(
           correction: correction,
           hasPublishedDocs: hasPublishedDocs,
           message: message,
@@ -414,4 +409,7 @@
 
   @override
   ErrorSeverity get errorSeverity => type.severity;
+
+  @override
+  ErrorType get type => ErrorType.COMPILE_TIME_ERROR;
 }