/arkcompiler/ets_runtime/test/typeinfer/automatedcases/ |
D | templateStringBinaryOperationsES6.ts | 20 declare function AssertType(value:any, type:string):void; function 22 AssertType(a, "string"); 23 AssertType(1 + `${ 3 }`, "string"); 24 AssertType(1, "int"); 25 AssertType(`${ 3 }`, "string"); 26 AssertType(3, "int"); 29 AssertType(b, "string"); 30 AssertType(1 + `2${ 3 }`, "string"); 31 AssertType(1, "int"); 32 AssertType(`2${ 3 }`, "string"); [all …]
|
D | templateStringBinaryOperations.ts | 20 declare function AssertType(value:any, type:string):void; function 22 AssertType(a, "string"); 23 AssertType(1 + `${ 3 }`, "string"); 24 AssertType(1, "int"); 25 AssertType(`${ 3 }`, "string"); 26 AssertType(3, "int"); 29 AssertType(b, "string"); 30 AssertType(1 + `2${ 3 }`, "string"); 31 AssertType(1, "int"); 32 AssertType(`2${ 3 }`, "string"); [all …]
|
D | emitExponentiationOperator1.ts | 20 declare function AssertType(value:any, type:string):void; function 22 AssertType(1 ** -2, "number"); 23 AssertType(1, "int"); 24 AssertType(-2, "int"); 25 AssertType(2, "int"); 28 AssertType(1 ** 2, "number"); 29 AssertType(1, "int"); 30 AssertType(2, "int"); 33 AssertType((-1) ** 2, "number"); 34 AssertType((-1), "int"); [all …]
|
D | convertClassExpressionToFunctionFromObjectProperty2.ts | 20 declare function AssertType(value:any, type:string):void; function 22 AssertType({ x: class { constructor() { } }, y: class { constructor() { } … 23 AssertType(({ x: class { constructor() { } }, y: class { constructor() { } … 26 AssertType(x, "typeof x"); 27 AssertType(class { constructor() { } }, "typeof x"); 32 AssertType(y, "typeof y"); 33 AssertType(class { constructor() { } }, "typeof y"); 40 AssertType(break, "typeof break"); 41 AssertType(class { constructor() { } }, "typeof break"); 46 AssertType(case, "typeof case"); [all …]
|
D | manyConstExports.ts | 20 declare function AssertType(value:any, type:string):void; function 22 AssertType(exp0, "string"); 23 AssertType("test", "string"); 26 AssertType(exp1, "string"); 27 AssertType("test", "string"); 30 AssertType(exp2, "string"); 31 AssertType("test", "string"); 34 AssertType(exp3, "string"); 35 AssertType("test", "string"); 38 AssertType(exp4, "string"); [all …]
|
D | emitExponentiationOperator3.ts | 20 declare function AssertType(value:any, type:string):void; function 22 AssertType(temp, "number"); 23 AssertType(10, "int"); 26 AssertType((-++temp) ** 3, "number"); 27 AssertType((-++temp), "number"); 28 AssertType(-++temp, "number"); 29 AssertType(++temp, "number"); 30 AssertType(temp, "number"); 31 AssertType(3, "int"); 34 AssertType((+--temp) ** 3, "number"); [all …]
|
D | asyncMethodWithSuper_es6.ts | 20 declare function AssertType(value:any, type:string):void; function 33 AssertType(super.x(), "void"); 34 AssertType(super.x, "() => void"); 35 AssertType(super, "A"); 39 AssertType(super.y(), "void"); 40 AssertType(super.y, "() => void"); 41 AssertType(super, "A"); 45 AssertType(super["x"](), "void"); 46 AssertType(super["x"], "() => void"); 47 AssertType(super, "A"); [all …]
|
D | arrayBestCommonTypes.ts | 20 declare function AssertType(value:any, type:string):void; function 33 AssertType(null, "null"); 39 AssertType(<number>(this.voidIfAny([4, 2][0])), "number"); 40 AssertType((this.voidIfAny([4, 2][0])), "number"); 41 AssertType(this.voidIfAny([4, 2][0]), "number"); 42 AssertType(this.voidIfAny, "{ (boolean, ?boolean): number; (string, ?boolean): number; (number, ?bo… 43 AssertType(this, "this"); 44 AssertType([4, 2][0], "number"); 45 AssertType([4, 2], "number[]"); 46 AssertType(4, "int"); [all …]
|
D | emitExponentiationOperator2.ts | 20 declare function AssertType(value:any, type:string):void; function 22 AssertType(temp, "number"); 23 AssertType(10, "int"); 26 AssertType(++temp ** 3, "number"); 27 AssertType(++temp, "number"); 28 AssertType(temp, "number"); 29 AssertType(3, "int"); 32 AssertType(--temp ** 3, "number"); 33 AssertType(--temp, "number"); 34 AssertType(temp, "number"); [all …]
|
D | nullIsSubtypeOfEverythingButUndefined.ts | 20 declare function AssertType(value:any, type:string):void; function 24 AssertType(r0, "any"); 25 AssertType(true ? null : null, "null"); 26 AssertType(true, "boolean"); 27 AssertType(null, "null"); 28 AssertType(null, "null"); 31 AssertType(r0, "any"); 32 AssertType(true ? null : null, "null"); 33 AssertType(true, "boolean"); 34 AssertType(null, "null"); [all …]
|
D | newWithSpreadES6.ts | 20 declare function AssertType(value:any, type:string):void; function 46 AssertType(a, "string[]"); 49 AssertType(b, "A"); 52 AssertType(c, "C"); 55 AssertType(d, "A[]"); 58 AssertType(e, "{ [string]: A; }"); 59 AssertType(key, "string"); 62 AssertType(g, "C[]"); 65 AssertType(h, "{ [string]: C; }"); 66 AssertType(key, "string"); [all …]
|
D | newWithSpreadES5.ts | 20 declare function AssertType(value:any, type:string):void; function 45 AssertType(a, "string[]"); 48 AssertType(b, "A"); 51 AssertType(c, "C"); 54 AssertType(d, "A[]"); 57 AssertType(e, "{ [string]: A; }"); 58 AssertType(key, "string"); 61 AssertType(g, "C[]"); 64 AssertType(h, "{ [string]: C; }"); 65 AssertType(key, "string"); [all …]
|
D | convertClassExpressionToFunctionFromObjectProperty1.ts | 20 declare function AssertType(value:any, type:string):void; function 22 AssertType(foo, "any"); 23 AssertType({}, "{}"); 27 AssertType(foo.x = class { constructor () {}}, "typeof x"); 28 AssertType(foo.x, "any"); 29 AssertType(class { constructor () {}}, "typeof x"); 34 AssertType(foo.y = class { constructor () {}}, "typeof y"); 35 AssertType(foo.y, "any"); 36 AssertType(class { constructor () {}}, "typeof y"); 43 AssertType(foo.break = class { constructor () {}}, "typeof break"); [all …]
|
D | jsDeclarationsFunctionKeywordPropExhaustive.ts | 20 declare function AssertType(value:any, type:string):void; function 24 AssertType(foo.x = 1, "int"); 25 AssertType(foo.x, "number"); 26 AssertType(1, "int"); 29 AssertType(foo.y = 1, "int"); 30 AssertType(foo.y, "number"); 31 AssertType(1, "int"); 35 AssertType(foo.break = 1, "int"); 36 AssertType(foo.break, "number"); 37 AssertType(1, "int"); [all …]
|
D | nullPropertyName.ts | 20 declare function AssertType(value:any, type:string):void; function 24 AssertType(foo.x = 1, "int"); 25 AssertType(foo.x, "number"); 26 AssertType(1, "int"); 29 AssertType(foo.y = 1, "int"); 30 AssertType(foo.y, "number"); 31 AssertType(1, "int"); 35 AssertType(foo.break = 1, "int"); 36 AssertType(foo.break, "number"); 37 AssertType(1, "int"); [all …]
|
D | privateNameFieldUnaryMutation.ts | 20 declare function AssertType(value:any, type:string):void; function 25 AssertType(this.#test++, "number"); 26 AssertType(this.#test, "number"); 27 AssertType(this, "this"); 30 AssertType(this.#test--, "number"); 31 AssertType(this.#test, "number"); 32 AssertType(this, "this"); 35 AssertType(++this.#test, "number"); 36 AssertType(this.#test, "number"); 37 AssertType(this, "this"); [all …]
|
D | arithmeticOperatorWithAnyAndNumber.ts | 20 declare function AssertType(value:any, type:string):void; function 22 AssertType(a, "any"); 25 AssertType(b, "number"); 29 AssertType(ra1, "number"); 30 AssertType(a * a, "number"); 31 AssertType(a, "any"); 32 AssertType(a, "any"); 35 AssertType(ra2, "number"); 36 AssertType(a * b, "number"); 37 AssertType(a, "any"); [all …]
|
D | emitCompoundExponentiationOperator2.ts | 20 declare function AssertType(value:any, type:string):void; function 22 AssertType(comp, "number"); 25 AssertType(comp **= 1, "number"); 26 AssertType(comp, "number"); 27 AssertType(1, "int"); 30 AssertType(comp **= comp **= 1, "number"); 31 AssertType(comp, "number"); 32 AssertType(comp **= 1, "number"); 33 AssertType(comp, "number"); 34 AssertType(1, "int"); [all …]
|
D | arrayLiterals2ES5.ts | 20 declare function AssertType(value:any, type:string):void; function 31 AssertType(a0, "number[]"); 32 AssertType([,, 2, 3, 4], "number[]"); 33 AssertType(, "undefined"); 34 AssertType(, "undefined"); 35 AssertType(2, "int"); 36 AssertType(3, "int"); 37 AssertType(4, "int"); 40 AssertType(a1, "string[]"); 41 AssertType(["hello", "world"], "string[]"); [all …]
|
D | assignmentToExpandingArrayType.ts | 20 declare function AssertType(value:any, type:string):void; function 23 AssertType(x, "any[]"); 24 AssertType([], "undefined[]"); 27 AssertType(x[0] = { foo: 'hi' }, "{ foo: string; }"); 29 AssertType(x[0], "any"); 31 AssertType(x, "any[]"); 33 AssertType(0, "int"); 35 AssertType({ foo: 'hi' }, "{ foo: string; }"); 37 AssertType(foo, "string"); 39 AssertType('hi', "string"); [all …]
|
D | typedArrays.ts | 20 declare function AssertType(value:any, type:string):void; function 23 AssertType(typedArrays, "any[]"); 24 AssertType([], "undefined[]"); 27 AssertType(typedArrays[0] = Int8Array, "Int8ArrayConstructor"); 28 AssertType(typedArrays[0], "any"); 29 AssertType(typedArrays, "any[]"); 30 AssertType(0, "int"); 31 AssertType(Int8Array, "Int8ArrayConstructor"); 34 AssertType(typedArrays[1] = Uint8Array, "Uint8ArrayConstructor"); 35 AssertType(typedArrays[1], "any"); [all …]
|
D | arrayLiterals2ES6.ts | 20 declare function AssertType(value:any, type:string):void; function 31 AssertType(a0, "number[]"); 32 AssertType([, , 2, 3, 4], "number[]"); 33 AssertType(, "undefined"); 34 AssertType(, "undefined"); 35 AssertType(2, "int"); 36 AssertType(3, "int"); 37 AssertType(4, "int"); 40 AssertType(a1, "string[]"); 41 AssertType(["hello", "world"], "string[]"); [all …]
|
D | promiseTypeStrictNull.ts | 20 declare function AssertType(value:any, type:string):void; function 22 AssertType(p, "Promise<boolean>"); 25 AssertType(x, "any"); 29 AssertType(a, "boolean"); 30 AssertType(await p, "boolean"); 31 AssertType(p, "Promise<boolean>"); 33 AssertType(a, "boolean"); 39 AssertType(a, "boolean"); 40 AssertType(await p, "boolean"); 41 AssertType(p, "Promise<boolean>"); [all …]
|
D | genericRestParameters2.ts | 20 declare function AssertType(value:any, type:string):void; function 22 AssertType(t1, "[number, string, ...boolean[]]"); 25 AssertType(t2, "[string, ...boolean[]]"); 28 AssertType(t3, "boolean[]"); 31 AssertType(t4, "[]"); 34 AssertType(f00, "(number, string, boolean) => void"); 35 AssertType(x, "[number, string, boolean]"); 38 AssertType(f01, "(number, string, boolean) => void"); 39 AssertType(a, "number"); 40 AssertType(x, "[string, boolean]"); [all …]
|
D | literalTypes2.ts | 20 declare function AssertType(value:any, type:string):void; function 26 AssertType(cond, "boolean"); 30 AssertType(v1, "number"); 31 AssertType(1, "int"); 34 AssertType(v2, "number"); 35 AssertType(-123, "int"); 36 AssertType(123, "int"); 39 AssertType(v3, "number"); 40 AssertType(3 + 4, "number"); 41 AssertType(3, "int"); [all …]
|