Crashing is always not good.
When i not know this is a bug or not a bug,
and you too not,
than we can wait until we get any qualified complete statement
to that from 4D or any 4D-Developer.
I think it is not wrong when you make a bugreport for that,
to get any statement
or to get full bufix
or to get small bugfix only a errorMessage instead of crash.
Pointers and Parameters, that is a very special kind
which can not so easy directly compare with behaviour of OtherTypes
and with normalVariables(not parameters).
Think about a Pointer can only point on something or be Nil,
nothing other the status of a pointer-variable can have.
When assign a Null to a Pointer it is like
assign Nil (or do this with CLEAR VARIABLE),
Nil is the init status of a pointer which still not point to something.
That is different to, only for example, a C_OBJECT or a C_COLLECTION
which init status is Null
and when not Null than it is a referece to a object or collection.
$ptr:=Null // translated to Nil
$longint:=12.34 // translated to 12
Using Parameters is not totally the same like to assign with :=
To have a caller like this (and myMethod has only pointer parameters)
it not worked to have instead $ptr3 a constant Null (like to advice $3 is not needed/defined)
$ptrResult:=myMethod($ptr1; $ptr2; Null; $ptr4)
To beware from error message or crash, it is better to let third parameter in call Nil and not Null.
Here are two routines what always needed in different situations:
// PM: "zGetNilPtr"
// This method only returns a constant nil pointer
// - EOF -
// PM: "zGetFixType"
// This method gives you always wished type (save to use a fix type parameter)
// Example call: zGetFixType (Null;Is pointer) // -> Nil
If (Count parameters>0)
If (Count parameters>1)
$result:=OB Get(New object("x";$src);"x";$type)
// - EOF -
Use case example “zGetNilPtr”
$ptrResult:=myMethod($obj.ptr1; $obj.ptr2; $obj.ptr3; $obj.ptr4)
Use case example “zGetFixType”
$ptrResult:=myMethod(zGetFixType ($obj.ptr1;Is pointer); zGetFixType ($obj.ptr2;Is pointer); zGetFixType ($obj.ptr3;Is pointer); zGetFixType ($obj.ptr4;Is pointer))
More simple to read, but not a realistic example of a needed to do it this way
$ptrResult:=myMethod($ptr1; $ptr2; zGetFixType(Null;Is pointer); $ptr4)
When only a fix Nil is needed use “zGetNilPtr”
$ptrResult:=myMethod($ptr1; $ptr2; zGetNilPtr; $ptr4)
Do not forget, i am just discuss about it and give some tipps maybe it helps anyway,
because i can+will not make the final decision “bug” or “not a bug”
and too not again decide “it would maybe normal expected behaviour”.
I think at minimum 4D needs to write this more clear in documentation
(what is possible, what did not work, what is absolutly forbidden when you want beware from crash, and lastNotLeast a detailed explanation about the always question “Why it must be so?”)