Skip to content

ASTPrinter: Fix generic signatures with requirements on outer parameters [5.1] #26508

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

Conversation

slavapestov
Copy link
Contributor

We incorrectly assumed that a requirement 'rooted' in an outer parameter
must be necessarily defined as part of the outer context's signature,
and thus we were skipping it when printing the 'where' clause of a
nested declaration or an extension of a nested type.

Instead, actually get the outer generic signature and filter requirements
that the outer signature satisfies.

Fixes rdar://problem/53769896, https://bugs.swift.org/browse/SR-11221.

We incorrectly assumed that a requirement 'rooted' in an outer parameter
must be necessarily defined as part of the outer context's signature,
and thus we were skipping it when printing the 'where' clause of a
nested declaration or an extension of a nested type.

Instead, actually get the outer generic signature and filter requirements
that the outer signature satisfies.

Fixes <rdar://problem/53769896>, <https://bugs.swift.org/browse/SR-11221>.
@slavapestov slavapestov requested a review from a team as a code owner August 6, 2019 01:16
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

swift-ci commented Aug 6, 2019

Build failed
Swift Test Linux Platform
Git Sha - d7dcd08

@slavapestov
Copy link
Contributor Author

@swift-ci Please test Linux

@slavapestov
Copy link
Contributor Author

@swift-ci Please test

// RUN: %FileCheck %s < %t/main.swiftinterface

// RUN: %target-build-swift %s -emit-module-interface-path %t/main.swiftinterface -enable-library-evolution -wmo
// RUN: %FileCheck %s < %t/main.swiftinterface
Copy link
Contributor

Choose a reason for hiding this comment

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

One or the other of these will always be equivalent to the frontend-only one, so you shouldn't need all three.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I copy and pasted that from another test. I'll clean up both on master.

@slavapestov slavapestov merged commit b8f4481 into swiftlang:swift-5.1-branch Sep 10, 2019
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.

4 participants