1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
|
=== tests/cases/compiler/superCallInStaticMethod.ts ===
class Doing {
>Doing : Doing
public static staticMethod() {
>staticMethod : () => void
}
}
class Other extends Doing {
>Other : Other
>Doing : Doing
// in static method
public static staticMethod() {
>staticMethod : () => void
super.staticMethod();
>super.staticMethod() : void
>super.staticMethod : () => void
>super : typeof Doing
>staticMethod : () => void
}
// in a lambda inside a static method
public static lambdaInsideAStaticMethod() {
>lambdaInsideAStaticMethod : () => void
() => {
>() => { super.staticMethod(); } : () => void
super.staticMethod();
>super.staticMethod() : void
>super.staticMethod : () => void
>super : typeof Doing
>staticMethod : () => void
}
}
// in an object literal inside a static method
public static objectLiteralInsideAStaticMethod() {
>objectLiteralInsideAStaticMethod : () => { a: () => void; b: void; }
return {
>{ a: () => { super.staticMethod(); }, b: super.staticMethod() } : { a: () => void; b: void; }
a: () => {
>a : () => void
>() => { super.staticMethod(); } : () => void
super.staticMethod();
>super.staticMethod() : void
>super.staticMethod : () => void
>super : typeof Doing
>staticMethod : () => void
},
b: super.staticMethod()
>b : void
>super.staticMethod() : void
>super.staticMethod : () => void
>super : typeof Doing
>staticMethod : () => void
};
}
// in a getter
public static get staticGetter() {
>staticGetter : number
super.staticMethod();
>super.staticMethod() : void
>super.staticMethod : () => void
>super : typeof Doing
>staticMethod : () => void
return 0;
>0 : 0
}
// in a setter
public static set staticGetter(value: number) {
>staticGetter : number
>value : number
super.staticMethod();
>super.staticMethod() : void
>super.staticMethod : () => void
>super : typeof Doing
>staticMethod : () => void
}
// in static method
public static initializerInAStaticMethod(a = super.staticMethod()) {
>initializerInAStaticMethod : (a?: void) => void
>a : void
>super.staticMethod() : void
>super.staticMethod : () => void
>super : typeof Doing
>staticMethod : () => void
super.staticMethod();
>super.staticMethod() : void
>super.staticMethod : () => void
>super : typeof Doing
>staticMethod : () => void
}
}
|