Skip to content

Don't drop requirements from potential archetypes if they came from a parent archetype #4791

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

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Sep 15, 2016

  • Description: This is a targeted fix for an issue where a same-type constraint creates a cycle in the archetype graph, causing requirements to be dropped. We think a requirement is redundant if it comes from the parent, but the parent might also be a child.
  • Scope of the issue: This is a regression in Swift 3, because minimized signatures are now used as part of the calling convention.
  • Risk: Low risk that we might end up rejecting previously-valid code.
  • Tested: New test added.
  • Reviewed by: @DougGregor
  • Radar: rdar://problem/27018457

@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 068a8c5592b22f589b3f1249f8b78a3517bb66ba
Test requested by - @slavapestov

@DougGregor
Copy link
Member

Looks fine as a targeted fix (w/ the necessary test update)

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 068a8c5592b22f589b3f1249f8b78a3517bb66ba
Test requested by - @slavapestov

… child

It was possible to create a same-type requirement between a type and
one of its associated types. If one of those associated types had
inferred conformance constraints, we would drop them from the parent
type.

This is not actually correct because then we have no way to recover
metadata for the parent type.

The underlying problem has been present for a long time, however this
particular failure mode was new to Swift 3, when we stopped passing
metadata for associated types.

Fixes <rdar://problem/27018457>.
@slavapestov slavapestov force-pushed the cycle-in-archetype-graph-3.0 branch from 068a8c5 to 1116f48 Compare September 15, 2016 04:35
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

1 similar comment
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov slavapestov added this to the Swift 3.0 milestone Sep 15, 2016
@tkremenek tkremenek merged commit 8db7b08 into swiftlang:swift-3.0-branch Sep 15, 2016
@slavapestov slavapestov deleted the cycle-in-archetype-graph-3.0 branch September 16, 2016 08:36
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