i.e. rebasing https://github.com/dlang/dmd/pull/8517
i.e. rebasing dlang/dmd#8517