Skip to content

Ncgenerics test fixes kavon v9 #71550

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 7 commits into from
Feb 12, 2024

Conversation

kavon
Copy link
Member

@kavon kavon commented Feb 12, 2024

more test fixes

I thought it might be impossible to recursively lookupConformance of
Copyable, unlike for Sendable. Turns out there are still situations
where it can happen, that aren't invalid.

This alone fixes `ClangImporter/objc_bridging_generics.swift` and will
help reveal any invalid request cycles.
It's not the point of the test.
Noncopyable types cannot be substituted for an unconstrained generic
parameter, as it will have a Copyable conformance on it.

This test should be refactored to use a concrete function like
`transferMoveOnlyStruct` instead of the generic. But its not obvious to
me the best way to update this test.
It doesn't make sense that we permit a `ReferenceStorageType` to be
substituted for a generic parameter, since I don't know whether any
valid Swift code would ever actually construct such SIL.

But there are some hand-written SIL test cases that do it anyway, for
unconstrained generic parameters. Since now even those get protocol
requirements with NoncopyableGenerics, just look at the referent type in
ParseSIL.
While this doesn't provde defence agianst incorrect conformance
responses in the general case, it should flush out a lot of incorrect
ones.
@kavon kavon force-pushed the ncgenerics-test-fixes-kavon-v9 branch from 846a5ad to 32a0ea8 Compare February 12, 2024 04:40
@kavon
Copy link
Member Author

kavon commented Feb 12, 2024

@swift-ci please test

@kavon kavon marked this pull request as ready for review February 12, 2024 04:42
@kavon kavon enabled auto-merge February 12, 2024 05:40
@kavon kavon merged commit a1d70b6 into swiftlang:main Feb 12, 2024
@kavon kavon deleted the ncgenerics-test-fixes-kavon-v9 branch February 12, 2024 19:07
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.

1 participant