TypeScript/tests/baselines/reference/constructorOverloads2.types

77 lines
1.2 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/constructorOverloads2.ts ===
class FooBase {
>FooBase : FooBase
2014-08-15 23:33:16 +02:00
constructor(s: string);
>s : string
2014-08-15 23:33:16 +02:00
constructor(n: number);
>n : number
2014-08-15 23:33:16 +02:00
constructor(x: any) {
>x : any
2014-08-15 23:33:16 +02:00
}
bar1() { /*WScript.Echo("base bar1");*/ }
>bar1 : () => void
2014-08-15 23:33:16 +02:00
}
class Foo extends FooBase {
>Foo : Foo
>FooBase : FooBase
2014-08-15 23:33:16 +02:00
constructor(s: string);
>s : string
2014-08-15 23:33:16 +02:00
constructor(n: number);
>n : number
2014-08-15 23:33:16 +02:00
constructor(a:any);
>a : any
2014-08-15 23:33:16 +02:00
constructor(x: any, y?: any) {
>x : any
>y : any
2014-08-15 23:33:16 +02:00
super(x);
>super(x) : void
>super : typeof FooBase
>x : any
2014-08-15 23:33:16 +02:00
}
bar1() { /*WScript.Echo("bar1");*/ }
>bar1 : () => void
2014-08-15 23:33:16 +02:00
}
var f1 = new Foo("hey");
>f1 : Foo
2014-08-15 23:33:16 +02:00
>new Foo("hey") : Foo
>Foo : typeof Foo
2015-04-13 21:36:11 +02:00
>"hey" : string
2014-08-15 23:33:16 +02:00
var f2 = new Foo(0);
>f2 : Foo
2014-08-15 23:33:16 +02:00
>new Foo(0) : Foo
>Foo : typeof Foo
2015-04-13 21:36:11 +02:00
>0 : number
2014-08-15 23:33:16 +02:00
var f3 = new Foo(f1);
>f3 : Foo
2014-08-15 23:33:16 +02:00
>new Foo(f1) : Foo
>Foo : typeof Foo
>f1 : Foo
2014-08-15 23:33:16 +02:00
var f4 = new Foo([f1,f2,f3]);
>f4 : Foo
2014-08-15 23:33:16 +02:00
>new Foo([f1,f2,f3]) : Foo
>Foo : typeof Foo
2014-08-15 23:33:16 +02:00
>[f1,f2,f3] : Foo[]
>f1 : Foo
>f2 : Foo
>f3 : Foo
2014-08-15 23:33:16 +02:00
f1.bar1();
>f1.bar1() : void
>f1.bar1 : () => void
>f1 : Foo
>bar1 : () => void
2014-08-15 23:33:16 +02:00