TypeScript/tests/baselines/reference/derivedClasses.types

96 lines
1.6 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/derivedClasses.ts ===
class Red extends Color {
>Red : Red
>Color : Color
2014-08-15 23:33:16 +02:00
public shade() {
>shade : () => string
2014-08-15 23:33:16 +02:00
var getHue = () => { return this.hue(); };
>getHue : () => string
2014-08-15 23:33:16 +02:00
>() => { return this.hue(); } : () => string
>this.hue() : string
>this.hue : () => string
>this : Red
>hue : () => string
2014-08-15 23:33:16 +02:00
return getHue() + " red";
>getHue() + " red" : string
>getHue() : string
>getHue : () => string
2015-04-13 21:36:11 +02:00
>" red" : string
2014-08-15 23:33:16 +02:00
}
}
class Color {
>Color : Color
2014-08-15 23:33:16 +02:00
public shade() { return "some shade"; }
>shade : () => string
2015-04-13 21:36:11 +02:00
>"some shade" : string
2014-08-15 23:33:16 +02:00
public hue() { return "some hue"; }
>hue : () => string
2015-04-13 21:36:11 +02:00
>"some hue" : string
2014-08-15 23:33:16 +02:00
}
class Blue extends Color {
>Blue : Blue
>Color : Color
2014-08-15 23:33:16 +02:00
public shade() {
>shade : () => string
2014-08-15 23:33:16 +02:00
var getHue = () => { return this.hue(); };
>getHue : () => string
2014-08-15 23:33:16 +02:00
>() => { return this.hue(); } : () => string
>this.hue() : string
>this.hue : () => string
>this : Blue
>hue : () => string
2014-08-15 23:33:16 +02:00
return getHue() + " blue";
>getHue() + " blue" : string
>getHue() : string
>getHue : () => string
2015-04-13 21:36:11 +02:00
>" blue" : string
2014-08-15 23:33:16 +02:00
}
}
var r = new Red();
>r : Red
2014-08-15 23:33:16 +02:00
>new Red() : Red
>Red : typeof Red
2014-08-15 23:33:16 +02:00
var b = new Blue();
>b : Blue
2014-08-15 23:33:16 +02:00
>new Blue() : Blue
>Blue : typeof Blue
2014-08-15 23:33:16 +02:00
r.shade();
>r.shade() : string
>r.shade : () => string
>r : Red
>shade : () => string
2014-08-15 23:33:16 +02:00
r.hue();
>r.hue() : string
>r.hue : () => string
>r : Red
>hue : () => string
2014-08-15 23:33:16 +02:00
b.shade();
>b.shade() : string
>b.shade : () => string
>b : Blue
>shade : () => string
2014-08-15 23:33:16 +02:00
b.hue();
>b.hue() : string
>b.hue : () => string
>b : Blue
>hue : () => string
2014-08-15 23:33:16 +02:00