Skip to content

Start testing Swift 6 mode changes #38742

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 2 commits into from
Aug 18, 2021
Merged

Conversation

beccadax
Copy link
Contributor

@beccadax beccadax commented Aug 4, 2021

This pull request makes asserts compilers only accept -swift-version 6 so that we can begin to test source-breaking changes intended for the next language version mode, but without shipping that unfinished work to Swift users. It also adds tests for existing Swift 6 mode behaviors (mostly warnings being strengthened into errors) and enables the changes to #file approved in SE-0274/SE-0285 for Swift 6 mode.

Tests that wish to use -swift-version 6 currently must be marked with REQUIRES: asserts or they will fail in no-asserts bots. The simplest pattern is probably to duplicate part or all of the Swift 5 test to check that will behave as intended in Swift 6.

To allow us to start testing language changes tied to a future Swift 6 mode without actually *shipping* a Swift 6 mode to customers who might accidentally use it before it's ready.

This commit also adds parallel tests for a number of already existing (but untested) Swift 6 mode behaviors.
This change was approved for Swift 6 mode in SE-0274/SE-0285.
@beccadax
Copy link
Contributor Author

beccadax commented Aug 4, 2021

@swift-ci test

@beccadax beccadax requested a review from kavon August 4, 2021 05:14
Copy link
Member

@kavon kavon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼 LGTM. Thanks for doing this and updating the actor_definite_init test, among other things.

Comment on lines +9 to +10
// ERROR_7: <unknown>:0: note: valid arguments to '-swift-version'
// ERROR_7-NOT: '6'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we missing a FileCheck invocation that uses ERROR_7 as the prefix?

@DougGregor
Copy link
Member

I'm going to merge this now so we can start building on it.

@DougGregor DougGregor merged commit cafa252 into swiftlang:main Aug 18, 2021
@DougGregor
Copy link
Member

I do wonder if we should use REQUIRES: swift6 instead to better document the requirement.

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