Teach the constraints-based type checker to cope with generic member references better. There are a number of aspects to this:   - Treat member references and generic member references the same   way, by creating proper (albeit trivial) overload sets for   them. This allows the specialization machinery to kick in when the   member referenced is a polymorphic function.   - "Sanitize" already type-checked expressions produced by an   over-eager TypeCheckExpr.cpp by removing implicit conversions and   turning DotSyntaxCallExprs into member references. This allows the   specialization machinery to properly handle the two-step   specialization implied by calling a polymoprhic method on an   instance of a polymorphic type.   - Factor out the construction of a member reference, along with   subsequent specialization of the result, so it can be re-used for   the various member reference expression forms.   - Handle coercion of the object argument of a DotSyntaxCallExpr.
Teach the constraints-based type checker to cope with generic member
references better. There are a number of aspects to this:
  - Treat member references and generic member references the same
  way, by creating proper (albeit trivial) overload sets for
  them. This allows the specialization machinery to kick in when the
  member referenced is a polymorphic function.
  - "Sanitize" already type-checked expressions produced by an
  over-eager TypeCheckExpr.cpp by removing implicit conversions and
  turning DotSyntaxCallExprs into member references. This allows the
  specialization machinery to properly handle the two-step
  specialization implied by calling a polymoprhic method on an
  instance of a polymorphic type.
  - Factor out the construction of a member reference, along with
  subsequent specialization of the result, so it can be re-used for
  the various member reference expression forms.
  - Handle coercion of the object argument of a DotSyntaxCallExpr.



Swift SVN r2911

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