Wrong error location when using macro
Original Reporter info from Mantis: y.ivanov
-
Reporter name: Yuliyan Ivanov
Original Reporter info from Mantis: y.ivanov
- Reporter name: Yuliyan Ivanov
Description:
When using a macro to rename a unit, and the compiler issues an error, the location of the error is incorrect.
Steps to reproduce:
Given the files:
project1.lpr
program project1;
{$MACRO ON}
{$DEFINE module:=Unit1}
uses Unit1;
begin
module.Moo(1, 2);
module.Moo(1);
end.
and unit1.pas
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils;
procedure Moo(A1, A2: Integer);
implementation
procedure Moo(A1, A2: Integer);
begin
end;
end.
(Note in the project1.lpr the Moo is called with just one parameter on line 7)
The compiler is giving the following error:
project1.lpr(3,6) Error: Wrong number of parameters specified for call to "Moo"
which is the location of I in {$DEFINE}. The error is actually on the 7-th line.
Mantis conversion info:
- Mantis ID: 39205
- OS: Windows
- OS Build: 10
- Build: Lazarus 2.0.12 r64642 FPC 3.2.2
- Platform: i386
- Version: 3.2.1