Skip to content
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

Remove support for -swift-version 3 from the expression type checker. #17691

Merged
merged 4 commits into from
Jul 15, 2018
Merged

Remove support for -swift-version 3 from the expression type checker. #17691

merged 4 commits into from
Jul 15, 2018

Conversation

rudkx
Copy link
Contributor

@rudkx rudkx commented Jul 3, 2018

This is the obvious stuff. There will probably be more fallout.

@rudkx
Copy link
Contributor Author

rudkx commented Jul 3, 2018

There are no test changes here, just updates to the code, so this won't pass tests.

Waiting on #17689 and any other test and source compatibility updates before merging.

@rudkx
Copy link
Contributor Author

rudkx commented Jul 3, 2018

@swift-ci Please smoke test

Copy link
Contributor

@slavapestov slavapestov left a comment

Choose a reason for hiding this comment

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

Nice work. If you don't mind, can you please remove the dead diagnostics now also?

dc, SourceLoc(), sub, SourceRange())
== CheckedCastKind::Swift3BridgingDowncast) {
tc.diagnose(expr->getLoc(),
diag::missing_forced_downcast_swift3_compat_warning,
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove "missing_forced_downcast_swift3_compat_warning"

// parameter.
auto params = FT->getParams();
if (params.size() > 1) {
TC.diagnose(Call->getLoc(), diag::tuple_splat_use, params.size())
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove "tuple_splat_use"

@@ -676,9 +641,7 @@ static void diagSyntacticUseRestrictions(TypeChecker &TC, const Expr *E,

// In Swift 3, this is just a warning.
TC.diagnose(apply->getLoc(),
TC.Context.isSwiftVersion3()
? diag::warn_noescape_param_call
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove "warn_noescape_param_call"

@@ -741,36 +704,6 @@ static void diagSyntacticUseRestrictions(TypeChecker &TC, const Expr *E,

// Swift 3 mode produces a warning + Fix-It for the missing ".self"
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this comment

@@ -797,19 +730,6 @@ static void diagSyntacticUseRestrictions(TypeChecker &TC, const Expr *E,
}
}

if (shouldWarnOnMissingSelf(E)) {
auto diag = TC.diagnose(E->getEndLoc(),
diag::warn_value_of_metatype_missing_self,
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove "warn_value_of_metatype_missing_self"

@rudkx
Copy link
Contributor Author

rudkx commented Jul 3, 2018

@slavapestov I think I took care of the things you mentioned.

@slavapestov
Copy link
Contributor

@rudkx Thanks! My PR that you linked to is now merged. This LGTM, but I suspect it will break the source compat suite.

Copy link
Contributor

@slavapestov slavapestov left a comment

Choose a reason for hiding this comment

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

One more nitpick

@@ -6545,7 +6501,7 @@ Expr *ExprRewriter::coerceToType(Expr *expr, Type toType,
// ```
//
// See also: https://bugs.swift.org/browse/SR-6796
if (cs.getASTContext().isSwiftVersionAtLeast(3) &&
if (cs.getASTContext().isSwiftVersionAtLeast(4) &&
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn’t the first part always true? It should suffice to just check if you’re < 5

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was intentional. If there are tests passing -swift-version 3 explicitly they should break if they are relying on this behavior. You might have removed all of those with your PR, though.

@rudkx
Copy link
Contributor Author

rudkx commented Jul 3, 2018

@swift-ci Please test source compatibility

@rudkx
Copy link
Contributor Author

rudkx commented Jul 4, 2018

@swift-ci Please smoke test

1 similar comment
@rudkx
Copy link
Contributor Author

rudkx commented Jul 4, 2018

@swift-ci Please smoke test

@rudkx rudkx requested review from nathawes and benlangmuir July 4, 2018 01:43
@rudkx
Copy link
Contributor Author

rudkx commented Jul 4, 2018

@nathawes FYI, I'm removing a few migrator tests here that don't make sense with Swift 3 support removed from the expression type checker.

@benlangmuir I'm not sure what's going on with the code completion test. I'll take a look at it, but in the mean time do you have any idea why removing support for some Swift 3 compatibility hacks would have an impact here?

@rudkx
Copy link
Contributor Author

rudkx commented Jul 4, 2018

I've split all the test updates out into #17748.

@rudkx
Copy link
Contributor Author

rudkx commented Jul 4, 2018

Please test with following PR:
#17748

@swift-ci Please smoke test

@rudkx
Copy link
Contributor Author

rudkx commented Jul 4, 2018

Please test with following PR:
swiftlang/swift-source-compat-suite#197

@swift-ci Please test source compatibility

@rudkx
Copy link
Contributor Author

rudkx commented Jul 4, 2018

Hmmm, neither of my "test with" seems to have actually tested with. I guess testing with another PR from the same repo might not be supported, but I don't know what's up with the source compatibility suite.

@rudkx
Copy link
Contributor Author

rudkx commented Jul 5, 2018

@swift-ci Please smoke test

@rudkx
Copy link
Contributor Author

rudkx commented Jul 5, 2018

Please test with following pull request:
swiftlang/swift-source-compat-suite#197

@swift-ci Please test source compatibility

This is the obvious stuff. There will probably be more fallout.
@rudkx
Copy link
Contributor Author

rudkx commented Jul 6, 2018

@swift-ci Please smoke test

@rudkx
Copy link
Contributor Author

rudkx commented Jul 9, 2018

@swift-ci Please test source compatibility

@rudkx
Copy link
Contributor Author

rudkx commented Jul 12, 2018

@swift-ci Please smoke test

@rudkx
Copy link
Contributor Author

rudkx commented Jul 12, 2018

@swift-ci Please test source compatibility

@rudkx
Copy link
Contributor Author

rudkx commented Jul 12, 2018

Source compatibility failures in 3.x configs:

Kickstarter-ReactiveExtensions
ReactiveCocoa
RxDataSources
Starscream

@rudkx
Copy link
Contributor Author

rudkx commented Jul 12, 2018

@swift-ci Please smoke test

@rudkx
Copy link
Contributor Author

rudkx commented Jul 12, 2018

@swift-ci build toolchain

@rudkx
Copy link
Contributor Author

rudkx commented Jul 12, 2018

Linux test failure is unrelated to my changes: TestFoundation/TestProcess.swift:410: error: TestProcess.test_preStartEndState : XCTAssertEqual failed: ("exit") is not equal to ("uncaughtSignal") -

@rudkx
Copy link
Contributor Author

rudkx commented Jul 12, 2018

@swift-ci Please smoke test Linux platform

@rudkx
Copy link
Contributor Author

rudkx commented Jul 14, 2018

@swift-ci Please smoke test

@rudkx
Copy link
Contributor Author

rudkx commented Jul 14, 2018

@swift-ci Please test source compatibility

1 similar comment
@rudkx
Copy link
Contributor Author

rudkx commented Jul 15, 2018

@swift-ci Please test source compatibility

@rudkx
Copy link
Contributor Author

rudkx commented Jul 15, 2018

@swift-ci Please smoke test

@rudkx rudkx merged commit eb57e20 into swiftlang:master Jul 15, 2018
@rudkx rudkx deleted the remove-swift-3-in-expr-typechecking branch July 15, 2018 02:04
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