Skip to content

Instantly share code, notes, and snippets.

@davidbalbert
Created July 27, 2023 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidbalbert/bb3ef63d8d7120dff7b0b3f51bced74f to your computer and use it in GitHub Desktop.
Save davidbalbert/bb3ef63d8d7120dff7b0b3f51bced74f to your computer and use it in GitHub Desktop.
Conflicting conformances
import Cocoa
struct EmptyContainer<T> {
}
typealias IntContainer = EmptyContainer<Int>
extension IntContainer: Sequence {
struct Iterator: IteratorProtocol {
func next() -> Int? {
return nil
}
}
func makeIterator() -> Iterator {
Iterator()
}
}
typealias DoubleContainer = EmptyContainer<Double>
extension DoubleContainer: Sequence {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment