Skip to content

[docs] CToSwift: remove the import-as-member-subscript discussion #27415

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
Sep 28, 2019
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
13 changes: 0 additions & 13 deletions docs/CToSwiftNameTranslation.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,19 +370,6 @@ extension Counter {
}
```

The getter/setter syntax also allows for subscripts by using the base name `subscript`.

```objc
__attribute__((swift_name("getter:LinkedListOfInts.subscript(self:_:)")))
int LinkedListGetAtIndex(const LinkedListOfInts *head, int index);
```

```swift
extension LinkedListOfInts {
subscript(_ index: Int32) -> Int32 { get }
}
```

Finally, functions can be imported as initializers as well by using the base name `init`. These are considered "factory" initializers and are never inherited or overridable. They must not have a `self` parameter.

```objc
Expand Down