Skip to content

[Runtime] Diagnose multiple retroactive conformances for X: P. #20322

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

Thread a module name into the protocol conformance lookup function
(e.g., the function implementing swift_conformsToProtocol), and compare that
against the module context of retroactive conformances. When we don’t care
where we find the resulting conformance (e.g., the module name is NULL),
and more than one retroactive conformance found, produce a warning like this:

***Swift runtime warning: multiple conformances for 
'RetroactiveCommon.CommonStruct: CommonP1' found in modules
'RetroactiveA' and 'RetroactiveB'. Arbitrarily selecting conformance 
from module 'RetroactiveA'

This code will also be used to select specific conformances.

Thread a module name into the protocol conformance lookup function
(e.g., the function implementing swift_conformsToProtocol), and compare that
against the module context of retroactive conformances. When we don’t care
where we find the resulting conformance (e.g., the module name is NULL),
and more than one retroactive conformance found, produce a warning like this:

    ***Swift runtime warning: multiple conformances for 
    'RetroactiveCommon.CommonStruct: CommonP1' found in modules
    'RetroactiveA' and 'RetroactiveB'. Arbitrarily selecting conformance 
    from module 'RetroactiveA'

This code will also be used to select specific conformances.
@DougGregor
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Nov 5, 2018

Build failed
Swift Test Linux Platform
Git Sha - a0fae92

@DougGregor
Copy link
Member Author

@swift-ci please smoke test Linux

@DougGregor
Copy link
Member Author

@swift-ci please test Linux

@swift-ci
Copy link
Contributor

swift-ci commented Nov 7, 2018

Build failed
Swift Test Linux Platform
Git Sha - a0fae92

@DougGregor DougGregor closed this Nov 8, 2018
@DougGregor
Copy link
Member Author

I'm pulling this into #20424.

@DougGregor DougGregor deleted the runtime-multiple-conformances-warning branch November 8, 2018 18:45
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