fix Issue 10354 - DIP37: ICE with using indirectly imported template through package.d
Merge pull request #2177 from 9rnsr/fix10354

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