Skip to content

Instantly share code, notes, and snippets.

@marksands
Last active March 17, 2018 02:53
Show Gist options
  • Save marksands/239e62186f73157092110d098c78c467 to your computer and use it in GitHub Desktop.
Save marksands/239e62186f73157092110d098c78c467 to your computer and use it in GitHub Desktop.
func =(_ lhs: UInt8, _ rhs: UInt8) -> UInt8 { return 0 }
struct WHelper {
subscript(_ a: (UInt8, UInt8) -> (UInt8)) -> () -> Void {
get { return { } }
}
}
func w(_ a: () -> Void) -> WHelper {
return WHelper()
}
struct X {
subscript(_ a: (UInt8, UInt8) -> (UInt8)) -> (() -> Void) -> Void {
get { return { _ in } }
}
}
let x = X()
struct Y {
subscript(_ a: (UInt8, UInt8) -> (UInt8), _ b: () -> Void) -> () -> Void {
get { return { } }
}
}
let y = Y()
struct z {
subscript(_ a: (UInt8, UInt8) -> (UInt8), _ b: () -> Void) -> Void {
get { }
}
}
w{}[&]()
x[&](){}
y[&]{}()
z()[&]{}
w{}[=]()
x[=](){}
y[=]{}()
z()[=]{}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment