143 lines
6.2 KiB
Text
143 lines
6.2 KiB
Text
=== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithAnyAndEveryType.ts ===
|
|
function foo() { }
|
|
>foo : Symbol(foo, Decl(additionOperatorWithAnyAndEveryType.ts, 0, 0))
|
|
|
|
class C {
|
|
>C : Symbol(C, Decl(additionOperatorWithAnyAndEveryType.ts, 0, 18))
|
|
|
|
public a: string;
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 1, 9))
|
|
|
|
static foo() { }
|
|
>foo : Symbol(C.foo, Decl(additionOperatorWithAnyAndEveryType.ts, 2, 21))
|
|
}
|
|
enum E { a, b, c }
|
|
>E : Symbol(E, Decl(additionOperatorWithAnyAndEveryType.ts, 4, 1))
|
|
>a : Symbol(E.a, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 8))
|
|
>b : Symbol(E.b, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 11))
|
|
>c : Symbol(E.c, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 14))
|
|
|
|
module M { export var a }
|
|
>M : Symbol(M, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 18))
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 6, 21))
|
|
|
|
var a: any;
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
|
|
|
|
var b: boolean;
|
|
>b : Symbol(b, Decl(additionOperatorWithAnyAndEveryType.ts, 9, 3))
|
|
|
|
var c: number;
|
|
>c : Symbol(c, Decl(additionOperatorWithAnyAndEveryType.ts, 10, 3))
|
|
|
|
var d: string;
|
|
>d : Symbol(d, Decl(additionOperatorWithAnyAndEveryType.ts, 11, 3))
|
|
|
|
var e: Object;
|
|
>e : Symbol(e, Decl(additionOperatorWithAnyAndEveryType.ts, 12, 3))
|
|
>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11))
|
|
|
|
// any as left operand, result is type Any except plusing string
|
|
var r1 = a + a;
|
|
>r1 : Symbol(r1, Decl(additionOperatorWithAnyAndEveryType.ts, 15, 3))
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
|
|
|
|
var r2 = a + b;
|
|
>r2 : Symbol(r2, Decl(additionOperatorWithAnyAndEveryType.ts, 16, 3))
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
|
|
>b : Symbol(b, Decl(additionOperatorWithAnyAndEveryType.ts, 9, 3))
|
|
|
|
var r3 = a + c;
|
|
>r3 : Symbol(r3, Decl(additionOperatorWithAnyAndEveryType.ts, 17, 3))
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
|
|
>c : Symbol(c, Decl(additionOperatorWithAnyAndEveryType.ts, 10, 3))
|
|
|
|
var r4 = a + d;
|
|
>r4 : Symbol(r4, Decl(additionOperatorWithAnyAndEveryType.ts, 18, 3))
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
|
|
>d : Symbol(d, Decl(additionOperatorWithAnyAndEveryType.ts, 11, 3))
|
|
|
|
var r5 = a + e;
|
|
>r5 : Symbol(r5, Decl(additionOperatorWithAnyAndEveryType.ts, 19, 3))
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
|
|
>e : Symbol(e, Decl(additionOperatorWithAnyAndEveryType.ts, 12, 3))
|
|
|
|
// any as right operand, result is type Any except plusing string
|
|
var r6 = b + a;
|
|
>r6 : Symbol(r6, Decl(additionOperatorWithAnyAndEveryType.ts, 22, 3))
|
|
>b : Symbol(b, Decl(additionOperatorWithAnyAndEveryType.ts, 9, 3))
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
|
|
|
|
var r7 = c + a;
|
|
>r7 : Symbol(r7, Decl(additionOperatorWithAnyAndEveryType.ts, 23, 3))
|
|
>c : Symbol(c, Decl(additionOperatorWithAnyAndEveryType.ts, 10, 3))
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
|
|
|
|
var r8 = d + a;
|
|
>r8 : Symbol(r8, Decl(additionOperatorWithAnyAndEveryType.ts, 24, 3))
|
|
>d : Symbol(d, Decl(additionOperatorWithAnyAndEveryType.ts, 11, 3))
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
|
|
|
|
var r9 = e + a;
|
|
>r9 : Symbol(r9, Decl(additionOperatorWithAnyAndEveryType.ts, 25, 3))
|
|
>e : Symbol(e, Decl(additionOperatorWithAnyAndEveryType.ts, 12, 3))
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
|
|
|
|
// other cases
|
|
var r10 = a + foo;
|
|
>r10 : Symbol(r10, Decl(additionOperatorWithAnyAndEveryType.ts, 28, 3))
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
|
|
>foo : Symbol(foo, Decl(additionOperatorWithAnyAndEveryType.ts, 0, 0))
|
|
|
|
var r11 = a + foo();
|
|
>r11 : Symbol(r11, Decl(additionOperatorWithAnyAndEveryType.ts, 29, 3))
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
|
|
>foo : Symbol(foo, Decl(additionOperatorWithAnyAndEveryType.ts, 0, 0))
|
|
|
|
var r12 = a + C;
|
|
>r12 : Symbol(r12, Decl(additionOperatorWithAnyAndEveryType.ts, 30, 3))
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
|
|
>C : Symbol(C, Decl(additionOperatorWithAnyAndEveryType.ts, 0, 18))
|
|
|
|
var r13 = a + new C();
|
|
>r13 : Symbol(r13, Decl(additionOperatorWithAnyAndEveryType.ts, 31, 3))
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
|
|
>C : Symbol(C, Decl(additionOperatorWithAnyAndEveryType.ts, 0, 18))
|
|
|
|
var r14 = a + E;
|
|
>r14 : Symbol(r14, Decl(additionOperatorWithAnyAndEveryType.ts, 32, 3))
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
|
|
>E : Symbol(E, Decl(additionOperatorWithAnyAndEveryType.ts, 4, 1))
|
|
|
|
var r15 = a + E.a;
|
|
>r15 : Symbol(r15, Decl(additionOperatorWithAnyAndEveryType.ts, 33, 3))
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
|
|
>E.a : Symbol(E.a, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 8))
|
|
>E : Symbol(E, Decl(additionOperatorWithAnyAndEveryType.ts, 4, 1))
|
|
>a : Symbol(E.a, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 8))
|
|
|
|
var r16 = a + M;
|
|
>r16 : Symbol(r16, Decl(additionOperatorWithAnyAndEveryType.ts, 34, 3))
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
|
|
>M : Symbol(M, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 18))
|
|
|
|
var r17 = a + '';
|
|
>r17 : Symbol(r17, Decl(additionOperatorWithAnyAndEveryType.ts, 35, 3))
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
|
|
|
|
var r18 = a + 123;
|
|
>r18 : Symbol(r18, Decl(additionOperatorWithAnyAndEveryType.ts, 36, 3))
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
|
|
|
|
var r19 = a + { a: '' };
|
|
>r19 : Symbol(r19, Decl(additionOperatorWithAnyAndEveryType.ts, 37, 3))
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 37, 15))
|
|
|
|
var r20 = a + ((a: string) => { return a });
|
|
>r20 : Symbol(r20, Decl(additionOperatorWithAnyAndEveryType.ts, 38, 3))
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 38, 16))
|
|
>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 38, 16))
|
|
|