Created
March 18, 2016 15:18
-
-
Save djcsdy/c120c8c0b4c88b1bd461 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
class Base { } | |
class A extends Base { } | |
class B extends Base { } | |
interface Constructor<T> { | |
new(): T; | |
} | |
function doAThing(ctor: Constructor<Base>) { | |
let instance = new ctor(); | |
} | |
doAThing(A); | |
doAThing(B); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment