Sema: Fix bug in buildMemberRef() with subclass existentials
Sema: Fix bug in buildMemberRef() with subclass existentials

Make sure we use the right 'self' type in various places. When
calling a Self-returning class method on a subclass existential,
the following has to happen correctly:

- The existential is opened to produce an archetype with a superclass
  constraint.

- The archetype is upcast to a class type to produce the 'self'
  parameter for the call.

- The method call returns a value with the same type as the 'self'
  parameter.

- The return value is downcast to the opened archetype.

- The opened archetype is converted back to an existential.

Some SILGen tests in an upcoming patch exercise this code path.

huonw/swift,OscarSwanros/swift,deyton/swift,shahmishal/swift,shahmishal/swift,Jnosh/swift,JGiola/swift,parkera/swift,zisko/swift,roambotics/swift,brentdax/swift,lorentey/swift,shahmishal/swift,lorentey/swift,austinzheng/swift,tjw/swift,jmgc/swift,atrick/swift,harlanhaskins/swift,Jnosh/swift,felix91gr/swift,tkremenek/swift,gribozavr/swift,atrick/swift,uasys/swift,natecook1000/swift,jckarter/swift,jopamer/swift,jtbandes/swift,xwu/swift,stephentyrone/swift,stephentyrone/swift,shahmishal/swift,jmgc/swift,calebd/swift,harlanhaskins/swift,gribozavr/swift,milseman/swift,gregomni/swift,JGiola/swift,aschwaighofer/swift,practicalswift/swift,zisko/swift,huonw/swift,apple/swift,xedin/swift,ahoppen/swift,glessard/swift,airspeedswift/swift,hooman/swift,amraboelela/swift,tkremenek/swift,lorentey/swift,CodaFi/swift,return/swift,rudkx/swift,parkera/swift,arvedviehweger/swift,parkera/swift,deyton/swift,airspeedswift/swift,brentdax/swift,benlangmuir/swift,jopamer/swift,arvedviehweger/swift,apple/swift,Jnosh/swift,jtbandes/swift,xwu/swift,glessard/swift,shajrawi/swift,tkremenek/swift,CodaFi/swift,shajrawi/swift,natecook1000/swift,jopamer/swift,return/swift,parkera/swift,stephentyrone/swift,hughbe/swift,apple/swift,xwu/swift,gregomni/swift,aschwaighofer/swift,glessard/swift,amraboelela/swift,hughbe/swift,shajrawi/swift,danielmartin/swift,glessard/swift,karwa/swift,xedin/swift,practicalswift/swift,deyton/swift,xedin/swift,alblue/swift,danielmartin/swift,nathawes/swift,austinzheng/swift,jopamer/swift,harlanhaskins/swift,allevato/swift,jopamer/swift,natecook1000/swift,deyton/swift,jmgc/swift,airspeedswift/swift,stephentyrone/swift,alblue/swift,deyton/swift,brentdax/swift,lorentey/swift,jckarter/swift,huonw/swift,jmgc/swift,gribozavr/swift,hughbe/swift,tkremenek/swift,jopamer/swift,roambotics/swift,return/swift,hooman/swift,gregomni/swift,gribozavr/swift,austinzheng/swift,tjw/swift,huonw/swift,danielmartin/swift,xedin/swift,devincoughlin/swift,zisko/swift,tjw/swift,OscarSwanros/swift,nathawes/swift,arvedviehweger/swift,shahmishal/swift,xedin/swift,felix91gr/swift,djwbrown/swift,sschiau/swift,milseman/swift,apple/swift,gribozavr/swift,calebd/swift,ahoppen/swift,calebd/swift,jmgc/swift,arvedviehweger/swift,karwa/swift,sschiau/swift,lorentey/swift,natecook1000/swift,JGiola/swift,gribozavr/swift,benlangmuir/swift,djwbrown/swift,benlangmuir/swift,parkera/swift,apple/swift,uasys/swift,amraboelela/swift,jckarter/swift,OscarSwanros/swift,return/swift,uasys/swift,brentdax/swift,uasys/swift,deyton/swift,zisko/swift,return/swift,arvedviehweger/swift,huonw/swift,swiftix/swift,benlangmuir/swift,harlanhaskins/swift,shahmishal/swift,hooman/swift,atrick/swift,ahoppen/swift,shajrawi/swift,hooman/swift,jmgc/swift,return/swift,roambotics/swift,arvedviehweger/swift,xedin/swift,Jnosh/swift,sschiau/swift,gregomni/swift,danielmartin/swift,tjw/swift,practicalswift/swift,tkremenek/swift,karwa/swift,nathawes/swift,alblue/swift,parkera/swift,felix91gr/swift,tkremenek/swift,aschwaighofer/swift,hughbe/swift,uasys/swift,austinzheng/swift,felix91gr/swift,huonw/swift,austinzheng/swift,jtbandes/swift,shajrawi/swift,calebd/swift,danielmartin/swift,amraboelela/swift,jckarter/swift,devincoughlin/swift,brentdax/swift,brentdax/swift,JGiola/swift,airspeedswift/swift,amraboelela/swift,zisko/swift,atrick/swift,swiftix/swift,xwu/swift,tkremenek/swift,arvedviehweger/swift,frootloops/swift,alblue/swift,danielmartin/swift,xwu/swift,practicalswift/swift,CodaFi/swift,nathawes/swift,benlangmuir/swift,jckarter/swift,tjw/swift,felix91gr/swift,alblue/swift,devincoughlin/swift,CodaFi/swift,gribozavr/swift,brentdax/swift,frootloops/swift,karwa/swift,jckarter/swift,natecook1000/swift,jmgc/swift,karwa/swift,Jnosh/swift,karwa/swift,lorentey/swift,xedin/swift,lorentey/swift,djwbrown/swift,airspeedswift/swift,milseman/swift,allevato/swift,jtbandes/swift,nathawes/swift,gregomni/swift,hooman/swift,allevato/swift,hooman/swift,austinzheng/swift,zisko/swift,stephentyrone/swift,huonw/swift,stephentyrone/swift,jckarter/swift,atrick/swift,austinzheng/swift,milseman/swift,xedin/swift,devincoughlin/swift,shahmishal/swift,danielmartin/swift,djwbrown/swift,karwa/swift,atrick/swift,allevato/swift,benlangmuir/swift,ahoppen/swift,tjw/swift,calebd/swift,calebd/swift,alblue/swift,practicalswift/swift,practicalswift/swift,aschwaighofer/swift,OscarSwanros/swift,gregomni/swift,devincoughlin/swift,glessard/swift,frootloops/swift,xwu/swift,ahoppen/swift,gribozavr/swift,amraboelela/swift,apple/swift,devincoughlin/swift,swiftix/swift,frootloops/swift,amraboelela/swift,return/swift,aschwaighofer/swift,roambotics/swift,parkera/swift,alblue/swift,felix91gr/swift,shajrawi/swift,CodaFi/swift,OscarSwanros/swift,nathawes/swift,jtbandes/swift,zisko/swift,harlanhaskins/swift,rudkx/swift,allevato/swift,sschiau/swift,JGiola/swift,natecook1000/swift,Jnosh/swift,swiftix/swift,milseman/swift,tjw/swift,sschiau/swift,OscarSwanros/swift,xwu/swift,parkera/swift,rudkx/swift,uasys/swift,swiftix/swift,frootloops/swift,sschiau/swift,shajrawi/swift,hughbe/swift,OscarSwanros/swift,swiftix/swift,shahmishal/swift,allevato/swift,frootloops/swift,glessard/swift,swiftix/swift,uasys/swift,devincoughlin/swift,milseman/swift,sschiau/swift,djwbrown/swift,airspeedswift/swift,natecook1000/swift,rudkx/swift,jopamer/swift,frootloops/swift,stephentyrone/swift,jtbandes/swift,airspeedswift/swift,sschiau/swift,hughbe/swift,aschwaighofer/swift,rudkx/swift,roambotics/swift,karwa/swift,harlanhaskins/swift,rudkx/swift,ahoppen/swift,felix91gr/swift,JGiola/swift,jtbandes/swift,Jnosh/swift,harlanhaskins/swift,hooman/swift,CodaFi/swift,deyton/swift,milseman/swift,hughbe/swift,lorentey/swift,roambotics/swift,allevato/swift,nathawes/swift,CodaFi/swift,aschwaighofer/swift,calebd/swift,shajrawi/swift,devincoughlin/swift,djwbrown/swift,practicalswift/swift,practicalswift/swift,djwbrown/swift