Created
April 21, 2020 18:53
-
-
Save digitalbuddha/369b915e3a049a34e1bf1577df4eb802 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
interface Foo{ | |
fun doStuff() | |
companion object | |
} | |
fun Foo.Companion.CreateFoo():Foo = RealFoo() | |
private class RealFoo : Foo{ | |
override fun doStuff() { | |
"Doing Stuff" | |
} | |
} | |
//Somewhere else in your application | |
Foo.CreateFoo() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment