60 lines
943 B
Text
60 lines
943 B
Text
=== tests/cases/conformance/expressions/superCalls/superCalls.ts ===
|
|
class Base {
|
|
>Base : Base
|
|
|
|
x = 43;
|
|
>x : number
|
|
|
|
constructor(n: string) {
|
|
>n : string
|
|
|
|
}
|
|
}
|
|
|
|
function v(): void { }
|
|
>v : typeof v
|
|
|
|
class Derived extends Base {
|
|
>Derived : Derived
|
|
>Base : Base
|
|
|
|
//super call in class constructor of derived type
|
|
constructor(public q: number) {
|
|
>q : number
|
|
|
|
super('');
|
|
>super('') : void
|
|
>super : typeof Base
|
|
|
|
//type of super call expression is void
|
|
var p = super('');
|
|
>p : void
|
|
>super('') : void
|
|
>super : typeof Base
|
|
|
|
var p = v();
|
|
>p : void
|
|
>v() : void
|
|
>v : typeof v
|
|
}
|
|
}
|
|
|
|
class OtherBase {
|
|
>OtherBase : OtherBase
|
|
|
|
}
|
|
|
|
class OtherDerived extends OtherBase {
|
|
>OtherDerived : OtherDerived
|
|
>OtherBase : OtherBase
|
|
|
|
constructor() {
|
|
var p = '';
|
|
>p : string
|
|
|
|
super();
|
|
>super() : void
|
|
>super : typeof OtherBase
|
|
}
|
|
}
|
|
|