Dynamic array variables in boolean context (e.g. when encountered in an if condition by themselves) are considered equivalent to their .ptr property. It has been argued they should instead use their .length property, so that empty (but not null) arrays evaluate as false. See Issue 4733 - Possible bugs caused by dynamic arrays in boolean evaluation context and related pull requests.
(from: https://wiki.dlang.org/Language_issues)
Dynamic array variables in boolean context (e.g. when encountered in an if condition by themselves) are considered equivalent to their .ptr property. It has been argued they should instead use their .length property, so that empty (but not null) arrays evaluate as false. See Issue 4733 - Possible bugs caused by dynamic arrays in boolean evaluation context and related pull requests.
(from: https://wiki.dlang.org/Language_issues)