pointfreeco / swift-nonempty

🎁 A compile-time guarantee that a collection contains a value.

Home Page:https://www.pointfree.co/episodes/ep20-nonempty

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ambiguous use of operator '+'

buscarini opened this issue · comments

I'm suddenly getting this issue when using Validated 0.2.1 and NonEmpty 0.3.0.

The compiler says he has these two candidates:

  public static func + <S: Sequence>(lhs: NonEmpty, rhs: S) -> NonEmpty where Element == S.Element {
    var lhs = lhs
    lhs += rhs
    return lhs
  }

  public static func + <S: Sequence>(lhs: S, rhs: NonEmpty) -> NonEmpty where Element == S.Element {
    var rhs = rhs
    rhs.insert(contentsOf: ContiguousArray(lhs), at: rhs.startIndex)
    return rhs
  }