Implement basic overload resolution.
Implement basic overload resolution.

When different solutions to the same constraint system have selected
different overload choices for the same locator, compare the overload
choices. The rules are fairly simplistic:

  - An identity overload beats a declaration overload.
  - A declaration overload beats another declaration overload if it is
    more specialized, meaning that:
      + It is monomorphic while the other is polymorphic
      + It's type is a subtype of the other's type (but the converse
    is not true)

Expect more revision here. In particular, we likely will only need the
subtyping rule when comparing two declarations, but our "is a subtype"
check currently doesn't handle polymorphic function types well, so we
avoid them.



Swift SVN r5521

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