Skip to content

Commit d638e48

Browse files
authored
Merge pull request swiftlang#11 from minuscorp/typed-throws-dev
Update typed throws implementation
2 parents f372825 + 2deb7fe commit d638e48

File tree

490 files changed

+16904
-15143
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

490 files changed

+16904
-15143
lines changed

Diff for: CHANGELOG.md

+60-17
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,68 @@ CHANGELOG
44
<details>
55
<summary>Note: This is in reverse chronological order, so newer entries are added to the top.</summary>
66

7-
| Version | Released | Toolchain |
8-
| :--------------------- | :--------- | :---------- |
9-
| [Swift 5.3](#swift-53) | | |
10-
| [Swift 5.2](#swift-52) | 2020-03-24 | Xcode 11.4 |
11-
| [Swift 5.1](#swift-51) | 2019-09-20 | Xcode 11.0 |
12-
| [Swift 5.0](#swift-50) | 2019-03-25 | Xcode 10.2 |
13-
| [Swift 4.2](#swift-42) | 2018-09-17 | Xcode 10.0 |
14-
| [Swift 4.1](#swift-41) | 2018-03-29 | Xcode 9.3 |
15-
| [Swift 4.0](#swift-40) | 2017-09-19 | Xcode 9.0 |
16-
| [Swift 3.1](#swift-31) | 2017-03-27 | Xcode 8.3 |
17-
| [Swift 3.0](#swift-30) | 2016-09-13 | Xcode 8.0 |
18-
| [Swift 2.2](#swift-22) | 2016-03-21 | Xcode 7.3 |
19-
| [Swift 2.1](#swift-21) | 2015-10-21 | Xcode 7.1 |
20-
| [Swift 2.0](#swift-20) | 2015-09-17 | Xcode 7.0 |
21-
| [Swift 1.2](#swift-12) | 2015-04-08 | Xcode 6.3 |
22-
| [Swift 1.1](#swift-11) | 2014-12-02 | Xcode 6.1.1 |
23-
| [Swift 1.0](#swift-10) | 2014-09-15 | Xcode 6.0 |
7+
| Version | Released | Toolchain |
8+
| :------------------------ | :--------- | :---------- |
9+
| [Swift Next](#swift-next) |
10+
| [Swift 5.3](#swift-53) | | |
11+
| [Swift 5.2](#swift-52) | 2020-03-24 | Xcode 11.4 |
12+
| [Swift 5.1](#swift-51) | 2019-09-20 | Xcode 11.0 |
13+
| [Swift 5.0](#swift-50) | 2019-03-25 | Xcode 10.2 |
14+
| [Swift 4.2](#swift-42) | 2018-09-17 | Xcode 10.0 |
15+
| [Swift 4.1](#swift-41) | 2018-03-29 | Xcode 9.3 |
16+
| [Swift 4.0](#swift-40) | 2017-09-19 | Xcode 9.0 |
17+
| [Swift 3.1](#swift-31) | 2017-03-27 | Xcode 8.3 |
18+
| [Swift 3.0](#swift-30) | 2016-09-13 | Xcode 8.0 |
19+
| [Swift 2.2](#swift-22) | 2016-03-21 | Xcode 7.3 |
20+
| [Swift 2.1](#swift-21) | 2015-10-21 | Xcode 7.1 |
21+
| [Swift 2.0](#swift-20) | 2015-09-17 | Xcode 7.0 |
22+
| [Swift 1.2](#swift-12) | 2015-04-08 | Xcode 6.3 |
23+
| [Swift 1.1](#swift-11) | 2014-12-02 | Xcode 6.1.1 |
24+
| [Swift 1.0](#swift-10) | 2014-09-15 | Xcode 6.0 |
2425

2526
</details>
2627

28+
Swift Next
29+
----------
30+
31+
* [SE-0287][]:
32+
33+
Implicit member expressions now support chains of member accesses, making the following valid:
34+
35+
```swift
36+
let milky: UIColor = .white.withAlphaComponent(0.5)
37+
let milky2: UIColor = .init(named: "white")!.withAlphaComponent(0.5)
38+
let milkyChance: UIColor? = .init(named: "white")?.withAlphaComponent(0.5)
39+
```
40+
41+
As is the case with the existing implicit member expression syntax, the resulting type of the chain must be the same as the (implicit) base, so it is not well-formed to write:
42+
43+
```swift
44+
let cgMilky: CGColor = .white.withAlphaComponent(0.5).cgColor
45+
```
46+
47+
(Unless, of course, appropriate `white` and `withAlphaComponent` members were defined on `CGColor`.)
48+
49+
Members of a "chain" can be properties, method calls, subscript accesses, force unwraps, or optional chaining question marks. Furthermore, the type of each member along the chain is permitted to differ (again, as long as the base of the chain matches the resulting type) meaning the following successfully typechecks:
50+
51+
```swift
52+
struct Foo {
53+
static var foo = Foo()
54+
static var bar = Bar()
55+
56+
var anotherFoo: Foo { Foo() }
57+
func getFoo() -> Foo { Foo() }
58+
var optionalFoo: Foo? { Foo() }
59+
subscript() -> Foo { Foo() }
60+
}
61+
62+
struct Bar {
63+
var anotherFoo = Foo()
64+
}
65+
66+
let _: Foo? = .bar.anotherFoo.getFoo().optionalFoo?.optionalFoo![]
67+
```
68+
2769
Swift 5.3
2870
---------
2971

@@ -8071,6 +8113,7 @@ Swift 1.0
80718113
[SE-0269]: <https://github.com/apple/swift-evolution/blob/master/proposals/0269-implicit-self-explicit-capture.md>
80728114
[SE-0276]: <https://github.com/apple/swift-evolution/blob/master/proposals/0276-multi-pattern-catch-clauses.md>
80738115
[SE-0280]: <https://github.com/apple/swift-evolution/blob/master/proposals/0280-enum-cases-as-protocol-witnesses.md>
8116+
[SE-0287]: <https://github.com/apple/swift-evolution/blob/master/proposals/0287-implicit-member-chains.md>
80748117

80758118
[SR-75]: <https://bugs.swift.org/browse/SR-75>
80768119
[SR-106]: <https://bugs.swift.org/browse/SR-106>

Diff for: CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,6 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
914914
endif()
915915
endif()
916916

917-
find_package(Python2 COMPONENTS Interpreter REQUIRED)
918917
find_package(Python3 COMPONENTS Interpreter REQUIRED)
919918

920919
#

Diff for: docs/ABI/Mangling.rst

+5
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@ Globals
176176
global ::= global 'MJ' // noncanonical specialized generic type metadata instantiation cache associated with global
177177
global ::= global 'MN' // noncanonical specialized generic type metadata for global
178178

179+
#if SWIFT_RUNTIME_VERSION >= 5.4
180+
global ::= context (decl-name '_')+ 'WZ' // global variable one-time initialization function
181+
global ::= context (decl-name '_')+ 'Wz' // global variable one-time initialization token
182+
#endif
183+
179184
A direct symbol resolves directly to the address of an object. An
180185
indirect symbol resolves to the address of a pointer to the object.
181186
They are distinct manglings to make a certain class of bugs

Diff for: docs/Branches.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ To switch from one set of branches to another, you can use `utils/update-checkou
1818

1919
## The Release Branches
2020

21-
| Swift | LLVM Project
22-
| ---------------- | ----------------------
23-
| swift-x.y-branch | swift/swift-x.y-branch
21+
| Swift | LLVM Project
22+
| ----------- | -----------------
23+
| release/x.y | swift/release/x.y
2424

25-
At some point before a release, a *release branch* will be created in every repository with a name like `swift-4.0-branch`. (The actual number is chosen by Apple.) After the branch has been created, commits must make it to this branch to make it into the release. In some cases, the [release manager][] for the branch will decide to merge in all additional changes from `master`; otherwise, cherry-picking changes and making a new pull request is the way to go. If there are any "patch" releases (e.g. Swift 4.0.1), they will also come from this branch.
25+
At some point before a release, a *release branch* will be created in every repository with a name like `release/5.3`. (The actual number is chosen by Apple.) After the branch has been created, commits must make it to this branch to make it into the release. In some cases, the [release manager][] for the branch will decide to merge in all additional changes from `master`; otherwise, cherry-picking changes and making a new pull request is the way to go. If there are any "patch" releases (e.g. Swift 5.3.1), they will also come from this branch.
2626

2727
Note that these branches come not from the "development" branches (above), but the "upstream" branches (below). This is because they need to contain the latest changes not just from Swift, but from the LLVM project as well. For some releases, the release branch for the LLVM project will be timed to coincide with the corresponding llvm.org release branch.
2828

@@ -35,7 +35,7 @@ Note that these branches come not from the "development" branches (above), but t
3535

3636
`swift/master-next` is a branch for LLVM that includes all changes necessary to support Swift. Changes from llvm.org's master branch are automatically merged in. Why isn't this just `swift/master`? Well, because LLVM changes *very* rapidly, and that wouldn't be very stable. However, we do want to make sure the Swift stuff keeps working.
3737

38-
If you are making changes to LLVM to support Swift, you'll probably need to work on them in `swift/master` to test them against Swift itself, but they should be committed to `swift/master-next`, and cherry-picked to the current release branch (`swift/swift-x.y-branch`) if needed. Remember, the release branches are automerged into `swift/master` on a regular basis.
38+
If you are making changes to LLVM to support Swift, you'll probably need to work on them in `swift/master` to test them against Swift itself, but they should be committed to `swift/master-next`, and cherry-picked to the current release branch (`swift/release/x.y`) if needed. Remember, the release branches are automerged into `swift/master` on a regular basis.
3939

4040
(If you're making changes to LLVM Project that *aren't* about Swift, they should generally be made on llvm.org instead, then cherry-picked to the active release branch or `swift/master`.)
4141

@@ -83,6 +83,6 @@ Some branches are *automerged* into other branches, to keep them in sync. This i
8383
- `master` is automerged into `master-next`
8484

8585
### LLVM Project
86-
- `swift/swift-x.y-branch` (the *latest* release branch) is automerged into `swift/master`
86+
- `swift/release/x.y` (the *latest* release branch) is automerged into `swift/master`
8787
- llvm.org's `master` is automerged into `swift/master-next`
88-
- llvm.org's release branch *may* be automerged into `swift/swift-x.y-branch`, if they are in sync
88+
- llvm.org's release branch *may* be automerged into `swift/release/x.y`, if they are in sync

0 commit comments

Comments
 (0)