pointfreeco / swift-identified-collections

A library of data structures for working with collections of identifiable elements in an ergonomic, performant way.
MIT License
539 stars 46 forks source link

Identified is ambiguous for type lookup in this context #53

Closed mrtnlst closed 1 year ago

mrtnlst commented 1 year ago

Description

Hey guys! This morning our CI builds broke with the following error:

…/checkouts/…/RegistrationNativeState.swift:18:26: 'Identified' ambiguous for type lookup in this context

In this place we import both IdentifiedCollections and ComposableArchitecture and use the Identified type.

We have the unfortunate setup of TCA being pinned to 0.45.0 (we're a framework and someone integrating us has pinned TCA as well). From TCA's Package.swift it seems that swift-identified-collections has no semver limit and therefor updated itself to 0.7 over night.

I don't know if this is just part of the Road to 1.0 and is supposed to break in this case, or is this an accident here?

Solution: I just realised we didn't pin the version in the Package.resolved and this fixes it. Nevertheless I thought I give you the feedback here. If this is intentional, you can close the issue!

Checklist

Expected behavior

swift-composable-architecture 0.45.0 is compatible with swift-identified-collection 0.7.0 and shouldn't create ambiguity errors regarding the Identified type.

Actual behavior

swift-composable-architecture 0.45.0 together with swift-identified-collection 0.7.0 creates an ambiguity error regarding the Identified type.

Steps to reproduce

No response

Identified Collections version information

0.7.0

Destination operating system

iOS 16

Xcode version information

Xcode 14.1

Swift Compiler version information

5.7.2
stephencelis commented 1 year ago

@mrtnlst We'll have a TCA release today, but this will be an issue if you ever upgrade one before the other.

To work around, you can:

  1. Temporarily qualify Identified with either IdentifiedCollections.Identified or ComposableArchitecture.Identified to disambiguate (they're the same type).
  2. Temporarily lock swift-identified-collections to < 0.7.0.

Once we do a minor release of TCA later today you can remove either of the above workarounds.