Skip to content

Instantly share code, notes, and snippets.

@Ben-G
Created April 12, 2016 05:23
Show Gist options
  • Save Ben-G/6eccdab63d25c32ed2b439420fbddd81 to your computer and use it in GitHub Desktop.
Save Ben-G/6eccdab63d25c32ed2b439420fbddd81 to your computer and use it in GitHub Desktop.
Issue with constrained extensions in Swift 2.2
struct StructTest {}
class ClassTest {}
class WillBeConstrained<T> {}
// Error: type 'T' constrained to non-protocol type 'StructTest'
extension WillBeConstrained where T: StructTest {
}
// No Error
extension WillBeConstrained where T: ClassTest {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment