Implement type checking of ElementRefDecl's in SemaExpressionTree, diagnosing an invalid case and propagating types further.
Implement type checking of ElementRefDecl's in SemaExpressionTree, diagnosing an invalid case and propagating types further.

Swift SVN r265

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