Last active
September 4, 2017 13:36
-
-
Save kutschenator/68b3568dfbbe74f3369e699c3bb7b31d to your computer and use it in GitHub Desktop.
StaticallyAccessible
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
postfix operator ~ | |
protocol StaticallyAccessible { } | |
extension StaticallyAccessible { | |
static postfix func ~ (c: Self) -> Self.Type { | |
return type(of: c) | |
} | |
var 🌩: Self.Type { | |
return type(of: self) | |
} | |
} | |
class X: StaticallyAccessible { | |
func doStuff() { | |
type(of: self).doStaticStuff() | |
self~.doStaticStuff() | |
🌩.doStaticStuff() | |
} | |
static func doStaticStuff() { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment