Created
May 6, 2017 04:17
-
-
Save NaridaL/08160f049a41c72cb54892f38eef6a86 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// A.ts | |
abstract class A { | |
public static create(t: boolean) { | |
//noinspection TsLint | |
const b = new D(); | |
return t ? new B() : new C(); | |
} | |
abstract foo(): string | |
abstract bar(): string | |
con(): string { | |
return 'con' | |
} | |
} | |
export default A | |
// B.ts | |
import A from './A'; | |
export default class B extends A { | |
foo() { | |
return 'B here'; | |
} | |
bar(): string { | |
return null; | |
} | |
} | |
// D.ts | |
import B from './B'; | |
const a = new B().con() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment