2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/staticFactory1.ts ===
|
|
|
|
class Base {
|
2015-04-13 23:01:57 +02:00
|
|
|
>Base : Base, Symbol(Base, Decl(staticFactory1.ts, 0, 0))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
foo() { return 1; }
|
2015-04-13 23:01:57 +02:00
|
|
|
>foo : () => number, Symbol(foo, Decl(staticFactory1.ts, 0, 12))
|
2015-04-13 21:36:11 +02:00
|
|
|
>1 : number
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
static create() {
|
2015-04-13 23:01:57 +02:00
|
|
|
>create : () => Base, Symbol(Base.create, Decl(staticFactory1.ts, 1, 23))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
return new this();
|
|
|
|
>new this() : Base
|
2015-04-13 23:01:57 +02:00
|
|
|
>this : typeof Base, Symbol(Base, Decl(staticFactory1.ts, 0, 0))
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class Derived extends Base {
|
2015-04-13 23:01:57 +02:00
|
|
|
>Derived : Derived, Symbol(Derived, Decl(staticFactory1.ts, 5, 1))
|
|
|
|
>Base : Base, Symbol(Base, Decl(staticFactory1.ts, 0, 0))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
foo() { return 2; }
|
2015-04-13 23:01:57 +02:00
|
|
|
>foo : () => number, Symbol(foo, Decl(staticFactory1.ts, 7, 28))
|
2015-04-13 21:36:11 +02:00
|
|
|
>2 : number
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
var d = Derived.create();
|
2015-04-13 23:01:57 +02:00
|
|
|
>d : Base, Symbol(d, Decl(staticFactory1.ts, 10, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>Derived.create() : Base
|
2015-04-13 23:01:57 +02:00
|
|
|
>Derived.create : () => Base, Symbol(Base.create, Decl(staticFactory1.ts, 1, 23))
|
|
|
|
>Derived : typeof Derived, Symbol(Derived, Decl(staticFactory1.ts, 5, 1))
|
|
|
|
>create : () => Base, Symbol(Base.create, Decl(staticFactory1.ts, 1, 23))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
d.foo();
|
|
|
|
>d.foo() : number
|
2015-04-13 23:01:57 +02:00
|
|
|
>d.foo : () => number, Symbol(Base.foo, Decl(staticFactory1.ts, 0, 12))
|
|
|
|
>d : Base, Symbol(d, Decl(staticFactory1.ts, 10, 3))
|
|
|
|
>foo : () => number, Symbol(Base.foo, Decl(staticFactory1.ts, 0, 12))
|
2014-08-15 23:33:16 +02:00
|
|
|
|