89 lines
3.7 KiB
Text
89 lines
3.7 KiB
Text
=== 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, 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))
|
|
|