Type helper for pointer compiles but cannot be used due to Error: Illegal Qualifier
Original Reporter info from Mantis: CraigChapman
-
Reporter name: Craig Chapman
Original Reporter info from Mantis: CraigChapman
- Reporter name: Craig Chapman
Description:
Please see source code which fails to compile under Steps To Reproduce.
Errors occur on lines 25&26: Error: Illegal Qualifier
Steps to reproduce:
program Project1;
{$mode delphiunicode}
type
TPointerHelper = record helper for pointer
function AsNativeUint: nativeuint;
function PCharLen: uint32;
end;
function TPointerHelper.AsNativeUint: nativeuint;
begin
Result := nativeuint(self);
end;
function TPointerHelper.PCharLen: uint32;
begin
Result := 5; //- Just here to illustrate the issue.
end;
var
P: pointer;
begin
P := @ParamStr(0); //- Just a nonsense pointer.
Writeln( P.AsNativeUInt );
Writeln( P.PCharLen );
Readln;
end.
Additional information:
Note: Mode set to 'DelphiUnicode' - This source compiles using Delphi compiler.
Mantis conversion info:
- Mantis ID: 35533
- OS: Windows
- OS Build: 10
- Build: r41976
- Platform: amd64
- Version: 3.3.1
- Fixed in version: 3.3.1
- Fixed in revision: 42036 (#251c5596)