Skip to content

Ncgenerics test fixes kavon v10 #71560

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
Feb 13, 2024

Conversation

kavon
Copy link
Member

@kavon kavon commented Feb 12, 2024

more test fixes

@kavon kavon force-pushed the ncgenerics-test-fixes-kavon-v10 branch from d47d866 to 75e9135 Compare February 12, 2024 20:06
@kavon
Copy link
Member Author

kavon commented Feb 13, 2024

preset=ncgenerics,smoketest=macosx
@swift-ci Please test with preset macOS Platform

@kavon
Copy link
Member Author

kavon commented Feb 13, 2024

@swift-ci smoke test

@kavon kavon marked this pull request as ready for review February 13, 2024 01:01
@kavon kavon enabled auto-merge February 13, 2024 01:01
@kavon kavon disabled auto-merge February 13, 2024 01:03
@kavon kavon force-pushed the ncgenerics-test-fixes-kavon-v10 branch from ff45ef3 to 737dcb9 Compare February 13, 2024 01:50
@kavon
Copy link
Member Author

kavon commented Feb 13, 2024

@swift-ci smoke test

@kavon
Copy link
Member Author

kavon commented Feb 13, 2024

preset=ncgenerics,smoketest=macosx
@swift-ci Please test with preset macOS Platform

@kavon kavon force-pushed the ncgenerics-test-fixes-kavon-v10 branch from 737dcb9 to 517901e Compare February 13, 2024 06:26
@kavon
Copy link
Member Author

kavon commented Feb 13, 2024

@swift-ci smoke test

@kavon kavon force-pushed the ncgenerics-test-fixes-kavon-v10 branch 2 times, most recently from 1cb2632 to 6dc0c7c Compare February 13, 2024 17:17
There's a few uses of ReferenceStorageTypes being substituted for
generic parameters, at least in the test suite, such as
`Optional<@sil_unmanaged ..>` and just plain `<@sil_unowned ..>`.

Before, conformance lookup could (and did) give bogus answers when asked
 if the type satisfies any conformance requirements. Now with
 NoncopyableGenerics, we will interpret such conformance lookups as
 being asked of the referent type, ignoring the SIL ownership wrapping
 it.
With NoncopyableGenerics, we get a cycle involving
`SuperclassTypeRequest` with this program:

  public struct RawMarkupHeader {}
  final class RawMarkup: ManagedBuffer<RawMarkupHeader, RawMarkup> { }

Because we generally don't support the following kind of relationship:

  class Base<T: P>: P {}
  class Derived: Base<Derived> {}

This commit works around the root-cause, which is that Derived's
synthesized conformance to Copyable gets superceded by the inherited one
from Base. Instead of recording conformances in the ConformanceLookup
table at all, create builtin conformances on the fly, since classes
cannot be conditionally Copyable or Escapable.
@kavon kavon force-pushed the ncgenerics-test-fixes-kavon-v10 branch from 6dc0c7c to 3a45393 Compare February 13, 2024 17:19
@kavon kavon enabled auto-merge February 13, 2024 17:19
@kavon
Copy link
Member Author

kavon commented Feb 13, 2024

@swift-ci smoke test

@kavon kavon merged commit 8a7fd33 into swiftlang:main Feb 13, 2024
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