TypeScript/tests/baselines/reference/commaOperatorOtherValidOperation.types
2015-04-13 14:29:37 -07:00

64 lines
2.5 KiB
Plaintext

=== tests/cases/conformance/expressions/commaOperator/commaOperatorOtherValidOperation.ts ===
//Comma operator in for loop
for (var i = 0, j = 10; i < j; i++, j--)
>i : number, Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 1, 8))
>0 : number
>j : number, Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 1, 15))
>10 : number
>i < j : boolean
>i : number, Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 1, 8))
>j : number, Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 1, 15))
>i++, j-- : number
>i++ : number
>i : number, Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 1, 8))
>j-- : number
>j : number, Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 1, 15))
{
}
//Comma operator in fuction arguments and return
function foo(x: number, y: string)
>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))
{
return x, y;
>x, y : string
>x : number, Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 6, 13))
>y : string, Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 6, 23))
}
var resultIsString = foo(1, "123");
>resultIsString : string, Symbol(resultIsString, Decl(commaOperatorOtherValidOperation.ts, 10, 3))
>foo(1, "123") : string
>foo : (x: number, y: string) => string, Symbol(foo, Decl(commaOperatorOtherValidOperation.ts, 3, 1))
>1 : number
>"123" : string
//TypeParameters
function foo1<T1, T2>()
>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))
{
var x: T1;
>x : T1, Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 15, 7))
>T1 : T1, Symbol(T1, Decl(commaOperatorOtherValidOperation.ts, 13, 14))
var y: T2;
>y : T2, Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 16, 7))
>T2 : T2, Symbol(T2, Decl(commaOperatorOtherValidOperation.ts, 13, 17))
x, y;
>x, y : T2
>x : T1, Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 15, 7))
>y : T2, Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 16, 7))
var resultIsT1 = (y, x);
>resultIsT1 : T1, Symbol(resultIsT1, Decl(commaOperatorOtherValidOperation.ts, 18, 7))
>(y, x) : T1
>y, x : T1
>y : T2, Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 16, 7))
>x : T1, Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 15, 7))
}