-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Reapply: [Sema] Remove some unreachable code from CSApply #84280
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
Conversation
@swift-ci please test source compatibility |
@swift-ci please SourceKit stress test |
Nice! |
After this I'd like to try and see if we can replace UnresolvedType with ErrorType |
Thanks! I will take a look at this one and others on monday. |
Oh fun, TIL we allow PlaceholderTypes in interface types for e.g FuncDecls, specifically so we can diagnose them later in MiscDiagnostics and suggest replacing with the inferred return type. That explains this existing SILGen crasher: protocol a {
func b() -> _
}
do {
func c(d : a) {
let e = d.b
}
} But it also means that the following crashes with this change: func foo() -> _ {}
foo() Looks like we need to at least record a fix to stop the constraint system from attempting to apply the solution here (as well as ensuring we also reject PlaceholderTypes in FuncDecls with no body) |
Fixing the above case in #84345 |
Using `*` previously meant we'd invoke undefined behavior.
It's not actually clear these are necessary anymore, and in one case it actually makes a diagnostic worse.
And ensure we don't end up with invalid key paths in CSApply.
I believe these code paths could only be reached by re-typechecking invalid code in the old CSDiag implementation.
Enforce that we don't ever encounter solutions that contain holes or error types.
bca2d6f
to
3484f63
Compare
@swift-ci please test |
@swift-ci please test Linux |
@swift-ci please smoke test Linux |
swiftlang/swift-package-manager#9153 @swift-ci please smoke test Linux |
Reapply #36028 with an even stricter set of assertions to ensure we never have a solution with errors or holes in CSApply. Depends on #84279.