-
Notifications
You must be signed in to change notification settings - Fork 93
Open
Description
Our codebase has multiple modules that contain types with the same name, for example: ModuleA.Foo and ModuleB.Foo. The generated mock file will import both ModuleA and ModuleB, leading to ambiguity for the Foo type.
Would it be possible to always specify the module, thereby resolving any ambiguity?
Example
Input
// ModuleA
public struct Foo {}
public protocol ProtocolInModuleA {
func doSomething(with: Foo) -> Void
}// ModuleB
public struct Foo {}Current mocks
// Mocks.generated.swift
import ModuleA
import ModuleB
class ProtocolInModuleAMock {
// These references to Foo are ambiguous
var doSomethingArgValues = [Foo]()
var doSomethingHandler: ((Foo) -> ())?
func doSomething(with: Foo) { ... }
}Expected mocks
// Mocks.generated.swift
import ModuleA
import ModuleB
class ProtocolInModuleAMock {
// These references to Foo are explicitly disambiguated by including the module
var doSomethingArgValues = [ModuleA.Foo]()
var doSomethingHandler: ((ModuleA.Foo) -> ())?
func doSomething(with: ModuleA.Foo) { ... }
}Metadata
Metadata
Assignees
Labels
No labels