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 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
|
=== tests/cases/compiler/super1.ts ===
// Case 1
class Base1 {
>Base1 : Base1
public foo() {
>foo : () => string
return "base";
>"base" : "base"
}
}
class Sub1 extends Base1 {
>Sub1 : Sub1
>Base1 : Base1
public bar() {
>bar : () => string
return "base";
>"base" : "base"
}
}
class SubSub1 extends Sub1 {
>SubSub1 : SubSub1
>Sub1 : Sub1
public bar() {
>bar : () => any
return super.super.foo;
>super.super.foo : any
>super.super : any
>super : Sub1
>super : any
>foo : any
}
}
// Case 2
class Base2 {
>Base2 : Base2
public foo() {
>foo : () => string
return "base";
>"base" : "base"
}
}
class SubE2 extends Base2 {
>SubE2 : SubE2
>Base2 : Base2
public bar() {
>bar : () => any
return super.prototype.foo = null;
>super.prototype.foo = null : null
>super.prototype.foo : any
>super.prototype : any
>super : Base2
>prototype : any
>foo : any
>null : null
}
}
// Case 3
class Base3 {
>Base3 : Base3
public foo() {
>foo : () => string
return "base";
>"base" : "base"
}
}
class SubE3 extends Base3 {
>SubE3 : SubE3
>Base3 : Base3
public bar() {
>bar : () => any
return super.bar();
>super.bar() : any
>super.bar : any
>super : Base3
>bar : any
}
}
// Case 4
module Base4 {
>Base4 : typeof Base4
class Sub4 {
>Sub4 : Sub4
public x(){
>x : () => string
return "hello";
>"hello" : "hello"
}
}
export class SubSub4 extends Sub4{
>SubSub4 : SubSub4
>Sub4 : Sub4
public x(){
>x : () => string
return super.x();
>super.x() : string
>super.x : () => string
>super : Sub4
>x : () => string
}
}
export class Sub4E {
>Sub4E : Sub4E
public x() {
>x : () => any
return super.x();
>super.x() : any
>super.x : any
>super : any
>x : any
}
}
}
|