TypeScript/tests/baselines/reference/extendStringInterface.types

50 lines
2.2 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/conformance/types/primitives/string/extendStringInterface.ts ===
interface String {
2015-04-13 23:01:57 +02:00
>String : String, Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(extendStringInterface.ts, 0, 0))
2014-08-15 23:33:16 +02:00
doStuff(): string;
2015-04-13 23:01:57 +02:00
>doStuff : () => string, Symbol(doStuff, Decl(extendStringInterface.ts, 0, 18))
2014-08-15 23:33:16 +02:00
doOtherStuff<T>(x:T): T;
2015-04-13 23:01:57 +02:00
>doOtherStuff : <T>(x: T) => T, Symbol(doOtherStuff, Decl(extendStringInterface.ts, 1, 22))
>T : T, Symbol(T, Decl(extendStringInterface.ts, 2, 17))
>x : T, Symbol(x, Decl(extendStringInterface.ts, 2, 20))
>T : T, Symbol(T, Decl(extendStringInterface.ts, 2, 17))
>T : T, Symbol(T, Decl(extendStringInterface.ts, 2, 17))
2014-08-15 23:33:16 +02:00
}
var x = '';
2015-04-13 23:01:57 +02:00
>x : string, Symbol(x, Decl(extendStringInterface.ts, 5, 3))
2015-04-13 21:36:11 +02:00
>'' : string
2014-08-15 23:33:16 +02:00
var a: string = x.doStuff();
2015-04-13 23:01:57 +02:00
>a : string, Symbol(a, Decl(extendStringInterface.ts, 6, 3))
2014-08-15 23:33:16 +02:00
>x.doStuff() : string
2015-04-13 23:01:57 +02:00
>x.doStuff : () => string, Symbol(String.doStuff, Decl(extendStringInterface.ts, 0, 18))
>x : string, Symbol(x, Decl(extendStringInterface.ts, 5, 3))
>doStuff : () => string, Symbol(String.doStuff, Decl(extendStringInterface.ts, 0, 18))
2014-08-15 23:33:16 +02:00
var b: string = x.doOtherStuff('hm');
2015-04-13 23:01:57 +02:00
>b : string, Symbol(b, Decl(extendStringInterface.ts, 7, 3))
2014-08-15 23:33:16 +02:00
>x.doOtherStuff('hm') : string
2015-04-13 23:01:57 +02:00
>x.doOtherStuff : <T>(x: T) => T, Symbol(String.doOtherStuff, Decl(extendStringInterface.ts, 1, 22))
>x : string, Symbol(x, Decl(extendStringInterface.ts, 5, 3))
>doOtherStuff : <T>(x: T) => T, Symbol(String.doOtherStuff, Decl(extendStringInterface.ts, 1, 22))
2015-04-13 21:36:11 +02:00
>'hm' : string
2014-08-15 23:33:16 +02:00
var c: string = x['doStuff']();
2015-04-13 23:01:57 +02:00
>c : string, Symbol(c, Decl(extendStringInterface.ts, 8, 3))
2014-08-15 23:33:16 +02:00
>x['doStuff']() : string
>x['doStuff'] : () => string
2015-04-13 23:01:57 +02:00
>x : string, Symbol(x, Decl(extendStringInterface.ts, 5, 3))
>'doStuff' : string, Symbol(String.doStuff, Decl(extendStringInterface.ts, 0, 18))
2014-08-15 23:33:16 +02:00
var d: string = x['doOtherStuff']('hm');
2015-04-13 23:01:57 +02:00
>d : string, Symbol(d, Decl(extendStringInterface.ts, 9, 3))
2014-08-15 23:33:16 +02:00
>x['doOtherStuff']('hm') : string
>x['doOtherStuff'] : <T>(x: T) => T
2015-04-13 23:01:57 +02:00
>x : string, Symbol(x, Decl(extendStringInterface.ts, 5, 3))
>'doOtherStuff' : string, Symbol(String.doOtherStuff, Decl(extendStringInterface.ts, 1, 22))
2015-04-13 21:36:11 +02:00
>'hm' : string
2014-08-15 23:33:16 +02:00