122 lines
5.6 KiB
Text
122 lines
5.6 KiB
Text
=== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithStringType.ts ===
|
|
// ~ operator on string type
|
|
var STRING: string;
|
|
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
|
|
|
|
var STRING1: string[] = ["", "abc"];
|
|
>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
|
|
|
|
function foo(): string { return "abc"; }
|
|
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 2, 36))
|
|
|
|
class A {
|
|
>A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 4, 40))
|
|
|
|
public a: string;
|
|
>a : Symbol(a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9))
|
|
|
|
static foo() { return ""; }
|
|
>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 7, 21))
|
|
}
|
|
module M {
|
|
>M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 9, 1))
|
|
|
|
export var n: string;
|
|
>n : Symbol(n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14))
|
|
}
|
|
|
|
var objA = new A();
|
|
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 14, 3))
|
|
>A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 4, 40))
|
|
|
|
// string type var
|
|
var ResultIsNumber1 = ~STRING;
|
|
>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithStringType.ts, 17, 3))
|
|
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
|
|
|
|
var ResultIsNumber2 = ~STRING1;
|
|
>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithStringType.ts, 18, 3))
|
|
>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
|
|
|
|
// string type literal
|
|
var ResultIsNumber3 = ~"";
|
|
>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithStringType.ts, 21, 3))
|
|
|
|
var ResultIsNumber4 = ~{ x: "", y: "" };
|
|
>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithStringType.ts, 22, 3))
|
|
>x : Symbol(x, Decl(bitwiseNotOperatorWithStringType.ts, 22, 24))
|
|
>y : Symbol(y, Decl(bitwiseNotOperatorWithStringType.ts, 22, 31))
|
|
|
|
var ResultIsNumber5 = ~{ x: "", y: (s: string) => { return s; } };
|
|
>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(bitwiseNotOperatorWithStringType.ts, 23, 3))
|
|
>x : Symbol(x, Decl(bitwiseNotOperatorWithStringType.ts, 23, 24))
|
|
>y : Symbol(y, Decl(bitwiseNotOperatorWithStringType.ts, 23, 31))
|
|
>s : Symbol(s, Decl(bitwiseNotOperatorWithStringType.ts, 23, 36))
|
|
>s : Symbol(s, Decl(bitwiseNotOperatorWithStringType.ts, 23, 36))
|
|
|
|
// string type expressions
|
|
var ResultIsNumber6 = ~objA.a;
|
|
>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(bitwiseNotOperatorWithStringType.ts, 26, 3))
|
|
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9))
|
|
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 14, 3))
|
|
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9))
|
|
|
|
var ResultIsNumber7 = ~M.n;
|
|
>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(bitwiseNotOperatorWithStringType.ts, 27, 3))
|
|
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14))
|
|
>M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 9, 1))
|
|
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14))
|
|
|
|
var ResultIsNumber8 = ~STRING1[0];
|
|
>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(bitwiseNotOperatorWithStringType.ts, 28, 3))
|
|
>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
|
|
|
|
var ResultIsNumber9 = ~foo();
|
|
>ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(bitwiseNotOperatorWithStringType.ts, 29, 3))
|
|
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 2, 36))
|
|
|
|
var ResultIsNumber10 = ~A.foo();
|
|
>ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(bitwiseNotOperatorWithStringType.ts, 30, 3))
|
|
>A.foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 7, 21))
|
|
>A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 4, 40))
|
|
>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 7, 21))
|
|
|
|
var ResultIsNumber11 = ~(STRING + STRING);
|
|
>ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(bitwiseNotOperatorWithStringType.ts, 31, 3))
|
|
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
|
|
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
|
|
|
|
var ResultIsNumber12 = ~STRING.charAt(0);
|
|
>ResultIsNumber12 : Symbol(ResultIsNumber12, Decl(bitwiseNotOperatorWithStringType.ts, 32, 3))
|
|
>STRING.charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23))
|
|
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
|
|
>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23))
|
|
|
|
// multiple ~ operators
|
|
var ResultIsNumber13 = ~~STRING;
|
|
>ResultIsNumber13 : Symbol(ResultIsNumber13, Decl(bitwiseNotOperatorWithStringType.ts, 35, 3))
|
|
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
|
|
|
|
var ResultIsNumber14 = ~~~(STRING + STRING);
|
|
>ResultIsNumber14 : Symbol(ResultIsNumber14, Decl(bitwiseNotOperatorWithStringType.ts, 36, 3))
|
|
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
|
|
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
|
|
|
|
//miss assignment operators
|
|
~STRING;
|
|
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
|
|
|
|
~STRING1;
|
|
>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
|
|
|
|
~foo();
|
|
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 2, 36))
|
|
|
|
~objA.a,M.n;
|
|
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9))
|
|
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 14, 3))
|
|
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9))
|
|
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14))
|
|
>M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 9, 1))
|
|
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14))
|
|
|