When an assertion fails due to an Objective-C exception, that should be
treated as an unexpected failure, not an expected failure.
Addresses rdar://problem/24114025.
When an assertion expression throws an error, treat that as an
unexpected failure of the assertion.
Also generate the failure message for the error directly in the overlay,
rather than routing through _XCTFailureDescription, to avoid revlock
between the overlay and XCTest.framework's implementation.
Addresses rdar://problem/23789893.
Add an assertion that can be used to check that an expression throws an
error, and if it does to run a block against that error which may
contain further checks.
Addresses rdar://problem/23789904.
In swift 2.0, type parameter name of `Set` is changed from `T` to `Element`.
Therefore, modified the names which appear in code comments and a document.
1. I think replace the NSMutableSet with Set<UIView>(and Set<NSView>)
could make the operations more Swift-like.
These code works fine in my Playground, and I also pass the test. But
I’m not quite sure it’s ok to use Set here rather than NSSet.
2. I also simplify the read-only computed property in “UIKit.swift”
In iOS 8.0/OS X 10.10, SpriteKit introduced an
-objectForKeyedSubscript: method that enabled subscripting in
Objective-C. However, this subscript wasn't generally useful in Swift
because it took AnyObject and produced AnyObject, so the SpriteKit
overlay defined a subscript that took a String and produced an
[SKNode].
Subsequently, in iOS 9.0/OS X 10.10, -objectForKeyedSubscript: got
type annotations that gave it the appropriate Swift signature, which
made the subscript defined in the overlay redundant.
The twisty logic of the Clang importer would suppress the imported
subscript when it saw the one in the overlay, hiding the
redundancy. My cleanup of that logic in
0c0a0fab4b caused uses of the subscript
to be redundant.
Removal of the redundant code in the overlay is the overall best
answer, because it minimizes the size of the overlay and leaves the
API in the Objective-C header. However, this will introduce a
regression for SpriteKit applications targeting iOS 7.0/OS X 10.8,
where the overlay was compensating for the lack of this operation
before iOS 8.0 / OS X 10.8. There are workarounds here we can
investigate, although they're fairly hacky.
The preferred way to create a nil pointer is to use the 'nil' literal.
Affected types:
AutoreleasingUnsafeMutablePointer
OpaquePointer
UnsafeMutablePointer
UnsafePointer