Wrong error message with "type foo = type bar;"
Original Reporter info from Mantis: Martin @martin_frb
-
Reporter name: Martin Friebe
Original Reporter info from Mantis: Martin @martin_frb
- Reporter name: Martin Friebe
Description:
If you declare a distinct type, with
Wrong error message with "type foo = type bar;"
And then try to pass an incompatible type the error will refer to "bar", but it should refer to "foo";
See code in "steps to reproduce"
Compiler gives the following error:
project1.lpr(16,8) Error: Incompatible type for arg no. 1: Got "TPoint", expected "PROJECT1.TPoint"
But it should say: "... expected Project1.TMyPoint"
Steps to reproduce:
program Project1;
{$mode objfpc}{$H+}
uses types;
type
TMyPoint = type TPoint;
procedure Foo(mp: TMyPoint);
begin
end;
var
p: TPoint;
begin
Foo(p);
end.
Mantis conversion info:
- Mantis ID: 37132
- OS: win 10
- OS Build: 10
- Platform: 64bit Intel
- Version: 3.3.1