TypeScript/tests/baselines/reference/commaOperatorOtherValidOperation.types

64 lines
2.5 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/conformance/expressions/commaOperator/commaOperatorOtherValidOperation.ts ===
//Comma operator in for loop
for (var i = 0, j = 10; i < j; i++, j--)
2015-04-13 23:01:57 +02:00
>i : number, Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 1, 8))
2015-04-13 21:36:11 +02:00
>0 : number
2015-04-13 23:01:57 +02:00
>j : number, Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 1, 15))
2015-04-13 21:36:11 +02:00
>10 : number
2014-08-15 23:33:16 +02:00
>i < j : boolean
2015-04-13 23:01:57 +02:00
>i : number, Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 1, 8))
>j : number, Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 1, 15))
2014-08-15 23:33:16 +02:00
>i++, j-- : number
>i++ : number
2015-04-13 23:01:57 +02:00
>i : number, Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 1, 8))
2014-08-15 23:33:16 +02:00
>j-- : number
2015-04-13 23:01:57 +02:00
>j : number, Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 1, 15))
2014-08-15 23:33:16 +02:00
{
}
//Comma operator in fuction arguments and return
function foo(x: number, y: string)
2015-04-13 23:01:57 +02:00
>foo : (x: number, y: string) => string, Symbol(foo, Decl(commaOperatorOtherValidOperation.ts, 3, 1))
>x : number, Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 6, 13))
>y : string, Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 6, 23))
2014-08-15 23:33:16 +02:00
{
return x, y;
>x, y : string
2015-04-13 23:01:57 +02:00
>x : number, Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 6, 13))
>y : string, Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 6, 23))
2014-08-15 23:33:16 +02:00
}
var resultIsString = foo(1, "123");
2015-04-13 23:01:57 +02:00
>resultIsString : string, Symbol(resultIsString, Decl(commaOperatorOtherValidOperation.ts, 10, 3))
2014-08-15 23:33:16 +02:00
>foo(1, "123") : string
2015-04-13 23:01:57 +02:00
>foo : (x: number, y: string) => string, Symbol(foo, Decl(commaOperatorOtherValidOperation.ts, 3, 1))
2015-04-13 21:36:11 +02:00
>1 : number
>"123" : string
2014-08-15 23:33:16 +02:00
//TypeParameters
function foo1<T1, T2>()
2015-04-13 23:01:57 +02:00
>foo1 : <T1, T2>() => void, Symbol(foo1, Decl(commaOperatorOtherValidOperation.ts, 10, 35))
>T1 : T1, Symbol(T1, Decl(commaOperatorOtherValidOperation.ts, 13, 14))
>T2 : T2, Symbol(T2, Decl(commaOperatorOtherValidOperation.ts, 13, 17))
2014-08-15 23:33:16 +02:00
{
var x: T1;
2015-04-13 23:01:57 +02:00
>x : T1, Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 15, 7))
>T1 : T1, Symbol(T1, Decl(commaOperatorOtherValidOperation.ts, 13, 14))
2014-08-15 23:33:16 +02:00
var y: T2;
2015-04-13 23:01:57 +02:00
>y : T2, Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 16, 7))
>T2 : T2, Symbol(T2, Decl(commaOperatorOtherValidOperation.ts, 13, 17))
2014-08-15 23:33:16 +02:00
x, y;
>x, y : T2
2015-04-13 23:01:57 +02:00
>x : T1, Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 15, 7))
>y : T2, Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 16, 7))
2014-08-15 23:33:16 +02:00
var resultIsT1 = (y, x);
2015-04-13 23:01:57 +02:00
>resultIsT1 : T1, Symbol(resultIsT1, Decl(commaOperatorOtherValidOperation.ts, 18, 7))
2014-08-15 23:33:16 +02:00
>(y, x) : T1
>y, x : T1
2015-04-13 23:01:57 +02:00
>y : T2, Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 16, 7))
>x : T1, Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 15, 7))
2014-08-15 23:33:16 +02:00
}