Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hack: Force UIEdgeInsets.zero to always come from the SDK
...instead of relying on the one in the overlay in pre-4.2 versions of Swift. This caused crashes in deserialization, which (deliberately) doesn't respect availability. There are three changes here: - Remove UIEdgeInsets.zero and UIOffset.zero from the UIKit overlay. - Always use the 4.2 name for UIEdgeInsetsZero and UIOffsetZero from the underlying UIKit framework. (This is the nested name.) - Ignore the unavailability messages for those two constants in pre-4.2 Swift, since we're now relying on them being present. The latter two, the compiler changes, can go away once UIKit's API notes no longer specify different pre-4.2 behavior, but meanwhile we need to keep compatibility with the SDKs released in Xcode 10b1. https://bugs.swift.org/browse/SR-7879
- Loading branch information
1 parent
d6bf8e3
commit a467bea
Showing
5 changed files
with
40 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// RUN: %empty-directory(%t) | ||
// RUN: %target-build-swift -emit-module-path %t/main4.swiftmodule -swift-version 4 %s | ||
// RUN: %target-build-swift -emit-module-path %t/main4_2.swiftmodule -swift-version 4.2 %s | ||
|
||
// REQUIRES: OS=ios | ||
|
||
import UIKit | ||
|
||
public func testInsets(_: UIEdgeInsets = .zero) {} | ||
public func testOffsets(_: UIOffset = .zero) {} |