Skip to content

[6.0🍒] NCGenerics reverse condfail fix + bonus content! #74744

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 8 commits into from
Jun 27, 2024

Conversation

kavon
Copy link
Member

@kavon kavon commented Jun 26, 2024

  • Explanation:
    • Fixes an issue with the ASTPrinter where an incorrect swiftinterface can be generated (rdar://130179698).
    • Fixes a reverse condfail where the new compiler can't read a slightly older stdlib's swiftinterface (rdar://130424971).
    • In addition, there are NFC / documentation improvements which these patches depend on or are mostly harmless.
  • Scope: Bug fixes with modules.
  • Issue: rdar://130179698&130450351&130424971
  • Original PR:
  • Risk: Low; bug fixes for cases that hadn't come up before.
  • Testing: Swift CI + new tests
  • Reviewer: see above

kavon added 5 commits June 26, 2024 11:49
Removes duplicated code between Sema and the ASTPrinter.

(cherry picked from commit 80c9997)
rdar://130450351
(cherry picked from commit 05f5e51)
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

(cherry picked from commit 545844c)
(cherry picked from commit bcedcca)
resolves rdar://130424971

(cherry picked from commit baabaa0)
@kavon kavon requested a review from a team as a code owner June 26, 2024 18:57
@kavon
Copy link
Member Author

kavon commented Jun 26, 2024

@swift-ci test

@kavon kavon enabled auto-merge June 26, 2024 18:57
It won't work on other machines :)

(cherry picked from commit 1a0fb4c)
@kavon
Copy link
Member Author

kavon commented Jun 26, 2024

@swift-ci test

This is mainly for tests to avoid the reverse condfail.

(cherry picked from commit 1e2111a)
@kavon
Copy link
Member Author

kavon commented Jun 27, 2024

@swift-ci test

@kavon
Copy link
Member Author

kavon commented Jun 27, 2024

@swift-ci test

@kavon kavon merged commit 473e722 into swiftlang:release/6.0 Jun 27, 2024
5 checks passed
@kavon kavon deleted the combo-fixes-6-26-2024 branch June 27, 2024 17:48
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