Skip to content

[ChangeLog] NFC: Adjust format of the last entry to render correctly #37451

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

Merged
merged 1 commit into from
May 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ Swift 5.5

* Type names are no longer allowed as an argument to a subscript parameter that expects a metatype type

```swift
struct MyValue {
}
```swift
struct MyValue {
}

struct MyStruct {
subscript(a: MyValue.Type) -> Int { get { ... } }
}
struct MyStruct {
subscript(a: MyValue.Type) -> Int { get { ... } }
}

func test(obj: MyStruct) {
let _ = obj[MyValue]
}
```
func test(obj: MyStruct) {
let _ = obj[MyValue]
}
```

Accepting subscripts with `MyValue` as an argument was an oversight because `MyValue` requires explicit `.self`
to reference its metatype, so correct syntax would be to use `obj[MyValue.self]`.
Accepting subscripts with `MyValue` as an argument was an oversight because `MyValue` requires explicit `.self`
to reference its metatype, so correct syntax would be to use `obj[MyValue.self]`.

* [SE-0310][]:

Expand Down