TypeScript/tests/baselines/reference/additionOperatorWithStringAndEveryType.types

162 lines
6.9 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithStringAndEveryType.ts ===
enum E { a, b, c }
2015-04-13 23:01:57 +02:00
>E : E, Symbol(E, Decl(additionOperatorWithStringAndEveryType.ts, 0, 0))
>a : E, Symbol(E.a, Decl(additionOperatorWithStringAndEveryType.ts, 0, 8))
>b : E, Symbol(E.b, Decl(additionOperatorWithStringAndEveryType.ts, 0, 11))
>c : E, Symbol(E.c, Decl(additionOperatorWithStringAndEveryType.ts, 0, 14))
2014-08-15 23:33:16 +02:00
var a: any;
2015-04-13 23:01:57 +02:00
>a : any, Symbol(a, Decl(additionOperatorWithStringAndEveryType.ts, 2, 3))
2014-08-15 23:33:16 +02:00
var b: boolean;
2015-04-13 23:01:57 +02:00
>b : boolean, Symbol(b, Decl(additionOperatorWithStringAndEveryType.ts, 3, 3))
2014-08-15 23:33:16 +02:00
var c: number;
2015-04-13 23:01:57 +02:00
>c : number, Symbol(c, Decl(additionOperatorWithStringAndEveryType.ts, 4, 3))
2014-08-15 23:33:16 +02:00
var d: string;
2015-04-13 23:01:57 +02:00
>d : string, Symbol(d, Decl(additionOperatorWithStringAndEveryType.ts, 5, 3))
2014-08-15 23:33:16 +02:00
var e: Object;
2015-04-13 23:01:57 +02:00
>e : Object, Symbol(e, Decl(additionOperatorWithStringAndEveryType.ts, 6, 3))
>Object : Object, Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11))
2014-08-15 23:33:16 +02:00
var f: void;
2015-04-13 23:01:57 +02:00
>f : void, Symbol(f, Decl(additionOperatorWithStringAndEveryType.ts, 7, 3))
2014-08-15 23:33:16 +02:00
var g: E;
2015-04-13 23:01:57 +02:00
>g : E, Symbol(g, Decl(additionOperatorWithStringAndEveryType.ts, 8, 3))
>E : E, Symbol(E, Decl(additionOperatorWithStringAndEveryType.ts, 0, 0))
2014-08-15 23:33:16 +02:00
var x: string;
2015-04-13 23:01:57 +02:00
>x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
2014-08-15 23:33:16 +02:00
// string could plus every type, and the result is always string
// string as left operand
var r1 = x + a;
2015-04-13 23:01:57 +02:00
>r1 : string, Symbol(r1, Decl(additionOperatorWithStringAndEveryType.ts, 14, 3))
2014-08-15 23:33:16 +02:00
>x + a : string
2015-04-13 23:01:57 +02:00
>x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
>a : any, Symbol(a, Decl(additionOperatorWithStringAndEveryType.ts, 2, 3))
2014-08-15 23:33:16 +02:00
var r2 = x + b;
2015-04-13 23:01:57 +02:00
>r2 : string, Symbol(r2, Decl(additionOperatorWithStringAndEveryType.ts, 15, 3))
2014-08-15 23:33:16 +02:00
>x + b : string
2015-04-13 23:01:57 +02:00
>x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
>b : boolean, Symbol(b, Decl(additionOperatorWithStringAndEveryType.ts, 3, 3))
2014-08-15 23:33:16 +02:00
var r3 = x + c;
2015-04-13 23:01:57 +02:00
>r3 : string, Symbol(r3, Decl(additionOperatorWithStringAndEveryType.ts, 16, 3))
2014-08-15 23:33:16 +02:00
>x + c : string
2015-04-13 23:01:57 +02:00
>x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
>c : number, Symbol(c, Decl(additionOperatorWithStringAndEveryType.ts, 4, 3))
2014-08-15 23:33:16 +02:00
var r4 = x + d;
2015-04-13 23:01:57 +02:00
>r4 : string, Symbol(r4, Decl(additionOperatorWithStringAndEveryType.ts, 17, 3))
2014-08-15 23:33:16 +02:00
>x + d : string
2015-04-13 23:01:57 +02:00
>x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
>d : string, Symbol(d, Decl(additionOperatorWithStringAndEveryType.ts, 5, 3))
2014-08-15 23:33:16 +02:00
var r5 = x + e;
2015-04-13 23:01:57 +02:00
>r5 : string, Symbol(r5, Decl(additionOperatorWithStringAndEveryType.ts, 18, 3))
2014-08-15 23:33:16 +02:00
>x + e : string
2015-04-13 23:01:57 +02:00
>x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
>e : Object, Symbol(e, Decl(additionOperatorWithStringAndEveryType.ts, 6, 3))
2014-08-15 23:33:16 +02:00
var r6 = x + f;
2015-04-13 23:01:57 +02:00
>r6 : string, Symbol(r6, Decl(additionOperatorWithStringAndEveryType.ts, 19, 3))
2014-08-15 23:33:16 +02:00
>x + f : string
2015-04-13 23:01:57 +02:00
>x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
>f : void, Symbol(f, Decl(additionOperatorWithStringAndEveryType.ts, 7, 3))
2014-08-15 23:33:16 +02:00
var r7 = x + g;
2015-04-13 23:01:57 +02:00
>r7 : string, Symbol(r7, Decl(additionOperatorWithStringAndEveryType.ts, 20, 3))
2014-08-15 23:33:16 +02:00
>x + g : string
2015-04-13 23:01:57 +02:00
>x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
>g : E, Symbol(g, Decl(additionOperatorWithStringAndEveryType.ts, 8, 3))
2014-08-15 23:33:16 +02:00
// string as right operand
var r8 = a + x;
2015-04-13 23:01:57 +02:00
>r8 : string, Symbol(r8, Decl(additionOperatorWithStringAndEveryType.ts, 23, 3))
2014-08-15 23:33:16 +02:00
>a + x : string
2015-04-13 23:01:57 +02:00
>a : any, Symbol(a, Decl(additionOperatorWithStringAndEveryType.ts, 2, 3))
>x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
2014-08-15 23:33:16 +02:00
var r9 = b + x;
2015-04-13 23:01:57 +02:00
>r9 : string, Symbol(r9, Decl(additionOperatorWithStringAndEveryType.ts, 24, 3))
2014-08-15 23:33:16 +02:00
>b + x : string
2015-04-13 23:01:57 +02:00
>b : boolean, Symbol(b, Decl(additionOperatorWithStringAndEveryType.ts, 3, 3))
>x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
2014-08-15 23:33:16 +02:00
var r10 = c + x;
2015-04-13 23:01:57 +02:00
>r10 : string, Symbol(r10, Decl(additionOperatorWithStringAndEveryType.ts, 25, 3))
2014-08-15 23:33:16 +02:00
>c + x : string
2015-04-13 23:01:57 +02:00
>c : number, Symbol(c, Decl(additionOperatorWithStringAndEveryType.ts, 4, 3))
>x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
2014-08-15 23:33:16 +02:00
var r11 = d + x;
2015-04-13 23:01:57 +02:00
>r11 : string, Symbol(r11, Decl(additionOperatorWithStringAndEveryType.ts, 26, 3))
2014-08-15 23:33:16 +02:00
>d + x : string
2015-04-13 23:01:57 +02:00
>d : string, Symbol(d, Decl(additionOperatorWithStringAndEveryType.ts, 5, 3))
>x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
2014-08-15 23:33:16 +02:00
var r12 = e + x;
2015-04-13 23:01:57 +02:00
>r12 : string, Symbol(r12, Decl(additionOperatorWithStringAndEveryType.ts, 27, 3))
2014-08-15 23:33:16 +02:00
>e + x : string
2015-04-13 23:01:57 +02:00
>e : Object, Symbol(e, Decl(additionOperatorWithStringAndEveryType.ts, 6, 3))
>x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
2014-08-15 23:33:16 +02:00
var r13 = f + x;
2015-04-13 23:01:57 +02:00
>r13 : string, Symbol(r13, Decl(additionOperatorWithStringAndEveryType.ts, 28, 3))
2014-08-15 23:33:16 +02:00
>f + x : string
2015-04-13 23:01:57 +02:00
>f : void, Symbol(f, Decl(additionOperatorWithStringAndEveryType.ts, 7, 3))
>x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
2014-08-15 23:33:16 +02:00
var r14 = g + x;
2015-04-13 23:01:57 +02:00
>r14 : string, Symbol(r14, Decl(additionOperatorWithStringAndEveryType.ts, 29, 3))
2014-08-15 23:33:16 +02:00
>g + x : string
2015-04-13 23:01:57 +02:00
>g : E, Symbol(g, Decl(additionOperatorWithStringAndEveryType.ts, 8, 3))
>x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
2014-08-15 23:33:16 +02:00
// other cases
var r15 = x + E;
2015-04-13 23:01:57 +02:00
>r15 : string, Symbol(r15, Decl(additionOperatorWithStringAndEveryType.ts, 32, 3))
2014-08-15 23:33:16 +02:00
>x + E : string
2015-04-13 23:01:57 +02:00
>x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
>E : typeof E, Symbol(E, Decl(additionOperatorWithStringAndEveryType.ts, 0, 0))
2014-08-15 23:33:16 +02:00
var r16 = x + E.a;
2015-04-13 23:01:57 +02:00
>r16 : string, Symbol(r16, Decl(additionOperatorWithStringAndEveryType.ts, 33, 3))
2014-08-15 23:33:16 +02:00
>x + E.a : string
2015-04-13 23:01:57 +02:00
>x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
>E.a : E, Symbol(E.a, Decl(additionOperatorWithStringAndEveryType.ts, 0, 8))
>E : typeof E, Symbol(E, Decl(additionOperatorWithStringAndEveryType.ts, 0, 0))
>a : E, Symbol(E.a, Decl(additionOperatorWithStringAndEveryType.ts, 0, 8))
2014-08-15 23:33:16 +02:00
var r17 = x + '';
2015-04-13 23:01:57 +02:00
>r17 : string, Symbol(r17, Decl(additionOperatorWithStringAndEveryType.ts, 34, 3))
2014-08-15 23:33:16 +02:00
>x + '' : string
2015-04-13 23:01:57 +02:00
>x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
2015-04-13 21:36:11 +02:00
>'' : string
2014-08-15 23:33:16 +02:00
var r18 = x + 0;
2015-04-13 23:01:57 +02:00
>r18 : string, Symbol(r18, Decl(additionOperatorWithStringAndEveryType.ts, 35, 3))
2014-08-15 23:33:16 +02:00
>x + 0 : string
2015-04-13 23:01:57 +02:00
>x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
2015-04-13 21:36:11 +02:00
>0 : number
2014-08-15 23:33:16 +02:00
var r19 = x + { a: '' };
2015-04-13 23:01:57 +02:00
>r19 : string, Symbol(r19, Decl(additionOperatorWithStringAndEveryType.ts, 36, 3))
2014-08-15 23:33:16 +02:00
>x + { a: '' } : string
2015-04-13 23:01:57 +02:00
>x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
2014-08-15 23:33:16 +02:00
>{ a: '' } : { a: string; }
2015-04-13 23:01:57 +02:00
>a : string, Symbol(a, Decl(additionOperatorWithStringAndEveryType.ts, 36, 15))
2015-04-13 21:36:11 +02:00
>'' : string
2014-08-15 23:33:16 +02:00
var r20 = x + [];
2015-04-13 23:01:57 +02:00
>r20 : string, Symbol(r20, Decl(additionOperatorWithStringAndEveryType.ts, 37, 3))
2014-08-15 23:33:16 +02:00
>x + [] : string
2015-04-13 23:01:57 +02:00
>x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
2014-08-15 23:33:16 +02:00
>[] : undefined[]