TypeScript/tests/baselines/reference/inOperatorWithValidOperands.symbols
2015-04-15 16:44:20 -07:00

94 lines
3.6 KiB
Plaintext

=== tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithValidOperands.ts ===
var x: any;
>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3))
// valid left operands
// the left operand is required to be of type Any, the String primitive type, or the Number primitive type
var a1: string;
>a1 : Symbol(a1, Decl(inOperatorWithValidOperands.ts, 4, 3))
var a2: number;
>a2 : Symbol(a2, Decl(inOperatorWithValidOperands.ts, 5, 3))
var ra1 = x in x;
>ra1 : Symbol(ra1, Decl(inOperatorWithValidOperands.ts, 7, 3))
>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3))
>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3))
var ra2 = a1 in x;
>ra2 : Symbol(ra2, Decl(inOperatorWithValidOperands.ts, 8, 3))
>a1 : Symbol(a1, Decl(inOperatorWithValidOperands.ts, 4, 3))
>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3))
var ra3 = a2 in x;
>ra3 : Symbol(ra3, Decl(inOperatorWithValidOperands.ts, 9, 3))
>a2 : Symbol(a2, Decl(inOperatorWithValidOperands.ts, 5, 3))
>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3))
var ra4 = '' in x;
>ra4 : Symbol(ra4, Decl(inOperatorWithValidOperands.ts, 10, 3))
>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3))
var ra5 = 0 in x;
>ra5 : Symbol(ra5, Decl(inOperatorWithValidOperands.ts, 11, 3))
>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3))
// valid right operands
// the right operand is required to be of type Any, an object type, or a type parameter type
var b1: {};
>b1 : Symbol(b1, Decl(inOperatorWithValidOperands.ts, 15, 3))
var rb1 = x in b1;
>rb1 : Symbol(rb1, Decl(inOperatorWithValidOperands.ts, 17, 3))
>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3))
>b1 : Symbol(b1, Decl(inOperatorWithValidOperands.ts, 15, 3))
var rb2 = x in {};
>rb2 : Symbol(rb2, Decl(inOperatorWithValidOperands.ts, 18, 3))
>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3))
function foo<T>(t: T) {
>foo : Symbol(foo, Decl(inOperatorWithValidOperands.ts, 18, 18))
>T : Symbol(T, Decl(inOperatorWithValidOperands.ts, 20, 13))
>t : Symbol(t, Decl(inOperatorWithValidOperands.ts, 20, 16))
>T : Symbol(T, Decl(inOperatorWithValidOperands.ts, 20, 13))
var rb3 = x in t;
>rb3 : Symbol(rb3, Decl(inOperatorWithValidOperands.ts, 21, 7))
>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3))
>t : Symbol(t, Decl(inOperatorWithValidOperands.ts, 20, 16))
}
interface X { x: number }
>X : Symbol(X, Decl(inOperatorWithValidOperands.ts, 22, 1))
>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 24, 13))
interface Y { y: number }
>Y : Symbol(Y, Decl(inOperatorWithValidOperands.ts, 24, 25))
>y : Symbol(y, Decl(inOperatorWithValidOperands.ts, 25, 13))
var c1: X | Y;
>c1 : Symbol(c1, Decl(inOperatorWithValidOperands.ts, 27, 3))
>X : Symbol(X, Decl(inOperatorWithValidOperands.ts, 22, 1))
>Y : Symbol(Y, Decl(inOperatorWithValidOperands.ts, 24, 25))
var c2: X;
>c2 : Symbol(c2, Decl(inOperatorWithValidOperands.ts, 28, 3))
>X : Symbol(X, Decl(inOperatorWithValidOperands.ts, 22, 1))
var c3: Y;
>c3 : Symbol(c3, Decl(inOperatorWithValidOperands.ts, 29, 3))
>Y : Symbol(Y, Decl(inOperatorWithValidOperands.ts, 24, 25))
var rc1 = x in c1;
>rc1 : Symbol(rc1, Decl(inOperatorWithValidOperands.ts, 31, 3))
>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3))
>c1 : Symbol(c1, Decl(inOperatorWithValidOperands.ts, 27, 3))
var rc2 = x in (c2 || c3);
>rc2 : Symbol(rc2, Decl(inOperatorWithValidOperands.ts, 32, 3))
>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3))
>c2 : Symbol(c2, Decl(inOperatorWithValidOperands.ts, 28, 3))
>c3 : Symbol(c3, Decl(inOperatorWithValidOperands.ts, 29, 3))