Skip to content
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

[RemoteMirror] Fix generic depth calculation #75587

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

tbkka
Copy link
Contributor

@tbkka tbkka commented Jul 31, 2024

The "generic depth" is used to match up generic type variables. For example:

struct Foo<T> { // `T` at generic depth 0
  struct Bar {
    struct Baz<U> { // 'U' at generic depth 1
      ...
}}}

Note in the above that Bar is not counted in the generic depth. The previous logic did count Bar in the generic depth calculation, leading to mismatches when trying to associate references to generic variables.

This adds a new test with cases like the above and of course corrects the calculation.

Resolves rdar://127450037

The "generic depth" is used to match up generic type variables.
For example:
```
struct Foo<T> { // `T` at generic depth 0
  struct Bar {
    struct Baz<U> { // 'U' at generic depth 1
      ...
}}}
```

Note in the above that `Bar` is not counted in the
generic depth.  The previous logic did count `Bar` in
the generic depth calculation, leading to mismatches
when trying to associate references to generic variables.

This adds a new test with cases like the above and of course
corrects the calculation.

Resolves rdar://127450037
@tbkka tbkka requested review from slavapestov and a team as code owners July 31, 2024 14:12
@tbkka
Copy link
Contributor Author

tbkka commented Jul 31, 2024

@swift-ci Please test

Copy link
Contributor

@mikeash mikeash left a comment

Choose a reason for hiding this comment

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

Subtle! Superb test to fix ratio.

@tbkka
Copy link
Contributor Author

tbkka commented Jul 31, 2024

@swift-ci Please test macOS Platform

@tbkka tbkka enabled auto-merge July 31, 2024 22:18
@tbkka tbkka merged commit 725dc3c into swiftlang:main Aug 1, 2024
5 checks passed
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