Skip to content

Instantly share code, notes, and snippets.

@indragiek
Last active August 29, 2015 14:13
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 indragiek/9c4bdaff950515e0a95b to your computer and use it in GitHub Desktop.
Save indragiek/9c4bdaff950515e0a95b to your computer and use it in GitHub Desktop.
This code doesn't compile (Xcode 6.1.1, Swift 1.1)
public protocol TableViewSectionType {
typealias ItemCollection: CollectionType
}
public protocol TableViewCellFactoryType {
typealias Item
}
public final class TableViewDataSource<
SectionCollection: CollectionType,
Factory: TableViewCellFactoryType
where
SectionCollection.Generator.Element: TableViewSectionType,
SectionCollection.Generator.Element.ItemCollection.Generator.Element == Factory.Item // Changing this to a concrete type like Int fixes it
> {
}
@indragiek
Copy link
Author

Swapping the order of SectionCollection and Factory in the generic type parameter list seems to have fixed it. Probably a bug, then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment