Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CHANGELOG.md to mention covariant method overrides #8380

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,33 @@ CHANGELOG
Swift 4.0
---------

* [SR-1529](https://bugs.swift.org/browse/SR-1529):

Covariant method overrides are now fully supported, fixing many crashes
and compile-time assertions when defining or calling such methods.
Examples:

```swift
class Bed {}
class Nook : Bed {}

class Cat<T> {
func eat(snack: T) {}
func play(game: String) {}
func sleep(where: Nook) {}
}

class Dog : Cat<(Int, Int)> {
// 'T' becomes concrete
override func eat(snack: (Int, Int)) {}

// 'game' becomes optional
override func play(game: String?) {}

// 'where' becomes a superclass
override func sleep(where: Bed) {}
}```

* [SE-0148][]:

Subscript declarations can now be defined to have generic parameter lists.
Expand Down