In some situations, like the example below, the error message points to
$define instead of actual line where the error has happened:
program Project1;
var
A: TObject;
{$macro on}
{$define AObject:=(A as TObject)}
begin
A := TObject.Create(nil)
AObject.Tag := 0;
A.Free;
end.
I wonder if there a way to effectively find the actual faulty line in code? In the example it's trivial - a forgotten semicolon and incorrect
Create syntax. But when the macro is located inside of an include file and used a few dozens of times throughout a relatively large unit, debugging some trivial typos becomes slightly harder than necessary.