Last active
December 11, 2016 16:09
-
-
Save motokiee/c2617c790f89cf6d54f2e5b907222359 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
struct Extension<Base> { | |
let base: Base | |
init (_ base: Base) { | |
self.base = base | |
} | |
} | |
protocol ExtensionCompatible { | |
associatedtype Compatible | |
static var ex: Extension<Compatible>.Type { get } | |
var ex: Extension<Compatible> { get } | |
} | |
extension ExtensionCompatible { | |
static var ex: Extension<Self>.Type { | |
return Extension<Self>.self | |
} | |
var ex: Extension<Self> { | |
return Extension(self) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment