You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SR-898 Unresolvable "ambiguous for type lookup" error when using multiple modules
Issue Description:
Background
When using a global function defined in a module that shares the name with a global function defined in another it is possible to use the module name to solve the ambiguity.
For example, in Apple's Foundation contains the global function NSLocalizedString(). Should there be another module containing a global function with the same name the Foundation function can be invoked like so:
Foundation.NSLocalizedString()
Problem
If an imported module has a type that shares it's name there is no way to specify the module's global function using Swift.
For example, XCTest is the name of a module but it also contains a class with the same name. The module has several global functions but attempting to invoke them using it's namespace results in Swift trying to access them from the XCTest class.
// Invokes the NSLocalizedString function from the Foundation moduleFoundation.NSLocalizedString("key", comment: "comment")
// Will not compile as the class XCTest does not contain the XCTFail functionXCTest.XCTFail("reason of failure")
I would like to be able to somehow specify a global entity within a module namespace in the case that a module shares it's name with one of it's contained types.
The text was updated successfully, but these errors were encountered:
Attachment: Download
Additional Detail from JIRA
md5: e100af8449098240757d16638ad52712
duplicates:
Issue Description:
Background
When using a global function defined in a module that shares the name with a global function defined in another it is possible to use the module name to solve the ambiguity.
For example, in Apple's
Foundation
contains the global functionNSLocalizedString()
. Should there be another module containing a global function with the same name theFoundation
function can be invoked like so:Foundation.NSLocalizedString()
Problem
If an imported module has a type that shares it's name there is no way to specify the module's global function using Swift.
For example,
XCTest
is the name of a module but it also contains a class with the same name. The module has several global functions but attempting to invoke them using it's namespace results in Swift trying to access them from theXCTest
class.I would like to be able to somehow specify a global entity within a module namespace in the case that a module shares it's name with one of it's contained types.
The text was updated successfully, but these errors were encountered: