2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/super2.ts ===
|
|
|
|
// Case 5
|
|
|
|
class Base5 {
|
|
|
|
>Base5 : Base5
|
|
|
|
|
|
|
|
public x() {
|
|
|
|
>x : () => string
|
|
|
|
|
|
|
|
return "BaseX";
|
|
|
|
}
|
|
|
|
|
|
|
|
public y() {
|
|
|
|
>y : () => string
|
|
|
|
|
|
|
|
return "BaseY";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class Sub5 extends Base5 {
|
|
|
|
>Sub5 : Sub5
|
|
|
|
>Base5 : Base5
|
|
|
|
|
|
|
|
public x() {
|
|
|
|
>x : () => string
|
|
|
|
|
|
|
|
return "SubX";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class SubSub5 extends Sub5 {
|
|
|
|
>SubSub5 : SubSub5
|
|
|
|
>Sub5 : Sub5
|
|
|
|
|
|
|
|
public x() {
|
|
|
|
>x : () => string
|
|
|
|
|
|
|
|
return super.x();
|
|
|
|
>super.x() : string
|
|
|
|
>super.x : () => string
|
2014-08-28 21:31:37 +02:00
|
|
|
>super : Sub5
|
2014-08-15 23:33:16 +02:00
|
|
|
>x : () => string
|
|
|
|
}
|
|
|
|
public y() {
|
|
|
|
>y : () => string
|
|
|
|
|
|
|
|
return super.y();
|
|
|
|
>super.y() : string
|
|
|
|
>super.y : () => string
|
2014-08-28 21:31:37 +02:00
|
|
|
>super : Sub5
|
2014-08-15 23:33:16 +02:00
|
|
|
>y : () => string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Case 6
|
|
|
|
class Base6 {
|
|
|
|
>Base6 : Base6
|
|
|
|
|
|
|
|
public x() {
|
|
|
|
>x : () => string
|
|
|
|
|
|
|
|
return "BaseX";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class Sub6 extends Base6 {
|
|
|
|
>Sub6 : Sub6
|
|
|
|
>Base6 : Base6
|
|
|
|
|
|
|
|
public y() {
|
|
|
|
>y : () => string
|
|
|
|
|
|
|
|
return "SubY";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class SubSub6 extends Sub6 {
|
|
|
|
>SubSub6 : SubSub6
|
|
|
|
>Sub6 : Sub6
|
|
|
|
|
|
|
|
public y() {
|
|
|
|
>y : () => string
|
|
|
|
|
|
|
|
return super.y();
|
|
|
|
>super.y() : string
|
|
|
|
>super.y : () => string
|
2014-08-28 21:31:37 +02:00
|
|
|
>super : Sub6
|
2014-08-15 23:33:16 +02:00
|
|
|
>y : () => string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var results1 = new SubSub5();
|
|
|
|
>results1 : SubSub5
|
|
|
|
>new SubSub5() : SubSub5
|
|
|
|
>SubSub5 : typeof SubSub5
|
|
|
|
|
|
|
|
var results2 = new SubSub6();
|
|
|
|
>results2 : SubSub6
|
|
|
|
>new SubSub6() : SubSub6
|
|
|
|
>SubSub6 : typeof SubSub6
|
|
|
|
|
|
|
|
results1.x() + results1.y() + results2.y();
|
|
|
|
>results1.x() + results1.y() + results2.y() : string
|
|
|
|
>results1.x() + results1.y() : string
|
|
|
|
>results1.x() : string
|
|
|
|
>results1.x : () => string
|
|
|
|
>results1 : SubSub5
|
|
|
|
>x : () => string
|
|
|
|
>results1.y() : string
|
|
|
|
>results1.y : () => string
|
|
|
|
>results1 : SubSub5
|
|
|
|
>y : () => string
|
|
|
|
>results2.y() : string
|
|
|
|
>results2.y : () => string
|
|
|
|
>results2 : SubSub6
|
|
|
|
>y : () => string
|
|
|
|
|