See https://github.com/D-Programming-Language/dmd/pull/3070#issuecomment-35042722

Without this check pointer to shared types do not get checked properly.