Skip to content

New syntax for declaring primary associated types #41640

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

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Mar 3, 2022

The new syntax looks like a generic parameter list, eg

protocol SetProtocol<Element : Equatable> {}

You can also specify the default associated type:

protocol DictionaryProtocol<Key : Hashable, Value = UIViewController> {}

Proposal is here: swiftlang/swift-evolution#1538

@slavapestov slavapestov force-pushed the primary-associated-type-syntax branch 3 times, most recently from 30dab86 to 61218cc Compare March 3, 2022 03:15
@slavapestov slavapestov force-pushed the primary-associated-type-syntax branch 3 times, most recently from f85646a to ecacf8e Compare March 3, 2022 15:13
@slavapestov slavapestov force-pushed the primary-associated-type-syntax branch from ecacf8e to 20ccd05 Compare March 3, 2022 15:15
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test macOS

@slavapestov
Copy link
Contributor Author

swiftlang/swift-syntax#366
@swift-ci Please smoke test macOS

@slavapestov slavapestov merged commit 7ad9d89 into swiftlang:main Mar 4, 2022
slavapestov added a commit to swiftlang/swift-syntax that referenced this pull request Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant