TypeScript/tests/baselines/reference/superCalls.types

65 lines
1,003 B
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/conformance/expressions/superCalls/superCalls.ts ===
class Base {
>Base : Base
2014-08-15 23:33:16 +02:00
x = 43;
>x : number
2015-04-13 21:36:11 +02:00
>43 : number
2014-08-15 23:33:16 +02:00
constructor(n: string) {
>n : string
2014-08-15 23:33:16 +02:00
}
}
function v(): void { }
>v : () => void
2014-08-15 23:33:16 +02:00
class Derived extends Base {
>Derived : Derived
>Base : Base
2014-08-15 23:33:16 +02:00
//super call in class constructor of derived type
constructor(public q: number) {
>q : number
2014-08-15 23:33:16 +02:00
super('');
>super('') : void
>super : typeof Base
2015-04-13 21:36:11 +02:00
>'' : string
2014-08-15 23:33:16 +02:00
//type of super call expression is void
var p = super('');
>p : void
2014-08-15 23:33:16 +02:00
>super('') : void
>super : typeof Base
2015-04-13 21:36:11 +02:00
>'' : string
2014-08-15 23:33:16 +02:00
var p = v();
>p : void
2014-08-15 23:33:16 +02:00
>v() : void
>v : () => void
2014-08-15 23:33:16 +02:00
}
}
class OtherBase {
>OtherBase : OtherBase
2014-08-15 23:33:16 +02:00
}
class OtherDerived extends OtherBase {
>OtherDerived : OtherDerived
>OtherBase : OtherBase
2014-08-15 23:33:16 +02:00
constructor() {
var p = '';
>p : string
2015-04-13 21:36:11 +02:00
>'' : string
2014-08-15 23:33:16 +02:00
super();
>super() : void
>super : typeof OtherBase
2014-08-15 23:33:16 +02:00
}
}