Skip to content

Commit d45407d

Browse files
authored
Merge pull request #9079 from DougGregor/changelog-updates
Changelog updates
2 parents 0c45030 + 515f3ef commit d45407d

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,47 @@ CHANGELOG
2121
Swift 4.0
2222
---------
2323

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+
protocol StringRepresentable: RawRepresentable
31+
where RawValue == String { }
32+
33+
protocol RawStringWrapper {
34+
associatedtype Wrapped: 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 is required for 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
63+
SE-0160](https://github.com/apple/swift-evolution/blob/master/proposals/0160-objc-inference.md#minimal-migration-workflow).
64+
2465
* [SE-0138](https://github.com/apple/swift-evolution/blob/master/proposals/0138-unsaferawbufferpointer.md#amendment-to-normalize-the-slice-type):
2566

2667
Slicing a raw buffer no longer results in the same raw buffer

0 commit comments

Comments
 (0)