Skip to content

GSB: Fix some issues with concrete same-type requirements #36576

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 3 commits into from
Mar 26, 2021

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Mar 25, 2021

Builds upon #36577. Fixes rdar://problem/75656022 and rdar://problem/74395460.

@slavapestov slavapestov force-pushed the concrete-constraint-calamity branch from 0f68c29 to 180e5cb Compare March 25, 2021 01:33
…tead of the minimized ones

We rebuild a signature after dropping redundant conformance requirements,
since conformance requirements change the canonical type and conformance
access path computation.

When doing this, instead of using the canonical requirements from the
signature, use the original as-written requirements.

This fixes some weirdness around concrete same-type requirements.

There's a philosophical benefit here too -- since we rebuild the
signature without ever having built the old signature, we never create
an invalid GenericSignature in the ASTContext.

Fixes rdar://problem/75690903.
@slavapestov slavapestov force-pushed the concrete-constraint-calamity branch from 21a1c8c to 99d49f0 Compare March 25, 2021 21:38
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@@ -270,7 +270,7 @@ struct X18: P18, P17 {
}

// CHECK-LABEL: .X19.foo@
// CHECK: Generic signature: <T, U where T == X18>
// CHECK: Generic signature: <T, U where T == X18.A>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just a change in printed sugar that doesn't affect the canonical signature. X18.A is X18, so we're ending up with this because of T == T.A vs T == X18.

@slavapestov slavapestov requested a review from DougGregor March 25, 2021 22:20
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test macOS

@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 99d49f0

@DougGregor
Copy link
Member

@swift-ci please smoke test Linux

@slavapestov
Copy link
Contributor Author

@swift-ci Please test Linux

@slavapestov
Copy link
Contributor Author

@swift-ci Please test Windows

@DougGregor DougGregor merged commit 3fe2534 into swiftlang:main Mar 26, 2021
@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 99d49f0

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