Skip to content

Instantly share code, notes, and snippets.

@soxjke
Last active October 18, 2017 10:20
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 soxjke/5e384cdfe9b4f3b788994f15107b65cc to your computer and use it in GitHub Desktop.
Save soxjke/5e384cdfe9b4f3b788994f15107b65cc to your computer and use it in GitHub Desktop.
Swift 4 crash
public protocol A {
associatedtype V
associatedtype E
var a: V { get }
}
public protocol B {
associatedtype V
var b: V { get }
}
class C<V, E> {
var v: V? = nil
var e: E? = nil
}
extension C: A {
typealias V = C.V
typealias E = C.E
var a: C.V {
return v!
}
}
extension C: B {
typealias V = C.E
var b: C.E {
return e!
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment