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

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. [...]
const StaticTypeWarningCode('EXPECTED_ONE_LIST_TYPE_ARGUMENTS', 'List literals require exactly one type argument or none, ' 'but {0} found.', correction: 'Try adjusting the…
EXPECTED_ONE_SET_TYPE_ARGUMENTS → const StaticTypeWarningCode
Parameters: 0: the number of provided type arguments
const StaticTypeWarningCode('EXPECTED_ONE_SET_TYPE_ARGUMENTS', 'Set literals require exactly one type argument or none, ' 'but {0} found.', correction: 'Try adjusting the n…
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. [...]
const StaticTypeWarningCode('EXPECTED_TWO_MAP_TYPE_ARGUMENTS', 'Map literals require exactly two type arguments or none, ' 'but {0} found.', correction: 'Try adjusting the …
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. [...]
const 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…
FOR_IN_OF_INVALID_TYPE → const StaticTypeWarningCode
17.6.2 For-in. If the iterable expression does not implement Iterable, this warning is reported. [...]
const 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.
const StaticTypeWarningCode('ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE', 'Functions marked 'async*' must have a return type assignable to ' ''Stream'.', correction: &…
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.
const StaticTypeWarningCode('ILLEGAL_ASYNC_RETURN_TYPE', 'Functions marked 'async' must have a return type assignable to ' ''Future'.', correction: 'Try fix…
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.
const StaticTypeWarningCode('ILLEGAL_SYNC_GENERATOR_RETURN_TYPE', 'Functions marked 'sync*' must have a return type assignable to ' ''Iterable'.', correction: &…
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. [...]
const StaticTypeWarningCode('INSTANCE_ACCESS_TO_STATIC_MEMBER', 'Static {1} '{0}' can't be accessed through an instance.', correction: 'Try using the class '{2}'…
INVALID_ASSIGNMENT → const StaticTypeWarningCode
Parameters: 0: the name of the right hand side type 1: the name of the left hand side type
const StaticTypeWarningCode('INVALID_ASSIGNMENT', 'A value of type '{0}' can't be assigned to a variable of type ' ''{1}'.', correction: 'Try changing t…
INVOCATION_OF_NON_FUNCTION → const StaticTypeWarningCode
Parameters: 0: the name of the identifier that is not a function type
const StaticTypeWarningCode('INVOCATION_OF_NON_FUNCTION', ''{0}' isn't a function.', correction: 'Try correcting the name to match an existing function, or ' 'd…
INVOCATION_OF_NON_FUNCTION_EXPRESSION → const StaticTypeWarningCode
12.14.4 Function Expression Invocation: A function expression invocation i has the form ef(a1, …, an, xn+1: an+1, …, xn+k: an+k), where ef is an expression. [...]
const 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
12.20 Conditional: It is a static type warning if the type of e1 may not be assigned to bool. [...]
const StaticTypeWarningCode('NON_BOOL_CONDITION', 'Conditions must have a static type of 'bool'.', correction: 'Try changing the condition.')
NON_BOOL_EXPRESSION → const StaticTypeWarningCode
17.17 Assert: It is a static type warning if the type of e may not be assigned to bool.
const 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
12.28 Unary Expressions: The expression !e is equivalent to the expression e?false : true. [...]
const StaticTypeWarningCode('NON_BOOL_NEGATION_EXPRESSION', 'Negation argument must have a static type of 'bool'.', correction: 'Try changing the argument to the '!'…
NON_BOOL_OPERAND → const StaticTypeWarningCode
12.21 Logical Boolean Expressions: It is a static type warning if the static types of both of e1 and e2 may not be assigned to bool. [...]
const StaticTypeWarningCode('NON_BOOL_OPERAND', 'The operands of the '{0}' operator must be assignable to 'bool'.')
NON_TYPE_AS_TYPE_ARGUMENT → const StaticTypeWarningCode
Parameters: 0: the name appearing where a type is expected
const 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…
RETURN_OF_INVALID_TYPE → const StaticTypeWarningCode
13.11 Return: It is a static type warning if the type of e may not be assigned to the declared return type of the immediately enclosing function. [...]
const StaticTypeWarningCode('RETURN_OF_INVALID_TYPE', 'The return type '{0}' isn't a '{1}', as defined by the method ' ''{2}'.')
RETURN_OF_INVALID_TYPE_FROM_CLOSURE → const StaticTypeWarningCode
13.11 Return: It is a static type warning if the type of e may not be assigned to the declared return type of the immediately enclosing function. [...]
const StaticTypeWarningCode('RETURN_OF_INVALID_TYPE_FROM_CLOSURE', 'The return type '{0}' isn't a '{1}', as defined by anonymous ' 'closure.')
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. [...]
const 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 sub…
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. [...]
const StaticTypeWarningCode('UNDEFINED_ENUM_CONSTANT', 'There is no constant named '{0}' in '{1}'.', correction: 'Try correcting the name to the name of an existing…
UNDEFINED_FUNCTION → const StaticTypeWarningCode
Parameters: 0: the name of the method that is undefined
const StaticTypeWarningCode('UNDEFINED_FUNCTION', 'The function '{0}' isn't defined.', correction: 'Try importing the library that defines '{0}', ' 'cor…
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
const StaticTypeWarningCode('UNDEFINED_GETTER', 'The getter '{0}' isn't defined for the class '{1}'.', correction: 'Try importing the library that defines '…
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
const StaticTypeWarningCode('UNDEFINED_METHOD', 'The method '{0}' isn't defined for the class '{1}'.', correction: 'Try correcting the name to the name of an ex…
UNDEFINED_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). [...]
const 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.
const StaticTypeWarningCode('UNDEFINED_PREFIXED_NAME', 'The name '{0}' is being referenced through the prefix '{1}', but it ' 'isn't defined in any of the libra…
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
const StaticTypeWarningCode('UNDEFINED_SETTER', 'The setter '{0}' isn't defined for the class '{1}'.', correction: 'Try importing the library that defines '…
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. [...]
const StaticTypeWarningCode('UNDEFINED_SUPER_GETTER', 'The getter '{0}' isn't defined in a superclass of '{1}'.', correction: 'Try correcting the name to the na…
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
const StaticTypeWarningCode('UNDEFINED_SUPER_METHOD', 'The method '{0}' isn't defined in a superclass of '{1}'.', correction: 'Try correcting the name to the na…
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). [...]
const StaticTypeWarningCode('UNDEFINED_SUPER_OPERATOR', 'The operator '{0}' isn't defined in a superclass of '{1}'.', correction: 'Try defining the operator …
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=. [...]
const StaticTypeWarningCode('UNDEFINED_SUPER_SETTER', 'The setter '{0}' isn't defined in a superclass of '{1}'.', correction: 'Try correcting the name to the na…
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. [...]
const StaticTypeWarningCode('UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER', 'Static members from supertypes must be qualified by the name of the ' 'defining type.', correct…
WRONG_NUMBER_OF_TYPE_ARGUMENTS → const StaticTypeWarningCode
15.8 Parameterized Types: It is a static type warning if G is not a generic type with exactly n type parameters. [...]
const StaticTypeWarningCode('WRONG_NUMBER_OF_TYPE_ARGUMENTS', 'The type '{0}' is declared with {1} type parameters, ' 'but {2} type arguments were given.', correction: …
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. [...]
const StaticTypeWarningCode('WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR', 'The constructor '{0}.{1}' doesn't have type parameters.', correction: 'Try moving type argume…
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. [...]
const StaticTypeWarningCode('WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD', 'The method '{0}' is declared with {1} type parameters, ' 'but {2} type arguments were given.', cor…
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: [...]
const StaticTypeWarningCode('YIELD_OF_INVALID_TYPE', 'The type '{0}' implied by the 'yield' expression must be assignable ' 'to '{1}'.')