I just noticed this still doesn't provide good type safety as MyPtr can be 
assigned an untyped pointer. Are pointers simply not an option here? Maybe we 
need classes for opaque pointer types instead?

type
  _MyPtr = record end;
  MyPtr = ^_MyPtr;
var
  p: Pointer;
  x: MyPtr;
begin
  x := p; // Should be an error!
end;

Regards,
Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to