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-12453] Type extensions of ambiguous types cannot be disambiguated by prefixing module name #54892

Open
ahoppen opened this issue Mar 30, 2020 · 3 comments
Labels
compiler The Swift compiler in itself improvement

Comments

@ahoppen
Copy link
Contributor

ahoppen commented Mar 30, 2020

Previous ID SR-12453
Radar rdar://problem/62201068
Original Reporter @ahoppen
Type Improvement

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement
Assignee None
Priority Medium

md5: 54919e9cb62f55ccf1cd98c9c263f09d

Issue Description:

Assume I have two modules, each declaring a type:

Module A:

public struct Foo {}
Module B:

public struct Foo {} 

Now in a third module I want to do the following:

Module C:

import A
import B

extension Foo {} // error: 'Type' is ambiguous for type lookup in this context

I would have expected to be able to disambiguate the type by prefixing it with the module name which I expected to work. However, it still throws an error:

Module C:

import A
import B

extension A.Foo {} // error: Use of undeclared type 'A'

Is there any particular reason why the disambiguation cannot work?

@beccadax
Copy link
Contributor

@swift-ci create

@beccadax
Copy link
Contributor

@ahoppen I tried to reproduce this in master with a pair of swiftinterfaces, but I couldn't. Can you provide a more complete test case? Which version did you see it in?

@ahoppen
Copy link
Contributor Author

ahoppen commented May 17, 2020

Hi Brent, I have attached a sample project to reproduce the issue. I think I was also missing the public modifiers in the original description.

I am using the Swift that’s shipped with Xcode 11.4.1 (11E503a).

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler in itself improvement
Projects
None yet
Development

No branches or pull requests

2 participants