Skip to content

Handful of small NoncopyableGenerics fixes / cleanups. #74672

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 4 commits into from
Jun 26, 2024

Conversation

kavon
Copy link
Member

@kavon kavon commented Jun 25, 2024

resolves rdar://130179698 and rdar://130450351

Removes duplicated code between Sema and the ASTPrinter.
@kavon
Copy link
Member Author

kavon commented Jun 25, 2024

@swift-ci test

kavon added 3 commits June 25, 2024 12:06
A generic signature's `getInnermostGenericParams` will find the generic
parameters in the innermost scope. That's not quite right for printing
inverses, since we don't want to print an inverse for `T` when emitting
the generic signature of `f` below:

```swift
    struct S<T: ~Copyable, E> {
        func f() where E == Never {}
    }
```

Since `f` has its own generic signature, but doesn't define any generic
parameters, it shouldn't have an inverse emitted. The solution here is
to filter inverses by depth of the generic parameter.

We also want to print _all_ of the inverses in other situations, rather
than just the innermost ones. This aids in debugging and other
tools like the API digester.

resolves rdar://130179698
@kavon kavon force-pushed the post-vacation-misc-cleanups branch from 7a15d6f to bcedcca Compare June 25, 2024 19:06
@kavon
Copy link
Member Author

kavon commented Jun 25, 2024

@swift-ci test

@kavon kavon enabled auto-merge June 25, 2024 20:29
@kavon kavon merged commit 4b98498 into swiftlang:main Jun 26, 2024
5 checks passed
@kavon kavon deleted the post-vacation-misc-cleanups branch June 26, 2024 17: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.

2 participants