-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Remove support for -swift-version 3 from the expression type checker. #17691
Conversation
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. |
@swift-ci Please smoke test |
There was a problem hiding this 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, |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove "tuple_splat_use"
lib/Sema/MiscDiagnostics.cpp
Outdated
@@ -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 |
There was a problem hiding this comment.
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"
lib/Sema/MiscDiagnostics.cpp
Outdated
@@ -741,36 +704,6 @@ static void diagSyntacticUseRestrictions(TypeChecker &TC, const Expr *E, | |||
|
|||
// Swift 3 mode produces a warning + Fix-It for the missing ".self" |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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"
@slavapestov I think I took care of the things you mentioned. |
@rudkx Thanks! My PR that you linked to is now merged. This LGTM, but I suspect it will break the source compat suite. |
There was a problem hiding this 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) && |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
@swift-ci Please test source compatibility |
@swift-ci Please smoke test |
1 similar comment
@swift-ci Please smoke test |
@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? |
I've split all the test updates out into #17748. |
Please test with following PR: @swift-ci Please test source compatibility |
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. |
@swift-ci Please smoke test |
Please test with following pull request: @swift-ci Please test source compatibility |
This is the obvious stuff. There will probably be more fallout.
@swift-ci Please smoke test |
@swift-ci Please test source compatibility |
@swift-ci Please smoke test |
@swift-ci Please test source compatibility |
Source compatibility failures in 3.x configs:
|
@swift-ci Please smoke test |
@swift-ci build toolchain |
Linux test failure is unrelated to my changes: |
@swift-ci Please smoke test Linux platform |
@swift-ci Please smoke test |
@swift-ci Please test source compatibility |
1 similar comment
@swift-ci Please test source compatibility |
@swift-ci Please smoke test |
This is the obvious stuff. There will probably be more fallout.