127 lines
5.3 KiB
Text
127 lines
5.3 KiB
Text
=== tests/cases/conformance/expressions/unaryOperators/voidOperator/voidOperatorWithNumberType.ts ===
|
|
// void operator on number type
|
|
var NUMBER: number;
|
|
>NUMBER : Symbol(NUMBER, Decl(voidOperatorWithNumberType.ts, 1, 3))
|
|
|
|
var NUMBER1: number[] = [1, 2];
|
|
>NUMBER1 : Symbol(NUMBER1, Decl(voidOperatorWithNumberType.ts, 2, 3))
|
|
|
|
function foo(): number { return 1; }
|
|
>foo : Symbol(foo, Decl(voidOperatorWithNumberType.ts, 2, 31))
|
|
|
|
class A {
|
|
>A : Symbol(A, Decl(voidOperatorWithNumberType.ts, 4, 36))
|
|
|
|
public a: number;
|
|
>a : Symbol(a, Decl(voidOperatorWithNumberType.ts, 6, 9))
|
|
|
|
static foo() { return 1; }
|
|
>foo : Symbol(A.foo, Decl(voidOperatorWithNumberType.ts, 7, 21))
|
|
}
|
|
module M {
|
|
>M : Symbol(M, Decl(voidOperatorWithNumberType.ts, 9, 1))
|
|
|
|
export var n: number;
|
|
>n : Symbol(n, Decl(voidOperatorWithNumberType.ts, 11, 14))
|
|
}
|
|
|
|
var objA = new A();
|
|
>objA : Symbol(objA, Decl(voidOperatorWithNumberType.ts, 14, 3))
|
|
>A : Symbol(A, Decl(voidOperatorWithNumberType.ts, 4, 36))
|
|
|
|
// number type var
|
|
var ResultIsAny1 = void NUMBER;
|
|
>ResultIsAny1 : Symbol(ResultIsAny1, Decl(voidOperatorWithNumberType.ts, 17, 3))
|
|
>NUMBER : Symbol(NUMBER, Decl(voidOperatorWithNumberType.ts, 1, 3))
|
|
|
|
var ResultIsAny2 = void NUMBER1;
|
|
>ResultIsAny2 : Symbol(ResultIsAny2, Decl(voidOperatorWithNumberType.ts, 18, 3))
|
|
>NUMBER1 : Symbol(NUMBER1, Decl(voidOperatorWithNumberType.ts, 2, 3))
|
|
|
|
// number type literal
|
|
var ResultIsAny3 = void 1;
|
|
>ResultIsAny3 : Symbol(ResultIsAny3, Decl(voidOperatorWithNumberType.ts, 21, 3))
|
|
|
|
var ResultIsAny4 = void { x: 1, y: 2};
|
|
>ResultIsAny4 : Symbol(ResultIsAny4, Decl(voidOperatorWithNumberType.ts, 22, 3))
|
|
>x : Symbol(x, Decl(voidOperatorWithNumberType.ts, 22, 25))
|
|
>y : Symbol(y, Decl(voidOperatorWithNumberType.ts, 22, 31))
|
|
|
|
var ResultIsAny5 = void { x: 1, y: (n: number) => { return n; } };
|
|
>ResultIsAny5 : Symbol(ResultIsAny5, Decl(voidOperatorWithNumberType.ts, 23, 3))
|
|
>x : Symbol(x, Decl(voidOperatorWithNumberType.ts, 23, 25))
|
|
>y : Symbol(y, Decl(voidOperatorWithNumberType.ts, 23, 31))
|
|
>n : Symbol(n, Decl(voidOperatorWithNumberType.ts, 23, 36))
|
|
>n : Symbol(n, Decl(voidOperatorWithNumberType.ts, 23, 36))
|
|
|
|
// number type expressions
|
|
var ResultIsAny6 = void objA.a;
|
|
>ResultIsAny6 : Symbol(ResultIsAny6, Decl(voidOperatorWithNumberType.ts, 26, 3))
|
|
>objA.a : Symbol(A.a, Decl(voidOperatorWithNumberType.ts, 6, 9))
|
|
>objA : Symbol(objA, Decl(voidOperatorWithNumberType.ts, 14, 3))
|
|
>a : Symbol(A.a, Decl(voidOperatorWithNumberType.ts, 6, 9))
|
|
|
|
var ResultIsAny7 = void M.n;
|
|
>ResultIsAny7 : Symbol(ResultIsAny7, Decl(voidOperatorWithNumberType.ts, 27, 3))
|
|
>M.n : Symbol(M.n, Decl(voidOperatorWithNumberType.ts, 11, 14))
|
|
>M : Symbol(M, Decl(voidOperatorWithNumberType.ts, 9, 1))
|
|
>n : Symbol(M.n, Decl(voidOperatorWithNumberType.ts, 11, 14))
|
|
|
|
var ResultIsAny8 = void NUMBER1[0];
|
|
>ResultIsAny8 : Symbol(ResultIsAny8, Decl(voidOperatorWithNumberType.ts, 28, 3))
|
|
>NUMBER1 : Symbol(NUMBER1, Decl(voidOperatorWithNumberType.ts, 2, 3))
|
|
|
|
var ResultIsAny9 = void foo();
|
|
>ResultIsAny9 : Symbol(ResultIsAny9, Decl(voidOperatorWithNumberType.ts, 29, 3))
|
|
>foo : Symbol(foo, Decl(voidOperatorWithNumberType.ts, 2, 31))
|
|
|
|
var ResultIsAny10 = void A.foo();
|
|
>ResultIsAny10 : Symbol(ResultIsAny10, Decl(voidOperatorWithNumberType.ts, 30, 3))
|
|
>A.foo : Symbol(A.foo, Decl(voidOperatorWithNumberType.ts, 7, 21))
|
|
>A : Symbol(A, Decl(voidOperatorWithNumberType.ts, 4, 36))
|
|
>foo : Symbol(A.foo, Decl(voidOperatorWithNumberType.ts, 7, 21))
|
|
|
|
var ResultIsAny11 = void (NUMBER + NUMBER);
|
|
>ResultIsAny11 : Symbol(ResultIsAny11, Decl(voidOperatorWithNumberType.ts, 31, 3))
|
|
>NUMBER : Symbol(NUMBER, Decl(voidOperatorWithNumberType.ts, 1, 3))
|
|
>NUMBER : Symbol(NUMBER, Decl(voidOperatorWithNumberType.ts, 1, 3))
|
|
|
|
// multiple void operators
|
|
var ResultIsAny12 = void void NUMBER;
|
|
>ResultIsAny12 : Symbol(ResultIsAny12, Decl(voidOperatorWithNumberType.ts, 34, 3))
|
|
>NUMBER : Symbol(NUMBER, Decl(voidOperatorWithNumberType.ts, 1, 3))
|
|
|
|
var ResultIsAny13 = void void void (NUMBER + NUMBER);
|
|
>ResultIsAny13 : Symbol(ResultIsAny13, Decl(voidOperatorWithNumberType.ts, 35, 3))
|
|
>NUMBER : Symbol(NUMBER, Decl(voidOperatorWithNumberType.ts, 1, 3))
|
|
>NUMBER : Symbol(NUMBER, Decl(voidOperatorWithNumberType.ts, 1, 3))
|
|
|
|
// miss assignment operators
|
|
void 1;
|
|
void NUMBER;
|
|
>NUMBER : Symbol(NUMBER, Decl(voidOperatorWithNumberType.ts, 1, 3))
|
|
|
|
void NUMBER1;
|
|
>NUMBER1 : Symbol(NUMBER1, Decl(voidOperatorWithNumberType.ts, 2, 3))
|
|
|
|
void foo();
|
|
>foo : Symbol(foo, Decl(voidOperatorWithNumberType.ts, 2, 31))
|
|
|
|
void objA.a;
|
|
>objA.a : Symbol(A.a, Decl(voidOperatorWithNumberType.ts, 6, 9))
|
|
>objA : Symbol(objA, Decl(voidOperatorWithNumberType.ts, 14, 3))
|
|
>a : Symbol(A.a, Decl(voidOperatorWithNumberType.ts, 6, 9))
|
|
|
|
void M.n;
|
|
>M.n : Symbol(M.n, Decl(voidOperatorWithNumberType.ts, 11, 14))
|
|
>M : Symbol(M, Decl(voidOperatorWithNumberType.ts, 9, 1))
|
|
>n : Symbol(M.n, Decl(voidOperatorWithNumberType.ts, 11, 14))
|
|
|
|
void objA.a, M.n;
|
|
>objA.a : Symbol(A.a, Decl(voidOperatorWithNumberType.ts, 6, 9))
|
|
>objA : Symbol(objA, Decl(voidOperatorWithNumberType.ts, 14, 3))
|
|
>a : Symbol(A.a, Decl(voidOperatorWithNumberType.ts, 6, 9))
|
|
>M.n : Symbol(M.n, Decl(voidOperatorWithNumberType.ts, 11, 14))
|
|
>M : Symbol(M, Decl(voidOperatorWithNumberType.ts, 9, 1))
|
|
>n : Symbol(M.n, Decl(voidOperatorWithNumberType.ts, 11, 14))
|
|
|