Created
September 6, 2015 16:44
-
-
Save cgoldsby/20fd0719a18954c8d58d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I really like this one | |
// XCode 7.0 beta 6 (7A192o) | |
func ~=(left: Any, right: Bool) -> BooleanType { | |
return true | |
} | |
func +(left: Any, right: Any) -> String { | |
return "" | |
} | |
protocol Challenge4: class, BooleanType, ArrayLiteralConvertible { | |
typealias D | |
var `self` : () -> () { get set } | |
func doIt(inout s: D) | |
} | |
extension Challenge4 where D == NonObjectiveCBase { | |
typealias Element = Any | |
internal init(arrayLiteral elements: Any...) { | |
self.init() | |
} | |
// | |
func doIt(inout s: D) { | |
if case self = isUniquelyReferenced(&s), | |
self.`self` = true where self { | |
self.`self` = { [unowned x = [self, 7] as Self] n in | |
print(x + n) | |
} as () -> () | |
} | |
} | |
// | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment