On 24.05.20 14:12, bauss wrote:
Is there a way to do that?
Since the following are both true:
int a = null;
int b = ;
assert(a is null);
assert(b is null);
What I would like is to tell that b is an empty array and a is a null
No way. `null` and `` are the same thing for arrays. (Ulike `""` for
strings which has a non-null `.ptr`.)
You can distinguish `null` from other (non-null, non-``) empty arrays.
int b = [1, 2, 3];
b = b[0 .. 0];
assert(b !is null);