The Delphi Bug List

Compiler

Shouldn't compile


The color codes indicate in which version(s) of Delphi the bug occurs and what its status is.
Latest update: 28 October 1998
Bug # Delphi versions Description
134 1.02 2.01 3.0 3.01 3.02 4.0 4.01 4.02
It is possible to 'use' the current unit in the Implementation section without errors
495 1.02 2.01 3.0 3.01 3.02 4.0 4.01 4.02
The compiler accepts that a subroutine declared as a function is implemented as a procedure and the other way around.

Bug #134; last modified: 12-Jul-98
1.02 2.01 3.0 3.01 3.02 4.0 4.01 4.02
Absent Exists Unknown Unknown Fixed Fixed Fixed Fixed
Shouldn't compile

It is possible to 'use' the current unit in the Implementation section without errors

Description
Reported by Jani Järvinen; checked by Rune Moberg
Problem example:
Create a unit:
Unit MyUnit;

Interface

Implementation

Uses MyUnit; { this should not compile }

End.
The above code compiles happily. For example in Borland Pascal 7.0 the above fails with error message "Identifier redeclared.". If the Uses clause is moved to the Interface section, Delphi doesn't compile the unit.
Solution / workaround
None needed, as this bug doesn't result in any problems.

Bug #495; last modified: 28-Oct-98
1.02 2.01 3.0 3.01 3.02 4.0 4.01 4.02
Absent Absent Absent Absent Absent Exists Exists Exists
Shouldn't compile

The compiler accepts that a subroutine declared as a function is implemented as a procedure and the other way around.

Description
Reported by Clinton R. Johnson; checked by Reinier Sterkenburg
Examples:
interface

function func: Integer;
procedure proc;

implementation

procedure func;
begin
  Result := 10;
  ShowMessage('func');
end;

function proc;
begin
  ShowMessage('proc');
end;
These are compiled without complaints. This not only 'works' for subroutines in an interface, but also for methods of objects.

Index page
The Delphi Bug Lists are maintained by Reinier Sterkenburg, with help from the DeBug Team.
All feedback is appreciated. See also the feedback section of the Delphi Bug List home page.