This section lists all parser messages. The parser takes care of the semantics of you language, i.e. it
determines if your Pascal constructs are correct.
-
Error: Parser - Syntax Error
- An error against the Turbo Pascal language was
encountered. This typically happens when an illegal character is found in the source
file.
-
Error: INTERRUPT procedure can’t be nested
- An INTERRUPT procedure must be
global.
-
Warning: Procedure type ”arg1” ignored
- The specified procedure directive is ignored
by FPC programs.
-
Error: Not all declarations of ”arg1” are declared with OVERLOAD
- When you
want to use overloading using the OVERLOAD directive, then all declarations need to
have OVERLOAD specified.
-
Error: Duplicate exported function name ”arg1”
- Exported function names inside a
specific DLL must all be different.
-
Error: Duplicate exported function index arg1
- Exported function indexes inside a
specific DLL must all be different.
-
Error: Invalid index for exported function
- DLL function index must be in the range
1..$FFFF.
-
Warning: Relocatable DLL or executable arg1 debug info does not work, disabled.
-
It is currently not possible to include debug information in a relocatable DLL.
-
Warning: To allow debugging for win32 code you need to disable relocation with -WN option
-
Stabs debug info is wrong for relocatable DLL or EXES. Use -WN if you want to debug
win32 executables.
-
Error: Constructor name must be INIT
- You are declaring an object constructor with
a name which is not init, and the -Ss switch is in effect. See the switch -Ss (see page
109).
-
Error: Destructor name must be DONE
- You are declaring an object destructor with
a name which is not done, and the -Ss switch is in effect. See the switch -Ss (see page
109).
-
Error: Procedure type INLINE not supported
- You tried to compile a program with
C++ style inlining, and forgot to specify the -Si option (-Si (see page 109)). The
compiler doesn’t support C++ styled inlining by default.
-
Warning: Constructor should be public
- Constructors must be in the ’public’ part of
an object (class) declaration.
-
Warning: Destructor should be public
- Destructors must be in the ’public’ part of an
object (class) declaration.
-
Note: Class should have one destructor only
- You can declare only one destructor for
a class.
-
Error: Local class definitions are not allowed
- Classes must be defined globally. They
cannot be defined inside a procedure or function.
-
Fatal: Anonymous class definitions are not allowed
- An invalid object (class) declaration
was encountered, i.e. an object or class without methods that isn’t derived from another
object or class. For example:
Type o = object
a : longint;
end;
will trigger this error.
-
Note: The object ”arg1” has no VMT
- This is a note indicating that the declared object has
no virtual method table.
-
Error: Illegal parameter list
- You are calling a function with parameters that are of a different
type than the declared parameters of the function.
-
Error: Wrong number of parameters specified for call to ”arg1”
- There is an error in the
parameter list of the function or procedure – the number of parameters is not
correct.
-
Error: overloaded identifier ”arg1” isn’t a function
- The compiler encountered a symbol
with the same name as an overloaded function, but it is not a function it can
overload.
-
Error: overloaded functions have the same parameter list
- You’re declaring overloaded
functions, but with the same parameter list. Overloaded function must have at least 1
different parameter in their declaration.
-
Error: function header doesn’t match the previous declaration ”arg1”
- You
declared a function with the same parameters but different result type or function
modifiers.
-
Error: function header ”arg1” doesn’t match forward : var name changes arg2 =¿ arg3
-
You declared the function in the interface part, or with the forward directive, but defined
it with a different parameter list.
-
Note: Values in enumeration types have to be ascending
- Free Pascal allows enumeration
constructions as in C. Examine the following two declarations:
type a = (A_A,A_B,A_E:=6,A_UAS:=200);
type a = (A_A,A_B,A_E:=6,A_UAS:=4);
The second declaration would produce an error. A_UAS needs to have a value higher than A_E,
i.e. at least 7.
-
Error: With cannot be used for variables in a different segment
- With stores a variable
locally on the stack, but this is not possible if the variable belongs to another
segment.
-
Error: function nesting ¿ 31
- You can nest function definitions only 31 levels deep.
-
Error: range check error while evaluating constants
- The constants are out of their allowed
range.
-
Warning: range check error while evaluating constants
- The constants are out of their
allowed range.
-
Error: duplicate case label
- You are specifying the same label 2 times in a case
statement.
-
Error: Upper bound of case range is less than lower bound
- The upper bound of a case
label is less than the lower bound and this is useless.
-
Error: typed constants of classes or interfaces are not allowed
- You cannot declare a
constant of type class or object.
-
Error: functions variables of overloaded functions are not allowed
- You are trying to
assign an overloaded function to a procedural variable. This is not allowed.
-
Error: string length must be a value from 1 to 255
- The length of a shortstring in Pascal is
limited to 255 characters. You are trying to declare a string with length less than 1 or greater
than 255.
-
Warning: use extended syntax of NEW and DISPOSE for instances of objects
- If you
have a pointer a to an object type, then the statement new(a) will not initialize the object
(i.e. the constructor isn’t called), although space will be allocated. You should issue the
new(a,init) statement. This will allocate space, and call the constructor of the
object.
-
Warning: use of NEW or DISPOSE for untyped pointers is meaningless
-
-
Error: use of NEW or DISPOSE is not possible for untyped pointers
- You cannot use
new(p) or dispose(p) if p is an untyped pointer because no size is associated to an untyped
pointer. It is accepted for compatibility in TP and DELPHI modes, but the compiler will still
warn you if it finds such a construct.
-
Error: class identifier expected
- This happens when the compiler scans a procedure declaration
that contains a dot, i.e., an object or class method, but the type in front of the dot is not a
known type.
-
Error: type identifier not allowed here
- You cannot use a type inside an expression.
-
Error: method identifier expected
- This identifier is not a method. This happens when the
compiler scans a procedure declaration that contains a dot, i.e., an object or class method,
but the procedure name is not a procedure of this type.
-
Error: function header doesn’t match any method of this class ”arg1”
- This identifier is
not a method. This happens when the compiler scans a procedure declaration that contains a
dot, i.e., an object or class method, but the procedure name is not a procedure of this
type.
-
procedure/function arg1
- When using the -vd switch, the compiler tells you when it starts
processing a procedure or function implementation.
-
Error: Illegal floating point constant
- The compiler expects a floating point expression, and
gets something else.
-
Error: FAIL can be used in constructors only
- You are using the fail keyword outside a
constructor method.
-
Error: Destructors can’t have parameters
- You are declaring a destructor with a parameter
list. Destructor methods cannot have parameters.
-
Error: Only class methods can be referred with class references
- This error occurs in a
situation like the following:
Type :
Tclass = Class of Tobject;
Var C : TClass;
begin
...
C.free
Free is not a class method and hence cannot be called with a class reference.
-
Error: Only class methods can be accessed in class methods
- This is related to the
previous error. You cannot call a method of an object from inside a class method. The
following code would produce this error:
class procedure tobject.x;
begin
free
Because free is a normal method of a class it cannot be called from a class method.
-
Error: Constant and CASE types do not match
- One of the labels is not of the same type as
the case variable.
-
Error: The symbol can’t be exported from a library
- You can only export procedures and
functions when you write a library. You cannot export variables or constants.
-
Warning: An inherited method is hidden by ”arg1”
- A method that is declared virtual in
a parent class, should be overridden in the descendant class with the override directive. If
you don’t specify the override directive, you will hide the parent method; you will not
override it.
-
Error: There is no method in an ancestor class to be overridden: ”arg1”
- You are trying
to override a virtual method of a parent class that does not exist.
-
Error: No member is provided to access property
- You specified no read directive for a
property.
-
Warning: Stored property directive is not yet implemented
- This message is no longer
used, as the stored directive has been implemented.
-
Error: Illegal symbol for property access
- There is an error in the read or write
directives for an array property. When you declare an array property, you can only
access it with procedures and functions. The following code would cause such an
error.
tmyobject = class
i : integer;
property x [i : integer]: integer read I write i;
-
Error: Cannot access a protected field of an object here
- Fields that are declared in a
protected section of an object or class declaration cannot be accessed outside the module
where the object is defined, or outside descendent object methods.
-
Error: Cannot access a private field of an object here
- Fields that are declared in a
private section of an object or class declaration cannot be accessed outside the module
where the class is defined.
-
Error: Overridden methods must have the same return type: ”arg2” is overridden by ”arg1” which has another return type
-
If you declare overridden methods in a class definition, they must have the same return
type.
-
Error: EXPORT declared functions can’t be nested
- You cannot declare a function or
procedure within a function or procedure that was declared as an export procedure.
-
Error: Methods can’t be EXPORTed
- You cannot declare a procedure that is a method for an
object as exported.
-
Error: Call by var for arg no. arg1 has to match exactly: Got ”arg2” expected ”arg3”
-
When calling a function declared with var parameters, the variables in the function call must
be of exactly the same type. There is no automatic type conversion.
-
Error: Class isn’t a parent class of the current class
- When calling inherited methods, you
are trying to call a method of a non-related class. You can only call an inherited method of a
parent class.
-
Error: SELF is only allowed in methods
- You are trying to use the self parameter outside an
object’s method. Only methods get passed the self parameters.
-
Error: Methods can be only in other methods called direct with type identifier of the class
-
A construction like sometype.somemethod is only allowed in a method.
-
Error: Illegal use of ’:’
- You are using the format : (colon) 2 times on an expression that is not
a real expression.
-
Error: range check error in set constructor or duplicate set element
- The declaration of a
set contains an error. Either one of the elements is outside the range of the set type, or two of
the elements are in fact the same.
-
Error: Pointer to object expected
- You specified an illegal type in a new statement. The
extended syntax of new needs an object as a parameter.
-
Error: Expression must be constructor call
- When using the extended syntax of new, you
must specify the constructor method of the object you are trying to create. The procedure
you specified is not a constructor.
-
Error: Expression must be destructor call
- When using the extended syntax of dispose, you
must specify the destructor method of the object you are trying to dispose of. The procedure
you specified is not a destructor.
-
Error: Illegal order of record elements
- When declaring a constant record, you specified the
fields in the wrong order.
-
Error: Expression type must be class or record type
- A with statement needs an argument
that is of the type record or class. You are using with on an expression that is not of this
type.
-
Error: Procedures can’t return a value
- In Free Pascal, you can specify a return value for a
function when using the exit statement. This error occurs when you try to do this with a
procedure. Procedures cannot return a value.
-
Error: constructors and destructors must be methods
- You’re declaring a procedure as
destructor or constructor, when the procedure isn’t a class method.
-
Error: Operator is not overloaded
- You’re trying to use an overloaded operator when it is not
overloaded for this type.
-
Error: Impossible to overload assignment for equal types
- You cannot overload assignment
for types that the compiler considers as equal.
-
Error: Impossible operator overload
- The combination of operator, arguments and return type
are incompatible.
-
Error: Re-raise isn’t possible there
- You are trying to re-raise an exception where it is not
allowed. You can only re-raise exceptions in an except block.
-
Error: The extended syntax of new or dispose isn’t allowed for a class
- You cannot
generate an instance of a class with the extended syntax of new. The constructor must be
used for that. For the same reason, you cannot call dispose to de-allocate an instance of a
class, the destructor must be used for that.
-
Error: Procedure overloading is switched off
- When using the -So switch, procedure
overloading is switched off. Turbo Pascal does not support function overloading.
-
Error: It is not possible to overload this operator. Related overloadable operators (if any) are: arg1
-
You are trying to overload an operator which cannot be overloaded. The following operators
can be overloaded :
+, -, *, /, =, >, <, <=, >=, is, as, in, **, :=
-
Error: Comparative operator must return a boolean value
- When overloading the =
operator, the function must return a boolean value.
-
Error: Only virtual methods can be abstract
- You are declaring a method as abstract, when
it is not declared to be virtual.
-
Fatal: Use of unsupported feature!
- You’re trying to force the compiler into doing something it
cannot do yet.
-
Error: The mix of different kind of objects (class, object, interface, etc) isn’t allowed
-
You cannot derive objects, classes, cppclasses and interfaces intertwined. E.g. a class
cannot have an object as parent and vice versa.
-
Warning: Unknown procedure directive had to be ignored: ”arg1”
- The procedure
directive you specified is unknown.
-
Error: absolute can only be associated to one variable
- You cannot specify more than one
variable before the absolute directive. Thus, the following construct will provide this
error:
Var Z : Longint;
X,Y : Longint absolute Z;
-
Error: absolute can only be associated with a var or const
- The address of an absolute
directive can only point to a variable or constant. Therefore, the following code will produce
this error:
Procedure X;
var p : longint absolute x;
-
Error: Only one variable can be initialized
- You cannot specify more than one variable with
a initial value in Delphi mode.
-
Error: Abstract methods shouldn’t have any definition (with function body)
- Abstract
methods can only be declared, you cannot implement them. They should be overridden by a
descendant class.
-
Error: This overloaded function can’t be local (must be exported)
- You are defining an
overloaded function in the implementation part of a unit, but there is no corresponding
declaration in the interface part of the unit.
-
Warning: Virtual methods are used without a constructor in ”arg1”
- If you declare
objects or classes that contain virtual methods, you need to have a constructor and
destructor to initialize them. The compiler encountered an object or class with virtual
methods that doesn’t have a constructor/destructor pair.
-
Macro defined: arg1
- When -vc is used, the compiler tells you when it defines macros.
-
Macro undefined: arg1
- When -vc is used, the compiler tells you when it undefines
macros.
-
Macro arg1 set to arg2
- When -vc is used, the compiler tells you what values macros
get.
-
Info: Compiling arg1
- When you turn on information messages (-vi), the compiler tells you
what units it is recompiling.
-
Parsing interface of unit arg1
- This tells you that the reading of the interface of the current
unit has started
-
Parsing implementation of arg1
- This tells you that the code reading of the implementation of
the current unit, library or program starts
-
Compiling arg1 for the second time
- When you request debug messages (-vd) the compiler
tells you what units it recompiles for the second time.
-
Error: No property found to override
- You want to override a property of a parent class,
when there is, in fact, no such property in the parent class.
-
Error: Only one default property is allowed
- You specified a property as Default, but
the class already has a default property, and a class can have only one default
property.
-
Error: The default property must be an array property
- Only array properties of classes
can be made default properties.
-
Error: Virtual constructors are only supported in class object model
- You cannot have
virtual constructors in objects. You can only have them in classes.
-
Error: No default property available
- You are trying to access a default property of a class,
but this class (or one of its ancestors) doesn’t have a default property.
-
Error: The class can’t have a published section, use the {$M+} switch
- If you want a
published section in a class definition, you must use the {$M+} switch, which turns on
generation of type information.
-
Error: Forward declaration of class ”arg1” must be resolved here to use the class as ancestor
-
To be able to use an object as an ancestor object, it must be defined first. This error occurs
in the following situation:
Type ParentClas = Class;
ChildClass = Class(ParentClass)
...
end;
where ParentClass is declared but not defined.
-
Error: Local operators not supported
- You cannot overload locally, i.e. inside procedures or
function definitions.
-
Error: Procedure directive ”arg1” not allowed in interface section
- This procedure
directive is not allowed in the interface section of a unit. You can only use it in the
implementation section.
-
Error: Procedure directive ”arg1” not allowed in implementation section
- This
procedure directive is not allowed in the implementation section of a unit. You can only use
it in the interface section.
-
Error: Procedure directive ”arg1” not allowed in procvar declaration
- This procedure
directive cannot be part of a procedural or function type declaration.
-
Error: Function is already declared Public/Forward ”arg1”
- You will get this error if a
function is defined as forward twice. Or if it occurs in the interface section, and again as a
forward declaration in the implementation section.
-
Error: Can’t use both EXPORT and EXTERNAL
- These two procedure directives are
mutually exclusive.
-
Warning: ”arg1” not yet supported inside inline procedure/function
- Inline procedures
don’t support this declaration.
-
Warning: Inlining disabled
- Inlining of procedures is disabled.
-
Info: Writing Browser log arg1
- When information messages are on, the compiler warns you
when it writes the browser log (generated with the {$Y+ } switch).
-
Hint: may be pointer dereference is missing
- The compiler thinks that a pointer may need a
dereference.
-
Fatal: Selected assembler reader not supported
- The selected assembler reader (with
{$ASMMODE xxx} is not supported. The compiler can be compiled with or without support for
a particular assembler reader.
-
Error: Procedure directive ”arg1” has conflicts with other directives
- You specified a
procedure directive that conflicts with other directives. For instance cdecl and pascal are
mutually exclusive.
-
Error: Calling convention doesn’t match forward
- This error happens when you declare a
function or procedure with e.g. cdecl; but omit this directive in the implementation, or vice
versa. The calling convention is part of the function declaration, and must be repeated in the
function definition.
-
Error: Property can’t have a default value
- Set properties or indexed properties cannot have
a default value.
-
Error: The default value of a property must be constant
- The value of a default
declared property must be known at compile time. The value you specified is only
known at run time. This happens e.g. if you specify a variable name as a default
value.
-
Error: Symbol can’t be published, can be only a class
- Only class type variables can be in a
published section of a class if they are not declared as a property.
-
Error: This kind of property can’t be published
- Properties in a published section cannot
be array properties. They must be moved to public sections. Properties in a published
section must be an ordinal type, a real type, strings or sets.
-
Error: An import name is required
- Some targets need a name for the imported procedure or
a cdecl specifier.
-
Error: Division by zero
- A division by zero was encounted.
-
Error: Invalid floating point operation
- An operation on two real type values produced an
overflow or a division by zero.
-
Error: Upper bound of range is less than lower bound
- The upper bound of an array
declaration is less than the lower bound and this is not possible.
-
Warning: string ”arg1” is longer than ”arg2”
- The size of the constant string is larger than
the size you specified in string type definition.
-
Error: string length is larger than array of char length
- The size of the constant string is
larger than the size you specified in the Array[x..y] of char definition.
-
Error: Illegal expression after message directive
- Free Pascal supports only integer or string
values as message constants.
-
Error: Message handlers can take only one call by ref. parameter
- A method declared
with the message directive as message handler can take only one parameter which must be
declared as call by reference. Parameters are declared as call by reference using the
var-directive.
-
Error: Duplicate message label: ”arg1”
- A label for a message is used twice in one
object/class.
-
Error: Self can only be an explicit parameter in methods which are message handlers
-
The Self parameter can only be passed explicitly to a method which is declared as message
handler.
-
Error: Threadvars can be only static or global
- Threadvars must be static or global; you
can’t declare a thread local to a procedure. Local variables are always local to a
thread, because every thread has its own stack and local variables are stored on the
stack.
-
Fatal: Direct assembler not supported for binary output format
- You can’t use direct
assembler when using a binary writer. Choose an other output format or use another
assembler reader.
-
Warning: Don’t load OBJPAS unit manually, use \{\$mode objfpc\} or \{\$mode delphi\} instead
-
You are trying to load the ObjPas unit manually from a uses clause. This is not a good
idea. Use the {$MODE OBJFPC} or {$mode delphi} directives which load the unit
automatically.
-
Error: OVERRIDE can’t be used in objects
- Override is not supported for objects, use
virtual instead to override a method of a parent object.
-
Error: Data types which require initialization/finalization can’t be used in variant records
-
Some data types (e.g. ansistring) need initialization/finalization code which is implicitly
generated by the compiler. Such data types can’t be used in the variant part of a
record.
-
Error: Resourcestrings can be only static or global
- Resourcestring cannot be declared
local, only global or using the static directive.
-
Error: Exit with argument can’t be used here
- An exit statement with an argument for the
return value can’t be used here. This can happen for example in try..except or
try..finally blocks.
-
Error: The type of the storage symbol must be boolean
- If you specify a storage symbol in
a property declaration, it must be a boolean type.
-
Error: This symbol isn’t allowed as storage symbol
- You can’t use this type of symbol as
storage specifier in property declaration. You can use only methods with the result type
boolean, boolean class fields or boolean constants.
-
Error: Only classes which are compiled in $M+ mode can be published
- A class-typed
field in the published section of a class can only be a class which was compiled in {$M+} or
which is derived from such a class. Normally such a class should be derived from
TPersistent.
-
Error: Procedure directive expected
- This error is triggered when you have a {$Calling}
directive without a calling convention specified. It also happens when declaring a procedure
in a const block and you used a ; after a procedure declaration which must be followed by a
procedure directive. Correct declarations are:
const
p : procedure;stdcall=nil;
p : procedure stdcall=nil;
-
Error: The value for a property index must be of an ordinal type
- The value you use to
index a property must be of an ordinal type, for example an integer or enumerated
type.
-
Error: Procedure name too short to be exported
- The length of the procedure/function
name must be at least 2 characters long. This is because of a bug in dlltool which doesn’t
parse the .def file correctly with a name of length 1.
-
Error: No DEFFILE entry can be generated for unit global vars
-
-
Error: Compile without -WD option
- You need to compile this file without the -WD switch
on the command line.
-
Fatal: You need ObjFpc (-S2) or Delphi (-Sd) mode to compile this module
- You need
to use {$MODE OBJFPC} or {$MODE DELPHI} to compile this file. Or use the corresponding
command line switch, either -Mobjfpc or -MDelphi.
-
Error: Can’t export with index under arg1
- Exporting of functions or procedures with a
specified index is not supported on this target.
-
Error: Exporting of variables is not supported under arg1
- Exporting of variables is not
supported on this target.
-
Error: Improper GUID syntax
- The GUID indication does not have the proper syntax. It
should be of the form
{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
Where each X represents a hexadecimal digit.
-
Warning: Procedure named ”arg1” not found that is suitable for implementing the arg2.arg3
-
The compiler cannot find a suitable procedure which implements the given method of an
interface. A procedure with the same name is found, but the arguments do not
match.
-
Error: interface identifier expected
- This happens when the compiler scans a class
declaration that contains interface function name mapping code like this:
type
TMyObject = class(TObject, IDispatch)
function IUnknown.QueryInterface=MyQueryInterface;
....
and the interface before the dot is not listed in the inheritance list.
-
Error: Type ”arg1” can’t be used as array index type
- Types like qword or int64 aren’t
allowed as array index type.
-
Error: Con- and destructors aren’t allowed in interfaces
- Constructor and destructor
declarations aren’t allowed in interfaces. In the most cases method QueryInterface of
IUnknown can be used to create a new interface.
-
Error: Access specifiers can’t be used in INTERFACES
- The access specifiers public,
private, protected and published can’t be used in interfaces because all methods of an
interface must be public.
-
Error: An interface can’t contain fields
- Declarations of fields aren’t allowed in interfaces.
An interface can contain only methods and properties with method read/write
specifiers.
-
Error: Can’t declare local procedure as EXTERNAL
- Declaring local procedures as
external is not possible. Local procedures get hidden parameters that will make the chance of
errors very high.
-
Warning: Some fields coming before ”arg1” weren’t initialized
- In Delphi mode, not all
fields of a typed constant record have to be initialized, but the compiler warns you when it
detects such situations.
-
Error: Some fields coming before ”arg1” weren’t initialized
- In all syntax modes but
Delphi mode, you can’t leave some fields uninitialized in the middle of a typed constant
record.
-
Warning: Some fields coming after ”arg1” weren’t initialized
- You can leave some fields at
the end of a type constant record uninitialized (The compiler will initialize them to zero
automatically). This may be the cause of subtle problems.
-
Error: VarArgs directive (or ’...’ in MacPas) without CDecl/CPPDecl/MWPascal and External
-
The varargs directive (or the “...” varargs parameter in MacPas mode) can only be used with
procedures or functions that are declared with external and one of cdecl, cppdecl and
mwpascal. This functionality is only supported to provide a compatible interface to C
functions like printf.
-
Error: Self must be a normal (call-by-value) parameter
- You can’t declare Self as a const
or var parameter, it must always be a call-by-value parameter.
-
Error: Interface ”arg1” has no interface identification
- When you want to assign an
interface to a constant, then the interface must have a GUID value set.
-
Error: Unknown class field or method identifier ”arg1”
- Properties must refer to a field or
method in the same class.
-
Warning: Overriding calling convention ”arg1” with ”arg2”
- There are two directives in
the procedure declaration that specify a calling convention. Only the last directive will be
used.
-
Error: Typed constants of the type ”procedure of object” can only be initialized with NIL
-
You can’t assign the address of a method to a typed constant which has a ’procedure of
object’ type, because such a constant requires two addresses: that of the method (which is
known at compile time) and that of the object or class instance it operates on (which cannot
be known at compile time).
-
Error: Default value can only be assigned to one parameter
- It is not possible to specify a
default value for several parameters at once. The following is invalid:
Procedure MyProcedure (A,B : Integer = 0);
Instead, this should be declared as
Procedure MyProcedure (A : Integer = 0; B : Integer = 0);
-
Error: Default parameter required for ”arg1”
- The specified parameter requires a default
value.
-
Warning: Use of unsupported feature!
- You’re trying to force the compiler into doing
something it cannot do yet.
-
Hint: C arrays are passed by reference
- Any array passed to a C function is passed by a
pointer (i.e. by reference).
-
Error: C array of const must be the last argument
- You cannot add any other argument
after an array of const for cdecl functions, as the size pushed on stack for this argument
is not known.
-
Hint: Type ”arg1” redefinition
- This is an indicator that a previously declared type is
being redefined as something else. This may, or may not be, a potential source of
errors.
-
Warning: cdecl’ared functions have no high parameter
- Functions declared with the cdecl
modifier do not pass an extra implicit parameter.
-
Warning: cdecl’ared functions do not support open strings
- Openstring is not supported
for functions that have the cdecl modifier.
-
Error: Cannot initialize variables declared as threadvar
- Variables declared as threadvar
cannot be initialized with a default value. The variables will always be filled with zero at the
start of a new thread.
-
Error: Message directive is only allowed in Classes
- The message directive is only supported
for Class types.
-
Error: Procedure or Function expected
- A class method can only be specified for procedures
and functions.
-
Warning: Calling convention directive ignored: ”arg1”
- Some calling conventions are
supported only by certain CPUs. I.e. most non-i386 ports support only the standard ABI
calling convention of the CPU.
-
Error: REINTRODUCE can’t be used in objects
- reintroduce is not supported for
objects.
-
Error: Each argument must have its own location
- If locations for arguments are specified
explicitly as it is required by some syscall conventions, each argument must have its own
location. Things like
procedure p(i,j : longint ’r1’);
aren’t allowed.
-
Error: Each argument must have an explicit location
- If one argument has an explicit
argument location, all arguments of a procedure must have one.
-
Error: Unknown argument location
- The location specified for an argument isn’t recognized
by the compiler.
-
Error: 32 Bit-Integer or pointer variable expected
- The libbase for MorphOS/AmigaOS can
be given only as longint, dword or any pointer variable.
-
Error: Goto statements aren’t allowed between different procedures
- It isn’t allowed to
use goto statements referencing labels outside the current procedure. The following example
shows the problem:
...
procedure p1;
label
l1;
procedure p2;
begin
goto l1; // This goto ISN’T allowed
end;
begin
p2
l1:
end;
...
-
Fatal: Procedure too complex, it requires too many registers
- Your procedure body is
too long for the compiler. You should split the procedure into multiple smaller
procedures.
-
Error: Illegal expression
- This can occur under many circumstances. Usually when trying to
evaluate constant expressions.
-
Error: Invalid integer expression
- You made an expression which isn’t an integer, and the
compiler expects the result to be an integer.
-
Error: Illegal qualifier
- One of the following is happening :
- You’re trying to access a field of a variable that is not a record.
- You’re indexing a variable that is not an array.
- You’re dereferencing a variable that is not a pointer.
-
Error: High range limit ¡ low range limit
- You are declaring a subrange, and the high limit is
less than the low limit of the range.
-
Error: Exit’s parameter must be the name of the procedure it is used in
- Non local exit
is not allowed. This error occurs only in mode MacPas.
-
Error: Illegal assignment to for-loop variable ”arg1”
- The type of a for loop variable must
be an ordinal type. Loop variables cannot be reals or strings. You also cannot assign values to
loop variables inside the loop (Except in Delphi and TP modes). Use a while or repeat loop
instead if you need to do something like that, since those constructs were built for
that.
-
Error: Can’t declare local variable as EXTERNAL
- Declaring local variables as external is
not allowed. Only global variables can reference external variables.
-
Error: Procedure is already declared EXTERNAL
- The procedure is already declared with
the EXTERNAL directive in an interface or forward declaration.
-
Warning: Implicit uses of Variants unit
- The Variant type is used in the unit without any
used unit using the Variants unit. The compiler has implicitly added the Variants unit to the
uses list. To remove this warning the Variants unit needs to be added to the uses
statement.
-
Error: Class and static methods can’t be used in INTERFACES
- The specifier class and
directive static can’t be used in interfaces because all methods of an interface must be
public.
-
Error: Overflow in arithmetic operation
- An operation on two integer values produced an
overflow.
-
Error: Protected or private expected
- strict can be only used together with protected or
private.
-
Error: SLICE can’t be used outside of parameter list
- slice can be used only for
arguments accepting an open array parameter.
-
Error: A DISPINTERFACE can’t have a parent class
- A DISPINTERFACE is a special
type of interface which can’t have a parent class.
-
Error: A DISPINTERFACE needs a guid
- A DISPINTERFACE always needs an interface
identification (a GUID).
-
Warning: Overridden methods must have a related return type. This code may crash, it depends on a Delphi parser bug (”arg2” is overridden by ”arg1” which has another return type)
-
If you declare overridden methods in a class definition, they must have the same return type.
Some versions of Delphi allow you to change the return type of interface methods, and even
to change procedures into functions, but the resulting code may crash depending on the types
used and the way the methods are called.
-
Error: Dispatch IDs must be ordinal constants
- The dispid keyword must be followed by an
ordinal constant (the dispid index).
-
Error: The range of the array is too large
- Regardless of the size taken up by its elements, an
array cannot have more than high(ptrint) elements. Additionally, the range type must be a
subrange of ptrint.
-
Error: The address cannot be taken of bit packed array elements and record fields
- If
you declare an array or record as packed in Mac Pascal mode (or as packed in any mode
with {$bitpacking on}), it will be packed at the bit level. This means it becomes impossible
to take addresses of individual array elements or record fields. The only exception to this
rule is in the case of packed arrays elements whose packed size is a multple of 8
bits.
-
Error: Dynamic arrays cannot be packed
- Only regular (and possibly in the future also open)
arrays can be packed.
-
Error: Bit packed array elements and record fields cannot be used as loop variables
- If
you declare an array or record as packed in Mac Pascal mode (or as packed in any mode
with {$bitpacking on}), it will be packed at the bit level. For performance reasons, they
cannot be used as loop variables.
-
Error: VAR and TYPE are allowed only in generics
- The usage of VAR and TYPE to
declare new types inside an object is allowed only inside generics.
-
Error: This type can’t be a generic
- Only Classes, Objects, Interfaces and Records are allowed
to be used as generic.
-
Warning: Don’t load LINEINFO unit manually, Use the -gl compiler switch instead
-
Do not use the lineinfo unit directly, Use the -gl switch which automatically adds the correct
unit for reading the selected type of debugging information. The unit that needs
to be used depends on the type of debug information used when compiling the
binary.
-
Error: No function result type specified for function ”arg1”
- The first time you declare a
function you have to declare it completely, including all parameters and the result
type.
-
Error: Specialization is only supported for generic types
- Types which are not generics
can’t be specialized.
-
Error: Generics can’t be used as parameters when specializing generics
- When
specializing a generic, only non-generic types can be used as parameters.
-
Error: Constants of objects containing a VMT aren’t allowed
- If an object requires a
VMT either because it contains a constructor or virtual methods, it’s not allowed to
create constants of it. In TP and Delphi mode this is allowed for compatibility
reasons.
-
Error: Taking the address of labels defined outside the current scope isn’t allowed
- It
isn’t allowed to take the address of labels outside the current procedure.
-
Error: Cannot initialize variables declared as external
- Variables declared as external
cannot be initialized with a default value.
-
Error: Illegal function result type
- Some types like file types cannot be used as function
result.
-
Error: No common type possible between ”arg1” and ”arg2”
- To perform an operation on
integers, the compiler converts both operands to their common type, which appears to be an
invalid type. To determine the common type of the operands, the compiler takes the
minimum of the minimal values of both types, and the maximum of the maximal values of
both types. The common type is then minimum..maximum.
-
Error: Generics without specialization cannot be used as a type for a variable
- Generics
must be always specialized before being used as variable type.
-
Warning: Register list is ignored for pure assembler routines
- When using pure assembler
routines, the list with modified registers is ignored.
-
Error: Implements property must have class or interface type
- A property which
implements an interface must be of type class or interface.
-
Error: Implements-property must implement interface of correct type, found ”arg1” expected ”arg2”
-
A property which implements an interface actually implements a different interface.
-
Error: Implements-property must have read specifier
- A property which implements an
interface must have at least a read specifier.
-
Error: Implements-property must not have write-specifier
- A property which implements
an interface may not have a write specifier.
-
Error: Implements-property must not have stored-specifier
- A property which implements
an interface may not have a stored specifier.
-
Error: Implements-property used on unimplemented interface: ”arg1”
- The
interface which is implemented by a property is not an interface implemented by the
class.
-
Error: Floating point not supported for this target
- The compiler parsed a floating point
expression, but it is not supported.
-
Error: Class ”arg1” does not implement interface ”arg2”
- The delegated interface is not
implemented by the class given in the implements clause.
-
Error: Type used by implements must be an interface
- The implements keyword must be
followed by an interface type.
-
Error: Variables cannot be exported with a different name on this target, add the name to the declaration using the ”export” directive (variable name: arg1, declared export name: arg2)
-
On most targets it is not possible to change the name under which a variable is exported
inside the exports statement of a library. In that case, you have to specify the export
name at the point where the variable is declared, using the export and alias
directives.
-
Error: Weak external symbols are not supported for the current target
- A ”weak
external” symbol is a symbol which may or may not exist at (either static or dynamic) link
time. This concept may not be available (or implemented yet) on the current cpu/OS
target.
-
Error: Forward type definition does not match
- Classes and interfaces being defined forward
must have the same type when being implemented. A forward interface cannot be changed
into a class.
-
Note: Virtual method ”arg1” has a lower visibility (arg2) than parent class arg3 (arg4)
-
The virtual method overrides an method that is declared with a higher visibility. This might
give unexpected results. In case the new visibility is private than it might be that a call to
inherited in a new child class will call the higher visible method in a parent class and ignores
the private method.
-
Error: Fields cannot appear after a method or property definition, start a new visibility section first
-
Once a method or property has been defined in a class or object, you cannot define any fields
afterwards without starting a new visibility section (such as public, private, etc.). The
reason is that otherwise the source code can appear ambiguous to the compiler,
since it is possible to use modifiers such as default and register also as field
names.
-
Error: Parameters cannot contain local type definitions. Use a separate type definition in a type block.
-
In Pascal, types are not considered to be identical simply because they are semantically
equivalent. Two variables or parameters are only considered to be of the same type if they
refer to the same type definition. As a result, it is not allowed to define new types inside
parameter lists, because then it is impossible to refer to the same type definition in the
procedure headers of the interface and implementation of a unit (both procedure headers
would define a separate type). Keep in mind that expressions such as “file of byte” or
“string[50]” also define a new type.
-
Error: ABSTRACT and SEALED conflict
- ABSTRACT and SEALED cannot be used
together in one declaration
-
Error: Cannot create a descendant of the sealed class ”arg1”
- Sealed means that class
cannot be derived by another class.
-
Error: SEALED class cannot have an ABSTRACT method
- Sealed means that class
cannot be derived. Therefore no one class is able to override an abstract method in a sealed
class.
-
Error: Only virtual methods can be final
- You are declaring a method as final, when it is not
declared to be virtual.
-
Error: Final method cannot be overridden: ”arg1”
- You are trying to override a virtual
method of a parent class that does not exist.
-
Error: Invalid enumerator identifier: ”arg1”
- Only ”MoveNext” and ”Current” enumerator
identifiers are supported.
-
Error: Enumerator identifier required
- ”MoveNext” or ”Current” identifier must follow the
enumerator modifier.
-
Error: Enumerator MoveNext pattern method is not valid. Method must be a function with the Boolean return type and no required arguments.
-
”MoveNext” enumerator pattern method must be a function with Boolean return type and
no required arguments
-
Error: Enumerator Current pattern property is not valid. Property must have a getter.
-
”Current” enumerator pattern property must have a getter
-
Error: Only one enumerator MoveNext method is allowed per class/object
- Class or
Object can have only one enumerator MoveNext declaration.
-
Error: Only one enumerator Current property is allowed per class/object
- Class or
Object can have only one enumerator Current declaration.
-
Error: For in loop cannot be used for the type ”arg1”
- For in loop can be used not for all
types. For example it cannot be used for the enumerations with jumps.