1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
=== tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithBooleanType.ts ===
// delete operator on boolean type
var BOOLEAN: boolean;
>BOOLEAN : Symbol(BOOLEAN, Decl(deleteOperatorWithBooleanType.ts, 1, 3))
function foo(): boolean { return true; }
>foo : Symbol(foo, Decl(deleteOperatorWithBooleanType.ts, 1, 21))
class A {
>A : Symbol(A, Decl(deleteOperatorWithBooleanType.ts, 3, 40))
public a: boolean;
>a : Symbol(A.a, Decl(deleteOperatorWithBooleanType.ts, 5, 9))
static foo() { return false; }
>foo : Symbol(A.foo, Decl(deleteOperatorWithBooleanType.ts, 6, 22))
}
module M {
>M : Symbol(M, Decl(deleteOperatorWithBooleanType.ts, 8, 1))
export var n: boolean;
>n : Symbol(n, Decl(deleteOperatorWithBooleanType.ts, 10, 14))
}
var objA = new A();
>objA : Symbol(objA, Decl(deleteOperatorWithBooleanType.ts, 13, 3))
>A : Symbol(A, Decl(deleteOperatorWithBooleanType.ts, 3, 40))
// boolean type var
var ResultIsBoolean1 = delete BOOLEAN;
>ResultIsBoolean1 : Symbol(ResultIsBoolean1, Decl(deleteOperatorWithBooleanType.ts, 16, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(deleteOperatorWithBooleanType.ts, 1, 3))
// boolean type literal
var ResultIsBoolean2 = delete true;
>ResultIsBoolean2 : Symbol(ResultIsBoolean2, Decl(deleteOperatorWithBooleanType.ts, 19, 3))
var ResultIsBoolean3 = delete { x: true, y: false };
>ResultIsBoolean3 : Symbol(ResultIsBoolean3, Decl(deleteOperatorWithBooleanType.ts, 20, 3))
>x : Symbol(x, Decl(deleteOperatorWithBooleanType.ts, 20, 31))
>y : Symbol(y, Decl(deleteOperatorWithBooleanType.ts, 20, 40))
// boolean type expressions
var ResultIsBoolean4 = delete objA.a;
>ResultIsBoolean4 : Symbol(ResultIsBoolean4, Decl(deleteOperatorWithBooleanType.ts, 23, 3))
>objA.a : Symbol(A.a, Decl(deleteOperatorWithBooleanType.ts, 5, 9))
>objA : Symbol(objA, Decl(deleteOperatorWithBooleanType.ts, 13, 3))
>a : Symbol(A.a, Decl(deleteOperatorWithBooleanType.ts, 5, 9))
var ResultIsBoolean5 = delete M.n;
>ResultIsBoolean5 : Symbol(ResultIsBoolean5, Decl(deleteOperatorWithBooleanType.ts, 24, 3))
>M.n : Symbol(M.n, Decl(deleteOperatorWithBooleanType.ts, 10, 14))
>M : Symbol(M, Decl(deleteOperatorWithBooleanType.ts, 8, 1))
>n : Symbol(M.n, Decl(deleteOperatorWithBooleanType.ts, 10, 14))
var ResultIsBoolean6 = delete foo();
>ResultIsBoolean6 : Symbol(ResultIsBoolean6, Decl(deleteOperatorWithBooleanType.ts, 25, 3))
>foo : Symbol(foo, Decl(deleteOperatorWithBooleanType.ts, 1, 21))
var ResultIsBoolean7 = delete A.foo();
>ResultIsBoolean7 : Symbol(ResultIsBoolean7, Decl(deleteOperatorWithBooleanType.ts, 26, 3))
>A.foo : Symbol(A.foo, Decl(deleteOperatorWithBooleanType.ts, 6, 22))
>A : Symbol(A, Decl(deleteOperatorWithBooleanType.ts, 3, 40))
>foo : Symbol(A.foo, Decl(deleteOperatorWithBooleanType.ts, 6, 22))
// multiple delete operator
var ResultIsBoolean8 = delete delete BOOLEAN;
>ResultIsBoolean8 : Symbol(ResultIsBoolean8, Decl(deleteOperatorWithBooleanType.ts, 29, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(deleteOperatorWithBooleanType.ts, 1, 3))
// miss assignment operators
delete true;
delete BOOLEAN;
>BOOLEAN : Symbol(BOOLEAN, Decl(deleteOperatorWithBooleanType.ts, 1, 3))
delete foo();
>foo : Symbol(foo, Decl(deleteOperatorWithBooleanType.ts, 1, 21))
delete true, false;
delete objA.a;
>objA.a : Symbol(A.a, Decl(deleteOperatorWithBooleanType.ts, 5, 9))
>objA : Symbol(objA, Decl(deleteOperatorWithBooleanType.ts, 13, 3))
>a : Symbol(A.a, Decl(deleteOperatorWithBooleanType.ts, 5, 9))
delete M.n;
>M.n : Symbol(M.n, Decl(deleteOperatorWithBooleanType.ts, 10, 14))
>M : Symbol(M, Decl(deleteOperatorWithBooleanType.ts, 8, 1))
>n : Symbol(M.n, Decl(deleteOperatorWithBooleanType.ts, 10, 14))
|