Commits

Andrew Trick committed 5bc23acf75d
Add wrappers around Builtin.isUnique. Currently they do nothing but allow stdlib code to use regular (Bool) types. However, soon the wrappers for the _native variants will provide point-of-use sanity checking. These need to be fully generic to support class protocols and single-payload enums (not just for optional). It also avoids a massive amount of overloading for all the reference type variations (AnyObject, Native, Unknown, Bridge) x 2 for optional versions of each. Because the wrapper is generic, type checking had to be deferred until IRGen. Generating code for the wrapper itself will result in an IRGen-time type error. They need to be transparent anyway for proper diagnostics, but also must be internal. Note that the similar external API type checks ok because it forces conformance to AnyObject. The sanity checks are disabled because our current facilities for unsafe type casting are incomplete and unsound. SILCombine can remove UnsafeMutablePointer and RawPointer casts by assuming layout compatibility. IRGen will later discover layout incompatibility and generate a trap. I'll send out a proposal for improving the casting situation so we can get the sanity checks back. Swift SVN r28057