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

[SR-8353] Public extensions of shared types in a framework are visible without importing it #50881

Closed
swift-ci opened this issue Jul 24, 2018 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself duplicate Resolution: Duplicates another issue extension Feature → declarations: `extension` declarations multiple modules Flag: An issue whose reproduction requires multiple modules name lookup Area → compiler → type checker: Name lookup swift 5.8 unexpected behavior Bug: Unexpected behavior or incorrect output

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Jul 24, 2018

Previous ID SR-8353
Radar None
Original Reporter rockbruno (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate
Additional Detail from JIRA
Votes 0
Component/s
Labels Bug
Assignee None
Priority Medium

md5: c77119319b6f089af96d450dddf89e34

duplicates:

Issue Description:

Framework A:

import Foundation

extension Foundation.URL {
    public static func foo() {}
}

Main:

import Foundation

URL.foo() //works, even though framework `A`, who defines this extension, is not being imported

I am not sure if this is intended, but we found this out after two frameworks defined extensions with the same name in our tool. This led to an ambiguous use compilation error even though only one of the frameworks was being imported.

@swift-ci
Copy link
Collaborator Author

Comment by Bruno Rocha (JIRA)

I accidentally submitted this without finishing the description. Closing

@swift-ci
Copy link
Collaborator Author

Comment by Bruno Rocha (JIRA)

Reopening

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added duplicate Resolution: Duplicates another issue compiler The Swift compiler in itself multiple files Flag: An issue whose reproduction requires multiple files unexpected error Bug: Unexpected error extension Feature → declarations: `extension` declarations name lookup Area → compiler → type checker: Name lookup multiple modules Flag: An issue whose reproduction requires multiple modules swift 5.8 unexpected behavior Bug: Unexpected behavior or incorrect output and removed unexpected error Bug: Unexpected error multiple files Flag: An issue whose reproduction requires multiple files labels May 11, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself duplicate Resolution: Duplicates another issue extension Feature → declarations: `extension` declarations multiple modules Flag: An issue whose reproduction requires multiple modules name lookup Area → compiler → type checker: Name lookup swift 5.8 unexpected behavior Bug: Unexpected behavior or incorrect output
Projects
None yet
Development

No branches or pull requests

2 participants