StrongModeCode class

This class has Strong Mode specific error codes.

"Strong Mode" was the prototype for Dart 2's sound type system. Many of these errors became part of Dart 2. Some of them are optional flags, used for stricter checking.

These error codes tend to use the same message across different severity levels, so they are grouped for clarity.

Inheritance

Constructors

StrongModeCode(ErrorType type, String name, { String message, { String correction, bool hasPublishedDocs })
Initialize a newly created error code to have the given type and name. [...]
const

Properties

errorSeverity ErrorSeverity
The severity of the error.
read-only, override
type ErrorType
The type of the error.
final
correction → String
The template used to create the correction to be displayed for this error, or null if there is no correction information for this error. The correction should indicate how the user can fix the error.
final, inherited
hashCode → int
The hash code for this object.
read-only, inherited
hasPublishedDocs → bool
Return true if diagnostics with this code have documentation for them that has been published.
final, inherited
isUnresolvedIdentifier → bool
Whether this error is caused by an unresolved identifier.
final, inherited
message → String
The template used to create the message to be displayed for this error. The message should indicate what is wrong and why it is wrong.
final, inherited
name → String
The name of the error code.
final, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited
uniqueName → String
The unique name of this error code.
read-only, inherited
url → String
Return a URL that can be used to access documentation for diagnostics with this code, or null if there is no published documentation.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited

Constants

ASSIGNMENT_CAST → const StrongModeCode
const StrongModeCode(ErrorType.HINT, 'ASSIGNMENT_CAST', _implicitCastMessage, correction: _implicitCastCorrection)
COULD_NOT_INFER → const StrongModeCode
const StrongModeCode(ErrorType.COMPILE_TIME_ERROR, 'COULD_NOT_INFER', 'Couldn't infer type parameter '{0}'.{1}')
DOWN_CAST_COMPOSITE → const StrongModeCode
const StrongModeCode(ErrorType.HINT, 'DOWN_CAST_COMPOSITE', _implicitCastMessage, correction: _implicitCastCorrection)
DOWN_CAST_IMPLICIT → const StrongModeCode
const StrongModeCode(ErrorType.HINT, 'DOWN_CAST_IMPLICIT', _implicitCastMessage, correction: _implicitCastCorrection)
DOWN_CAST_IMPLICIT_ASSIGN → const StrongModeCode
const StrongModeCode(ErrorType.HINT, 'DOWN_CAST_IMPLICIT_ASSIGN', _implicitCastMessage, correction: _implicitCastCorrection)
DYNAMIC_CAST → const StrongModeCode
const StrongModeCode(ErrorType.HINT, 'DYNAMIC_CAST', _implicitCastMessage, correction: _implicitCastCorrection)
DYNAMIC_INVOKE → const StrongModeCode
const StrongModeCode(ErrorType.HINT, 'DYNAMIC_INVOKE', ''{0}' requires a dynamic invoke.')
IMPLICIT_DYNAMIC_FIELD → const StrongModeCode
const StrongModeCode(ErrorType.COMPILE_TIME_ERROR, 'IMPLICIT_DYNAMIC_FIELD', 'Missing field type for '{0}'.', correction: _implicitDynamicCorrection)
IMPLICIT_DYNAMIC_FUNCTION → const StrongModeCode
const StrongModeCode(ErrorType.COMPILE_TIME_ERROR, 'IMPLICIT_DYNAMIC_FUNCTION', 'Missing type arguments for generic function '{0}<{1}>'.', correction: _implicitDynamicCor…
IMPLICIT_DYNAMIC_INVOKE → const StrongModeCode
const StrongModeCode(ErrorType.COMPILE_TIME_ERROR, 'IMPLICIT_DYNAMIC_INVOKE', 'Missing type arguments for calling generic function type '{0}'.', correction: _implicitDynamicCor…
IMPLICIT_DYNAMIC_LIST_LITERAL → const StrongModeCode
const StrongModeCode(ErrorType.COMPILE_TIME_ERROR, 'IMPLICIT_DYNAMIC_LIST_LITERAL', 'Missing type argument for list literal.', correction: _implicitDynamicCorrection)
IMPLICIT_DYNAMIC_MAP_LITERAL → const StrongModeCode
const StrongModeCode(ErrorType.COMPILE_TIME_ERROR, 'IMPLICIT_DYNAMIC_MAP_LITERAL', 'Missing type arguments for map literal.', correction: _implicitDynamicCorrection)
IMPLICIT_DYNAMIC_METHOD → const StrongModeCode
const StrongModeCode(ErrorType.COMPILE_TIME_ERROR, 'IMPLICIT_DYNAMIC_METHOD', 'Missing type arguments for generic method '{0}<{1}>'.', correction: _implicitDynamicCorrect…
IMPLICIT_DYNAMIC_PARAMETER → const StrongModeCode
const StrongModeCode(ErrorType.COMPILE_TIME_ERROR, 'IMPLICIT_DYNAMIC_PARAMETER', 'Missing parameter type for '{0}'.', correction: _implicitDynamicCorrection)
IMPLICIT_DYNAMIC_RETURN → const StrongModeCode
const StrongModeCode(ErrorType.COMPILE_TIME_ERROR, 'IMPLICIT_DYNAMIC_RETURN', 'Missing return type for '{0}'.', correction: _implicitDynamicCorrection)
IMPLICIT_DYNAMIC_TYPE → const StrongModeCode
const StrongModeCode(ErrorType.COMPILE_TIME_ERROR, 'IMPLICIT_DYNAMIC_TYPE', 'Missing type arguments for generic type '{0}'.', correction: _implicitDynamicCorrection)
IMPLICIT_DYNAMIC_VARIABLE → const StrongModeCode
const StrongModeCode(ErrorType.COMPILE_TIME_ERROR, 'IMPLICIT_DYNAMIC_VARIABLE', 'Missing variable type for '{0}'.', correction: _implicitDynamicCorrection)
INFERRED_TYPE → const StrongModeCode
const StrongModeCode(ErrorType.HINT, 'INFERRED_TYPE', _inferredTypeMessage)
INFERRED_TYPE_ALLOCATION → const StrongModeCode
const StrongModeCode(ErrorType.HINT, 'INFERRED_TYPE_ALLOCATION', _inferredTypeMessage)
INFERRED_TYPE_CLOSURE → const StrongModeCode
const StrongModeCode(ErrorType.HINT, 'INFERRED_TYPE_CLOSURE', _inferredTypeMessage)
INFERRED_TYPE_LITERAL → const StrongModeCode
const StrongModeCode(ErrorType.HINT, 'INFERRED_TYPE_LITERAL', _inferredTypeMessage)
INVALID_CAST_FUNCTION → const StrongModeCode
const StrongModeCode(ErrorType.COMPILE_TIME_ERROR, 'INVALID_CAST_FUNCTION', 'The function '{0}' has type '{1}' that isn't of expected type ' ''{2}'. Thi…
INVALID_CAST_FUNCTION_EXPR → const StrongModeCode
const StrongModeCode(ErrorType.COMPILE_TIME_ERROR, 'INVALID_CAST_FUNCTION_EXPR', 'The function expression type '{0}' isn't of type '{1}'. ' 'This means its para…
INVALID_CAST_LITERAL → const StrongModeCode
const StrongModeCode(ErrorType.COMPILE_TIME_ERROR, 'INVALID_CAST_LITERAL', 'The literal '{0}' with type '{1}' isn't of expected type '{2}'.')
INVALID_CAST_LITERAL_LIST → const StrongModeCode
const StrongModeCode(ErrorType.COMPILE_TIME_ERROR, 'INVALID_CAST_LITERAL_LIST', 'The list literal type '{0}' isn't of expected type '{1}'. The list's ' 'typ…
INVALID_CAST_LITERAL_MAP → const StrongModeCode
const StrongModeCode(ErrorType.COMPILE_TIME_ERROR, 'INVALID_CAST_LITERAL_MAP', 'The map literal type '{0}' isn't of expected type '{1}'. The maps's ' 'type …
INVALID_CAST_LITERAL_SET → const StrongModeCode
const StrongModeCode(ErrorType.COMPILE_TIME_ERROR, 'INVALID_CAST_LITERAL_SET', 'The set literal type '{0}' isn't of expected type '{1}'. The set's ' 'type c…
INVALID_CAST_METHOD → const StrongModeCode
const StrongModeCode(ErrorType.COMPILE_TIME_ERROR, 'INVALID_CAST_METHOD', 'The method tear-off '{0}' has type '{1}' that isn't of expected type ' ''{2}'…
INVALID_CAST_NEW_EXPR → const StrongModeCode
const StrongModeCode(ErrorType.COMPILE_TIME_ERROR, 'INVALID_CAST_NEW_EXPR', 'The constructor returns type '{0}' that isn't of expected type '{1}'.')
INVALID_PARAMETER_DECLARATION → const StrongModeCode
const StrongModeCode(ErrorType.COMPILE_TIME_ERROR, 'INVALID_PARAMETER_DECLARATION', 'Type check failed: '{0}' isn't of type '{1}'.')
INVALID_SUPER_INVOCATION → const StrongModeCode
const StrongModeCode(ErrorType.COMPILE_TIME_ERROR, 'INVALID_SUPER_INVOCATION', 'The super call must be last in an initializer ' 'list (see https://goo.gl/EY6hDP): '…
NON_GROUND_TYPE_CHECK_INFO → const StrongModeCode
const StrongModeCode(ErrorType.HINT, 'NON_GROUND_TYPE_CHECK_INFO', 'Runtime check on non-ground type '{0}' may throw StrongModeError.')
NOT_INSTANTIATED_BOUND → const StrongModeCode
const StrongModeCode(ErrorType.COMPILE_TIME_ERROR, 'NOT_INSTANTIATED_BOUND', 'Type parameter bound types must be instantiated.', correction: 'Try adding type arguments.')
TOP_LEVEL_CYCLE → const StrongModeCode
const StrongModeCode(ErrorType.COMPILE_TIME_ERROR, 'TOP_LEVEL_CYCLE', 'The type of '{0}' can't be inferred because it depends on itself ' 'through the cycle: {1}.',…
TOP_LEVEL_FUNCTION_LITERAL_BLOCK → const StrongModeCode
const StrongModeCode(ErrorType.HINT, 'TOP_LEVEL_FUNCTION_LITERAL_BLOCK', 'The type of the function literal can't be inferred because the ' 'literal has a block as its body.'…
TOP_LEVEL_IDENTIFIER_NO_TYPE → const StrongModeCode
const StrongModeCode(ErrorType.HINT, 'TOP_LEVEL_IDENTIFIER_NO_TYPE', 'The type of '{0}' can't be inferred because the type of '{1}' ' 'couldn't be inferred.…
TOP_LEVEL_INSTANCE_GETTER → const StrongModeCode
const StrongModeCode(ErrorType.STATIC_WARNING, 'TOP_LEVEL_INSTANCE_GETTER', 'The type of '{0}' can't be inferred because it refers to an instance ' 'getter, '{1}…
TOP_LEVEL_INSTANCE_METHOD → const StrongModeCode
const StrongModeCode(ErrorType.STATIC_WARNING, 'TOP_LEVEL_INSTANCE_METHOD', 'The type of '{0}' can't be inferred because it refers to an instance ' 'method, '{1}…