/arkcompiler/ets_runtime/test/typeinfer/automatedcases/ |
D | TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts | 22 export interface Point { 25 toCarth(): Point; 30 export interface Point { interface 31 fromCarth(): Point; 36 let p: { x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; }; 37 AssertType(p, "{ x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; }"); 40 AssertType(toCarth, "() => A.Point"); 42 AssertType(fromCarth, "() => A.Point"); 45 let p: A.Point; 46 AssertType(p, "{ x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; }"); [all …]
|
D | declarationEmitExpandoWithGenericConstraint.ts | 21 export interface Point { 26 export interface Rect<p extends Point> { 31 export const Point = (x: number, y: number): Point => ({ x, y }); constant 32 AssertType(Point, "{ (number, number): Point; zero(): Point; }"); 33 AssertType((x: number, y: number): Point => ({ x, y }), "{ (number, number): Point; zero(): Point; … 41 export const Rect = <p extends Point>(a: p, b: p): Rect<p> => ({ a, b }); 42 AssertType(Rect, "<p extends Point>(p, p) => Rect<p>"); 43 AssertType(<p extends Point>(a: p, b: p): Rect<p> => ({ a, b }), "<p extends Point>(p, p) => Rect<p… 51 Point.zero = (): Point => Point(0, 0); 52 AssertType(Point.zero = (): Point => Point(0, 0), "() => Point"); [all …]
|
D | instantiatedModule.ts | 24 export interface Point { x: number; y: number } 25 export let Point = 1; 40 let a1 = M.Point; 42 AssertType(M.Point, "number"); 44 let a1 = m.Point; 46 AssertType(m.Point, "number"); 56 let p1: M.Point; 60 // making the point a class instead of an interface 63 export class Point { class 66 static Origin(): Point { [all …]
|
D | mergedDeclarations1.ts | 21 interface Point { 25 function point(x: number, y: number): Point { function 33 module point { 34 export let origin = point(0, 0); 35 export function equals(p1: Point, p2: Point) { 46 let p1 = point(0, 0); 47 AssertType(p1, "Point"); 48 AssertType(point(0, 0), "Point"); 49 AssertType(point, "typeof point"); 53 let p2 = point.origin; [all …]
|
D | TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts | 22 export interface Point { 25 toCarth(): Point; 30 interface Point { interface 31 fromCarth(): Point; 36 let p: { x: number; y: number; toCarth(): A.Point; }; 37 AssertType(p, "{ x: number; y: number; toCarth(): A.Point; }"); 40 AssertType(toCarth, "() => A.Point"); 43 let p: A.Point; 44 AssertType(p, "{ x: number; y: number; toCarth(): A.Point; }"); 49 new (start: A.Point, end: A.Point); [all …]
|
D | castTest.ts | 62 declare class Point 66 add(dx: number, dy: number): Point; 67 mult(p: Point): Point; 71 let p_cast = <Point> ({ 72 AssertType(p_cast, "Point"); 73 …Point(this.x + dx, this.y + dy); }, mult: function(p) { return p; }}), "{ x: number; y: numb… 74 …Point(this.x + dx, this.y + dy); }, mult: function(p) { return p; }}, "{ x: number; y: numbe… 75 …Point> ({ x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y… 86 AssertType(add, "(number, number) => Point"); 89 …rtType(function(dx, dy) { return new Point(this.x + dx, this.y + dy); }, "(number, numbe… [all …]
|
D | importAliasIdentifiers.ts | 22 export class Point { 29 let p: alias.Point; 30 AssertType(p, "alias.Point"); 33 let p: moduleA.Point; 34 AssertType(p, "alias.Point"); 38 AssertType(p, "alias.Point"); 47 export interface Point { interface 50 let Point: Point = { x: 0, y: 0 }; variable 55 let p: clolias.Point; 56 AssertType(p, "alias.Point"); [all …]
|
D | nestedModules.ts | 22 export interface Point { 30 let Point: C.Point = { x: 0, y: 0 }; // bug 832088: could not find module 'C' variable 35 export interface Point { interface 42 export let Point: number; variable 50 let point: number; variable 51 AssertType(point, "number"); 53 let point = m.Point; variable 54 AssertType(point, "number"); 55 AssertType(m.Point, "number"); 65 let p: M2.X.Point;
|
D | topLevel.ts | 26 class Point implements IPoint { class 65 result+=(new Point(3,4).move(2,2)); 66 AssertType(result+=(new Point(3,4).move(2,2)), "string"); 68 AssertType((new Point(3,4).move(2,2)), "Point"); 69 AssertType(new Point(3,4).move(2,2), "Point"); 70 AssertType(new Point(3,4).move, "(number, number) => Point"); 75 export let origin=new Point(0,0); 81 AssertType((M.origin.move(1,1)), "Point"); 82 AssertType(M.origin.move(1,1), "Point"); 83 AssertType(M.origin.move, "(number, number) => Point");
|
D | exportImportAlias.ts | 26 export class Point { 44 let b: { x: number; y: number; } = new C.a.Point(0, 0); 48 AssertType(new C.a.Point(0, 0), "A.Point"); 49 AssertType(C.a.Point, "typeof A.Point"); 70 export class Point { class 87 let n: { x: number; y: number; } = new Z.y.Point(0, 0); 91 AssertType(new Z.y.Point(0, 0), "X.Y.Point"); 92 AssertType(Z.y.Point, "typeof X.Y.Point"); 103 export interface Point { interface 132 let p: M.D.Point;
|
D | nonInstantiatedModule.ts | 22 export interface Point { x: number; y: number } 50 export module Point { 51 export function Origin(): Point { 61 export interface Point { interface 72 let p: M2.Point; 82 let p2: typeof M2.Point; 84 AssertType(M2.Point, "typeof M2.Point"); 86 AssertType(Point, "typeof M2.Point"); 90 export interface Point { interface
|
D | ExportModuleWithAccessibleTypesOnItsExportedMembers.ts | 23 export class Point { 28 export let Origin: Point = new Point(0, 0); 31 constructor(start: Point, end: Point) { 35 static fromOrigin(p: Point) { 43 AssertType(p, "Point");
|
D | ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts | 22 class Point { 25 static Origin: Point = { x: 0, y: 0 }; 28 module Point { 34 export class Point { class 37 static Origin: Point = { x: 0, y: 0 }; 40 export module Point {
|
D | ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts | 23 class Point { 28 export let Origin: Point = { x: 0, y: 0 }; 30 export class Point3d extends Point { 36 export class Line<TPoint extends Point>{ 39 static fromorigin2d(p: Point): Line<Point>{
|
D | mapOnTupleTypes02.ts | 21 export type Point = [number, number]; 23 export function increment(point: Point) { 24 AssertType(point.map(d => d + 1), "number[]"); 25 AssertType(point.map, "<U>((number, number, number[]) => U, ?any) => U[]"); 31 return point.map(d => d + 1);
|
D | declFileObjectLiteralWithAccessors.ts | 50 let /*4*/point = makePoint(2); variable 51 AssertType(point, "{ b: number; x: number; }"); 56 let /*2*/x = point.x; 58 AssertType(point.x, "number"); 60 point./*3*/x = 30; 61 AssertType(point./*3*/x = 30, "int"); 62 AssertType(point./*3*/x, "number");
|
D | instanceAndStaticDeclarations1.ts | 23 class Point { 25 public distance(p: Point) { 51 static origin = new Point(0, 0); 52 static distance(p1: Point, p2: Point) { 56 AssertType(p1.distance, "(Point) => number"); 58 AssertType(p2, "Point");
|
D | EnumAndModuleWithSameNameAndCommonRoot.ts | 27 export class Point { class 44 let y = new enumdule.Point(0, 0); 46 AssertType(new enumdule.Point(0, 0), "enumdule.Point"); 47 AssertType(enumdule.Point, "typeof enumdule.Point");
|
D | ModuleAndEnumWithSameNameAndCommonRoot.ts | 23 export class Point { 44 let y = new enumdule.Point(0, 0); 46 AssertType(new enumdule.Point(0, 0), "enumdule.Point"); 47 AssertType(enumdule.Point, "typeof enumdule.Point");
|
D | es6ClassTest4.ts | 22 declare class Point 26 add(dx: number, dy: number): Point; 27 mult(p: Point): Point; 28 static origin: Point;
|
D | parserErrorRecovery_IncompleteMemberVariable1.ts | 30 export class Point implements IPoint { class 67 static origin = new Point(0, 0); 73 let p: IPoint = new Shapes.Point(3, 4); 75 AssertType(new Shapes.Point(3, 4), "Shapes.Point"); 76 AssertType(Shapes.Point, "typeof Shapes.Point");
|
D | sourceMap-FileWithComments.ts | 30 export class Point implements IPoint { class 65 static origin = new Point(0, 0); 81 let p: IPoint = new Shapes.Point(3, 4); 83 AssertType(new Shapes.Point(3, 4), "Shapes.Point"); 84 AssertType(Shapes.Point, "typeof Shapes.Point");
|
D | ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts | 24 class Point { 29 top: { left: Point, right: Point }, 30 bottom: { left: Point, right: Point }
|
D | ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts | 21 class Point { 24 static Origin(): Point { 38 module Point { 46 export class Point { class 49 static Origin(): Point { 63 export module Point {
|
/arkcompiler/ets_runtime/test/typeinfer/automatedcases/jsDeclarationsFunctionLikeClasses/ |
D | source.js | 25 export function Point(x, y) { class 26 if (!(this instanceof Point)) { 27 AssertType(!(this instanceof Point), "boolean"); 28 AssertType((this instanceof Point), "boolean"); 29 AssertType(this instanceof Point, "boolean"); 31 AssertType(Point, "typeof Point"); 33 AssertType(new Point(x, y), "Point"); 34 AssertType(Point, "typeof Point"); 37 return new Point(x, y);
|