Teach requestNativeBuffer() to return nil on an empty buffer.
Teach requestNativeBuffer() to return nil on an empty buffer.

The _native computed property that backs this method has a different
contract than requestNativeBuffer() expected: it returned an empty
buffer rather than using an optional and returning nil. We were just
wrapping up that empty buffer and declaring success, which meant we
would bridge from an NSArray wrapping native storage of T to an empty
native array, always.

This change is a necessary prerequisite to importing NSArray* as
(AnyObject[])! per <rdar://problem/16535097>. That (imminent) change
tests this, but we need more targetted testing of this area.




Swift SVN r18143

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