Q: What is the difference between a compile error and a warning.
A: A warning usually indicates that the fix may involve adding some more code, for example adding a definition for an unknown identifier. An error usually indicates that you will need to alter code to fix the error. But they are similar in that you will not be able to run your program until the issues are fixed. In all programming languages it is a good practice 'treat all compile warnings as errors' i.e. fix them as soon as you see them appear.
An expression, when evaluated, results in a value of a type that is not compatible with its 'target', for example: if the result of the expression is being assigned to an existing variable, or if an expression is defined 'inline' as an argument into a method call.
may only be used within an instance method on a class to refer to the current instance.
If a class inherits from one or more abstract classes, then the latter must all have already been declared (defined) earlier in the code file.
This error occurs when a class is defined as inheriting from an abstract class, and has implemented an inherited member (method or property) with the correct name, but with different Types.
Arises when 'dot calling' a member (method or property) that does not exist on the type of the named value or expression before the dot.
A function (or function method) is to be used within an expression, not via a call procedure instruction.
A 'system method' (defined in the Standard Library) returns a value like a function does. However, because a system method either makes changes to the system and/or depends on external inputs, it may be used only within a procedure or the main routine.
Indicates that a library method or class has been changed since the version in which your Elan code was written. The link in the message should take you directly to information in the Library Reference documentation on how to update your code to cope with the change.
A procedure may be used only within a call procedure instruction.
The code is attempting to use a free-standing method (function or procedure) as a 'dot method' on a named value or the result of an expression.
An index (in square brackets) may be applied only to certain data structure Types: ,
and .
A range may be applied only to certain data structure Types: and .
The type specified after the call procedure instruction cannot be instantiated. Either the type is inapplicable, or it is an abstract class.
The message is self explanatory.
The message is self explanatory.
The message is self explanatory.
A private member (method or property) may be accessed only by code within the class, or within subclasses of it. It may not be accessed by any code outside the class hierarchy.
If a concrete class inherits from any abstract class it must implement all abstract methods defined in the abstract type (or in any super-type of the abstract class).
You cannot create an instance of any abstract class: only of a concrete class.
A method that is defined within the Library as an extension method, such as
The prefix property. may only be used before a property name: not a function name.
The method being called expects more arguments than have been provided.
A method has been passed more arguments than it expects.
One or more arguments provided to the method are of the wrong Type.
Certain data structure Types, including , must specify the type of their members, for example <of >.
Failure to specify the '<of Type>' on these Types will give an error, as will specifying 'of Type' where it is not required.
Dictionaries require Types to be specified for both the keys and the values,
for example: <of , >.
Attempting to reassign, or mutate, a named value that may not be reassigned in the current context.
Attempting to create an identifier with the same name as one already defined within the same scope.
A property can be reassigned only within a procedure method, not within a function, because reassigning a property is a side effect.
An existing named value may not be defined again within the same scope.
Attempting to define a literal
with one or more duplicated keys in the definition.
Compiler directives are a planned future capability. They will look like comments, but begin with an open square bracket. To avoid the possibility of ambiguity, you may not start your own comments with an open square bracket.
Most programming languages define keywords, or other 'reserved words' that may not be used as identifiers - for technical reasons. Because Elan supports multiple programming languages and guarantees that any program written in one language will convert correctly to the other languages, it must disallow the use of keywords from any of the supported languages - not just the ones defined by the language you are writing. Fortunately many of the keywords are common to more than one of the languages.
If you see this message, just alter the identifier you have defined - by extending the word, perhaps even just by adding an underscore - or choose a different word altogether.
An index into a list cannot have a negative value. If a negative is given in literal form e.g. a[−3] then this will generate a compile error. If you use a named value for an index and it is negative, then this will cause a runtime error.
It is not possible to apply comparison operations to functions or procedures as themselves. It is, however, possible to compare the results of two function evaluations. You may see this message because you intended to evaluate a function but forgot to add the brackets after the name.
The type of the key for any dictionary Dictionary must be an immutable Type, and not itself an indexable Type.
If you are referring to a property of a class from code defined within the class then the property name must be preceded by property.
You cannot defined an out parameter in a function (because that would imply the possibility of creating a side effect).
You cannot chain two 'unary' operators (those that apply to a single value), such as − or not successively within an expression.
A function or procedure named e.g. 'foo' may not define a parameter with that same name.
An error or infinite loop found in a test. Refer to ghosting tests .
Overly complex expressions, for example involving a sequence of open brackets, can result in very slow parsing. We strongly recommend that you you simplify the contents of this field, for example by breaking out parts of it into separate variable definition instructions; otherwise it might become impossible to add more text.
Elan Language Reference go to the top