Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

[SoM] - error: ambiguous reference to member #123

Open
chamons opened this issue Aug 10, 2018 · 2 comments
Open

[SoM] - error: ambiguous reference to member #123

chamons opened this issue Aug 10, 2018 · 2 comments
Milestone

Comments

@chamons
Copy link
Contributor

chamons commented Aug 10, 2018

public class Event <T> {

  public init () {}
}

public extension Event where T == Void {

  func emit () {
  }

  func emit (on target: AnyObject) {
  }

  func emit (on targets: [AnyObject]) {
  }
}


Error (Fatal): SwiftRepro-Event-Extension0.swift:7:5: error: ambiguous reference to member 'emit()'
    this.emit();
    ^~~~
SwiftRepro.Event<()>:2:17: note: found this candidate
    public func emit()
                ^
SwiftRepro.Event<()>:3:17: note: found this candidate
    public func emit(on target: Swift.AnyObject)
                ^
SwiftRepro.Event<()>:4:17: note: found this candidate
    public func emit(on targets: [Swift.AnyObject])
                ^
SwiftRepro-Event-Extension0.swift:11:5: error: ambiguous reference to member 'emit()'
    this.emit(on: on);
    ^~~~
SwiftRepro.Event<()>:2:17: note: found this candidate
    public func emit()
                ^
SwiftRepro.Event<()>:3:17: note: found this candidate
    public func emit(on target: Swift.AnyObject)
                ^
SwiftRepro.Event<()>:4:17: note: found this candidate
    public func emit(on targets: [Swift.AnyObject])
                ^
SwiftRepro-Event-Extension0.swift:15:5: error: ambiguous reference to member 'emit()'
    this.emit(on: on.pointee);
    ^~~~
SwiftRepro.Event<()>:2:17: note: found this candidate
    public func emit()
                ^
SwiftRepro.Event<()>:3:17: note: found this candidate
    public func emit(on target: Swift.AnyObject)
                ^
SwiftRepro.Event<()>:4:17: note: found this candidate
    public func emit(on targets: [Swift.AnyObject])
                ^
 (Exception)
Error (Fatal): Failed to wrap module SwiftRepro. (CompilerException)
@stephen-hawley
Copy link
Contributor

Note to future Steve

When you're compiling an extension of this type, the important part is the where T == Void conformance, not the ambiguous member reference.

When wrapping this, the generic parameter should get bound to Void.

@chamons
Copy link
Contributor Author

chamons commented Aug 10, 2018

EmitterKit.framework

@stephen-hawley stephen-hawley transferred this issue from another repository Oct 29, 2019
@chamons chamons added this to the Future milestone Nov 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants