You are looking for something that will never happen in FPC, because I've asked for a few times and all I get is flack about it..
All types without any Boolean expressions or otherwise should default to a Boolean expression if these are types, not functions etc..
In your case..
If SomePointer then ….
or
If Not SomePointer then....
Basically, being any form of a number type or pointer can be tested for a 0 value to indicate if it's tree of false, false for 0 / Nil otherwise true for all other values
I don't know if there are helpers for pointers, maybe there should be if not but with other numerical types you do have this..
If SomeInteger.ToBoolean then....
So my question here is , why can't we do this..
If SomeInteger then.....
Oh well, I understand the frustration that comes with it.
you can do this however,.
If Boolean(SomePotiner) then the compiler may decide to only examine the low byte and so on..
But I think making a pointer helper adding to one for a bool is a good idea and the helper should also be able to auto detect a Boolean operation if there is nothing defind..
for example
if SomePointer then..
In the helper there would be a default call of returning a Boolean results or inline generated code.
The proper way to do this is at the compiler intrinsic level where the compiler can property code it without the over head..
Maybe if we ask enough we could get it