Only look up whether a module's SOURCE-imported if it's in the current package Suppose we import anotherPackage:M, which exports things from anotherPackage:Internal. Then GHC will want to read anotherPackage:Internal.hi.
Only look up whether a module's SOURCE-imported if it's in the current package
Suppose we import anotherPackage:M, which exports things from
anotherPackage:Internal. Then GHC will want to read
anotherPackage:Internal.hi.

However, if we have also SOURCE-imported thisPackage:Internal then
we don't want GHC to try to read anotherPackage:Internal.hi-boot
instead.

The mapping that tells us whether a module is SOURCE-imported uses just
the module name for the key, so we have to check the package ID before
looking it up.

Fixes #3007.

mcschroeder/ghc,forked-upstream-packages-for-ghcjs/ghc,GaloisInc/halvm-ghc,siddhanathan/ghc,elieux/ghc,mettekou/ghc,tibbe/ghc,anton-dessiatov/ghc,jstolarek/ghc,green-haskell/ghc,acowley/ghc,mcschroeder/ghc,spacekitteh/smcghc,snoyberg/ghc,ezyang/ghc,tibbe/ghc,sgillespie/ghc,oldmanmike/ghc,mfine/ghc,elieux/ghc,anton-dessiatov/ghc,olsner/ghc,acowley/ghc,hferreiro/replay,vikraman/ghc,lukexi/ghc,bitemyapp/ghc,gridaphobe/ghc,wxwxwwxxx/ghc,wxwxwwxxx/ghc,ml9951/ghc,lukexi/ghc-7.8-arm64,fmthoma/ghc,gridaphobe/ghc,fmthoma/ghc,spacekitteh/smcghc,forked-upstream-packages-for-ghcjs/ghc,ilyasergey/GHC-XAppFix,mcmaniac/ghc,jstolarek/ghc,ezyang/ghc,mettekou/ghc,olsner/ghc,ryantm/ghc,AlexanderPankiv/ghc,shlevy/ghc,hferreiro/replay,sgillespie/ghc,nathyong/microghc-ghc,spacekitteh/smcghc,spacekitteh/smcghc,nathyong/microghc-ghc,gcampax/ghc,sgillespie/ghc,elieux/ghc,tjakway/ghcjvm,ekmett/ghc,bitemyapp/ghc,vikraman/ghc,wxwxwwxxx/ghc,sdiehl/ghc,nkaretnikov/ghc,hferreiro/replay,nomeata/ghc,mettekou/ghc,christiaanb/ghc,mcschroeder/ghc,urbanslug/ghc,holzensp/ghc,vTurbine/ghc,gcampax/ghc,snoyberg/ghc,mcmaniac/ghc,frantisekfarka/ghc-dsi,ghc-android/ghc,gridaphobe/ghc,ekmett/ghc,fmthoma/ghc,ryantm/ghc,shlevy/ghc,mfine/ghc,da-x/ghc,olsner/ghc,urbanslug/ghc,nkaretnikov/ghc,fmthoma/ghc,siddhanathan/ghc,siddhanathan/ghc,acowley/ghc,tjakway/ghcjvm,christiaanb/ghc,siddhanathan/ghc,gcampax/ghc,nathyong/microghc-ghc,nushio3/ghc,AlexanderPankiv/ghc,elieux/ghc,mettekou/ghc,gcampax/ghc,vikraman/ghc,lukexi/ghc,frantisekfarka/ghc-dsi,wxwxwwxxx/ghc,sdiehl/ghc,mcschroeder/ghc,da-x/ghc,ml9951/ghc,urbanslug/ghc,fmthoma/ghc,fmthoma/ghc,lukexi/ghc-7.8-arm64,lukexi/ghc,sdiehl/ghc,lukexi/ghc,nushio3/ghc,nushio3/ghc,green-haskell/ghc,nushio3/ghc,nushio3/ghc,ghc-android/ghc,snoyberg/ghc,TomMD/ghc,ekmett/ghc,snoyberg/ghc,wxwxwwxxx/ghc,acowley/ghc,tjakway/ghcjvm,urbanslug/ghc,vikraman/ghc,snoyberg/ghc,ilyasergey/GHC-XAppFix,forked-upstream-packages-for-ghcjs/ghc,tibbe/ghc,vTurbine/ghc,snoyberg/ghc,da-x/ghc,nomeata/ghc,christiaanb/ghc,da-x/ghc,shlevy/ghc,elieux/ghc,ml9951/ghc,nkaretnikov/ghc,hferreiro/replay,mfine/ghc,gridaphobe/ghc,da-x/ghc,mettekou/ghc,da-x/ghc,ezyang/ghc,ml9951/ghc,mcmaniac/ghc,holzensp/ghc,nathyong/microghc-ghc,vikraman/ghc,hferreiro/replay,ezyang/ghc,olsner/ghc,bitemyapp/ghc,ml9951/ghc,lukexi/ghc-7.8-arm64,holzensp/ghc,shlevy/ghc,tibbe/ghc,jstolarek/ghc,vTurbine/ghc,ghc-android/ghc,mcmaniac/ghc,nathyong/microghc-ghc,ml9951/ghc,oldmanmike/ghc,mcschroeder/ghc,christiaanb/ghc,vTurbine/ghc,urbanslug/ghc,christiaanb/ghc,sgillespie/ghc,oldmanmike/ghc,anton-dessiatov/ghc,gridaphobe/ghc,ekmett/ghc,spacekitteh/smcghc,frantisekfarka/ghc-dsi,christiaanb/ghc,ilyasergey/GHC-XAppFix,gcampax/ghc,ezyang/ghc,ekmett/ghc,forked-upstream-packages-for-ghcjs/ghc,acowley/ghc,lukexi/ghc,oldmanmike/ghc,GaloisInc/halvm-ghc,mettekou/ghc,gcampax/ghc,ilyasergey/GHC-XAppFix,oldmanmike/ghc,shlevy/ghc,AlexanderPankiv/ghc,vTurbine/ghc,holzensp/ghc,ezyang/ghc,nushio3/ghc,siddhanathan/ghc,green-haskell/ghc,olsner/ghc,siddhanathan/ghc,mcschroeder/ghc,tjakway/ghcjvm,wxwxwwxxx/ghc,ghc-android/ghc,sdiehl/ghc,GaloisInc/halvm-ghc,mfine/ghc,jstolarek/ghc,mfine/ghc,elieux/ghc,fmthoma/ghc,jstolarek/ghc,tjakway/ghcjvm,sgillespie/ghc,nathyong/microghc-ghc,hferreiro/replay,wxwxwwxxx/ghc,oldmanmike/ghc,green-haskell/ghc,mfine/ghc,AlexanderPankiv/ghc,urbanslug/ghc,GaloisInc/halvm-ghc,GaloisInc/halvm-ghc,green-haskell/ghc,olsner/ghc,ghc-android/ghc,mcschroeder/ghc,acowley/ghc,AlexanderPankiv/ghc,ryantm/ghc,ryantm/ghc,sdiehl/ghc,anton-dessiatov/ghc,ml9951/ghc,nkaretnikov/ghc,forked-upstream-packages-for-ghcjs/ghc,lukexi/ghc-7.8-arm64,AlexanderPankiv/ghc,nomeata/ghc,da-x/ghc,TomMD/ghc,christiaanb/ghc,AlexanderPankiv/ghc,lukexi/ghc-7.8-arm64,anton-dessiatov/ghc,tibbe/ghc,nkaretnikov/ghc,siddhanathan/ghc,nomeata/ghc,anton-dessiatov/ghc,bitemyapp/ghc,olsner/ghc,forked-upstream-packages-for-ghcjs/ghc,nushio3/ghc,gridaphobe/ghc,TomMD/ghc,TomMD/ghc,forked-upstream-packages-for-ghcjs/ghc,gcampax/ghc,ml9951/ghc,sgillespie/ghc,tjakway/ghcjvm,vikraman/ghc,mettekou/ghc,bitemyapp/ghc,elieux/ghc,shlevy/ghc,nathyong/microghc-ghc,shlevy/ghc,TomMD/ghc,frantisekfarka/ghc-dsi,vTurbine/ghc,TomMD/ghc,snoyberg/ghc,mfine/ghc,nkaretnikov/ghc,ryantm/ghc,TomMD/ghc,tjakway/ghcjvm,ezyang/ghc,urbanslug/ghc,holzensp/ghc,sdiehl/ghc,mcmaniac/ghc,ghc-android/ghc,acowley/ghc,ghc-android/ghc,sgillespie/ghc,hferreiro/replay,vikraman/ghc,sdiehl/ghc,GaloisInc/halvm-ghc,vTurbine/ghc,frantisekfarka/ghc-dsi,GaloisInc/halvm-ghc,nomeata/ghc,nkaretnikov/ghc,gridaphobe/ghc,oldmanmike/ghc,anton-dessiatov/ghc