Skip to content

[requires-evolution] Conditionally compiled catch clauses #27905

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

Closed
wants to merge 29 commits into from

Conversation

owenv
Copy link
Contributor

@owenv owenv commented Oct 28, 2019

This is based on #27776, so only the last 2 commits are relevant. It's a WIP for now because I broke code completion (again), but everything else is working so I plan on pitching this on the forums shortly.

This change makes the following legal:

do {
  try performTask()
}
#if os(macOS)
catch TaskError.macOSOnlyError {
  macOSRecovery()
}
#endif
catch { 
  crossPlatformRecovery()
}

@owenv owenv marked this pull request as ready for review October 30, 2019 23:36
@owenv
Copy link
Contributor Author

owenv commented Oct 30, 2019

This is passing the regular test suite locally now. If anyone sees this I'd be interested in seeing how it fares on the source compatibility suite

@theblixguy
Copy link
Collaborator

Can you fix the merge conflict? We can run a source compat test after that

@theblixguy
Copy link
Collaborator

@swift-ci please test source compatibility

1 similar comment
@theblixguy
Copy link
Collaborator

@swift-ci please test source compatibility

@owenv
Copy link
Contributor Author

owenv commented Oct 31, 2019

Hmm, looks like a couple of failures but nothing too bad. Thanks @theblixguy!

@owenv
Copy link
Contributor Author

owenv commented Nov 1, 2019

Let's see if this works

@swift-ci please test

@owenv owenv force-pushed the catch_if_support branch 3 times, most recently from a5efcc6 to bfe13f7 Compare November 6, 2019 21:58
@owenv owenv added the swift evolution pending discussion Flag → feature: A feature that has a Swift evolution proposal currently in review label Nov 6, 2019
@owenv owenv requested a review from rintaro November 6, 2019 22:03
@owenv owenv force-pushed the catch_if_support branch 2 times, most recently from 5311cdb to 75f1bfe Compare November 12, 2019 21:56
@owenv
Copy link
Contributor Author

owenv commented Jan 8, 2020

For my own future reference: swiftlang/swift-syntax#190 and swiftlang/llvm-project#538 contain the LLDB and swift-syntax changes needed to build a working toolchain.

@owenv owenv force-pushed the catch_if_support branch from 889d8cd to fe64516 Compare January 9, 2020 18:16
@owenv
Copy link
Contributor Author

owenv commented Jan 9, 2020

@DougGregor do you mind kicking off a toolchain build with the two PRs I linked in the comment above? I've tested this locally and was able to build a working macOS toolchain.

@xedin
Copy link
Contributor

xedin commented Jan 9, 2020

@swift-ci please build toolchain

@theblixguy
Copy link
Collaborator

swiftlang/swift-syntax#190
swiftlang/llvm-project#538

@swift-ci please build toolchain

@xedin
Copy link
Contributor

xedin commented Jan 9, 2020

Ugh, thanks @theblixguy! I totally missed previous comment...

@swift-ci
Copy link
Contributor

swift-ci commented Jan 9, 2020

macOS Toolchain
Download Toolchain
Git Sha - fe64516

Install command
tar -zxf swift-PR-27905-465-osx.tar.gz --directory ~/

@owenv
Copy link
Contributor Author

owenv commented Jan 20, 2020

Closing because conditional compilation was dropped from the final proposal

@owenv owenv closed this Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
swift evolution pending discussion Flag → feature: A feature that has a Swift evolution proposal currently in review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants