Skip to content

«where» clauses on contextually generic declarations #1011

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 14 commits into from
Oct 11, 2019

Conversation

AnthonyLatsis
Copy link
Contributor

@AnthonyLatsis AnthonyLatsis commented Apr 1, 2019

This proposal is about getting rid of the restriction on attaching where clauses to declarations that inherit the surrounding generic environment, but themselves do not introduce generic parameters. Only declarations that can already be generic fall under this enhancement.

class Foo<T> {
  func foo() where T: Equatable { ... }
}

Implementation: #23489

> protocol P {
> // error: Instance method requirement 'foo(arg:)' cannot add constraint 'Self: Equatable' on 'Self'
> func foo() where Self: Equatable
> }

This comment was marked as resolved.

@AnthonyLatsis
Copy link
Contributor Author

@DougGregor Would you like to manage this?

@AnthonyLatsis
Copy link
Contributor Author

@tkremenek Is there an opportunity to stage this for review in the near future?

@jckarter jckarter merged commit be27994 into swiftlang:master Oct 11, 2019
jckarter added a commit that referenced this pull request Oct 11, 2019
@AnthonyLatsis AnthonyLatsis deleted the where-clause-nongeneric branch August 19, 2020 13:00
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.

3 participants