fix Issue 10354 - DIP37: ICE with using indirectly imported template through package.d