Eliminate non-deterministic behavior when removing duplicate declarations after module lookup.
Eliminate non-deterministic behavior when removing duplicate declarations after module lookup.

Big thanks to JoeP for pointing this out! No specific test case here.

Swift SVN r19177

airspeedswift/swift,zisko/swift,swiftix/swift,tinysun212/swift-windows,jtbandes/swift,russbishop/swift,KrishMunot/swift,emilstahl/swift,amraboelela/swift,harlanhaskins/swift,ahoppen/swift,huonw/swift,codestergit/swift,Ivacker/swift,gottesmm/swift,stephentyrone/swift,dduan/swift,ben-ng/swift,roambotics/swift,JGiola/swift,gmilos/swift,jmgc/swift,apple/swift,karwa/swift,alblue/swift,russbishop/swift,zisko/swift,kperryua/swift,ahoppen/swift,MukeshKumarS/Swift,mightydeveloper/swift,zisko/swift,allevato/swift,apple/swift,jtbandes/swift,emilstahl/swift,amraboelela/swift,airspeedswift/swift,LeoShimonaka/swift,parkera/swift,harlanhaskins/swift,gregomni/swift,devincoughlin/swift,parkera/swift,cbrentharris/swift,KrishMunot/swift,rudkx/swift,kusl/swift,atrick/swift,milseman/swift,modocache/swift,xedin/swift,emilstahl/swift,dduan/swift,kentya6/swift,apple/swift,aschwaighofer/swift,frootloops/swift,felix91gr/swift,huonw/swift,amraboelela/swift,LeoShimonaka/swift,tinysun212/swift-windows,xedin/swift,return/swift,roambotics/swift,calebd/swift,arvedviehweger/swift,brentdax/swift,aschwaighofer/swift,shahmishal/swift,kentya6/swift,therealbnut/swift,danielmartin/swift,hooman/swift,LeoShimonaka/swift,deyton/swift,zisko/swift,khizkhiz/swift,swiftix/swift.old,felix91gr/swift,swiftix/swift,sdulal/swift,mightydeveloper/swift,natecook1000/swift,Ivacker/swift,jmgc/swift,kstaring/swift,xwu/swift,CodaFi/swift,hughbe/swift,harlanhaskins/swift,Ivacker/swift,OscarSwanros/swift,jopamer/swift,hooman/swift,jtbandes/swift,milseman/swift,milseman/swift,tardieu/swift,calebd/swift,modocache/swift,glessard/swift,karwa/swift,gmilos/swift,bitjammer/swift,natecook1000/swift,return/swift,KrishMunot/swift,JGiola/swift,shajrawi/swift,sschiau/swift,adrfer/swift,karwa/swift,gottesmm/swift,swiftix/swift.old,apple/swift,swiftix/swift.old,jopamer/swift,xwu/swift,Ivacker/swift,natecook1000/swift,rudkx/swift,johnno1962d/swift,kstaring/swift,IngmarStein/swift,johnno1962d/swift,JGiola/swift,stephentyrone/swift,cbrentharris/swift,IngmarStein/swift,slavapestov/swift,deyton/swift,KrishMunot/swift,danielmartin/swift,Jnosh/swift,tjw/swift,allevato/swift,amraboelela/swift,benlangmuir/swift,ken0nek/swift,shahmishal/swift,ahoppen/swift,huonw/swift,practicalswift/swift,roambotics/swift,manavgabhawala/swift,emilstahl/swift,ahoppen/swift,arvedviehweger/swift,shahmishal/swift,modocache/swift,dreamsxin/swift,johnno1962d/swift,uasys/swift,aschwaighofer/swift,slavapestov/swift,xedin/swift,airspeedswift/swift,gottesmm/swift,bitjammer/swift,tardieu/swift,hughbe/swift,rudkx/swift,glessard/swift,dduan/swift,harlanhaskins/swift,lorentey/swift,rudkx/swift,cbrentharris/swift,devincoughlin/swift,karwa/swift,return/swift,cbrentharris/swift,tjw/swift,danielmartin/swift,atrick/swift,jmgc/swift,CodaFi/swift,uasys/swift,gottesmm/swift,karwa/swift,alblue/swift,arvedviehweger/swift,tinysun212/swift-windows,ben-ng/swift,practicalswift/swift,modocache/swift,Ivacker/swift,jckarter/swift,khizkhiz/swift,brentdax/swift,tinysun212/swift-windows,ben-ng/swift,kusl/swift,tjw/swift,kperryua/swift,frootloops/swift,gregomni/swift,KrishMunot/swift,jopamer/swift,codestergit/swift,harlanhaskins/swift,alblue/swift,airspeedswift/swift,CodaFi/swift,jmgc/swift,cbrentharris/swift,johnno1962d/swift,mightydeveloper/swift,SwiftAndroid/swift,devincoughlin/swift,adrfer/swift,Ivacker/swift,russbishop/swift,felix91gr/swift,return/swift,tardieu/swift,alblue/swift,mightydeveloper/swift,nathawes/swift,JaSpa/swift,sdulal/swift,tjw/swift,lorentey/swift,hooman/swift,karwa/swift,tkremenek/swift,ben-ng/swift,ben-ng/swift,Jnosh/swift,ken0nek/swift,arvedviehweger/swift,ahoppen/swift,kstaring/swift,airspeedswift/swift,brentdax/swift,huonw/swift,uasys/swift,austinzheng/swift,xwu/swift,kstaring/swift,djwbrown/swift,gmilos/swift,swiftix/swift.old,russbishop/swift,austinzheng/swift,swiftix/swift,atrick/swift,SwiftAndroid/swift,mightydeveloper/swift,sdulal/swift,zisko/swift,cbrentharris/swift,jopamer/swift,kstaring/swift,return/swift,shajrawi/swift,deyton/swift,glessard/swift,tinysun212/swift-windows,ben-ng/swift,therealbnut/swift,harlanhaskins/swift,CodaFi/swift,sschiau/swift,gregomni/swift,kentya6/swift,therealbnut/swift,adrfer/swift,devincoughlin/swift,JaSpa/swift,stephentyrone/swift,tinysun212/swift-windows,tjw/swift,hughbe/swift,arvedviehweger/swift,tkremenek/swift,nathawes/swift,JaSpa/swift,lorentey/swift,kentya6/swift,therealbnut/swift,aschwaighofer/swift,kentya6/swift,shajrawi/swift,swiftix/swift,JGiola/swift,IngmarStein/swift,xwu/swift,deyton/swift,manavgabhawala/swift,OscarSwanros/swift,sschiau/swift,LeoShimonaka/swift,sdulal/swift,gribozavr/swift,danielmartin/swift,slavapestov/swift,uasys/swift,hughbe/swift,jtbandes/swift,codestergit/swift,CodaFi/swift,tjw/swift,brentdax/swift,Jnosh/swift,SwiftAndroid/swift,practicalswift/swift,johnno1962d/swift,emilstahl/swift,dduan/swift,ken0nek/swift,swiftix/swift,frootloops/swift,shahmishal/swift,zisko/swift,emilstahl/swift,lorentey/swift,devincoughlin/swift,lorentey/swift,uasys/swift,nathawes/swift,dreamsxin/swift,adrfer/swift,OscarSwanros/swift,devincoughlin/swift,felix91gr/swift,gribozavr/swift,jckarter/swift,sdulal/swift,tardieu/swift,gottesmm/swift,JaSpa/swift,deyton/swift,parkera/swift,atrick/swift,nathawes/swift,CodaFi/swift,deyton/swift,SwiftAndroid/swift,xedin/swift,kstaring/swift,therealbnut/swift,slavapestov/swift,ken0nek/swift,jckarter/swift,russbishop/swift,codestergit/swift,djwbrown/swift,felix91gr/swift,LeoShimonaka/swift,khizkhiz/swift,OscarSwanros/swift,practicalswift/swift,jmgc/swift,gottesmm/swift,swiftix/swift.old,khizkhiz/swift,jopamer/swift,airspeedswift/swift,xwu/swift,khizkhiz/swift,shajrawi/swift,deyton/swift,parkera/swift,kusl/swift,JGiola/swift,bitjammer/swift,djwbrown/swift,kperryua/swift,aschwaighofer/swift,benlangmuir/swift,jtbandes/swift,danielmartin/swift,glessard/swift,parkera/swift,calebd/swift,jckarter/swift,milseman/swift,gottesmm/swift,tinysun212/swift-windows,jopamer/swift,CodaFi/swift,parkera/swift,gmilos/swift,hughbe/swift,kentya6/swift,JaSpa/swift,shahmishal/swift,austinzheng/swift,mightydeveloper/swift,adrfer/swift,return/swift,Ivacker/swift,practicalswift/swift,nathawes/swift,OscarSwanros/swift,return/swift,rudkx/swift,gribozavr/swift,jckarter/swift,manavgabhawala/swift,sschiau/swift,gregomni/swift,SwiftAndroid/swift,modocache/swift,tkremenek/swift,xedin/swift,felix91gr/swift,hooman/swift,sschiau/swift,djwbrown/swift,ahoppen/swift,cbrentharris/swift,shajrawi/swift,allevato/swift,karwa/swift,calebd/swift,parkera/swift,hooman/swift,lorentey/swift,ken0nek/swift,natecook1000/swift,therealbnut/swift,benlangmuir/swift,ken0nek/swift,devincoughlin/swift,Jnosh/swift,sschiau/swift,airspeedswift/swift,shahmishal/swift,rudkx/swift,nathawes/swift,russbishop/swift,JGiola/swift,slavapestov/swift,allevato/swift,tkremenek/swift,austinzheng/swift,stephentyrone/swift,devincoughlin/swift,kusl/swift,tardieu/swift,tardieu/swift,MukeshKumarS/Swift,SwiftAndroid/swift,shajrawi/swift,arvedviehweger/swift,xwu/swift,milseman/swift,uasys/swift,MukeshKumarS/Swift,tkremenek/swift,djwbrown/swift,swiftix/swift.old,gribozavr/swift,gribozavr/swift,apple/swift,russbishop/swift,parkera/swift,SwiftAndroid/swift,stephentyrone/swift,apple/swift,frootloops/swift,jmgc/swift,amraboelela/swift,benlangmuir/swift,tkremenek/swift,frootloops/swift,calebd/swift,manavgabhawala/swift,JaSpa/swift,aschwaighofer/swift,ken0nek/swift,hooman/swift,huonw/swift,jtbandes/swift,stephentyrone/swift,roambotics/swift,shahmishal/swift,natecook1000/swift,swiftix/swift.old,practicalswift/swift,jckarter/swift,danielmartin/swift,hooman/swift,uasys/swift,alblue/swift,kstaring/swift,emilstahl/swift,modocache/swift,codestergit/swift,sdulal/swift,OscarSwanros/swift,karwa/swift,kentya6/swift,adrfer/swift,huonw/swift,jmgc/swift,practicalswift/swift,Jnosh/swift,slavapestov/swift,gmilos/swift,atrick/swift,brentdax/swift,kusl/swift,aschwaighofer/swift,frootloops/swift,stephentyrone/swift,Jnosh/swift,IngmarStein/swift,LeoShimonaka/swift,johnno1962d/swift,atrick/swift,swiftix/swift,gribozavr/swift,cbrentharris/swift,djwbrown/swift,khizkhiz/swift,gregomni/swift,swiftix/swift.old,gregomni/swift,manavgabhawala/swift,KrishMunot/swift,austinzheng/swift,practicalswift/swift,hughbe/swift,gmilos/swift,LeoShimonaka/swift,huonw/swift,harlanhaskins/swift,kperryua/swift,jtbandes/swift,KrishMunot/swift,austinzheng/swift,shajrawi/swift,codestergit/swift,MukeshKumarS/Swift,calebd/swift,bitjammer/swift,sschiau/swift,roambotics/swift,kperryua/swift,dduan/swift,tjw/swift,kperryua/swift,mightydeveloper/swift,gribozavr/swift,codestergit/swift,OscarSwanros/swift,sschiau/swift,amraboelela/swift,bitjammer/swift,kperryua/swift,JaSpa/swift,kusl/swift,shajrawi/swift,therealbnut/swift,xedin/swift,milseman/swift,allevato/swift,tkremenek/swift,emilstahl/swift,jopamer/swift,bitjammer/swift,roambotics/swift,johnno1962d/swift,alblue/swift,kentya6/swift,manavgabhawala/swift,bitjammer/swift,kusl/swift,IngmarStein/swift,allevato/swift,Ivacker/swift,MukeshKumarS/Swift,lorentey/swift,xwu/swift,IngmarStein/swift,calebd/swift,natecook1000/swift,manavgabhawala/swift,gribozavr/swift,shahmishal/swift,alblue/swift,felix91gr/swift,nathawes/swift,amraboelela/swift,allevato/swift,djwbrown/swift,MukeshKumarS/Swift,dduan/swift,milseman/swift,swiftix/swift,frootloops/swift,benlangmuir/swift,brentdax/swift,LeoShimonaka/swift,brentdax/swift,khizkhiz/swift,IngmarStein/swift,xedin/swift,gmilos/swift,jckarter/swift,slavapestov/swift,danielmartin/swift,glessard/swift,hughbe/swift,austinzheng/swift,modocache/swift,Jnosh/swift,sdulal/swift,ben-ng/swift,zisko/swift,dduan/swift,benlangmuir/swift,lorentey/swift,glessard/swift,tardieu/swift,adrfer/swift,MukeshKumarS/Swift,natecook1000/swift,kusl/swift,arvedviehweger/swift,mightydeveloper/swift,sdulal/swift,xedin/swift