Skip to content

Conversation

@ahoppen
Copy link
Member

@ahoppen ahoppen commented Mar 20, 2024

  • Explanation: SE-2305 allows returning Self and Self? from initializers so that the return type can be annotated with _borrow(a) etc. So we need to allow return clauses on initializers.
  • Scope: Parsing of initializers that have a return clause
  • Risk: I don’t see a risk in this change
  • Testing: Added a regression test
  • Issue: rdar://123905900
  • Reviewer: @bnbarham on Allow return types on initializers #2541

SE-2305 allows returning `Self` and `Self?` from initializers so that the return type can be annotated with `_borrow(a)` etc.

So we need to allow return clauses on initializers.

rdar://123905900
@ahoppen ahoppen requested a review from bnbarham as a code owner March 20, 2024 14:06
@ahoppen
Copy link
Member Author

ahoppen commented Mar 20, 2024

@swift-ci Please test

@ahoppen ahoppen merged commit e7071ef into swiftlang:main Mar 20, 2024
@ahoppen ahoppen deleted the ahoppen/6.0/return-type-on-initializer branch March 20, 2024 21:49
@ahoppen ahoppen restored the ahoppen/6.0/return-type-on-initializer branch March 22, 2024 12:49
@ahoppen ahoppen deleted the ahoppen/6.0/return-type-on-initializer branch March 22, 2024 12:51
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.

2 participants