Fork me on GitHub

List of the SARL Compiler Errors and Warnings

This page provides the exhaustive list of error and warning messages that may be generated by the SARL compiler.

The “N.” column provides a number that could be used in order to make easier your discussions with the SARL developers on the forums.

The column “Message and Description” contains information and details on each issue. The message gives a template of typical message that is given by the compiler. The cause describes the source of the issue, and provides a short explanation of the cause of the issue. The solving provides guidelines to fix the issue when it is possible.

The “Level” column indicates the level of importance for the issue. It may be:

In the case of an issue with a “configurable” or “delegated” level, you could select yourself the level that should be used by the SARL compiler for the issue. This configuration may be done into the preferences of the Eclipse SARL IDE or in the configuration of the sarlc command-line compiler. Additionally, you could force the SARL compiler to ignore an issue by attaching the annotation @SuppressWarnings("code") to the element that is marked with the issue. In this annotation, the code corresponds to the content of the “Code” column below. This code may have a short format (e.g., the one shown in the column), or a long format (e.g., if you move your mouse pointer on the code, you should see the long format of the code into a pop-up window). The long code is provided by the SARL compiler at the end of each of the issue messages. It is preferable to use the short code as argument to @SuppressWarnings. Nevertheless, it may be ambiguous with other issue codes that could be defined outside the SARL compiler itself (e.g. Eclipse, Checkstyle, etc.). In the case of ambiguity, you could use the long code as argument to @SuppressWarnings too.

N. Message and Description Level Code
1 Message: Cannot instantiate the abstract type type-name
Cause: This error is generated when you try to create an instance of an abstract class
Solving: Replace type-name by the name of a concrete class
Error abstract_class_instantiation
2 Message: Cannot directly invoke the abstract method func-prototype of the type name
Cause: The function with the given func-prototype is defined as non-abstract in the current type, and it is defined as abstract into the super-type. You try to call the super-type’s method by using super.function. But, the super-type’s function is abstract. Consequently, it cannot be invoked
Solving: Remove the call to the super-type function
Configurable; Default is: Error abstract_method_invocation
3 Message: Abstract methods do not specify a body
Cause: You have defined a method within an interface of a capacity with an associated block of code. Since Java 1.8, the default implementation within interfaces (i.e., a block of code that may be considered as the function’s implementation if the class implementing the interface is not providing its own code) is introduced. If you are using SARL upon an older Java environment, this error message is generated
Solving: Remove the code block
Error abstract_method_with_body
4a Message: Ambiguous feature-call. The feature-type feature-1 and feature-2 both match
Cause: You are calling a feature (method, field, etc.). But, the target feature is ambiguous. Multiple candidates were found within the scope of your call. SARL compiler cannot choose the concrete feature to be called. In order to help you, the SARL compiler provides to you the list of candidates
Solving: Rewrite your code in order to remove the ambiguity
Error ambiguous_feature_call
4b Message: Ambiguous feature-call. The feature-type list-of-features and feature-2 all match
Cause: You are calling a feature (method, field, etc.). But, the target feature is ambiguous. Multiple candidates were found within the scope of your call. SARL compiler cannot choose the concrete feature to be called. In order to help you, the SARL compiler provides to you the list of candidates
Solving: Rewrite your code in order to remove the ambiguity
Error ambiguous_feature_call
5 Message: Potential ambiguous notation for expression. The minus unary operator is applied on the result of the call to function name and not on the argument value value.
Cause: This warning message is generated for any expression of the form -value.name. In this case, the expression could be interpreted in the wrong way. For example, -125.abs is interpreted as -(125.abs) by SARL, i.e., -abs(125). It is not interpreted as abs(-125). If you would pass -125 to the function, you must use parentheses, i.e. (-125).abs
Solving: Put parentheses around the minus unary operator and the value, i.e., (-value).name
Configurable; Default is: Warning ambiguous_interpretation_by_developper
6 Message: The anonymous subclass of type-name does not implement list-of-functions
Cause: Because anonymous class cannot be abstract, all the abstract functions that are inherited must be implemented into the anonymous class
Solving: Implement the missed functions
Error anonymous_class_missing_members
7 Message: A static field of an anonymous class must be final
Cause: Because an anonymous class is a class, we can declare static fields for sharing data between the difference instances of the anonymous class (that is the usual usage of static fields for regular classes). However, because an anonymous class is attached to its enclosing context, any side-effect applied by the change of the static field’s value must be avoided. That’s why a static field in an anonymous class must be unmodifiable, i.e., defined with val or marked with the final modifier
Solving: Replace var keyword by val; or add the static modifier to the field
Error anonymous_class_static_field
8 Message: A method of an anonymous class cannot be static
Cause: Because an anonymous class is not a named type, we cannot refer to its functions with a static notation (that is the name of the type, followed by the name of the function). Consequently, it is forbidden to define a static function into an anonymous class
Solving: Remove static modifier from the function prototype
Error anonymous_class_static_method
9a Message: Assignment to final field
Cause: You try to assign a value to a field that is declared as final, e.g., val myvar or final var myvar. Since the field is declared as final, its value cannot be changed
Solving: Remove the final modifier on the field; or assign to another not-final field
Error assignment_to_final
9b Message: Assignment to final parameter
Cause: You try to assign a value to a parameter. Parameters are always considered as final from the SARL specification. Since the parameter is declared as final, its value cannot be changed
Solving: Assign to another not-final variable
Error assignment_to_final
9c Message: Assignment to final variable
Cause: You try to assign a value to a variable that is declared as final, e.g., val myvar or final var myvar. Since the variable is declared as final, its value cannot be changed
Solving: Remove the final modifier on the variable; or assign to another not-final variable
Error assignment_to_final
10 Message: The left-hand side of an assignment must be a variable
Cause: According to the definition of the assignment operator, the left operand must always be a variable or a field that is not declared as final. When this error message is generated, it means that the left operand is neither a variable nor a field.
Please not that the use of the assignment operator may be considered as a call to a “setter” function. In this case, this error message is not generated
Solving: Replace the left operand with an appropriate variable or field
Error assignment_to_no_variable
11 Message: A dispatch method’s name must not start with an underscore
Cause: A dispatch function is a function to which multiple blocks of code are attached to. Each block of code is invoked according to a specific type of the first formal parameter of the dispatch function. Internally, each block is attached to an hidden function with a name started with an underscore _ character. In order to avoid any conflict with the internal functions, it is forbidden to start the name of a dispatch function with an underscore character
Solving: Rename your dispatch function
Error case_func_name_starts_with_underscore
12 Message: A dispatch method must not declare any type parameters
Cause: A dispatch function is a function to which multiple blocks of code are attached to. Each block of code is invoked according to a specific type of the first formal parameter of the dispatch function. This error message is generated when a generic type parameter is defined in the dispatch function prototype; that is forbidden
Solving: Remove generic type declaration
Error case_function_with_type_params
13 Message: A dispatch method must at least have one parameter declared
Cause: A dispatch function is a function to which multiple blocks of code are attached to. Each block of code is invoked according to a specific type of the first formal parameter of the dispatch function. This error message is generated when a dispatch function has no parameter delcared
Solving: Add a formal parameter
Error case_function_without_params
14 Message: Recursive constructor invocation
Cause: You have defined several constructors into your type that are calling other constructors in the type. The sequence of constructor’s calls contains a loop; that is forbidden. An example of failing code is:
class X {
  new (x : int) {
    this('c')
  }
  new (x : char) {
    this(1)
  }
}

Solving: Rewrite your code to avoid cyclic calls to the constructors
Error circular_constructor_invocation
15a Message: Invalid supertype. Expecting a class
Cause: According to the syntax of SARL, a type (class, agent, skill, etc.) extends another type. This error message indicates to you that the type after extends is not a type implemented with a Java class, when it is expected to have one
Solving: Remove the extends statement; or replace the invalid type by the appropriate class
Error class_expected
15b Message: Superclass must be a class
Cause: According to the syntax of SARL, a class extends another class. This error message indicates to you that the type after extends is not a class
Solving: Remove the extends statement; or replace the invalid type by the appropriate class
Error class_expected
16 Message: The class type-name must be defined abstract because it does not implement list-of-functions
Cause: You have defined abstract functions into type-name, or abstract functions are inherited without beeing implemented. In this case, the type-name must also be defined as abstract because abstract functions can only be defined into an abstract type
Solving: Add abstract modifier to type-name
Error class_must_be_defined_abstract
17a Message: The non-abstract method first-prototype inherited from first-type conflicts with the method second-prototype inherited from second-type
Cause: This error message is generated when the current type inherited from two functions from types first-type and second-type, and there is a conflict between the signatures of these functions
Error conflicting_default_methods
17b Message: The type type-name inherits multiple implementations of the method func-prototype from first-type and second-type
Cause: This error message is generated when the current type with name type-name inherited a block of code for the function with the signature func-prototype, either from the super-type named first-type and the one named second-type. It is impossible for the SARL compiler to determine which one of the two blocks of code to be associated to type-name
Error conflicting_default_methods
18 Message: Constant condition is always boolean-constant
Cause: The loop, if-then and switch statements may have a boolean condition that is evalued to true or false. In this case, the statement itself is superfluous. For example, in the case of a while-loop, if the condition is alwaus true, the loop will never exit. This issue message notifies you that a potentiel problem is detected because of the evaluation of an expression to true or false
Configurable; Default is: Warning constant_condition
19 Message: Contructors are only permitted within classes
Cause: You try to define a construction in a type that cannot be mapped to a low-level class, e.g. class, agent, behavior, etc
Error constructor_not_permitted
20a Message: Type parameters are not supported for constructors
Cause: A constructor cannot have generic type parameters
Solving: Remove the generic type parameters
Error constructor_type_params_not_supported
20b Message: Unexpected type parameter to a static constructor
Cause: A static constructor cannot have generic type parameters
Solving: Remove the generic type parameters
Error constructor_type_params_not_supported
21 Message: any-message
Cause: Sometime, the Java code that is generated by the SARL compiler may contain compilation errors from the Java compiler point of view. This error code enables the SARL validator to forward the errors that were found into the Java code to be automatically attached to the SARL statement that is the source of the failing Java code
Solving: Contact the SARL development team
Configurable; Default is: Error copyJavaProblems
22 Message: The ‘create’-method func-name in type type-name must not be abstract
Cause: Creation method is inspired from the factory-method design pattern. It is forbidden to define this type of method without code
Solving: Add source code to the creation method
Error create_functions_must_not_be_abstract
23 Message: The inheritance hierarchy of ‘type-name’ is inconsistent
Cause: According the inheritance definition, that is common to SARL and the object-oriented programming languages, cyclic into the inheritance hierarchy is totally forbidden
Error cyclic_inheritance
24a Message: The constructor name is deprecated
Cause: The constructor that you are calling is marked as deprecated directly, or one of its enclosing types is marked as deprecated
Solving: Read the deprecation comment and update your code accordingly
Delegated to: org.eclipse.jdt.core.compiler.problem.deprecation
Delegated; Default is: Warning deprecated_member_reference
24b Message: The enum literal name is deprecated
Cause: The enum literal that you are using is marked as deprecated directly, or one of its enclosing types is marked as deprecated
Solving: Read the deprecation comment and update your code accordingly
Delegated to: org.eclipse.jdt.core.compiler.problem.deprecation
Delegated; Default is: Warning deprecated_member_reference
24c Message: The field name is deprecated
Cause: The field that you are accessor is marked as deprecated directly, or one of its enclosing types is marked as deprecated
Solving: Read the deprecation comment and update your code accordingly
Delegated to: org.eclipse.jdt.core.compiler.problem.deprecation
Delegated; Default is: Warning deprecated_member_reference
24d Message: The method func-prototype from the type container-name is deprecated
Cause: The method that you are calling is marked as deprecated directly, or one of its enclosing types is marked as deprecated
Solving: Read the deprecation comment and update your code accordingly
Delegated to: org.eclipse.jdt.core.compiler.problem.deprecation
Delegated; Default is: Warning deprecated_member_reference
24e Message: The type name is deprecated
Cause: The type that you are referencing is marked as deprecated directly, or one of its enclosing types is marked as deprecated
Solving: Read the deprecation comment and update your code accordingly
Delegated to: org.eclipse.jdt.core.compiler.problem.deprecation
Delegated; Default is: Warning deprecated_member_reference
25a Message: Discouraged boolean value. The guard is always true
Cause: It is discouraged to have the constant true as condition of an behavior unit’s guard. Indeed, a condition that is always evaluated to true makes the test void and time consuming for nothing
Solving: Remove the guard of the behavior unit
Configurable; Default is: Warning discouraged_boolean_expression
25b Message: Unexpected assertion due to its positive test result
Cause: It is discouraged to have the constant true as condition of the assert statement. Indeed, a condition that is always evaluated to true for an assertion test makes this test void and time consuming for nothing
Solving: Remove the assert statement
Configurable; Default is: Warning discouraged_boolean_expression
26 Message: Discouraged capacity definition. A capacity without actions defined inside is not useful since it cannot be called by an agent or a behavior
Cause: Message is explicit. There no sense to create a capacity without action according to the SARL metamodel
Solving: Define an action within the capacity; or delete the capacity
Configurable; Default is: Warning discouraged_capacity_definition
27 Message: Invalid action name ‘n’. You must not give to an action a name with reserved characters
Cause: Several names are discouraged to be used by the SARL compiler. One reason may be because the name is expected to be used as part of the language in future releases. Or, the name is amgiguous. For example, the name “self” is discouraged by the SARL compiler
Solving: Change the function name
Configurable; Default is: Warning discouraged_function_name
28a Message: Discouraged use of the break keyword inside a basic loop
Cause: break statement enables to stop the execution of a loop step by continuing the execution after the loop itself. However, according the algothimic best practices, it is not recommended to use the break statement for stopping a loop. It may denote a poor algorithmic analysis
Solving: Rewrite the loop code
Configurable; Default is: Warning discouraged_loop_breaking_keyword_use
28b Message: Discouraged use of the continue keyword inside a basic loop
Cause: continue statement enables to stop the execution of a loop step by continuing the execution at the next loop step. However, according the algothimic best practices, it is not recommended to use the continue statement for stopping a loop. It may denote a poor algorithmic analysis
Solving: Rewrite the loop code
Configurable; Default is: Warning discouraged_loop_breaking_keyword_use
29a Message: Possible invalid usage of ‘occurrence’. A impure function is detected into the sequence of calls on ‘occurrence’. Because a impure function has a possible side effect and side effect is not allowed on ‘occurrence’, it may cause an unexpected or invalid running behavior. You have to ensure by yourself that the usage of ‘occurrence’ is valid
Cause: The keyword occurrence represents the current instance of the just-received event within a behavior unit. It is assumed within the SARL operational semantics that occurrence instance is an unmodifiable event in order to ensure consistency between the different behavior units that handle the occurrence. This message is generated one component of the occurrence event is used in a way that its value may be changed. The SARL compiler is not sure that a change is applied to the occurrence from the code analysis. It notifies you that you have to double check the usage of occurrence and validate that no side-effect exist on it. If the used component of occurrence is of immutable type, then this issue does not exist
Solving: Rewrite your code to avoid the use of the impure function(s)
Configurable; Default is: Warning discouraged_occurrence_readonly_use
29b Message: Possible invalid usage of ‘occurrence’. The value of the feature ‘occurrence’ or one of its component is used as an argument of a function. This function is not marked as a pure function, i.e. without side effect. Because side effect is not allowed on ‘occurrence’, it may cause an unexpected or invalid running behavior. You have to ensure by yourself that the usage of ‘occurrence’ is valid
Cause: Message is clear
Solving: Mark with @Pure the function that takes occurrence as argument; or Change your code to avoid the passing of occurrence to the concerned function
Configurable; Default is: Warning discouraged_occurrence_readonly_use
29c Message: Possible invalid usage of ‘occurrence’. The value of the feature ‘occurrence’ or one of its component seems to be copied within a local variable. Because side effect is not allowed on ‘occurrence’, it may cause an unexpected or invalid running behavior. You have to ensure by yourself that the usage of ‘occurrence’ is valid
Cause: Message is clear
Solving: Rewrite your code to avoid the use of the impure function(s)
Configurable; Default is: Warning discouraged_occurrence_readonly_use
30 Message: Discouraged feature call: feature. You should use the dedicated language keyword, or an agent’s capacity in place of this feature call
Cause: This error is generated when a discouraged feature call is detected. The features that outside the best practices are: System::err, System::out, System::setErr, System::setOut, System::console, System::inheritedChannel, System::exit (when called from an object-oriented type), with a named starting with “InputOutput” or “Thread”. these different features are considered to be too low level to be used into a agent-oriented program
Solving: Remove the call
Error discouraged_reference
31 Message: Dispatch methods have arguments with different primitive types
Cause: A dispatch function is a function to which multiple blocks of code are attached to. Each block of code is invoked according to a specific type of the first formal parameter of the dispatch function. You could define more formal parameters than the mandatory one. This issue message is generated when the formal parameters at the same position into the prototypes of a dispatch function have not the same primitive type. It may cause issues, e.g., a loose of information due the automatic boxing of the parameter values
Solving: Change the primitive types to have the same in all the prototypes
Configurable; Default is: Warning dispatch_functions_different_primitive_args
32 Message: Static and non-static dispatch methods can not be mixed
Cause: A dispatch function is a function to which multiple blocks of code are attached to. Each block of code is invoked according to a specific type of the first formal parameter of the dispatch function. It is forbidden to mix static and not static prototypes for a single dispatch function
Solving: Make static or non-static all the prototypes of the same dispatch function
Error dispatch_functions_mixed_static_and_non_static
33 Message: The dispatch method fct-name in type type-name must not be abstract
Cause: A dispatch function is a function to which multiple blocks of code are attached to. Each block of code is invoked according to a specific type of the first formal parameter of the dispatch function. Because of this definition, it is forbidden to define, implictly or explicitly, a dispatch function as abstract
Solving: Add block of code for the dispatch function
Error dispatch_functions_must_not_be_abstract
34 Message: The dispatch method must not be static because the dispatch methods in the superclass are not static
Cause: A dispatch function is a function to which multiple blocks of code are attached to. Each block of code is invoked according to a specific type of the first formal parameter of the dispatch function. This error message is generated when a dispatch function into the current type is defined as static function; while the dispatch functions defined into the super-type are not defined as static. You cannot mix static and non-static definitions
Solving: Remove static modifier from the prototype of the local dispatch function
Error dispatch_functions_non_static_expected
35 Message: The dispatch method must be static because the dispatch methods in the superclass are static
Cause: A dispatch function is a function to which multiple blocks of code are attached to. Each block of code is invoked according to a specific type of the first formal parameter of the dispatch function. This error message is generated when a dispatch function into the current type is not defined as static function; while the dispatch functions defined into the super-type are defined as static. You cannot mix static and non-static definitions
Solving: Add static modifier to the prototype of the local dispatch function
Error dispatch_functions_static_expected
36 Message: All local dispatch methods must have the same visibility
Cause: A dispatch function is a function to which multiple blocks of code are attached to. Each block of code is invoked according to a specific type of the first formal parameter of the dispatch function. It is forbidden to define the different prototypes for a single dispatch function with different visibilities
Solving: Use the same function visility for all the prototypes of the same dispatch function
Error dispatch_functions_with_different_visibility
37a Message: Dispatch method has same name and number of parameters as non-dispatch method
Cause: A conflict is detected between the name of a dispatch function and the name of not-dispatching function. In this case, the SARL compiler is still able to invoke both functions. Nevertheless, it introduces an ambiguity for the caller of the functions that may have a call to the wrong function. This issue message notifies you that you have to take care of this situation, and ensure that the calls to functions are targeted the right function code
Solving: Rename the dispatch function; or the non-dispatch function
Configurable; Default is: Warning dispatch_plain_function_name_clash
37b Message: Non-dispatch method has same name and number of parameters as dispatch method
Cause: A conflict is detected between the name of a dispatch function and the name of not-dispatching function. In this case, the SARL compiler is still able to invoke both functions. Nevertheless, it introduces an ambiguity for the caller of the functions that may have a call to the wrong function. This issue message notifies you that you have to take care of this situation, and ensure that the calls to functions are targeted the right function code
Solving: Rename the non-dispatch function; or the dispatch function
Configurable; Default is: Warning dispatch_plain_function_name_clash
38 Message: Duplicate case
Cause: Into a switch statement, you have specified multiple times the same case, i.e., with the same case expression. Then, it is impossible to branch to a single case from the expression evaluated by the switch statement. This ambiguous branching is forbidden
Solving: Remove one of the cases; or merge the two cases into a single case
Error duplicate_case
39a Message: Duplicate extension with same type
Cause: Extension on fields is supported by SARL syntax. This error message is generated when two extensions have the same name. It is forbidden because they generate two hidden fields with the same name
Solving: Rename one of the extensions
Error duplicate_field
39b Message: Duplicate field name
Cause: It is forbidden to define multiple fields with the same name into the same type. This error message is generated when two fields have the given name
Solving: Rename one of the two fields
Error duplicate_field
40a Message: Duplicate dispatch methods. Primitives cannot overload their wrapper types in dispatch methods
Cause: It is forbidden to define a dispatch function without the same prototype/erasure as an inherited dispatch function
Solving: Change the prototype of the dispatch function in order to be compatible with the prototype of the inherited dispatch function
Error duplicate_method
40b Message: Duplicate method func-prototype in type type-name
Cause: It is forbidden to define two times a function with the same prototype/erasure. This error message is generated when two functions has the same prototype inside the current type declaration
Solving: Rename one of the functions; or change the erasure of one of them
Error duplicate_method
40c Message: Name clash: The method func-prototype of type type-name has the same erasure as other-prototype of type other-type but does not override it
Cause: It is forbidden to define a non-static function without the same prototype/erasure as an inherited non-static static function
Solving: Change the func-prototype to be compatible with other-prototype
Error duplicate_method
40d Message: The instance method func-prototype cannot override the static method static-prototype of type type-name
Cause: It is forbidden to define a function with the same prototype/erasure as an inherited static function without adding the staticmodifier to the inheriting function prototype
Solving: Add static modifier to the function prototype
Error duplicate_method
40e Message: The method func-prototype has the same erasure func-erasure as another method in type type-name
Cause: It is forbidden to define two times a function with the same prototype/erasure. This error message is generated when two functions has the same prototype inside the current type declaration
Solving: Rename one of the functions; or change the erasure of one of them
Error duplicate_method
41a Message: Duplicate implicit parameter ‘it’
Cause: You cannot define with the same name two formal parameters into the same function. In the context of the erroneous code, an implicit parameter is defined and named it. You have also explicitly defined a formal parameter named it. There is a conflict between the names
Solving: Rename your explicit formal parameter
Error duplicate_parameter_name
41b Message: Duplicate parameter name
Cause: You cannot define with the same name two formal parameters into the same function
Solving: Rename one of the formal parameters
Error duplicate_parameter_name
42a Message: Duplicate nested type name
Cause: It is forbidden to define into an enclosing type two type declarations with the same given name
Solving: Rename one of the inner types
Error duplicate_type
42b Message: Duplicate type name
Cause: It is forbidden to define into a SARL file two type declarations with the same given name
Solving: Rename one of the types
Error duplicate_type
42c Message: The type name is already defined
Cause: It is forbidden to define into a SARL file two type declarations with the same given name
Solving: Rename one of the types
Error duplicate_type
42d Message: The type name is already defined in file filename
Cause: It is forbidden to define into a SARL file two type declarations with the same given name
Solving: Rename one of the types
Error duplicate_type
43 Message: The operator ‘name’ should be replaced by ‘name=’ when null is one of the arguments
Cause: This error message is generated when one of the (in)equality test operators == and != is invoked with the null literal as left or right operand, e.g. x == null or null == x, and the other operand being of primitive type. These two test operators implement deep (in)equality tests. A better practice is to invoke the operator === or !==, which implement reference tests. Indeed, null value is a reference to nothing. It is better to compare a reference to another reference. And, the reference test operators are the most efficient for that
Solving: Replace == by ===, or != by !==
Configurable; Default is: Warning equals_with_null
44 Message: Exception type-name is declared twice
Cause: You have declared two times the same exception after a throw keyword
Solving: Remove one occurrence of type-name
Error exception_declared_twice
45 Message: No exception of type type-name can be thrown; an exception type must be a subclass of Throwable
Cause: You have specified a type after the thrown keyword that is not a subtype of Throwable. This type comes from the Java API, and represents all the throwable objects, e.g., the exceptions, into the virtual machine. You must given sub-types of Throwable after the thrown keyword
Solving: Remove type-name; or replace it by an appropriate type
Error exception_not_throwable
46 Message: Cannot access the type-name feature-name with parentheses
Cause: This error is generated when you try to access to a field with parentheses. Let be the field x defined. The code x() causes this error because x is a field, not a method
Solving: Remove the parentheses
Error field_access_with_parentheses
47 Message: The final field name may already have been assigned
Cause: You try to change the value of a final field after it was initialized. A value could be given to a final field only one time, i.e. its initialization
Solving: Remove the expression that try to change the final field
Error field_already_initialized
48a Message: The blank final derived field name may not have been initialized
Cause: Final fields must be initialized when they are declared, or inside the enclosing type constructor (when writing a constructor is possible). You have declared a final field that is never initialized
Solving: Add initialization value to the field
Error field_not_initialized
48b Message: The blank final field name may not have been initialized
Cause: Final fields must be initialized when they are declared, or inside the enclosing type constructor (when writing a constructor is possible). You have declared a final field that is never initialized
Solving: Add initialization value to the field
Error field_not_initialized
49a Message: Access restriction: The type name is not accessible
Cause: This error is generated when a reference to the type with the given name is detected, and the type is not visible/accessible
Solving: Remove type reference
Error forbidden_reference
49b Message: Default value’s expression cannot reference the not-pure operation: name
Cause: This error message is generated when a reference to a non-pure function is detected into the expression of the default value for a formal parameter. Only pure functions could be used for building a default value expression in order to avoid unexpected side-effects
Solving: Remove the reference to the not-pure function
Error forbidden_reference
49c Message: Forbidden annotation in a SARL program
Cause: An annotation is used into the code. But this annotation is forbidden because it is reserved for internal usage, or it is not supported by the SARL compiler
Solving: Remove the annotation
Error forbidden_reference
49d Message: Forbidden annotation to the agent-oriented feature of type type-name
Cause: An active annotation, i.e. an annotation that causes a specific generation of code by the SARL compiler, is attached to an agent-oriented type, e.g. agent, behavior, etc. But, it is forbidden to attached the active annotation to an agent-oriented type
Solving: Remove the active annotation
Error forbidden_reference
49e Message: Forbidden annotation to the object-oriented feature of type type-name
Cause: An active annotation, i.e. an annotation that causes a specific generation of code by the SARL compiler, is attached to an object-oriented type, e.g. class, interface, etc. But, it is forbidden to attached the active annotation to an object-oriented type
Solving: Remove the active annotation
Error forbidden_reference
49f Message: Forbidden feature call: feature
Cause: This error is generated when a forbidden feature call is detected. The forbidden features to call are: System::exit when it is inde an agent-oriented type, e.g. agent; with a name containing the forbidden character $.; or the feature is part of a private API and the caller is not part of the private API
Solving: Remove the call
Error forbidden_reference
49g Message: Forbidden reference to not final field {0} from a constructor’s default value expression
Cause: This error message is generated when a reference to a not-final field is detected into the expression of the default value for a constructor’s formal parameter. Only final fields could be used for building a default value expression of a constructor in order to avoid unexpected side-effects
Solving: Remove the reference to the not final field
Error forbidden_reference
50 Message: The generic type parameter ‘name’ is hiding the generic type parameter of ‘type-name
Cause: This error is generated when you declared a generic type parameter for an action that has the same name as another generic type parameter that is declared into the enclosing type (class, or interface)
Solving: Change the name
Error generic_type_name_shadowing
51a Message: Cannot instantiate the name
Cause: You try to create an instance of a type named name with the new instruction. The type with the given name cannot be instanciated due to several reasons, e.g., it is defiend as abstract, it has no visible constructor, etc
Error illegal_class_instantiation
51b Message: Cannot instantiate the annotation type name
Cause: You try to create an instance of an annotation named name with the new instruction. It is impossible to create an instance of annotation
Error illegal_class_instantiation
51c Message: Cannot instantiate the enum type name
Cause: You try to create an instance of an enumeration named name with the new instruction. It is impossible to create an instance of enumeration
Error illegal_class_instantiation
51d Message: Cannot instantiate the interface type name
Cause: You try to create an instance of an interface named name with the new instruction. It is impossible to create an instance of interface
Error illegal_class_instantiation
51e Message: Cannot instantiate the primitive type name
Cause: You try to create an instance of a primitive type named name with the new instruction. Since a primitive type is not object-oriented, it is impossible to create an instance of primitive type
Error illegal_class_instantiation
51f Message: Cannot instantiate the type parameter name
Cause: You try to create an instance of a type parameter named name with the new instruction. Since the concrete type represented by the type parameter is not known at compile time, creation of an instance of name is impossible
Error illegal_class_instantiation
52 Message: Cannot reference the field ‘name’ before it is defined
Cause: You try to have access to a field before it is defined within the sequence of statements ofyour code. This error should never append in SARL code. It was defined for “safety” reasons
Solving: Move the field definition before its first usage
Error illegal_forward_reference
53 Message: Illegal redefinition of the default value for the formal parameter name. Inherited value is: original value. While the current value is: redefined value.
Cause: This error message is generated when you declared a default value for a formal parameter that is different from the corresponding default value that was declared into the super types. You cannot change the default value of a formal parameter because it may cause unexpected side-effects for the callers of the function
Solving: Remove the redundant declaration fo the default value
Error illegal_parameter_default_value_redefinition
54 Message: Implicit return
Cause: By default, it is not necessary to specify an explicit return statement inside the code block of a function. The SARL compilier assumes that the last executed instruction gives the value to be returned by the function. This issue message is generated when an implicit return is used within a function
Solving: Add an explicit return
Configurable; Default is: Ignored implicit_return
55 Message: The import ‘package-1.name’ collides with the import ‘package-2.name
Cause: This error is generated when you define into the list of import two types with the same simple name. In this case, it is impossible to determine if an occurrence of name into the code refers to the type in the package package-1 or in the package package-2
Solving: Remove one of the import
Error import_collision
56 Message: The import ‘package.name’ conflicts with a type defined in the same file
Cause: You are importing a type with the given name into the given package. But, you have also defined a local type with the name. In this case, it is impossible to determine if an occurrence of name into the code refers to the local type or the imported type
Solving: Rename the local type
Error import_conflict
57 Message: The import name cannot be resolved
Cause: The name that is provided after an import cannot be found
Solving: Remove the import statement
Configurable; Default is: Error import_unresolved
58 Message: The import ‘name’ is never used
Cause: This issue message is generated when an import statement does not provide features that are used into the current file
Solving: Remove import statement
Configurable; Default is: Warning import_unsued
59 Message: The use of wildcard imports is deprecated
Cause: You are importing all the types that are defined into a package with import pkg.*. This instruction has two major drawbacks. Firstly, the really used types within the current are not explicit because of the wildcard. Second, the SARL compiler loads in memory too much type definitions for compiling the current file
Solving: Replace the wildcard by the really used types
Configurable; Default is: Warning import_wildcard_deprecated
60 Message: The declared exception exception-type is not compatible with throws clause in exception-list
Cause: According the inheritance definition, that is common to SARL and the object-oriented programming languages, overridable functions as associated to a contract with their callers. This contract indicates that the prototype of the function will never changed, and the function will have the same thrown exceptions always. This contract must be fullfil by the overriding functions. This error message is generated when your overriding function has a list of exceptions after the thrown keyword that is not compatible with the list defined into the inherited function. An exception of type “a” in the overriding function must be also a “b”, where “a” is equals to “b” or a sub-type of “b”
Solving: Change the list of exceptions after throws keyword to the appropriate exception types
Error incompatible_throws_clause
61a Message: Incompatible types. Expected expected-type but was actual-type
Cause: The value that is specified after a return statement has a type that is incompatible with the return type of the enclosing function
Solving: Rewrite the return’s expression in order to have a compatible type; or change the return type of the function to be compatible with those of the return expression
Error incompatible_types
61b Message: No exception of type type-name can be thrown; an exception type must be a subclass of Throwable
Cause: Inside a catch statement, you have specified a type-name that does not correspond to a sub-type of Throwable. The parameter of the catch statement must be a throwable type, or a collection of throwable types
Solving: Rewrite type-name by an appropriate throwable type
Error incompatible_types
62a Message: The enum constant name needs a corresponding case label in this enum switch on type-name
Cause: You have specified an enumerated value to a switch condition. The enumeration constant with the given name has not a corresponding case into the switch. It means that all the possible cases are not explicitly covered; It is preferrable they are all covered
Solving: Add a case for the missed constant name
Configurable; Default is: Warning incomplete_cases_on_enum
62b Message: The enum constants list-of-names need a corresponding case label in this enum switch on type-name
Cause: You have specified an enumerated value to a switch condition. The enumeration constants with the given names have not corresponding case into the switch. It means that all the possible cases are not explicitly covered; It is preferrable they are all covered
Solving: Add a case for each missed constant name
Configurable; Default is: Warning incomplete_cases_on_enum
63 Message: The return type is incompatible with func-prototype
Cause: This error message is generated when an overriding function has a specified return type that is incompatible with the return type defined into the super-type
Solving: Replace the return type with a compatible type
Error incomptible_return_type
64 Message: The static feature-type feature-name should be accessed in a static way
Cause: For a instance function, you try to access to a static feature using a non-static syntax, e.g. obj.StaticFeature. It is preferable to use the static call syntax, e.g. MyType::StaticFeature, where MyType is the type of the object obj from the previous example
Solving: Replace the non-static syntax by the static syntax
Delegated to: org.eclipse.jdt.core.compiler.problem.staticAccessReceiver
Delegated; Default is: Warning instance_access_to_static_member
65a Message: Extended interface must be an interface
Cause: According to the syntax of SARL, an interface extends another interface. This error message indicates to you that the type after extends is not an interface
Solving: Remove the extends statement; or replace the invalid type by the appropriate class
Error interface_expected
65b Message: Implemented interface must be an interface
Cause: According to the syntax of SARL, a class implements interfaces. This error message indicates to you that one type after implements is not an interface
Solving: Remove the extends statement; or replace the invalid type by the appropriate class
Error interface_expected
65c Message: Invalid supertype. Expecting an interface
Cause: According to the syntax of SARL, a type (interface, capacity, etc.) extends another type. This error message indicates to you that the type after extends is not a type implemented with a Java interface, when it is expected to have one
Solving: Remove the extends statement; or replace the invalid type by the appropriate interface type
Error interface_expected
66 Message: any-message
Cause: This error is generated when the SARL compiler has encountered an internal error
Error internal_error
67 Message: Invalid type: ‘type-name’. Only capacities can be used after the keyword ‘uses’
Cause: The keyword uses enables to uses and import capacities within the scope of the entity (agent, behavior, etc.) in which the uses is specified. This error is generated when the type named type-name that is specified after an uses is not a sub-type of Capacity, i.e. it is not a capacity type
Solving: Remove the type-name after the keyword uses; or replace type-name by the name of an appropriate capacity
Error invalid_capacity_type
68a Message: Cannot cast from type-name-1 to type-name-2
Cause: The operands of the cast operator as have not compatible types. SARL compiler has found no way to convert a value of the type with name type-name-1, which is the type of the left operand of the as operator, to a value of the type with name type-name-2, which is the right operand of the as operator
Solving: Change the left expression in order to be of a compatible type with the right operand; or Replace type-name-2 by an appropriate type name; or Define a “totype-name-2()” function if type-name-2 is a class; or Define a “type-name-2Value()” function if *type-name-2 is a primitive type
Error invalid_cast
68b Message: Cannot cast from void to type-name-2
Cause: Since void represents the fact that there is not value, it is impossible to convert “nothing” to a value, whatever its type
Solving: Remove as operator
Error invalid_cast
69a Message: Cannot refer to an instance field field-name while explicitly invoking a constructor
Cause: According to the standards of object-oriented programming, nothing could append into an object before it was constructed. It means that when you are calling a constructor from inside a constructor’s block of code, the object is not yet built. Consequently, you cannot have access to the object’s fields (not static)
Solving: Rewrite the arguments to avoid the access to the object’s field
Error invalid_constructor_argument
69b Message: Cannot refer to an instance method while explicitly invoking a constructor
Cause: According to the standards of object-oriented programming, nothing could append into an object before it was constructed. It means that when you are calling a constructor from inside a constructor’s block of code, the object is not yet built. Consequently, you cannot have access to the object’s method (not static)
Solving: Rewrite the arguments to avoid the access to the object’s method
Error invalid_constructor_argument
70 Message: Constructor call must be the first expression in a constructor
Cause: According to the standards of object-oriented programming, nothing could append into an object before it was constructed. It means that the first possible instruction within any constructor’s code is a call to another constructor. This call may be explicit or implicit. This error is generated by your constructor’s code starts with statements that are not a constructor calls, followed by a constructor call
Solving: Move the constructor call first
Error invalid_constructor_invocation
71a Message: Invalid annotation value. skill-name is not an implementation of capacity-name
Cause: The @DefaultSkill annotation enables to specify programmatically the skill that may be used by default by an agent for implementing a capacity. The parameter named skill-name of the @DefaultSill must be a skill that implements the capacity capacity-name
Solving: Remove the @DefaultSkill; or replace skill-name by an appropriate skill type name
Error invalid_default_skill_annotation
71b Message: Invalid annotation value. It must be a type literal to a skill
Cause: The @DefaultSkill annotation enables to specify programmatically the skill that may be used by default by an agent for implementing a capacity. The parameter of the annotation must be the type name of a skill
Solving: Remove the @DefaultSkill; or replace skill-name by an appropriate skill type name
Error invalid_default_skill_annotation
72a Message: A return expression is not allowed in this context
Cause: This error message is generated when a return statement is defined in a context that cannot allow a return
Solving: Remove the return statement
Error invalid_early_exit
72b Message: A throw expression is not allowed in this context
Cause: This error message is generated when a throw statement is defined in a context that cannot allow to throw exceptions
Solving: Remove the throw statement
Error invalid_early_exit
73a Message: Supertype must be a subtype of ‘type-name
Cause: This error message is generated when the provided type after the extends statement is invalid; because it is not a sub-type of type-name strictly (i.e., not type-name itself)
Solving: Remove the type after extends; or replace it by the appropriate name of a sub-type of type-name
Error invalid_extended_type
73b Message: Supertype must be of type ‘type-name
Cause: This error message is generated when the provided type after the extends statement is invalid; because it is neither equals to type-name nor a sub-type of type-name
Solving: Remove the type after extends; or replace it by the appropriate name of a sub-type of type-name
Error invalid_extended_type
74 Message: The primitive type name is not a valid extension
Cause: Extension on fields is supported by SARL syntax. The purpose is to call the member of an object or a type that is marked by extension. A primitive type has no member. Consequently, using the extension on a variable of primitive type is impossile
Solving: Remove extension; or replace the primitive type by its object-oriented equivalent
Error invalid_extension_type
75 Message: any-message
Cause: Extra-language generator is an extension module of the SARL compiler. It has the role to generate source code in a specific programming language, e.g., Python, that is not supported by the core generator of the SARL compiler, i.e., Java. When the extra-language generator encounters an issue (error, warning or information), it is notified with is issue code
Error invalid_extra_language_generation
76 Message: Invalid type: ‘type-name’. Only events can be used after the keyword ‘fires’
Cause: The keyword fires specifies the events that could be fired by a function. This error is generated when the type named type-name that is specified after an fires is not a sub-type of Capacity, i.e. it is not a capacity type
Solving: Remove the type-name after the keyword fires; or replace type-name by the name of an appropriate capacity
Error invalid_firing_event_type
77 Message: any-message
Cause: This error message is generated when you pass an invalid type to a generic parameter type. Caution: this issue seems not to have a message template from the Xtext/Xbase source code
Solving: Change the type argument
Error invalid_generic_argument_types
78 Message:name’ is not a valid identifier
Cause: This error is generated when you are using an identifier that is corresponding to a keyword of the Java programming language. Since the SARL compiler create Java source file, in order to make the generated files compilable, any variable with a name equals to a JAva keyword must be avoided
Solving: Change the name
Error invalid_identifier
79a Message: Invalid implemented type: ‘type-name’. Only subtypes of ‘expected-name’ are allowed for ‘element-name
Cause: This error message is generated when the provided type named type-name is invalid when it is specified for an implements statement; because it is not a sub-type of expected-name strictly (i.e., not expected-name itself). When it is used for the definition of element-name, an implemented type must fullfil the previous typing constraint
Solving: Remove type-name; or replace it by the appropriate name of a sub-type of expected-name
Error invalid_implemented_type
79b Message: Invalid implemented type: ‘type-name’. Only the type ‘expected-name’ and one of its subtypes are allowed for ‘element-name
Cause: This error message is generated when the provided type named type-name is invalid when it is specified for an implements statement; because it is neither equals to expected-name nor a sub-type of expected-name. When it is used for the definition of element-name, an implemented type must fullfil the previous typing constraint
Solving: Remove type-name; or replace it by the appropriate name of a sub-type of expected-name
Error invalid_implemented_type
80a Message: Expression with side effect is not allowed in guards
Cause: The guard that is specified for a behavior unit may have side effect, i.e. it may modify the state of the current agent/behavior/skill, or of another object. According to the SARL specification, the behavior units’ guards must not have any side-effect because the guard’s expression could be evaluated in parallel for different behavior units on the same event. In order to be consistent between the different evaluations of the guard, the guard expression cannot change the state of any object
Solving: Rewrite the guard expression to avoid the uses of side-effect expressions
Error invalid_inner_expression
80b Message: This expression is not allowed in this context, since it doesn’t cause any side effects
Cause: This error is generated when you write an expression without side effect, where one is expected. For example, the following code generates this error:
def fct : void {
  var x = 1
}

In this case, the variable declaration has not side effect; and should not be used in this context
Solving: Remove the expression without side-effect
Error invalid_inner_expression
81a Message: Cannot perform instanceof check against parameterized type type-name
Cause: You have written a instanceof operator with a right operand containing a generic type parameter, e.g. x instanceof MyType<T>. It is impossible for now to the SARL compiler to consider the generic type parameter, e.g. T
Solving: Remove the generic type parameter from the right operand’s expression
Error invalid_instanceof
81b Message: Cannot perform instanceof check against primitive type type-name
Cause: You have written a primitive type as right operand of the instanceof operator. Since a primitive type is not object-oriented, it is impossible to test if an object is of a primitive type using the instanceof operator
Solving: Remove instanceof operator; or Replace the primitive type by its object-oriented equivalent type
Error invalid_instanceof
81c Message: Incompatible conditional operand types type-name-1 and type-name-2
Cause: When you are testing expression typing with instanceof, the types of the operands are not compatible. It means that the values of the operands cannot be compared. Therefore, the instanceof operator becomes useless
Solving: Remove the instanceof operator; or Rewrite the instanceof expression to have compatible types for both operands
Error invalid_instanceof
82a Message: ‘it’ and ‘this’ are not allowed as member names
Cause: Names it and this are reserved by the SARL compiler. They cannot be used for naming your type members
Solving: Change the name of your type member
Error invalid_member_name
82b Message: Invalid action name ‘name’. You must not give to an action a name with reserved characters
Cause: You have defined an name for an action/function/method that contains forbidden characters. The major forbidden character is $. It is not allowed to use it inside a name, even if it is allowed into the Java specification
Solving: Rename your action
Error invalid_member_name
82c Message: The nested type type-name cannot hide an enclosing type
Cause: You have define an inner type with a name. One of the enclosing types has also the same name. It is forbidden because it hides the features of the enclosing type from the inner type
Solving: Rename your inner type
Error invalid_member_name
83a Message: Abstract method member-name cannot be final
Cause: It is forbidden to declare a function abstract and final at the same time. Indeed, a final function disables the function overriding, and an abstract function must be always overridden
Solving: Remove one of the two modifiers
Error invalid_modifier
83b Message: Abstract method member-name cannot be private
Cause: It is forbidden to declare a function abstract and private at the same time. Indeed, a private function cannot be overridden because it is not visible, and an abstract function must be always overridden
Solving: Remove one of the two modifiers
Error invalid_modifier
83c Message: Abstract method member-name cannot be static
Cause: It is forbidden to declare a function abstract and static at the same time. Indeed, a static function cannot be overridden, and an abstract function must be always overridden
Solving: Remove one of the two modifiers
Error invalid_modifier
83d Message: Duplicate modifier for the name
Cause: Duplicate modifiers are not allowed
Solving: Remove the duplicate modifier
Error invalid_modifier
83e Message: Illegal modifier for the ; only list-of-modifiers are permitted
Cause: You have used a modifier that is not allowed. The list-of-modifiers shows you the valid modifiers at the place of the issue
Solving: Remove the modifier
Error invalid_modifier
83f Message: Method member-name with a body cannot be abstract
Cause: An abstract function is by definition a function without a body
Solving: Remove the abstract modifier; or remove the block of code
Error invalid_modifier
83g Message: Native methods do not specify a body
Cause: A native function is always implemented by a very-low level library, usually written in C programming language. You cannot provide a block of code for a native function
Solving: Remove the native modifier; or remove the block of code
Error invalid_modifier
83h Message: The member-name can either be abstract or final, not both
Cause: It is forbidden to declare a function abstract and final at the same time. Indeed, a final function disables the function overriding, and an abstract function must be always overridden
Solving: Remove one of the two modifiers
Error invalid_modifier
83i Message: The member-name can either be abstract or static, not both
Cause: It is forbidden to declare a function abstract and static at the same time. Indeed, a static function cannot be overridden, and an abstract function must be always overridden
Solving: Remove one of the two modifiers
Error invalid_modifier
83j Message: The member-name can either be var or val / final, not both
Cause: var modifier is for declared a modifiable variable. val modifier (or final val) is for declaring a unmodifiable variable. You cannot use var and val at the same time
Solving: Remove one of the two modifiers
Error invalid_modifier
83k Message: The member-name can only set one of public / package / protected / private
Cause: You cannot specify more than one visibility modifier at a time
Solving: Select and use one of the visibility modifiers
Error invalid_modifier
83l Message: The field name can be either final or volatile, not both
Cause: It is forbidden to declare a field with the both modifiers at the same time. A final field does not need synchronization, that is provided by volatile
Solving: Remove one of the two modifiers
Error invalid_modifier
84a Message: The type-name-1 is already covered by the caught type-name-2
Cause: You have specified multiple types, including type-name-1 and type-name-2, into a multi-catch statement. The type-name-1 is redundant because it is a sub-type of type-name-2
Solving: Remove type-name-1
Error invalid_multitype_part
84b Message: The caught type-name is redundant
Cause: You have specified multiple types, including type-name, into a multi-catch statement. The type-name is specified more than one time. You must not specify a type more than one time
Solving: Remove one occurrence of type-name
Error invalid_multitype_part
85 Message: Cannot expression refer to the non-final variable var-name inside a lambda expression
Cause: You have written an expression inside a closure/lambda expression that is referring a variable that is not marked as final. In this case, the state of the variable becomes unpredictable for the internal class that is supporting the lambda expression implementation (due to the targeting to Java). That’s why only final (or quasi-final) variables could be used in lambda expressions
Solving: Replace var definition of the variable by a var definition; or Use another final variable from the lambda expression
Error invalid_mutable_variable_access
86a Message: Nested agents are not allowed inside enclosing-type
Cause: It is not allowed by the SARL language’s syntax to define an agent inside another type declaration, named enclosing-type
Solving: Move the agent definition outside the enclosing type
Error invalid_nested_definition
86b Message: Nested behaviors are not allowed inside enclosing-type
Cause: It is not allowed by the SARL language’s syntax to define a behavior inside another type declaration, named enclosing-type
Solving: Move the behavior definition outside the enclosing type
Error invalid_nested_definition
86c Message: Nested capacities are not allowed inside enclosing-type
Cause: It is not allowed by the SARL language’s syntax to define a capacity inside another type declaration, named enclosing-type
Solving: Move the capacity definition outside the enclosing type
Error invalid_nested_definition
86d Message: Nested events are not allowed inside enclosing-type
Cause: It is not allowed by the SARL language’s syntax to define an event inside another type declaration, named enclosing-type
Solving: Move the event definition outside the enclosing type
Error invalid_nested_definition
86e Message: Nested skills are not allowed inside enclosing-type
Cause: It is not allowed by the SARL language’s syntax to define a skill inside another type declaration, named enclosing-type
Solving: Move the capacity definition outside the enclosing type
Error invalid_nested_definition
87a Message: Invalid number of arguments. The feature-type feature-prototype is not applicable for the arguments list-of-arguments
Cause: You are calling a feature (method or constructor) with a list-of-arguments. But, the called feature required a different number of arguments
Solving: Call the feature with the correct number of arguments
Error invalid_number_of_arguments
87b Message: Invalid number of arguments. The feature-type feature-prototype is not applicable without arguments
Cause: You are calling a feature (method or constructor) without arguments. But, the called feature required to have arguments
Solving: Add arguments into your calling expression
Error invalid_number_of_arguments
88a Message: Incorrect number of arguments for type type-name ; it cannot be parameterized with arguments type-arguments
Cause: You are referencing a type with a list of generic type arguments (list-arguments). But, the referenced type required a different number of generic type arguments
Solving: Reference the type with the correct number of arguments
Error invalid_number_of_type_arguments
88b Message: Invalid number of type arguments. The feature-type feature-name is not applicable for the type arguments type-arguments
Cause: You are calling a feature (method or constructor) with a list of generic type arguments (list-arguments). But, the feature required a different number of generic type arguments
Solving: Call the feature with the correct number of arguments
Error invalid_number_of_type_arguments
89a Message: Invalid use of the unmodifiable feature ‘occurrence’. You cannot use ‘occurrence’ as the operand of a postfix operator because it causes a side effect
Cause: The keyword occurrence represents the current instance of the just-received event within a behavior unit. It is assumed within the SARL operational semantics that occurrence instance is an unmodifiable event in order to ensure consistency between the different behavior units that handle the occurrence. This error message is generated when you try to change the value of occurrence with a postfix operator, e.g., ++, that is forbidden
Error invalid_occurrence_readonly_use
89b Message: Invalid use of the unmodifiable feature ‘occurrence’. You cannot use ‘occurrence’ at the left-side of an assignment operator
Cause: The keyword occurrence represents the current instance of the just-received event within a behavior unit. It is assumed within the SARL operational semantics that occurrence instance is an unmodifiable event in order to ensure consistency between the different behavior units that handle the occurrence. This error message is generated when you try to assign a value to an occurrence, that is forbidden
Error invalid_occurrence_readonly_use
90 Message: Incompatible operand types left and right
Cause: When you are testing expression equality with ===, the types of the operands are not compatible. It means that the values of the operands cannot be compared
Solving: Rewrite your code in order to have compatible types for both operands
Error invalid_operand_types
91a Message: The binary operator ‘name’ allows at most two arguments
Cause: You try to use the operator name with zero or one operand; that is not allowed
Solving: Rewrite the expression with the failing operator
Configurable; Default is: Error invalid_operator_signature
91b Message: The binary operator ‘name’ requires at least one argument
Cause: You try to use the operator name with zero operand; that is not allowed
Solving: Rewrite the expression with the failing operator
Configurable; Default is: Error invalid_operator_signature
91c Message: The operator ‘name’ allows at most two arguments
Cause: You try to use the operator name with more than two operands; that is not allowed
Solving: Rewrite the expression with the failing operator
Configurable; Default is: Error invalid_operator_signature
91d Message: The static binary operator ‘name’ requires exactly two arguments
Cause: You try to use the operator *name
with zero or one operand; that is not allowed
Solving: Rewrite the expression with the failing operator
Configurable; Default is: Error invalid_operator_signature
91e Message: The static operator ‘name’ allows at most two arguments
Cause: You try to use the operator name without operand, when it requires at least one
Solving: Rewrite the expression with the failing operator
Configurable; Default is: Error invalid_operator_signature
91f Message: The static operator ‘name’ requires at least one argument
Cause: You try to use the operator name without argument, when it requires at least one
Solving: Rewrite the expression with the failing operator
Configurable; Default is: Error invalid_operator_signature
91g Message: The static unary operator ‘name’ requires exactly one argument
Cause: You try to use the operator name with a number of operand that is not equal to 1; that is not allowed
Solving: Rewrite the expression with the failing operator
Configurable; Default is: Error invalid_operator_signature
91h Message: The unary operator ‘name’ allows at most one argument
Cause: You try to use the operator name with more than 1 operand; that is not allowed
Solving: Rewrite the expression with the failing operator
Configurable; Default is: Error invalid_operator_signature
92a Message: Invalid return inside throw
Cause: It is forbidden to specify a return statement into a throw expression because the outer early-exit point (throw) could be never reached due to the execution of the inner early-exit point (return). It is inconsistent to do a regular return for a function inside the expression of an exceptional exit from the same function
Solving: Remove return from the throw expression
Error invalid_return
92b Message: Invalid return’s expression
Cause: SARL compiler infers that the type of the expression after a return statement is of type void. It is impossible to return “nothing” when a value is expected
Solving: Change the return expression in order to compute a value of the appropriate type
Error invalid_return
92c Message: Return cannot be nested
Cause: It is forbidden to specify a return statement into another return expression because the outer early-exit point could be never reached due to the execution of the inner early-exit point. It is inconsistent to do a return for a function inside the expression that computes another value to be returned from the same function
Solving: Remove the inner return from the outer return expression
Error invalid_return
92d Message: The function must return a result of type type-name
Cause: An incompatibility between the type of the expression after a return statement and those of the return value of the enclosing function is detected. Both types must be compatible, i.e., the type of the expression after the return statement must be equal to or a sub-type of the function’s return type
Solving: Update the expression of the return statement to have an appropriate type
Error invalid_return
92e Message: Void functions cannot return a value
Cause: You are specifying a return statement with an expression inside a procedure, i.e. a function returning “nothing”. Is it inconsistent to compute a value to be returned while the function does not return it
Solving: Remove the expression from the return statement
Error invalid_return
93 Message: JUnit method func-name must be void but is type-name
Cause: By specification, the functions that are dedicated to JUnit must return void. This issue is generated when an function with a JUnit annotation does not return void. The supported versions of Junit are 4 and 5
Solving: Replace the return type by void
Error invalid_return_type_in_case_of_junit_annotation
94 Message: Incompatible SARL library on the classpath. Actual: actual-version. Expected: expected-version
Cause: The SARL library found on the classpath (actual-version) is not compatible with the compiler’s version (expected-version)
Solving: Reconfigure your project to have the SARL libraries with expected-version into the classpath
Error invalid_sarl_lib_on_classpath
95 Message: Cannot call super of an anonymous class from a lambda expression
Cause: A closure/lambda expression is implemented by an anonymous class at the background, i.e. Java. You try to use the super statement that represents the instance viewed as the super-type of the associated anonymous class. However, it is forbidden to use super because the closure/lambda expression hides the background implementation, inclusing super
Solving: Remove super
Error invalid_super_call
96 Message: The resource ‘var-name’ of type type-name does not implement java.lang.AutoCloseable
Cause: The try-with-resource statement enables you to automatically close an opened resource (file, socket, etc.). The given resource, named var-named must implement the interface AutoCloseable in order to be able to be automatically closed. This constraint comes from the Java underground API
Solving: Change the resource by using one that is auto-closeable
Error invalid_try_resource_type
97a Message: ‘void[]’ is not a valid type
Cause: This error is generated when you are specifying a type literal representing an array of void, e.g. void[] or void[][]. An array of void cannot be created in memory. It is therefore impossible to specify this type with a type literal
Solving: Replace void by and appropriate type
Error invalid_type
97b Message: Undefined type for the default value of the formal parameter name
Cause: The type of the default for the formal parameter with the given name cannot be infered by the SARL compiler
Solving: Change the default value’s expression in order to make its type inferable
Error invalid_type
97c Message: Undefined type for the formal parameter name
Cause: A type specification is missed for the formal parameter with the given name
Solving: Add a type to the formal parameter
Error invalid_type
98a Message: Invalid type argument. Type arguments cannot be applied to the type literal name
Cause: You have specified a generic type argument into a type literal such as typeof; that is invalid. For example, typeof(Collection) is valid; but typeof(Collection<String>) is not
Solving: Remove the generic type argument
Error invalid_type_arguments_on_type_literal
98b Message: Invalid type arguments. Type arguments cannot be applied to the type literal name
Cause: You have specified generic type arguments into a type literal such as typeof; that is invalid. For example, typeof(Collection) is valid; but typeof(Collection<String, Integer>) is not
Solving: x
Error invalid_type_arguments_on_type_literal
99a Message: The array type type-name cannot be used as a type parameter bound
Cause: It is forbidden to use an array type into the generic type bounds, e.g. <? extends Integer[]>
Solving: Replace the array into the generic bounds by an appropriate type
Error invalid_type_parameter_bounds
99b Message: The type parameter %name% cannot be used as a type parameter bound with additional bounds
Cause: If you put a generic type paramater as bounds of another generic type parameter, it is forbidden to add more bounding constraints. For example, <A, B extends A> is valid. But, <A, B extends A & Cloneable> is invalid
Solving: Remove the additional bounding constraint
Error invalid_type_parameter_bounds
100a Message: Invalid use of the break keyword. It could only be used inside loops
Cause: break statement enables to stop the execution of a loop step by continuing the execution after the loop itself. The break keyword is not supposed to be used outside a loop expression
Solving: Remove the break statement
Error invalid_use_of_loop_breaking_keyword
100b Message: Invalid use of the continue keyword. It could only be used inside loops
Cause: continue statement enables to stop the execution of a loop step by continuing the execution at the next loop step. The continue keyword is not supposed to be used outside a loop expression
Solving: Remove the break statement
Error invalid_use_of_loop_breaking_keyword
101a Message: Create methods can not be static
Cause: Creation method is inspired from the factory-method design pattern. It cannot be defined with the static modifier
Solving: Remove the static modifier
Error invalid_use_of_static
101b Message: Create methods can not have type parameters
Cause: Creation method is inspired from the factory-method design pattern. It cannot have generic type parameters
Solving: Remove the generic type parameters
Error invalid_use_of_static
102a Message: Cannot perform instanceof check against type parameter name. Use its erasure erasure-name instead since further generic type information will be erased at runtime
Cause: You specify a generic type parameter as the right operand of an instanceof, e.g. x instanceof T. Since there is no keept information about the generic types at runtime, the instanceof operator cannot proceed. The erasure-name is the base definition of name related to its bounds
Solving: Replace name by erasure-name
Error invalid_use_of_type_parameter
102b Message: Cannot perform type switch against type parameter name. Use its erasure Object instead since further generic type information will be erased at runtime
Cause: You specify a generic type parameter as the type guard of a case, e.g. T case 1. Since there is no keept information about the generic types at runtime, the case statement cannot filter according to the type of the value. It is therefore recommended to use Object as the type guard
Solving: Remove the type guard
Error invalid_use_of_type_parameter
102c Message: Illegal class literal for the type parameter name
Cause: You specify a generic type parameter as a type literal, e.g. typeof(T). Since there is no keept information about the generic types at runtime, the typeof operator cannot reply the class at runtime
Solving: Replace name by an appropriate type from the erasure of name
Error invalid_use_of_type_parameter
103a Message: A vararg may not be an extension
Cause: By definition a variadic parameter, e.g., a : int* is a kind of list of argument values. Since the extension mechanism is associated to a single instance of object, and the variadic parameter may contains more than one, there is an incompatibility between the variadic parameter and the extension mechanism
Solving: Remove the keyword extension to the variadic parameter
Error invalid_use_of_varArg
103b Message: A vararg must be the last parameter
Cause: By definition a variadic parameter, e.g., a : int*, must be the last formal parameter of a function
Solving: Move the variadic parameter at the last position in the list of the formal parameters
Error invalid_use_of_varArg
104a Message: Primitive void cannot be used here
Cause: This message is generated in to cases.
a) Generic type argument: it is forbidden to put primitive void as generic type arguments, e.g. Collection<void>.
b) Guard type into a switch case: it is forbidden to put primitive void as guard type, e.g. void case 1
Solving: Replace void by its appropriate equivalent class
Error invalid_use_of_void
104b Message: Primitives are not allowed as type guards
Cause: It is forbidden to put primitive type as guard type, e.g. int case 1
Solving: Replace the primitive type by its appropriate equivalent class
Error invalid_use_of_void
104c Message: Primitives cannot be used as type arguments
Cause: It is forbidden to put primitive types as generic type arguments, e.g. Collection<int>. You must use only classes as generic type arguments, e.g. Collection<Integer>
Solving: Replace the primitive type by its appropriate equivalent class
Error invalid_use_of_void
104d Message: Primitives cannot be used as type arguments
Cause: It is forbidden to put primitive types as generic type arguments, e.g. Collection<int>. You must use only classes as generic type arguments, e.g. Collection<Integer>
Solving: Replace the primitive type by its appropriate equivalent class
Error invalid_use_of_void
104e Message: The primitive ‘void’ cannot be the type of a function parameter
Cause: This error is generated when a reference to a function, a.k.a. as pointer to a function, is specified with a void type. A function has parameters and returns values. It is not void
Solving: Replace void by an appropriate pointer to a function
Error invalid_use_of_void
104f Message: The primitive ‘void’ cannot be the type of a parameter
Cause: A formal parameter must have a type. Consequently, void cannot be specified as the type of a formal parameter
Solving: Replace void by an appropriate type
Error invalid_use_of_void
104g Message: The primitive type cannot be a type argument
Cause: It is forbidden to put primitive types as generic type parameters, e.g. Collection<int>. You must use only classes as generic type parameters, e.g. Collection<Integer>
Solving: Replace the primitive type by its appropriate equivalent class
Error invalid_use_of_void
104h Message: void is an invalid type for the variable name
Cause: Since a variable is supposed to contain a value, it is important to specify the size of memory that is occupied bythe variable. This specification is done by giving a type to the variable. void is not a valid type in this context
Solving: Replace void by an appropriate type
Error invalid_use_of_void
105 Message: Wildcard types are not allowed in this context
Cause: It is forbidden to put wildcard as generic type parameters, e.g. Collection<?>. You must use only classes as generic type parameters, e.g. Collection<Integer>
Solving: Replace the wildcard by an appropriate class
Error invalid_use_of_wild_card
106a Message: Invalid type constraint. Cannot use multiple lower bounds in wildcards
Cause: Inside a type reference, you have specified a type constraints with too much lower bounds, e.g. new MyType<? super Number &amp; CharSequence>. Currently, SARL does not support multiple lower bounds into the generic type references
Solving: Modify the bounds to have maximum one lower bound
Error invalid_wildcard_constraints
106b Message: Invalid type constraint. Cannot use multiple upper bounds in wildcards
Cause: Inside a type reference, you have specified a type constraints with too much upper bounds, e.g. new MyType<? extends Number &amp; CharSequence>. Currently, SARL does not support multiple upper bounds into the generic type references
Solving: Modify the bounds to have maximum one upper bound
Error invalid_wildcard_constraints
107 Message: Invalid number format: explaination
Cause: A number literal has not a valid syntax
Solving: Change the number literal to fullfil the number syntax
Error invalidNumberFormat
108a Message: Cannot access the private feature in a subclass context
Cause: You try to access to a field that is declared as private into the super-type
Error invisible_feature
108b Message: The field feature is not visible
Cause: You try to access to a field that is declared as private into its enclosing type
Error invisible_feature
108c Message: The method feature is not visible
Cause: You try to access to a method that is declared as private into its enclosing type
Error invisible_feature
109 Message: javaDoc: type-ref cannot be resolved to a type
Cause: A hyperlink to a type into the Javadoc points to an unknown type named type-ref
Solving: Change the type-name
Delegated to: org.eclipse.jdt.core.compiler.problem.invalidJavadoc
Delegated; Default is: Ignored java_doc_linking
110 Message: Use ‘as’ keyword for type casting
Cause: SARL has detected possible improper usage of the parentheses, i.e., a type reference enclosed by parentheses is found. This syntax is well known is other programming languages such as Java or C++, as the casting operator. However, the casting operator in SARL is as. For example, this error is detected when you starts a code block with the improper syntax, e.g. {(Integer) 1}
Solving: Replace the Java-like casting operator by as
Configurable; Default is: Error java_style_type_cast
111a Message: Couldn’t find a valid version of the JDK in the classpath. The generator configuration specifies the version current-version. Please change the configuration in order to use a version greater than or equal to min-version AND strictly lower than max-version
Cause: SARL needs a specific version of the Java Development Kit (JDK) in order to be executed. The current-version of the JDK that is used for compiling your SARL project is not compatible with SARL. It is recommended to use a JDK version between min-version (inclusive) and max-version (exclusive)
Solving: Change the configuration of your SARL project for using an appropriate JDK version
Error jdk_not_on_classpath
111b Message: SARL compiler couldn’t be executed on the JDK version current-version. Please use the JDK greater than or equal to min-version AND strictly lower than max-version
Cause: SARL needs a specific version of the Java Development Kit (JDK) in order to be executed. The current-version of the JDK is not compatible with SARL. It is recommended to use a JDK version between min-version (inclusive) and max-version (exclusive)
Solving: Run SARL with an appropriate JDK version
Error jdk_not_on_classpath
112 Message: Left-hand side of an assignment must be an variable
Cause: The left operand of the assignment operator = must be a variable (local, field, or indirect)
Error left_hand_side_must_be_variable
113a Message: name cannot be resolved to a type
Cause: You have specified a type name into your code, e.g. typeof(MyType). But, no type declaration was found for name into the current compilation scope
Solving: Replace name by an appropriate type name; or Add the type name into the compilation scope, by using an import statement for example
Error Linking
113b Message: Couldn’t resolve reference to name
Cause: You have written a reference to a feature that cannot be found from the current compilation scope. Since, it cannot be found, SARL compiler cannot determine the concrete type of the feature
Solving: Replace name by an appropriate feature; or Add the feature into the compilation scope, by using an import statement for example
Error Linking
113c Message: The method func-prototype is undefined
Cause: You have specified a function call to func-prototype into your code, e.g. myfct(). But, no method declaration was found for func-prototype into the current compilation scope
Solving: Replace func-prototype by an appropriate function call; or Add the method into the compilation scope, by using an import statement for example
Error Linking
113d Message: The method func-prototype is undefined for the type type-name
Cause: You have specified a function call to func-prototype into your code, e.g. myfct(). But, no method declaration was found for func-prototype into the current compilation scope
Solving: Replace func-prototype by an appropriate function call; or Add the method into the compilation scope, by using an import statement for example
Error Linking
113e Message: The method or field name is undefined
Cause: You have specified a function call to name, or a reference to the field name, into your code. But, neither a method declaration nor a field declaration was found into the current compilation scope
Solving: Replace name by an appropriate function call or field reference; or Add the method/field into the compilation scope, by using an import statement for example
Error Linking
113f Message: The method or field name is undefined for the type type-name
Cause: You have specified a function call to name, or a reference to the field name, into your code. But, neither a method declaration nor a field declaration was found into the current compilation scope
Solving: Replace name by an appropriate function call or field reference; or Add the method/field into the compilation scope, by using an import statement for example
Error Linking
114 Message: Cannot access the type-name feature-name with parentheses
Cause: This error is generated when you try to access to a local variable with parentheses. Let be the local variable x defined. The code x() causes this error because x is a variable, not a method
Solving: Remove the parentheses
Error local_var_access_with_parentheses
115 Message: Discouraged manual definition of an inline expression. Inline expression definition is reserved for advanced usage
Cause: The @Inline annotation enables the SARL compiler to replace the call to the annotated function by the expression specified inside the annotation. It may be useful for making faster the generated Java code. However, the expression inside @Inline must be written in valid Java and following strict inlining rules. That’s why, the explicit usage of @Inline is not recommended, except to advanced SARL developers
Solving: Remove the @Inline annotation
Configurable; Default is: Warning manual_inline_definition
116a Message: The abstract method func-name in type type-name can only be defined by an abstract class
Cause: An abstract method/function is a function without block of code. The keyword abstract could be missed on a function only if the enclosing type is defined as abstract too
Solving: Add the modifier abstract into the prototype of func-name
Error missing_abstract
116b Message: The method func-name in type type-name should be declared abstract
Cause: An abstract method/function is a function without block of code. The keyword abstract could be missed but it is a good practice to specify it explicitle. This warning is generated to notify you that an abstract is missed and may be added to the function prototype
Solving: Add the modifier abstract into the prototype of func-name
Warning missing_abstract
117 Message: The abstract method func-prototype in type type-name can only be defined by an abstract class
Cause: It is forbidden to define an abstract function into an anonymous class
Solving: Add block of code for the function with prototype func-prototype
Error missing_abstract_in_anonymous
118 Message: The class name is not declared abstract
Cause: The name of the class starts with the word Abstract, and the class has not the abstract modifier. Because the term “abstract” is part of the name of the class, it is a good practice to declare the class as abstract
Solving: Add abstract modifier to the class; or remove “Abstract” from name
Configurable; Default is: Warning missing_abstract_modifier
119 Message: The annotation must define the attribute ‘name
Cause: An annotation needs to have a specified value. This error message is generated when no value is specified into the annotation
Solving: Add a value to the annotation
Error missing_attribute_definition
120 Message: Missing code for a static constructor
Cause: A static constructor could be defined for initializing the static fields of a type. It is forbidden to define a static constructor without a block of code
Solving: Add a block of code to the static constructor
Error missing_body
121 Message: No default constructor in super type other-type. type-name must define an explicit constructor
Cause: You have define a type named type-name with a default constructor. But, the super-class does not have a default constructor. It is then impossible for your implicit default constructor to invoke a default constructor from the super-class. You must define explicitly your own constructor. This issue should never occur because the constructors from the super type are inherited when there is no explicit constructor defined
Error missing_constructor
122 Message: Value must be initialized
Cause: Final variables, a.k.a. value, could be declared with val, and must be initialized when they are declared. You have declared a final variable that is never initialized
Solving: Add initialization value to the final variable
Error missing_initialization
123 Message: The method func-prototype of type type-name must use override keyword since it actually overrides a supertype method
Cause: A function with the prototype func-prototype is defined into the type type-name. The same function prototype is defined into and inherited from a super-type. A good practice is to replace the def keyword by override in order to make explicit the fact that the function into type-name overrides another function
Configurable; Default is: Ignored missing_override
124 Message: Nested classes must be static
Cause: SARL specification forces to have static inner classes due to implementation of Xtext/Xtend
Solving: Add static modifier to the nested class
Error missing_static_modifier
125 Message: The overridden method is synchronized, the current one is not synchronized
Cause: According the inheritance definition, that is common to SARL and the object-oriented programming languages, overridable functions as associated to a contract with their callers. This contract indicates that the prototype of the function will never changed, and the function will have the same modifiers always. This contract must be fullfil by the overriding functions. This warning message is generated when your overriding function has not the synchronized modifier, and the inherited function has the synchronized modifier. It is a good practice to exhibit the same modifiers as the inherited function
Solving: Add synchronized modifier to your function
Error missing_synchronized
126a Message: Missing implemented type ‘type-name-1’ for ‘type-name-2
Cause: SARL detects for the declaration of the type named type-name-2 that an implementation specification after implements is missed. The expected implementation must be a type that is equal to or a sub-type of the type named type-named-1
Solving: Add an appropriate implemented type
Error missing_type
126b Message: Type cannot be derived
Cause: Within a variable declaration with var or val, no type was specified. SARL was failed to infer the type of the variable, notably because an initialization expression is missed for the variable. Because a variable must have a type, it is forbidden to let the variable type free
Solving: Add an explicit type to the variable, or Add an initialization expression for the variable
Error missing_type
127 Message: Multiple annotations of non-repeatable type @name. Only annotation types marked @Repeatable can be used multiple times at one target
Cause: By definition, an annotation could be attached multiple times to an element only if it is declared as repeatable with the @Repeatable annotation. This issue message is generated when the annotation with the given name is attached multiple times to an element, and the annotation @Repeatable is not attached to the declaration of the annotation with the given name
Error multiple_annotations_used
128 Message: No default constructor in super type type-name. Another constructor must be invoked explicitly
Cause: You have define a type extending the type type-name and with an explicit constructor. Inside the code of this explicit constructor, you call the default constructor (implicitly or explicitly). But, the super-type does not have a default constructor
Solving: Update you constructor code in order to invoke a constructor of the super-type
Error must_invoke_super_constructor
129 Message: The attribute value is undefined for the annotation type name
Cause: You are trying to provide a value to an annotation, but the field value is not defined into the annotation.
This error may occur when you write @MyAnnotion("value") with a definition of MyAnnotation without a field named value. In this example, assuming that the declared field is named myfield, the correct notation is @MyAnnotation(myfield = "value").
As for other languages as Java, SARL assumes that if the name of the attribute is not provided, the default attribute name is value
Solving: Add the name of the attribute before the value
Error no_attribute_value
130a Message: No enclosing instance of the type name is accessible in scope
Cause: You are referencing a feature within the type type that is defined non-statically. But, these is no accessible instance of the type name within the enclosing types. The following example is a typical example for this error:
class A {
  def f : void {}
  static class B {
    def g : void {
      f
    }
  }
}

The reference to f causes this error because the instance of A is inaccessible from B due to its static declaration
Error no_enclosing_instance_available
130b Message: The enclosing type does not extend or implement the interface name
Cause: Your are calling a feature (method or field) from the super-type by using the syntax super.feature. The super-type does not implement the interface name that is required to access to the specified feature
Error no_enclosing_instance_available
131 Message: The value for an annotation attribute must be a constant expression
Cause: It is forbidden to give a value to an annotation that is not a constant expression, i.e., an expression without variable reference, function calls, etc
Solving: Rewrite the value expression to have only constant features inside
Error no_illegal_value
132 Message: Cannot use null-safe feature call on primitive receiver
Cause: Null-safe call of an method, e.g. obj?.feature, enables you to test the nullity of an object before calling a feature on it. But, you have applied the null-safe call on a primitive type variable, i.e. obj is of primitive type. This is impossible because a primitive variable does not contain an object
Solving: Remove the null-safe operator
Error null_safe_feature_call_on_primitive
133 Message: Null-safe call of primitive-valued feature feature-name, default value value will be used
Cause: This issue message is generated when a null-safe test is used for computing a primitive-type value. For example, the code list?.isEmpty explicitly replies the value of isEmpty if the list is not null. But when list is null, nothing indicates what could be the boolean value to give. SARL compiler assumes the default value for the primitive type, e.g. false for boolean.
This issue message is also generated when your are using an incomplete if-then statement, e.g. var b = if (condition) true. There is no else, so that the default value for the primitive type is assumed if the condition is evaluated to false
Solving: Update your code to have a complete coverage of the cases
Configurable; Default is: Warning null_safe_feature_call_on_primitive_valued_feature
134 Message: Superfluous @Override annotation
Cause: From JAva language API, the annotation @Override is defined in order to mark a function as a function that is overridding another function. The usage of this annotation is not recommended, even it is still possible. This warning message is generated when the function is already defined with the override keyword, and annotated with @Override. In this case, the annotation is superfluous
Solving: Remove @Override
Warning obsolete_annotation_override
135 Message: Unnecessary cast from type-name-1 to type-name-2
Cause: You are using a cast operator as. But, the type of the left-operand expression is already compatible with the specified type as right operand. In other words, it is not necessary to cast explicitly the left expression to the right type
Solving: Remove as operator
Delegated to: org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck
Delegated; Default is: Warning obsolete_cast
136 Message: The expression of type type-name-1 is already of type type-name-2
Cause: You are using instanceof. But, the type of the left-operand expression is already compatible with the specified type as right operand. In other words, it is not necessary to test the type of the expression again the type; or the instanceof operator is always evaluated to true
Solving: Remove instanceof operator, and any “else” statement that is associated with the operator
Delegated to: org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck
Delegated; Default is: Warning obsolete_instanceof
137 Message: The method func-prototype of type type-name shadows the method other-prototype of type other-type, but does not override it
Cause: You have used the keyword override for declaring the function with prototype func-prototype. Since the function in type-name is not overriding a function from other-type with the same erasure, but with differences into the prototype such that your function is hidding the function of other-type. You function should be defined with def instead of overrride
Solving: Replace override by def
Error obsolete_override
138a Message: Constructor call without parentheses
Cause: This error message is generated when a constructor is defined without a formal parameter, e.g. new (), and this constructor is called without parentheses, e.g. this. In several programming standards, it is considered as a good practice to write the parentheses for each constructor call, even if there is no argument to pass to
Solving: Add ()
Configurable; Default is: Ignored operation_without_parentheses
138b Message: Method call without parentheses
Cause: This error message is generated when a function is defined without a formal parameter, e.g. def fct(), and this function is called without parentheses, e.g. fct. In several programming standards, it is considered as a good practice to write the parentheses for each method call, even if there is no argument to pass to
Solving: Add ()
Configurable; Default is: Ignored operation_without_parentheses
139a Message: Attempt to override final class
Cause: You define a class that is extending another class. But, the super class was defined as not extendable, with the final modifier. You cannot extend a class that is not extendable
Solving: Change the super-type
Error overridden_final
139b Message: Attempt to override final method func-prototype
Cause: You define a function with the given prototype func-prototype that is overriding an inherited function. But, the inherited function was defined as not overridable, with the final modifier. You cannot override a function that is not overridable
Solving: Remove your function
Error overridden_final
140 Message: Cannot reduce the visibility of the overridden method func-prototype
Cause: According the inheritance definition, that is common to SARL and the object-oriented programming languages, overridable functions as associated to a contract with their callers. This contract indicates that the prototype of the function will never changed, and the function will have the same accessibility/visibility always. This contract must be fullfil by the overriding functions. This error message is generated when your overriding function has a visibility lower than the visibility of the inherited function
Solving: Change the visibility of your function by moving up at least to the same visibility as the inherited function
Error override_reduces_visibility
141 Message: Redundant definition of the default value for the formal parameter name
Cause: This warning message is generated when you declared a default value for a formal parameter that has already a default value declared into one of the super types. It is not necessary to redefine the same default value for the formal parameter
Solving: Remove the redundant declaration fo the default value
Configurable; Default is: Warning parameter_default_value_redefinition
142 Message: The field field-name should be synchronized for avoiding value inconsistency due to parallel execution
Cause: Within the SARL operational semantic, a SARL program is executed in parallel, i.e., all the behavior units and the individual agent tasks are executed in different threaded tasks. Due to this run-time principle, the access to the fields within the scope of an agent (agent, behavior, skill) must be considered carefully. This issue code is generated by the compiler in order to notify the SARL developer that a synchronization issue may occur on the field named field-name. In this case, the SARL compiler cannot infer a default synchronization policy, it is recommended to the SARL developer to implement explicitly a synchronization method
Solving: Put the field access into a synchronization block
Configurable; Default is: Warning potential_field_synchronization_problem
143a Message: Potential inefficient value conversion. This operation is based on a call to the function ‘func-name’, which generates a value of type ‘origin-type’ that is converted on-the-fly to ‘target-type
Cause: When the as casting operator is used, SARL compiler infers the best method to convert the origin expression of type origin-type to the target target-type. The possible methods are:
1) Direct low-level cast that is natively supported by the virtual machine.
2) If target-type is a primitive type, find a function named “target-typeValue()” within the current scope.
3) If target-type is not a primitive type, find a function named “totarget-type()” within the current scope.
If none of these cases fits, an cast error is generated. However, the cases 2 and 3 means that a cast operator will be supported by a call to func-name function. Depending on the implementation of func-name, the call may be inefficient at run-time
Configurable; Default is: Warning potential_inefficient_value_conversion
143b Message: Potential inefficient value conversion. This operation is based on a call to the function ‘func-name’, which may cause inefficient code execution
Cause: When the as casting operator is used, SARL compiler infers the best method to convert the origin expression to a target type. The possible methods are:
1) Direct low-level cast that is natively supported by the virtual machine.
2) If the target type is a primitive type, find a function named “type-nameValue()” within the current scope.
3) If the target type is not a primitive type, find a function named “totype-name()” within the current scope.
If none of these cases fits, an cast error is generated. However, the cases 2 and 3 means that a cast operator will be supported by a call to a function. Depending on the implementation of the called function, the call may be inefficient at run-time
Configurable; Default is: Warning potential_inefficient_value_conversion
144 Message: Potential problem of data sharing outside the control of the agent. The field ‘name’ is declared with the static modifier. It enables the code to change the field value outside a direct control of the agent; that is breaking partly the agent autonomy principle
Cause: This warning message is generated when you declared a field with the static modifier into an agent or on of its components. Basically, a static field is defined outside an instance of agent or component. In other words, the static field could be used for sharing data between the components of the agents, and between the agents themselves. This method of data sharing is breaking the agent autonomy principle. It should be used only for sharing constant data between the agents
Solving: Remove the static modifier
Configurable; Default is: Warning potential_memory_sharing_outside_agent_control
145a Message: The operator ‘name’ is undefined for the argument types type-name and null
Cause: This error message is generated when an (in)equality test operator, i.e., ==, ===, != or !==, is invoked with the null literal as right operand, e.g. x == null, and the left operand being of primitive type. The problem is due to the usage of the keyword null that is not corresponding to a specific type. In this case, the SARL compiler cannot determine the best operator implementation
Solving: Initialize to null a local variable with the expected type for the right operand, and use this local variable as right operand
Error primitive_compared_to_null
145b Message: The operator ‘name’ is undefined for the argument types null and type-name
Cause: This error message is generated when an (in)equality test operator, i.e., ==, ===, != or !==, is invoked with the null literal as left operand, e.g. null == x, and the right operand being of primitive type. The problem is due to the usage of the keyword null that is not corresponding to a specific type. In this case, the SARL compiler cannot determine the best operator implementation
Solving: Initialize to null a local variable with the expected type for the left operand, and use this local variable as left operand
Error primitive_compared_to_null
145c Message: The operator ‘?:’ is undefined for arguments of type type-name
Cause: This error message may be generated when your are using the elvis operator, with a primitive type value as left operand and the null literal as right operand, e.g. x ?: null. The problem is due to the usage of the keyword null that is not corresponding to a specific type. In this case, the SARL compiler cannot determine the best operator implementation
Solving: Initialize to null a local variable with the expected type for the right operand, and use this local variable as right operand
Error primitive_compared_to_null
146 Message: any-message
Cause: It is possible to generate issue messages when a feature is used or invoked from the SARL code. The specification of the issue message is done by using one of the annotations @ErrorOnCall, @WarningOnCall or @InfoOnCall that takes an message (any-message). This annotation is attached to the feature for which a call must generate the issue
Configurable; Default is: Error programmatic_issue_annotation
147a Message: expression uses the raw type name. References to generic type name should be parameterized
Cause: The given expression is referencing a generic type with the given name without specifying its generic type arguments
Solving: Add the missed generic type arguments
Configurable; Default is: Warning raw_type
147b Message: name is a raw type. References to generic type name should be parameterized
Cause: You are referencing a generic type with the given name without specifying its generic type arguments
Solving: Add the missed generic type arguments
Configurable; Default is: Warning raw_type
148 Message: Redundant use of the capacity ‘capacity-name
Cause: The capacity named capacity-name is specified more than one time after a uses statement. It is not necessary to specify a capacity name multiple name, since the compiler has already activated the access to the capacity’s functions with the first occurrence of capacity-name
Solving: Remove the redundant capacity-name from the uses statement
Error redundant_capacity_use
149a Message: Redundant case
Cause: You have written a case without block of code that falls through the default case. It may be a piece of code like:
switch (v) {
  case 1,
}

It is clear that case 1 falls through a case that is not given. In this case, it is considered as an error because the fall-through cannot be implemented
Solving: Remove the fall-through case; or add a block of code to the redundant case
Error redundant_case
149b Message: Redundant case
Cause: You have written a case without block of code that falls through the default case. It may be a piece of code like:
switch (v) {
  case 1,
  default: {}
}

It is clear that case 1 is redundant with default since this last is covering the 1 value
Solving: Remove the redundant case
Warning redundant_case
150a Message: Duplicate implemented feature ‘interface-name
Cause: An interface, named interface-name, is implemented by a class. But, the interface with name interface-name is already implemented by the same class. It is not allowed by the SARL compiler to implement two time the same interface into a single class
Solving: Remove the redundant interface-name
Error redundant_interface_implementation
150b Message: The feature ‘interface-name’ is already implemented by the super-type ‘type-name
Cause: This error may occur in two cases.
First, the interface named interface-name is implemented by the current class. But, it is also implemented by one of the super classes, named type-name, or it is a super-interface, named type-name, of another implemented interface by the class. The current specification of the interface implementation becomes redundant and unnecessary.
Second, the interface named interface-name is extended by the current interface. But, it is also defined as a super-interface for the super-interface named type-name. The current specification of the interface implementation becomes redundant and unnecessary
Solving: Remove the redundant interface-name
Configurable; Default is: Warning redundant_interface_implementation
151a Message: The constructor constructor-prototype has an argument of void type
Cause: One of the generic type arguments that is implicitly associated to the given constructor is specified as to be void or non-found into the classpath
Error refer_invalid_types
151b Message: The constructor constructor-prototype refers to the missing type name
Cause: The given constructor is associated to a type that was not found into the classpath
Error refer_invalid_types
151c Message: The field field-name has an illegal argument type
Cause: One of the generic type arguments that is implicitly associated to the field field-name is specified as to be void or non-found into the classpath
Error refer_invalid_types
151d Message: The field field-name refers to the missing type name
Cause: The given field is associated to a type that was not found into the classpath. The non-found type may be the raw type of the field, or one of the generic type parameters
Error refer_invalid_types
151e Message: The method func-prototype from the type type-name has an illegal argument type
Cause: One of the generic type arguments that is implicitly associated to the given method is specified as to be void or non-found into the classpath
Error refer_invalid_types
151f Message: The method func-prototype from the type type-name refers to the missing type name
Cause: The given method is associated to a type that was not found into the classpath
Error refer_invalid_types
152 Message: Expecting the return type type-name. It is recommended to write the return type, even if it is inferred from the overridden function
Cause: SARL compiler is able to infer the type of the return values of a function according to the inherited prototype for the same function. In this case, it is not mandatory to specify explitly the return type into the overiding prototypes. Nevertheless, it is considered as a good practice to specify the return type. This issue message informs the developer of this recommendation
Solving: Add the return type into the overriding function prototype
Configurable; Default is: Warning return_type_specification_is_recommended
153 Message: SARL library not found on the classpath. Error code: code; Resources on classpath are:
classpath
Declared fields in SARLVersion class:
sarl-verison
Cause: The SARL library is not on the classpath. The cause of the error is specified by the given code that is one of NO_SARL_VERSION_CLASS (SARL version class not found), NO_SARL_VERSION_DECLARED_TYPE (SARL version class is not a Xtext declared type), NO_SARL_VERSION_FIELD (SARL version field not found), NO_SARL_VERSION_VALUE (SARL version value not found), or INVALID_SARL_VERSION_BYTECODE (the byte code (the class) of SARLVersion does not contains the expected field)
Solving: Reconfigure your project to have the SARL libraries into the classpath
Error sarl_lib_not_on_classpath
154 Message: Single dispatch method
Cause: A dispatch function is a function to which multiple blocks of code are attached to. Each block of code is invoked according to a specific type of the first formal parameter of the dispatch function. If you define a single block of code for a dispatch function, dispatch function syntax is not the best choice for performance reason. Indeed defining the same function as a not-dispatching function has the same operational effects, and faster
Configurable; Default is: Warning single_case_function
155a Message: Cannot make a static reference to the non-static feature-type feature-name
Cause: You are making a reference to a non-static feature (function call or field reference) from a static context. Accessing to a non-static feature needs to provide the instance of the object to access to; that is missed from a static context
Solving: Add the missed object reference
Error static_access_to_instance_member
155b Message: Cannot make a static reference to the non-static feature-type feature-name from the type type-name
Cause: You are making a reference to a non-static feature (function call or field reference) from a static context within the type type-name. Accessing to a non-static feature needs to provide the instance of the object to access to; that is missed from a static context
Solving: Add the missed object reference
Error static_access_to_instance_member
155c Message: Cannot make a static reference to the non-static type name
Cause: When you are defining the generic type arguments, you have to specify types as arguments, e.g. Collection<MyType>. Generic type arguments could only refer to statically declared types
Solving: Replace the non-static type reference by an appropriate static type reference
Error static_access_to_instance_member
155d Message: Cannot make an implicit reference to this from a static context
Cause: You are making an implicit reference to the current object this from a static context. Since it is a static context, this does not exist or is not accessible from it
Solving: Add the missed object reference
Error static_access_to_instance_member
155e Message: Cannot make an implicit static reference to the non-static extension name
Cause: You have defined a non-static extension in the enclosing code. And , you are making a reference to a non-static extension feature (function call usually) from a static context. Accessing to a non-static feature needs to provide the instance of the object to access to; that is missed from a static context
Solving: Replace implicit reference by explicit reference to the right object
Error static_access_to_instance_member
155f Message: Cannot use name in a static context
Cause: You cannot reference a type with name from a static context when the type name is not statically defined
Solving: Replace the non-static type reference by an appropriate static type reference
Error static_access_to_instance_member
156 Message: Suspiciously overloaded method. The feature-type list-of-features overloads the feature-type list-of-rejected-features
Cause: You are calling a feature (method, field, etc.). The target feature that is find by the SARL compiler seems to overload another feature, but not direct through an overriding. Indeed, with the extension method mechanism, candidates for being the target feature may be defined in the current type (regular linking), or imported from static types or from objects (extension linking). The selected target feature seems to hide another feature outside the inheritance mechanism between the types
Solving: Rewrite your code to remove the suspicious call
Configurable; Default is: Warning suspiciously_overloaded_feature
157 Message: any-message
Cause: This error is generated when your SARL code has an improper syntax, and cannot be parsed by the SARL compiler. The error message provides the detail of the invalid syntax
Error Syntax
158 Message: any-message
Cause: This error is generated when your SARL code has an improper syntax, and cannot be parsed by the SARL compiler. The error message provides the detail of the invalid syntax and the position into your source code that is under failure
Error Syntax.Range
159 Message: The ternary operator is not allowed. Use a normal if-expression
Cause: The ternary operator is the inline if-then-else expression. In some best programming practices, the inline if-then-else are considered as a bad practice. This issue message is generated when an ternary operator is used in your code
Solving: Replace the ternary operator by the equivalent if-then-else statement
Configurable; Default is: Ignored ternary_if_operator_is_not_allowed
160a Message: Cannot infer type
Cause: It is too complex for the SARL compiler to infer the type of the marked feature
Solving: Define explicitly the type of the feature
Error too_little_type_information
160b Message: Cannot infer type from recursive usage. Type ‘Object’ is used
Cause: You code has a type-free feature, e.g. a local variable. SARL cannot infer the type of the feature because a cycle is detected regarding the type definitions
Solving: Define explicitly the type of the feature
Error too_little_type_information
160c Message: There is no context to infer the closure’s argument types from. Consider typing the arguments or put the closures into a typed context
Cause: This error is generated when the SARL compiler cannot infer the type of a formal parameter of a closure/lambda expression from the usage context
Solving: Define explicitly the formal parameters within the closure; or Make more explicit within the enclosing context the type of the closure’s formal parameter
Error too_little_type_information
160d Message: There is no context to infer the closure’s argument types from. Consider typing the arguments or use the closures in a more specific context
Cause: This error is generated when the SARL compiler cannot infer the type of the first formal parameter of a closure/lambda expression from the usage context
Solving: Define explicitly the formal parameters within the closure; or Make more explicit within the enclosing context the type of the closure’s first formal parameter
Error too_little_type_information
161 Message: The maximum number of parameters for a closure is six
Cause: A constrain given by the underground Java API is the maximum number of formal parameters that could be defined for a closure/lambda expression
Solving: Reduce the number of formal parameters of your closure
Error too_many_params_in_closure
162 Message: The type type-name is not generic; it cannot be parameterized with arguments type-arguments
Cause: You have specified generic type parameters to a type that does not accept generic type parameters, e.g. Object<String>, int<String>, MyEnum<String>, MyAnnotation<String>
Solving: Remove the generic type parameters
Error type_argument_on_non_generic_type
163a Message: Bounds mismatch: The type argument type-argument is not a valid substitute for the bounded type parameter parameter of the feature-type feature-signature
Cause: The generic type-argument does not match the type bounding constraints of the corresponding generic type parameter of the specified feature. If the bounding constraint is extends, then the type-argument is not a sub-type of the one specified into the constraint. If the bounding constraint is super, then the type-argument is not a super-type of the one specified into the constraint
Solving: Replace type-argument by an appropriate type
Error type_bounds_missmatch
163b Message: Bounds mismatch: The type arguments type-arguments are not a valid substitute for the bounded type parameters parameters of the feature-type feature-signature
Cause: The type that is specified after a on statement is not a SARL event, i.e. a sub-type of the type Event
Solving: Replace type by an appropriate event type
Error type_bounds_missmatch
163c Message: Invalid type: ‘type’. Only events can be used after the keyword ‘on’
Cause: The type that is specified after a on statement is not a SARL event, i.e. a sub-type of the type Event
Solving: Replace type by an appropriate event type
Error type_bounds_missmatch
164 Message: Illegal forward reference to type parameter name
Cause: Since Java 5, forward references in type parameters are not allowed. Let define a list of generic type parameters <A, B extends C, C extends A>. In the previous example, C has a backward reference to A; and B has a forward reference to C. Then, extends C causes the generation of this error message. In other words, a local generic type parameters msut be declared before its usage into the bounds of another generic type parameter
Solving: Change the order of the generic type parameters
Error type_parameter_forward_reference
165 Message: Unexpected exception to a static constructor
Cause: A static constructor could be defined for initializing the static fields of a type. It is forbidden to define a list of thrown exceptions for a static constructor because they cannot be catched
Solving: Remove the thrown definition
Error unexpected_exception_throw
166 Message: Unexpected formal parameter to a static constructor
Cause: A static constructor could be defined for initializing the static fields of a type. It is forbidden to define a formal parameter for a static constructor because their is no way to assign values to the corresponding arguments
Solving: Remove the formal parameter(s) from static constructor
Error unexpected_formal_parameter
167 Message: The syntax for type literals is typeof(name) or name
Cause: The type literal, i.e. the name of the type, with *name
must follow a string syntax, that is explained in the error message
Solving: Use the correct syntax
Error unexpected_invocation_on_type_literal
168a Message: Unhandled exception type type-name
Cause: Exception type-name has been declared to be throwable by instructions within the code block of an method or a constructor. But, the method or the constructor has no declaration of type-name with throws. This is not an error stricly because SARL compiler is able to propagate the definition of the exceptions to the enclosing function or constructor
Solving: Add type-name to throws
Configurable; Default is: Ignored unhandled_exception
168b Message: Unhandled exception type type-name thrown by automatic close() invocation on feature
Cause: An exception is declared to be throwable by the close() function, which is automatically/implicitly invoked. This exception is not catched. This is not an error stricly because SARL compiler is able to propagate the definition of the exceptions to the enclosing function or constructor
Solving: Add catch statement
Configurable; Default is: Ignored unhandled_exception
168c Message: Unhandled exception types type-name-1 and type-name-2
Cause: Exceptions have been declared to be throwable by instructions within the code block of an method or a constructor. But, the method or the constructor has no declaration of type-name-1 and typename-2 with throws. This is not an error stricly because SARL compiler is able to propagate the definition of the exceptions to the enclosing function or constructor
Solving: Add type-name-1 and type-name-2 to throws
Configurable; Default is: Ignored unhandled_exception
169a Message: The def modifier is unnecessary on member-name
Cause: Usually, this issue is generated when the def modifier is redundant with another modifer like override
Solving: Remove the def modifier
Configurable; Default is: Warning unnecessary_modifier
169b Message: The final modifier is unnecessary on member-name
Cause: Usually, this issue is generated when the final modifier is redundant with another modifer like val
Solving: Remove the final modifier
Configurable; Default is: Warning unnecessary_modifier
169c Message: The package modifier is unnecessary on member-name
Cause: This issue message is generated when the modifier package is specified on a member that has a default visibility equals to package also
Solving: Remove the package modifier
Configurable; Default is: Warning unnecessary_modifier
169d Message: The private modifier is unnecessary on member-name
Cause: This issue message is generated when the modifier private is specified on a member that has a default visibility equals to private also
Solving: Remove the private modifier
Configurable; Default is: Warning unnecessary_modifier
169e Message: The protected modifier is unnecessary on member-name
Cause: This issue message is generated when the modifier protected is specified on a member that has a default visibility equals to protected also
Solving: Remove the protected modifier
Configurable; Default is: Warning unnecessary_modifier
169f Message: The public modifier is unnecessary on member-name
Cause: This issue message is generated when the modifier public is specified on a member that has a default visibility equals to public also
Solving: Remove the public modifier
Configurable; Default is: Warning unnecessary_modifier
170 Message: Unqualified super reference is not allowed in interface context
Cause: You try to use the super statement from an interface. Because an interface has no associated instance of object and consequently not super-type instance, you cannot call super
Solving: Remove super
Configurable; Default is: Error unqualified_super_call
171 Message: Dead code. The guard is always false
Cause: The guard that is specified for a behavior unit is evaluated by the compiler to be always false. In this case, the code of the behavior unit has absolutely no change to be executed. It may denote a problem is the design of the entity in which the behavior unit is defined, e.g. an agent
Solving: Change the guard condition; or remove the entier behavior unit
Configurable; Default is: Warning unreachable_behavior_unit
172 Message: Unreachable code: The case can never match. It is already handled by a previous condition
Cause: You have specified a case that is already handled by another case before. It means that this case will never match because the previous one will do
Solving: Remove case
Configurable; Default is: Warning unreachable_case
173 Message: Unreachable code: The catch block can never match. It is already handled by a previous condition
Cause: You have specified a catch that is already handled by another catch before. It means that this catch will never match because the previous one will do
Solving: Remove catch
Configurable; Default is: Warning unreachable_catch_block
174a Message: Dead code: The variable name will never be assigned
Cause: This error message is generated when a line of code cannot be reached in all the case. For example a loop with a true condition should never exit from looping. Then, all the statements after the loop becomes unreachable
Solving: Remove the dead code
Error unreachable_code
174b Message: Unreachable code
Cause: This error message is generated when a line of code cannot be reached in all the case. For example a loop with a true condition should never exit from looping. Then, all the statements after the loop becomes unreachable
Solving: Remove the dead code
Error unreachable_code
174c Message: Unreachable code
Cause: This error message is generated when a line of code cannot be reached in all the case. For example a loop with a true condition should never exit from looping. Then, all the statements after the loop becomes unreachable
Solving: Remove the dead code
Error unreachable_code
174d Message: Unreachable code. The last argument expression does not complete normally
Cause: This error message is generated when the evaluation of the last argument causes a stop of the execution sequence that avoid to call the method/constructor for switch the argument is computed
Solving: Remove the unreachable code
Error unreachable_code
174e Message: Unreachable code. The right argument expression does not complete normally
Cause: This error message is generated when the evaluation of the right argument causes a stop of the execution sequence that avoid to call the operator for switch the argument is computed
Solving: Remove the unreachable code
Error unreachable_code
174f Message: Unreachable expression
Cause: This error message is generated when a line of code cannot be reached in all the case. For example a loop with a true condition should never exit from looping. Then, all the statements after the loop becomes unreachable
Solving: Remove the unreachable code
Error unreachable_code
175 Message: Unreachable code: The if condition can never match. It is already handled by a previous condition
Cause: Inside a condition of if statement, you have specified multiple tests with instanceof. Since all the boolean conditions are evaluated from left to right, an instanceof test never matches because a left-most instanceof already matches the same scope of types
Solving: Remove the unmatchable instanceof
Configurable; Default is: Warning unreachable_instance_of
176a Message: The capacity ‘capacity-name’ is not used
Cause: This issue is generated when capacity-name is specified after a uses statement, but none of the capacity’s functions is invoked from the current entity (agent, etc.)
Solving: Remove capacity-name from the uses statement
Configurable; Default is: Warning unused_agent_capacity
176b Message: Unnecessary use of the capacity ‘capacity-name’ because it is implemented by the current skill
Cause: This issue is generated when the capacity named capacity-name is specified after a uses keyword; and it is at the same time an implemented capacity by the skill in which the uses statement is specified. The uses specification is redundant, because the functions that are defined into the capacity capacity-name are already accessible due to their local implementation
Solving: Remove capacity-name from the uses statement
Configurable; Default is: Warning unused_agent_capacity
177 Message: The value of the local variable name is not used
Cause: You have declared a local variable with the given name, but never use it somewhere
Solving: Remove the variable declaration; or Use the variable
Configurable; Default is: Warning unused_local_variable
178 Message: The method func-prototype from the type type-name is never used locally
Cause: This warning is generated because you have defined a private function that is never called. This is not a problem for running your program. But, it makes your binary executable file larger than stricly necessary
Solving: Remove the private function
Delegated to: org.eclipse.jdt.core.compiler.problem.unusedPrivateMember
Delegated; Default is: Warning unused_private_member
179 Message: Discouraged use of reserved annotation. @name is an annotation that is reserved for the compiler usage
Cause: SARL core library defines a collection of SARL annotations that are dedicated to the internal usage of the SARL compiler. They are supposed to never be in the SARL code directly. This issue message is generated when one of these SARL annotations is explicitly specified into the code
Solving: Remove the SARL annotation from your code
Configurable; Default is: Warning use_reserved_sarl_annotation
180a Message:name’ is a reserved keyword which is not allowed as identifier. Please choose another word
Cause: You defined the name of a feature by using a name that is equal to a SARL keyword. As in all programming languages, it is forbidden to use a language keyword as identifier
Solving: Change name to another identifier that is not a SARL keyword
Error used_reserved_keyword
180b Message:name’ is a reserved keyword which is not allowed as identifier. Please choose another word or alternatively confuse your co-workers by escaping it like this: simple-solution
Cause: You defined the name of a feature by using a name that is equal to a SARL keyword. As in all programming languages, it is forbidden to use a language keyword as identifier. This error message problem to you a simple-solution
Solving: Apply name to simple-solution or to another name that is not a SARL keyword
Error used_reserved_keyword
181a Message:name’ is not a valid name
Cause: This is the general error for notifying you that the name of an element is invalid. Most of the time, it is due to the use of a forbidden character into the name. The major forbidden character is $. It is not allowed to use it inside a name, even if it is allowed into the Java specification
Solving: Rename the element
Error variable_name_disallowed
181b Message: Invalid name ‘name’. You must not give to a field a name with reserved characters
Cause: You have defined an name for a field that contains forbidden characters. The major forbidden character is $. It is not allowed to use it inside a name, even if it is allowed into the Java specification
Solving: Rename your field
Error variable_name_disallowed
181c Message: Invalid name ‘name’. You must not give to an field the same name as a reserved keyword
Cause: You have defined an name for a field that is equal to a reserved keyword
Solving: Rename your field
Error variable_name_disallowed
182a Message:name’ is a discouraged name
Cause: This is the general message for notifying you that the name of an element is discouraged. Most of the time, it is due to the fact it may cause ambiguity with SARL language keywords, e.g. self
Solving: Rename the element
Configurable; Default is: Warning variable_name_discouraged
182b Message: ‘self’ is a discouraged name
Cause: self is a name that is used in several other programming languages as a synonym of this. In order to avoid ambiguity, self is a discouraged name
Solving: Rename the element
Configurable; Default is: Warning variable_name_discouraged
183a Message: Duplicate local variable name
Cause: You have declared two different variables in the same scope but with exactly the same name. It is simply forbidden to hide local variables
Solving: Rename one of the local variables
Error variable_name_shadowing
183b Message: The field ‘field-name’ in ‘type-name’ is hidding the inherited field ‘super-field-name
Cause: You have declared a field with the name field-name into the current type; but an accessible field with the same name is also declared into a super-type. It means that the value of the field into the super-type will not be accessible directly from the current type
Solving: Rename field field-name
Configurable; Default is: Warning variable_name_shadowing
184 Message: The type type-name cannot extend or implement other-type. A supertype may not specify any wildcard
Cause: The super-type named other-type is defined with wildcard into its generic type parameters. It is forbidden to extends or implement a super-type with a wildcard
Error wildcard_in_supertype
185a Message: The annotation @name is disallowed for this location
Cause: An annotation is defined in order to be attached to a specific type of element (type, field, method, etc.). This error is generated when an annotation with the given name is attached to a wrong type of element
Error wrong_annotation_target
185b Message: Unexpected annotation to a static constructor
Cause: A static constructor cannot have an annotation attached to it. This issue message is generated when a static constructor is annotated
Error wrong_annotation_target
186a Message: The declared package ‘actual-name’ does not match the expected package ‘expected-name
Cause: SARL enables to create groups of types that are named packages in order to increase the modularity of your software. The different types are written into SARL files that are located in folders. Usually the name of the package reflects the structure of the underlying folders, i.e., the sequence of folders’ names corresponds to the sequence of package name’s atoms. In the Java language this mapping is mandatory. In SARL language, this mapping is optional, but considered as a good practice. The SARL compiler notifies you that the expected-name may be preferred to the actual-name
Solving: Replace actual-name by expected-name
Warning wrong_package
186b Message: Unexpecting package definition
Cause: SARL enables to create groups of types that are named packages in order to increase the modularity of your software. The different types are written into SARL files that are located in folders. Usually the name of the package reflects the structure of the underlying folders, i.e., the sequence of folders’ names corresponds to the sequence of package name’s atoms. In the Java language this mapping is mandatory. In SARL language, this mapping is optional, but considered as a good practice. The SARL compiler notifies you that no name is expected for the package
Solving: Remove the package definition
Warning wrong_package

Copyright © 2014-2023 SARL.io, the Original Authors and Main Authors.

Documentation text and medias are licensed under the Creative Common CC-BY-SA-4.0; you may not use this file except in compliance with CC-BY-SA-4.0. You may obtain a copy of CC-BY-4.0.

Examples of SARL code are licensed under the Apache License, Version 2.0; you may not use this file except in compliance with the Apache License. You may obtain a copy of the Apache License.

You are free to reproduce the content of this page on copyleft websites such as Wikipedia.

Generated with the translator docs.generator 0.14.0-SNAPSHOT.