Skip to content

[Type checker] Downgrade some "redundant conformance" errors to warnings. #9160

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

DougGregor
Copy link
Member

When an extension introduces a conformance that already exists, the
type checker will reject the conformance and then ignore it. In cases
where the original conformance is in the same module as the type or
protocol (but the new, redundant conformance is in some other module),
downgrade this error to a warning. This helps with library-evolution
cases where a library omitted a particular conformance for one of its
own types/protocols in a previous version, then introduces it in a new
version.

The specific driver for this is the conformance of String to
Collection, which affects source compatibility. Fixes
rdar://problem/31104415.

DougGregor added 2 commits May 1, 2017 15:02
A cross-reference in a module cannot refer to a parsed entity, because the parsed entity couldn’t have been seen when the module was built. Filter these out, which prevents a crash in the subsequent commit.
(cherry picked from commit 905b6b1)
…ngs.

When an extension introduces a conformance that already exists, the
type checker will reject the conformance and then ignore it. In cases
where the original conformance is in the same module as the type or
protocol (but the new, redundant conformance is in some other module),
downgrade this error to a warning. This helps with library-evolution
cases where a library omitted a particular conformance for one of its
own types/protocols in a previous version, then introduces it in a new
version.

The specific driver for this is the conformance of String to
Collection, which affects source compatibility. Fixes
rdar://problem/31104415.

(cherry picked from commit f7bccb0)
@DougGregor
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented May 1, 2017

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 52804dd
Test requested by - @DougGregor

@DougGregor
Copy link
Member Author

@swift-ci please clean test Linux

@swift-ci
Copy link
Contributor

swift-ci commented May 1, 2017

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 52804dd
Test requested by - @DougGregor

@swift-ci
Copy link
Contributor

swift-ci commented May 1, 2017

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 52804dd
Test requested by - @DougGregor

@DougGregor DougGregor merged commit 37de124 into swiftlang:swift-4.0-branch May 1, 2017
@DougGregor DougGregor deleted the redundant-conformance-warnings-4.0 branch May 1, 2017 23:31
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