You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+41Lines changed: 41 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,47 @@ CHANGELOG
21
21
Swift 4.0
22
22
---------
23
23
24
+
*[SE-0142][]
25
+
26
+
Protocols and associated types can now contain `where` clauses that
27
+
provide additional restrictions on associated types. For example:
28
+
29
+
```swift
30
+
protocolStringRepresentable: RawRepresentable
31
+
whereRawValue==String { }
32
+
33
+
protocolRawStringWrapper {
34
+
associatedtypeWrapped: RawRepresentable
35
+
where Wrapper.RawValue==String
36
+
}
37
+
```
38
+
39
+
* [SE-0160][]
40
+
41
+
In Swift 4 mode, a declaration is inferred to be `@objc` where it isrequiredfor semantic consistency of the programming model. Specifically, it is inferred when:
42
+
43
+
* The declaration is an override of an `@objc` declaration
44
+
* The declaration satisfies a requirement in an `@objc` protocol
45
+
* The declaration has one of the following attributes: `@IBAction`, `@IBOutlet`, `@IBInspectable`, `@GKInspectable`, or `@NSManaged`
46
+
47
+
Additionally, in Swift 4 mode, `dynamic` declarations that don't
48
+
have `@objc` inferred based on the rules above will need to be
49
+
explicitly marked `@objc`.
50
+
51
+
Swift 3 compatibility mode retains the more-permissive Swift 3
52
+
rules for inference of `@objc` within subclasses of
53
+
`NSObject`. However, the compiler will emit warnings about places
54
+
where the Objective-C entry points for these inference cases are
55
+
used, e.g., in a `#selector` or `#keyPath` expression, via
56
+
messaging through `AnyObject`, or direct uses in Objective-C code
57
+
within a mixed project. The warnings can be silenced by adding an
58
+
explicit `@objc`. Uses of these entrypoints that are not
59
+
statically visible to the compiler can be diagnosed at runtime by
60
+
setting the environment variable
61
+
`SWIFT_DEBUG_IMPLICIT_OBJC_ENTRYPOINT` to a value between 1 and 3
62
+
and testing the application. See the [migration discussion in
0 commit comments