[fpc-pascal] Make a distinct pointer type

Hairy Pixels genericptr at gmail.com
Wed May 31 16:03:11 CEST 2023


What's the best way to make a pointer type which is distinct so that the following snippet would give an error. I thought "type pointer" would do it but it doesn't seem to work.

type
  PA = type pointer;
  PB = type pointer;

var
  a: PA;
  b: PB;
begin
  a := b; // should give an error!
end;

Regards,
	Ryan Joseph



More information about the fpc-pascal mailing list