When checking explicit conformance for a generic type, use the type as declared in its context.
When checking explicit conformance for a generic type, use the type as declared in its context.

The type as declared within its context contains the archetypes used
when type-checking that context, rather than being an unbound type, so
associated types will get correctly substituted while checking
conformance. Fixes the main issues with <rdar://problem/13153805> and
<rdar://problem/13992060>, although neither as actually completely done.


Swift SVN r5484

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