StaticTypeWarningCode class

The error codes used for static type warnings. The convention for this class is for the name of the error code to indicate the problem that caused the error to be generated and for the error message to explain what is wrong and, when appropriate, how the problem can be corrected.

Inheritance
Implementers

Constructors

StaticTypeWarningCode(String name, String message, {String correction, bool hasPublishedDocs, bool isUnresolvedIdentifier: false})
Initialize a newly created error code to have the given name. The message associated with the error will be created from the given message template. The correction associated with the error will be created from the given correction template.
const

Properties

errorSeverity ErrorSeverity
The severity of the error.
read-only, override
type ErrorType
The type of the error.
read-only, override
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

EXPECTED_ONE_LIST_TYPE_ARGUMENTS → const StaticTypeWarningCode
12.7 Lists: A fresh instance (7.6.1) a, of size n, whose class implements the built-in class List<E> is allocated. [...]
StaticTypeWarningCode('EXPECTED_ONE_LIST_TYPE_ARGUMENTS', 'List literals require exactly one type argument or none, ' 'but {0} found.', correction: 'Try adjusting the numbe…
EXPECTED_ONE_SET_TYPE_ARGUMENTS → const StaticTypeWarningCode
Parameters: 0: the number of provided type arguments
StaticTypeWarningCode('EXPECTED_ONE_SET_TYPE_ARGUMENTS', 'Set literals require exactly one type argument or none, ' 'but {0} found.', correction: 'Try adjusting the number …
EXPECTED_TWO_MAP_TYPE_ARGUMENTS → const StaticTypeWarningCode
12.8 Maps: A fresh instance (7.6.1) m, of size n, whose class implements the built-in class Map<K, V> is allocated. [...]
StaticTypeWarningCode('EXPECTED_TWO_MAP_TYPE_ARGUMENTS', 'Map literals require exactly two type arguments or none, ' 'but {0} found.', correction: 'Try adjusting the number…
FOR_IN_OF_INVALID_ELEMENT_TYPE → const StaticTypeWarningCode
17.6.2 For-in. It the iterable expression does not implement Iterable with a type argument that can be assigned to the for-in variable's type, this warning is reported. [...]
StaticTypeWarningCode('FOR_IN_OF_INVALID_ELEMENT_TYPE', 'The type '{0}' used in the 'for' loop must implement {1} with a ' 'type argument that can be assigned to &#…
FOR_IN_OF_INVALID_TYPE → const StaticTypeWarningCode
Parameters: 0: The type of the iterable expression. 1: The sequence type -- Iterable for for or Stream for await for.
StaticTypeWarningCode('FOR_IN_OF_INVALID_TYPE', 'The type '{0}' used in the 'for' loop must implement {1}.')
ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE → const StaticTypeWarningCode
9 Functions: It is a static warning if the declared return type of a function marked async* may not be assigned to Stream.
StaticTypeWarningCode('ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE', 'Functions marked 'async*' must have a return type assignable to ' ''Stream'.', correction: 'Tr…
ILLEGAL_ASYNC_RETURN_TYPE → const StaticTypeWarningCode
9 Functions: It is a static warning if the declared return type of a function marked async may not be assigned to Future.
StaticTypeWarningCode('ILLEGAL_ASYNC_RETURN_TYPE', 'Functions marked 'async' must have a return type assignable to ' ''Future'.', correction: 'Try fixing th…
ILLEGAL_SYNC_GENERATOR_RETURN_TYPE → const StaticTypeWarningCode
9 Functions: It is a static warning if the declared return type of a function marked sync* may not be assigned to Iterable.
StaticTypeWarningCode('ILLEGAL_SYNC_GENERATOR_RETURN_TYPE', 'Functions marked 'sync*' must have a return type assignable to ' ''Iterable'.', correction: 'Tr…
INSTANCE_ACCESS_TO_STATIC_MEMBER → const StaticTypeWarningCode
12.15.1 Ordinary Invocation: It is a static type warning if T does not have an accessible (3.2) instance member named m. [...]
StaticTypeWarningCode('INSTANCE_ACCESS_TO_STATIC_MEMBER', 'Static {1} '{0}' can't be accessed through an instance.', correction: 'Try using the class '{2}' to a…
INVALID_ASSIGNMENT → const StaticTypeWarningCode
Parameters: 0: the name of the right hand side type 1: the name of the left hand side type
StaticTypeWarningCode('INVALID_ASSIGNMENT', 'A value of type '{0}' can't be assigned to a variable of type ' ''{1}'.', correction: 'Try changing the typ…
INVOCATION_OF_NON_FUNCTION → const StaticTypeWarningCode
Parameters: 0: the name of the identifier that is not a function type
StaticTypeWarningCode('INVOCATION_OF_NON_FUNCTION', ''{0}' isn't a function.', correction: 'Try correcting the name to match an existing function, or ' 'define …
INVOCATION_OF_NON_FUNCTION_EXPRESSION → const StaticTypeWarningCode
No parameters.
StaticTypeWarningCode('INVOCATION_OF_NON_FUNCTION_EXPRESSION', 'The expression doesn't evaluate to a function, so it can't be ' 'invoked.')
NON_BOOL_CONDITION → const StaticTypeWarningCode
No parameters.
StaticTypeWarningCode('NON_BOOL_CONDITION', 'Conditions must have a static type of 'bool'.', correction: 'Try changing the condition.', hasPublishedDocs: true)
NON_BOOL_EXPRESSION → const StaticTypeWarningCode
No parameters.
StaticTypeWarningCode('NON_BOOL_EXPRESSION', 'The expression in an assert must be of type 'bool'.', correction: 'Try changing the expression.')
NON_BOOL_NEGATION_EXPRESSION → const StaticTypeWarningCode
No parameters.
StaticTypeWarningCode('NON_BOOL_NEGATION_EXPRESSION', 'A negation operand must have a static type of 'bool'.', correction: 'Try changing the operand to the '!' oper…
NON_BOOL_OPERAND → const StaticTypeWarningCode
Parameters: 0: the lexeme of the logical operator
StaticTypeWarningCode('NON_BOOL_OPERAND', 'The operands of the operator '{0}' must be assignable to 'bool'.')
NON_TYPE_AS_TYPE_ARGUMENT → const StaticTypeWarningCode
Parameters: 0: the name appearing where a type is expected
StaticTypeWarningCode('NON_TYPE_AS_TYPE_ARGUMENT', 'The name '{0}' isn't a type so it can't be used as a type argument.', correction: 'Try correcting the name to an…
RETURN_OF_INVALID_TYPE → const StaticTypeWarningCode
Parameters: 0: the return type as declared in the return statement 1: the expected return type as defined by the method 2: the name of the method
@Deprecated('Use either RETURN_OF_INVALID_TYPE_FROM_FUNCTION or ' 'RETURN_OF_INVALID_TYPE_FROM_METHOD')
StaticTypeWarningCode('RETURN_OF_INVALID_TYPE', 'The return type '{0}' isn't a '{1}', as defined by the method ' ''{2}'.', hasPublishedDocs: true)
RETURN_OF_INVALID_TYPE_FROM_CLOSURE → const StaticTypeWarningCode
Parameters: 0: the return type as declared in the return statement 1: the expected return type as defined by the method
StaticTypeWarningCode('RETURN_OF_INVALID_TYPE_FROM_CLOSURE', 'The return type '{0}' isn't a '{1}', as required by the closure's ' 'context.')
RETURN_OF_INVALID_TYPE_FROM_FUNCTION → const StaticTypeWarningCode
Parameters: 0: the return type as declared in the return statement 1: the expected return type as defined by the method 2: the name of the method
StaticTypeWarningCodeWithUniqueName('RETURN_OF_INVALID_TYPE', 'StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION', 'A value of type '{0}' can't be returned fro…
RETURN_OF_INVALID_TYPE_FROM_METHOD → const StaticTypeWarningCode
Parameters: 0: the return type as declared in the return statement 1: the expected return type as defined by the method 2: the name of the method
StaticTypeWarningCodeWithUniqueName('RETURN_OF_INVALID_TYPE', 'StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_METHOD', 'A value of type '{0}' can't be returned from …
TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND → const StaticTypeWarningCode
10 Generics: It is a static type warning if a type parameter is a supertype of its upper bound. [...]
StaticTypeWarningCode('TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND', ''{0}' can't be a supertype of its upper bound.', correction: 'Try using a type that is or is a subclass …
UNDEFINED_ENUM_CONSTANT → const StaticTypeWarningCode
12.17 Getter Invocation: It is a static warning if there is no class C in the enclosing lexical scope of i, or if C does not declare, implicitly or explicitly, a getter named m. [...]
StaticTypeWarningCode('UNDEFINED_ENUM_CONSTANT', 'There is no constant named '{0}' in '{1}'.', correction: 'Try correcting the name to the name of an existing const…
UNDEFINED_FUNCTION → const StaticTypeWarningCode
Parameters: 0: the name of the method that is undefined
StaticTypeWarningCode('UNDEFINED_FUNCTION', 'The function '{0}' isn't defined.', correction: 'Try importing the library that defines '{0}', ' 'correctin…
UNDEFINED_GETTER → const StaticTypeWarningCode
Parameters: 0: the name of the getter 1: the name of the enclosing type where the getter is being looked for
StaticTypeWarningCode('UNDEFINED_GETTER', 'The getter '{0}' isn't defined for the class '{1}'.', correction: 'Try importing the library that defines '{0}…
UNDEFINED_METHOD → const StaticTypeWarningCode
Parameters: 0: the name of the method that is undefined 1: the resolved type name that the method lookup is happening on
StaticTypeWarningCode('UNDEFINED_METHOD', 'The method '{0}' isn't defined for the class '{1}'.', correction: 'Try correcting the name to the name of an existing…
UNDEFINED_OPERATOR → const StaticTypeWarningCode
Parameters: 0: the name of the operator 1: the name of the enclosing type where the operator is being looked for
StaticTypeWarningCode('UNDEFINED_OPERATOR', 'The operator '{0}' isn't defined for the class '{1}'.', correction: 'Try defining the operator '{0}'.',…
UNDEFINED_PREFIXED_NAME → const StaticTypeWarningCode
No parameters.
StaticTypeWarningCode('UNDEFINED_PREFIXED_NAME', 'The name '{0}' is being referenced through the prefix '{1}', but it ' 'isn't defined in any of the libraries i…
UNDEFINED_SETTER → const StaticTypeWarningCode
Parameters: 0: the name of the setter 1: the name of the enclosing type where the setter is being looked for
StaticTypeWarningCode('UNDEFINED_SETTER', 'The setter '{0}' isn't defined for the class '{1}'.', correction: 'Try importing the library that defines '{0}…
UNDEFINED_SUPER_GETTER → const StaticTypeWarningCode
12.17 Getter Invocation: Let T be the static type of e. It is a static type warning if T does not have a getter named m. [...]
StaticTypeWarningCode('UNDEFINED_SUPER_GETTER', 'The getter '{0}' isn't defined in a superclass of '{1}'.', correction: 'Try correcting the name to the name of …
UNDEFINED_SUPER_METHOD → const StaticTypeWarningCode
Parameters: 0: the name of the method that is undefined 1: the resolved type name that the method lookup is happening on
StaticTypeWarningCode('UNDEFINED_SUPER_METHOD', 'The method '{0}' isn't defined in a superclass of '{1}'.', correction: 'Try correcting the name to the name of …
UNDEFINED_SUPER_OPERATOR → const StaticTypeWarningCode
12.18 Assignment: Evaluation of an assignment of the form e1<i>e<sub>2</sub></i> = e3 is equivalent to the evaluation of the expression (a, i, e){a.[]=(i, e); return e;} (e1, e2, e2). [...]
StaticTypeWarningCode('UNDEFINED_SUPER_OPERATOR', 'The operator '{0}' isn't defined in a superclass of '{1}'.', correction: 'Try defining the operator '{0}&…
UNDEFINED_SUPER_SETTER → const StaticTypeWarningCode
12.18 Assignment: Let T be the static type of e1. It is a static type warning if T does not have an accessible instance setter named v=. [...]
StaticTypeWarningCode('UNDEFINED_SUPER_SETTER', 'The setter '{0}' isn't defined in a superclass of '{1}'.', correction: 'Try correcting the name to the name of …
UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER → const StaticTypeWarningCode
12.15.1 Ordinary Invocation: It is a static type warning if T does not have an accessible (3.2) instance member named m. [...]
StaticTypeWarningCode('UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER', 'Static members from supertypes must be qualified by the name of the ' 'defining type.', correction: &…
WRONG_NUMBER_OF_TYPE_ARGUMENTS → const StaticTypeWarningCode
Parameters: 0: the name of the type being referenced (G) 1: the number of type parameters that were declared 2: the number of type arguments provided
StaticTypeWarningCode('WRONG_NUMBER_OF_TYPE_ARGUMENTS', 'The type '{0}' is declared with {1} type parameters, ' 'but {2} type arguments were given.', correction: 'T…
WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR → const StaticTypeWarningCode
It will be a static type warning if m is not a generic method with exactly n type parameters. [...]
StaticTypeWarningCode('WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR', 'The constructor '{0}.{1}' doesn't have type parameters.', correction: 'Try moving type arguments to…
WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD → const StaticTypeWarningCode
It will be a static type warning if m is not a generic method with exactly n type parameters. [...]
StaticTypeWarningCode('WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD', 'The method '{0}' is declared with {1} type parameters, ' 'but {2} type arguments were given.', correctio…
YIELD_OF_INVALID_TYPE → const StaticTypeWarningCode
17.16.1 Yield: Let T be the static type of e the expression to the right of "yield" and let f be the immediately enclosing function. It is a static type warning if either: [...]
StaticTypeWarningCode('YIELD_OF_INVALID_TYPE', 'The type '{0}' implied by the 'yield' expression must be assignable ' 'to '{1}'.')