Skip to content

Instantly share code, notes, and snippets.

@T1T4N
Created April 15, 2024 08:12
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 T1T4N/d84ba8ca6edeec9bfeb3fdbad0f1e631 to your computer and use it in GitHub Desktop.
Save T1T4N/d84ba8ca6edeec9bfeb3fdbad0f1e631 to your computer and use it in GitHub Desktop.
@objc public protocol TestProto1 {}
public protocol TestProto2: Hashable {}
public enum Destination: Hashable, Equatable {
// OKAY - Concrete
case test(obj: NSObject)
// Error: any type (not concrete/boxed)
// Type 'AppFeatureDestination' does not conform to protocol 'Equatable'
case test1(obj: NSObject & TestProto1)
// Error: Associated value type 'any TestProto2' does not conform to protocol 'Hashable', preventing synthesized conformance of 'AppFeatureDestination' to 'Hashable'
case test2(obj: any TestProto2)
//Associated value type 'any NSObject & TestProto2' does not conform to protocol 'Equatable', preventing synthesized conformance of 'AppFeatureDestination' to 'Equatable'
case test3(obj: any NSObject & Equatable & TestProto2)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment