/arkcompiler/ets_runtime/test/typeinfer/automatedcases/ |
D | classBlockScoping.ts | 22 let Foo: any; 23 AssertType(Foo, "any"); 28 Foo = class Foo { 29 AssertType(Foo = class Foo { static y = new Foo(); static x() { new Foo(); } … 30 AssertType(Foo, "any"); 31 AssertType(class Foo { static y = new Foo(); static x() { new Foo(); } m… 32 AssertType(Foo, "typeof Foo"); 34 static y = new Foo(); 36 AssertType(new Foo(), "Foo"); 37 AssertType(Foo, "typeof Foo"); [all …]
|
D | classStaticBlock27.ts | 23 void class Foo { 24 …Foo { static prop = 1 static { console.log(Foo.prop); Foo.prop++; } stat… 25 …Foo { static prop = 1 static { console.log(Foo.prop); Foo.prop++; } stat… 26 AssertType(Foo, "typeof Foo"); 33 console.log(Foo.prop); 34 AssertType(console.log(Foo.prop), "void"); 36 AssertType(Foo.prop, "number"); 38 Foo.prop++; 39 AssertType(Foo.prop++, "number"); 40 AssertType(Foo.prop, "number"); [all …]
|
D | constEnumToStringNoComments.ts | 21 const enum Foo { 30 let x0 = Foo.X.toString(); 32 AssertType(Foo.X.toString(), "string"); 33 AssertType(Foo.X.toString, "(?number) => string"); 35 let x1 = Foo["X"].toString(); 37 AssertType(Foo["X"].toString(), "string"); 38 AssertType(Foo["X"].toString, "(?number) => string"); 40 let y0 = Foo.Y.toString(); 42 AssertType(Foo.Y.toString(), "string"); 43 AssertType(Foo.Y.toString, "(?number) => string"); [all …]
|
D | constEnumToStringWithComments.ts | 21 const enum Foo { 30 let x0 = Foo.X.toString(); 32 AssertType(Foo.X.toString(), "string"); 33 AssertType(Foo.X.toString, "(?number) => string"); 35 let x1 = Foo["X"].toString(); 37 AssertType(Foo["X"].toString(), "string"); 38 AssertType(Foo["X"].toString, "(?number) => string"); 40 let y0 = Foo.Y.toString(); 42 AssertType(Foo.Y.toString(), "string"); 43 AssertType(Foo.Y.toString, "(?number) => string"); [all …]
|
D | ambientModuleWithTemplateLiterals.ts | 21 declare module Foo { 36 Foo.a; 37 AssertType(Foo.a, "string"); 39 Foo.b; 40 AssertType(Foo.b, "string"); 42 Foo.c; 43 AssertType(Foo.c, "Foo.Bar.a"); 45 Foo.d; 46 AssertType(Foo.d, "Foo.Bar.b"); 48 Foo.e; [all …]
|
D | classFunctionMerging.ts | 23 declare function Foo (x: number): Foo.Inst; 24 declare class Foo { 27 declare namespace Foo { namespace 31 const a = new Foo(""); 33 AssertType(new Foo(""), "Foo"); 34 AssertType(Foo, "typeof Foo"); 37 const b = Foo(12); 39 AssertType(Foo(12), "number"); 40 AssertType(Foo, "typeof Foo");
|
D | constructorOverloads2.ts | 29 class Foo extends FooBase { class 42 let f1 = new Foo("hey"); 44 AssertType(new Foo("hey"), "Foo"); 45 AssertType(Foo, "typeof Foo"); 48 let f2 = new Foo(0); 50 AssertType(new Foo(0), "Foo"); 51 AssertType(Foo, "typeof Foo"); 54 let f3 = new Foo(f1); 56 AssertType(new Foo(f1), "Foo"); 57 AssertType(Foo, "typeof Foo"); [all …]
|
D | privacyCheckExportAssignmentOnExportedGenericInterface1.ts | 21 module Foo { 25 interface Foo<T> { interface 27 let Foo: new () => Foo.A<Foo<string>>; variable 28 AssertType(Foo, "new () => Foo.A<Foo<string>>"); 29 AssertType(Foo, "any"); 31 export default Foo;
|
D | nestedThisContainer.ts | 21 type Foo = any; 23 const foo: Foo = {}; 28 AssertType(foo.bar = function () { const self: Foo = this;}, "() => void"); 30 AssertType(function () { const self: Foo = this;}, "() => void"); 32 const self: Foo = this; 39 AssertType(foo.zab = (function () { const self: Foo = this;}), "() => void"); 41 AssertType((function () { const self: Foo = this;}), "() => void"); 42 AssertType(function () { const self: Foo = this;}, "() => void"); 44 const self: Foo = this;
|
D | subtypingWithObjectMembersOptionality.ts | 36 Foo?: Base; property 40 Foo: Derived property 60 let a: { Foo?: Base; }; 62 AssertType(Foo, "Base"); 64 let b = { Foo: <Derived>null }; 66 AssertType({ Foo: <Derived>null }, "{ Foo: Derived; }"); 67 AssertType(Foo, "Derived"); 80 Foo?: Base; property 84 Foo: Derived2 property 104 let a: { Foo?: Base; }; [all …]
|
D | jsdocFunctionClassPropertiesDeclaration.ts | 25 export function Foo(x, y) { 26 if (!(this instanceof Foo)) { 27 AssertType(!(this instanceof Foo), "boolean"); 28 AssertType((this instanceof Foo), "boolean"); 29 AssertType(this instanceof Foo, "boolean"); 31 AssertType(Foo, "typeof Foo"); 33 AssertType(new Foo(x, y), "Foo"); 34 AssertType(Foo, "typeof Foo"); 37 return new Foo(x, y);
|
D | thisTypeInTaggedTemplateCall.ts | 21 class Foo { 29 Foo.m`test`; 30 AssertType(Foo.m`test`, "Foo"); 31 AssertType(Foo.m, "<T>(new () => T, union) => T"); 34 (Foo.m)`test`; 35 AssertType((Foo.m)`test`, "Foo"); 36 AssertType((Foo.m), "<T>(new () => T, union) => T"); 37 AssertType(Foo.m, "<T>(new () => T, union) => T");
|
D | ambientModuleExports.ts | 21 declare module Foo { 27 Foo.a(); 28 AssertType(Foo.a(), "void"); 29 AssertType(Foo.a, "() => void"); 31 Foo.b; 32 AssertType(Foo.b, "number"); 34 let c = new Foo.C(); 36 AssertType(new Foo.C(), "Foo.C"); 37 AssertType(Foo.C, "typeof Foo.C");
|
D | genericClassesInModule.ts | 21 module Foo { 28 let a = new Foo.B<Foo.A>(); 30 AssertType(new Foo.B<Foo.A>(), "Foo.B<Foo.A>"); 31 AssertType(Foo.B, "typeof Foo.B"); 32 AssertType(Foo, "any");
|
D | iterableArrayPattern20.ts | 22 class Foo extends Bar { y } class 25 AssertType({ value: [new Foo], done: false }, "{ value: Foo[]; done: b… 28 value: [new Foo], 30 AssertType([new Foo], "Foo[]"); 31 AssertType(new Foo, "Foo"); 32 AssertType(Foo, "typeof Foo"); 47 function fun(...[[a = new Foo], b = [new Foo]]: Bar[][]) { }
|
D | functionExpressionWithResolutionOfTypeOfSameName02.ts | 21 interface Foo { 24 let x = function Foo() { 26 AssertType(function Foo() { let x: Foo;}, "() => void"); function 27 AssertType(Foo, "() => void"); 29 let x: Foo;
|
D | typeGuardNarrowsIndexedAccessOfKnownProperty7.ts | 21 export namespace Foo { 26 [Foo.key]: string; 29 this[Foo.key] = "hello"; 30 AssertType(this[Foo.key] = "hello", "string"); 31 AssertType(this[Foo.key], "string"); 33 AssertType(Foo.key, "unique symbol");
|
D | generatorTypeCheck54.ts | 21 class Foo { x: number } 24 yield* [new Foo]; 25 AssertType(yield* [new Foo], "any"); 26 AssertType([new Foo], "Foo[]"); 27 AssertType(new Foo, "Foo"); 28 AssertType(Foo, "typeof Foo");
|
D | generatorTypeCheck24.ts | 21 class Foo { x: number } 22 class Bar extends Foo { y: string } 28 yield * [new Foo]; 29 AssertType(yield * [new Foo], "any"); 30 AssertType([new Foo], "Foo[]"); 31 AssertType(new Foo, "Foo"); 32 AssertType(Foo, "typeof Foo");
|
D | objectLiteralComputedNameNoDeclarationError.ts | 21 const Foo = { 22 AssertType(Foo, "{ BANANA: "banana"; }"); 33 AssertType({ [Foo.BANANA]: 1}, "{ banana: number; }"); 35 [Foo.BANANA]: 1 36 AssertType([Foo.BANANA], "number"); 37 AssertType(Foo.BANANA, "string");
|
D | privacyCheckExportAssignmentOnExportedGenericInterface2.ts | 21 export default Foo; 23 interface Foo<T> { 26 function Foo<T>(array: T[]): Foo<T> { function 31 module Foo {
|
/arkcompiler/ets_runtime/test/typeinfer/automatedcases/declarationEmitDefaultExportWithStaticAssignment/ |
D | index2.ts | 21 import {Foo} from './foo'; 22 export {Foo}; 24 Example.Foo = Foo 25 AssertType(Example.Foo = Foo, "typeof Foo"); 26 AssertType(Example.Foo, "typeof Foo"); 27 AssertType(Foo, "typeof Foo");
|
D | index1.ts | 21 import {Foo} from './foo'; 23 Example.Foo = Foo 24 AssertType(Example.Foo = Foo, "typeof Foo"); 25 AssertType(Example.Foo, "typeof Foo"); 26 AssertType(Foo, "typeof Foo");
|
/arkcompiler/ets_runtime/test/typeinfer/automatedcases/elidedJSImport2modulecommonjs/ |
D | index.js | 21 import { Foo } from "./other.js"; 25 const x = new Foo(); 27 AssertType(new Foo(), "error"); 28 AssertType(Foo, "error"); 30 const y = other.Foo(); 32 AssertType(other.Foo(), "error"); 33 AssertType(other.Foo, "error");
|
/arkcompiler/ets_runtime/test/typeinfer/automatedcases/elidedJSImport2modulees2022/ |
D | index.js | 21 import { Foo } from "./other.js"; 25 const x = new Foo(); 27 AssertType(new Foo(), "error"); 28 AssertType(Foo, "error"); 30 const y = other.Foo(); 32 AssertType(other.Foo(), "error"); 33 AssertType(other.Foo, "error");
|