/arkcompiler/ets_runtime/test/typeinfer/automatedcases/ |
D | deeplyNestedConditionalTypes.ts | 23 T extends 0 ? '0' : 24 T extends 1 ? '1' : 25 T extends 2 ? '2' : 26 T extends 3 ? '3' : 27 T extends 4 ? '4' : 28 T extends 5 ? '5' : 29 T extends 6 ? '6' : 30 T extends 7 ? '7' : 31 T extends 8 ? '8' : 32 T extends 9 ? '9' : [all …]
|
D | typeParameterUsedAsConstraint.ts | 21 class C<T, U extends T> { } 22 class C2<T extends U, U> { } 23 class C3<T extends Date, U extends T> { } 24 class C4<T extends U, U extends Date> { } 25 class C5<T extends U, U extends V, V> { } 26 class C6<T, U extends T, V extends U> { } 28 interface I<T, U extends T> { } 29 interface I2<T extends U, U> { } 30 interface I3<T extends Date, U extends T> { } 31 interface I4<T extends U, U extends Date> { } [all …]
|
D | privacyTypeParameterOfFunctionDeclFile.ts | 29 new <T extends privateClass>(): privateClass; // Error 30 <T extends privateClass>(): privateClass; // Error 31 myMethod<T extends privateClass>(): privateClass; // Error 35 new <T extends publicClass>(): publicClass; 36 <T extends publicClass>(): publicClass; 37 myMethod<T extends publicClass>(): publicClass; 41 new <T extends privateClass>(): privateClass; 42 <T extends privateClass>(): privateClass; 43 myMethod<T extends privateClass>(): privateClass; 47 new <T extends publicClass>(): publicClass; [all …]
|
D | typeParameterUsedAsTypeParameterConstraint2.ts | 24 function foo<T, U extends T>(x: T, y: U) { 25 function bar<V extends T, W extends U>() { 26 AssertType(bar, "<V extends T, W extends U>() => void"); 28 function baz<X extends W, Y extends V>(a: X, b: Y): T { 29 AssertType(baz, "<X extends W, Y extends V>(X, Y) => T"); 44 function foo2<U extends T, T>(x: T, y: U) { 45 function bar<V extends T, W extends U>() { 46 AssertType(bar, "<V extends T, W extends U>() => void"); 48 function baz<X extends W, Y extends V>(a: X, b: Y): T { 49 AssertType(baz, "<X extends W, Y extends V>(X, Y) => T"); [all …]
|
D | inferTypesWithExtends1.ts | 22 type X1<T extends any[]> = 23 T extends [infer U extends string] ? ["string", U] : 24 T extends [infer U extends number] ? ["number", U] : 32 type X2<T extends (...args: any[]) => void> = 33 T extends (a: infer U extends string) => void ? ["string", U] : 34 T extends (a: infer U extends number) => void ? ["number", U] : 42 type X3<T extends (...args: any[]) => any> = 43 T extends (...args: any[]) => (infer U extends string) ? ["string", U] : 44 T extends (...args: any[]) => (infer U extends number) ? ["number", U] : 52 type X4<T extends new (...args: any[]) => any> = [all …]
|
D | ramdaToolsNoInfinite.ts | 26 type Head<T extends any[]> = 27 T extends [any, ...any[]] 31 type Tail<T extends any[]> = 32 ((...t: T) => any) extends ((_: any, ...tail: infer TT) => any) 36 type HasTail<T extends any[]> = 37 T extends ([] | [any]) 41 type Last<T extends any[]> = { 45 HasTail<T> extends true 50 type Length<T extends any[]> = 53 type Prepend<E, T extends any[]> = [all …]
|
D | ramdaToolsNoInfinite2.ts | 23 import { Extends } from "Any/Extends"; 26 …extends any> = Extends<A, Function> extends 1 ? 'function' : Extends<A, List> extends 1 ? 'array' … 29 export type Compute<A extends any> = A extends Function ? A : { 36 type __Pick<O extends object, K extends keyof O> = { 40 export type _Pick<O extends object, K extends Key> = __Pick<O, keyof O & K>; 42 …export type Pick<O extends object, K extends Key> = O extends unknown ? _Pick<O, K & keyof O> : ne… 47 export type Keys<O extends object> = UKeys<O>; 54 export type _Omit<O extends object, K extends Key> = _Pick<O, Exclude<Keys<O>, K>>; 56 export type Omit<O extends object, K extends Key> = O extends unknown ? _Omit<O, K> : never; 62 …type AtStrict<O extends object, K extends Key> = [K & keyof O] extends [never] ? never : O[K & key… [all …]
|
D | privacyTypeParameterOfFunction.ts | 30 new <T extends privateClass>(): privateClass; 33 <T extends privateClass>(): privateClass; 36 myMethod<T extends privateClass>(): privateClass; 40 new <T extends publicClass>(): publicClass; 41 <T extends publicClass>(): publicClass; 42 myMethod<T extends publicClass>(): publicClass; 46 new <T extends privateClass>(): privateClass; 47 <T extends privateClass>(): privateClass; 48 myMethod<T extends privateClass>(): privateClass; 52 new <T extends publicClass>(): publicClass; [all …]
|
D | genericCallWithConstraintsTypeArgumentInference.ts | 24 class Derived extends Base { bar: string; } 25 class Derived2 extends Derived { baz: string; } 35 function foo<T extends Base>(t: T) { 43 AssertType(foo, "<T extends Base>(T) => T"); 49 AssertType(foo, "<T extends Base>(T) => T"); 52 function foo2<T extends Base, U extends Derived>(t: T, u: U) { 57 function foo2b<T extends Base, U extends Derived>(u: U) { 65 function foo2c<T extends Base, U extends Derived>() { 76 AssertType(foo2b, "<T extends Base, U extends Derived>(U) => T"); 82 AssertType(foo2c, "<T extends Base, U extends Derived>() => T"); [all …]
|
D | undefinedIsSubtypeOfEverything.ts | 28 class D0 extends Base { 32 class DA extends Base { 36 class D1 extends Base { 40 class D1A extends Base { 45 class D2 extends Base { 49 class D2A extends Base { 54 class D3 extends Base { 58 class D3A extends Base { 63 class D4 extends Base { 67 class D5 extends Base { [all …]
|
D | recursiveConditionalCrash3.ts | 30 export type CanBeExpanded<T extends object = object, D = string> = { 39 interface User extends Base { 45 interface Role extends Base { 52 interface X extends Base { 60 type Join<K, P> = K extends string | number ? 61 P extends string | number ? 62 `${K}${"" extends P ? "" : "."}${P}` 65 type PrefixWith<P, S, C = '.'> = P extends '' ? `${string & S}` : `${string & P}${string & C}${stri… 67 type SplitWithAllPossibleCombinations<S extends string, D extends string> = 68 string extends S ? string : [all …]
|
D | privacyClass.ts | 37 class m1_C1_private extends m1_c_public { 39 class m1_C2_private extends m1_c_private { 41 export class m1_C3_public extends m1_c_public { 43 export class m1_C4_public extends m1_c_private { 55 class m1_C9_private extends m1_c_public implements m1_i_private, m1_i_public { 57 class m1_C10_private extends m1_c_private implements m1_i_private, m1_i_public { 59 export class m1_C11_public extends m1_c_public implements m1_i_private, m1_i_public { 61 export class m1_C12_public extends m1_c_private implements m1_i_private, m1_i_public { 81 class m2_C1_private extends m2_c_public { 83 class m2_C2_private extends m2_c_private { [all …]
|
D | propertyAccessOnTypeParameterWithConstraints2.ts | 30 class B extends A { 37 class C<U extends A, T extends A> { 84 interface I<U extends A, T extends A> { 87 //interface I<U extends T, T extends A> { 106 AssertType(a, "{ <U extends A, T extends A>(): U; <U extends A, T extends A>(U): U; <U extends A, T… 108 <U extends A, T extends A>(): U; 109 <U extends A, T extends A>(x: U): U; 112 <U extends A, T extends A>(x: U, y: T): U; 117 // <U extends T, T extends A>(): U; 118 // <U extends T, T extends A>(x: U): U; [all …]
|
D | interfaceExtendsObjectIntersection.ts | 30 interface I1 extends T1 { x: string } 31 interface I2 extends T2 { x: string } 32 interface I3 extends T3 { x: string } 33 interface I4 extends T4 { x: string } 34 interface I5 extends T5 { x: string } 35 interface I6 extends T6 { x: string } 36 interface I7 extends T7 { x: string } 41 class C1 extends Constructor<I1>() { x: string } 42 class C2 extends Constructor<I2>() { x: string } 43 class C3 extends Constructor<I3>() { x: string } [all …]
|
D | performanceComparisonOfStructurallyIdenticalInterfacesWithGenericSignatures.ts | 21 export declare type ThenArg<T> = T extends any ? any : T extends PromiseLike<infer U> ? U : T; 26 await<R extends ThenArg<T>>(): InterfaceA<R>; 27 awaitLatest<R extends ThenArg<T>>(): InterfaceA<R>; 28 awaitOrdered<R extends ThenArg<T>>(): InterfaceA<R>; 29 awaitOrdered2<R extends ThenArg<T>>(): InterfaceA<R>; 30 awaitOrdered3<R extends ThenArg<T>>(): InterfaceA<R>; 31 awaitOrdered4<R extends ThenArg<T>>(): InterfaceA<R>; 32 awaitOrdered5<R extends ThenArg<T>>(): InterfaceA<R>; 33 awaitOrdered6<R extends ThenArg<T>>(): InterfaceA<R>; 34 awaitOrdered7<R extends ThenArg<T>>(): InterfaceA<R>; [all …]
|
D | identicalGenericConditionalsWithInferRelated.ts | 22 type Cond1 = X extends [infer A] ? A : never; 23 AssertType(Cond1, "X extends [infer A] ? A : never"); 25 type Cond2 = X extends [infer A] ? A : never; 26 AssertType(Cond2, "X extends [infer A] ? A : never"); 29 AssertType(x, "X extends [infer A] ? A : never"); 34 AssertType(y, "X extends [infer A] ? A : never"); 39 AssertType(x = y, "X extends [infer A] ? A : never"); 40 AssertType(x, "X extends [infer A] ? A : never"); 41 AssertType(y, "X extends [infer A] ? A : never"); 44 AssertType(y = x, "X extends [infer A] ? A : never"); [all …]
|
D | propertyAccessOnTypeParameterWithConstraints3.ts | 30 class B extends A { 37 class C<U extends A, T extends U> { 86 interface I<U extends A, T extends U> { 105 AssertType(a, "{ <U extends A, T extends U>(): T; <U extends T, T extends A>(U): U; }"); 107 <U extends A, T extends U>(): T; 108 <U extends T, T extends A>(x: U): U; 121 AssertType(a, "{ <U extends A, T extends U>(): T; <U extends T, T extends A>(U): U; }"); 135 AssertType(a, "{ <U extends A, T extends U>(): T; <U extends T, T extends A>(U): U; }"); 141 AssertType(b, "{ foo: <U extends A, T extends U>(T) => string; }"); 142 …extends A, T extends U>(x: T) => { // BUG 823818 let a = x['foo'](); // should be st… [all …]
|
D | objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts | 29 interface Five<T> extends Four<T> { } 35 foo<T extends U, U extends One>(x: T, y: U): string { 41 class B<T extends U, U extends Two> { 48 class C<T extends U, U extends Three> { 55 class D<T extends U, U extends Four<string>> { 62 interface I<T extends U, U extends Five<string>> { 67 foo<T extends U, U extends Six<string, string>>(x: T, y: U): string; 70 let a: { foo<T extends U, U extends One>(x: T, y: U): string 71 AssertType(a, "{ foo<T extends U, U extends One>(T, U): string; }"); 73 AssertType(foo, "<T extends U, U extends One>(T, U) => string"); [all …]
|
D | objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts | 26 foo<T extends U, U extends Date>(x: T, y: U): string { 32 class B<T extends U, U extends Array<number>> { 39 class C<T extends U, U extends String> { 46 class D<T extends U, U extends Number> { 53 interface I<T extends U, U extends Number> { 58 foo<T extends U, U extends Boolean>(x: T, y: U): string; 61 let a: { foo<T extends U, U extends Array<string>>(x: T, y: U): string 62 AssertType(a, "{ foo<T extends U, U extends string[]>(T, U): string; }"); 64 AssertType(foo, "<T extends U, U extends string[]>(T, U) => string"); 71 let b = { foo<T extends U, U extends RegExp>(x: T, y: U) { [all …]
|
D | constructSignatureAssignabilityInInheritance4.ts | 25 class Derived extends Base { bar: string; } 26 class Derived2 extends Derived { baz: string; } 27 class OtherDerived extends Base { bing: string; } 36 a6: new <T extends Base>(x: (arg: T) => Derived) => T; 39 a16: new <T extends Base>(x: { a: T; b: T }) => T[]; 41 new <T extends Base>(x: T): T[]; 42 new <U extends Derived>(x: U): U[]; 45 new <T extends Derived>(x: T): number[]; 46 new <U extends Base>(x: U): number[]; 49 new <T extends Derived>(x: new (a: T) => T): T[]; [all …]
|
D | doubleMixinConditionalTypeBaseClassWorks.ts | 23 const Mixin1 = <C extends Constructor>(Base: C) => class extends Base { private _fooPrivate: {}; class 24 AssertType(Mixin1, "<C extends Constructor>(C) => { new (...any[]): (Anonymous class); prototype: M… 26 AssertType(<C extends Constructor>(Base: C) => class extends Base { private _fooPrivate: {}; }, "<C… 30 AssertType(class extends Base { private _fooPrivate: {}; }, "{ new (...any[]): (Anonymous class); p… class 35 type FooConstructor = typeof Mixin1 extends (a: Constructor) => infer Cls ? Cls : never; 36 const Mixin2 = <C extends FooConstructor>(Base: C) => class extends Base {}; class 37 AssertType(Mixin2, "<C extends { new (...any[]): Mixin1<Constructor>.(Anonymous class); prototype: … 38 AssertType(<C extends FooConstructor>(Base: C) => class extends Base {}, "<C extends { new (...any[… class 40 AssertType(class extends Base {}, "{ new (...any[]): (Anonymous class); prototype: Mixin2<any>.(Ano… class 42 class C extends Mixin2(Mixin1(Object)) {}
|
D | objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts | 29 interface Five<T> extends Four<T> { } 34 class B<T extends U, U extends Two> { 41 class C<T extends U, U extends Three> { 48 class D<T extends U, U extends Four<string>> { 55 interface I<T extends U, U extends Five<string>> { 60 new<T extends U, U extends Six<string, string>>(x: T, y: U): string; 63 let a: { new<T extends U, U extends One>(x: T, y: U): string 64 AssertType(a, "new <T extends U, U extends One>(T, U) => string"); 71 let b = { new<T extends U, U extends Two>(x: T, y: U) { 72 AssertType(b, "{ new<T extends U, U extends Two>(T, U): string; }"); [all …]
|
/arkcompiler/ets_runtime/test/typeinfer/automatedcases/privacyInterfaceExtendsClauseDeclFile/ |
D | privacyInterfaceExtendsClauseDeclFile_externalModule.ts | 29 …interface privateInterfaceImplementingPublicInterfaceInModule extends publicInterfaceInPublicModul… 31 …interface privateInterfaceImplementingPrivateInterfaceInModule extends privateInterfaceInPublicMod… 33 …export interface publicInterfaceImplementingPublicInterfaceInModule extends publicInterfaceInPubli… 35 …export interface publicInterfaceImplementingPrivateInterfaceInModule extends privateInterfaceInPub… 38 …interface privateInterfaceImplementingFromPrivateModuleInterface extends privateModule.publicInter… 40 …export interface publicInterfaceImplementingFromPrivateModuleInterface extends privateModule.publi… 43 …export interface publicInterfaceImplementingPrivateAndPublicInterface extends privateInterfaceInPu… 55 …interface privateInterfaceImplementingPublicInterfaceInModule extends publicInterfaceInPrivateModu… 57 …interface privateInterfaceImplementingPrivateInterfaceInModule extends privateInterfaceInPrivateMo… 59 …export interface publicInterfaceImplementingPublicInterfaceInModule extends publicInterfaceInPriva… [all …]
|
/arkcompiler/ets_frontend/es2panda/test/parser/ts/ |
D | test-ts-conditional-type.ts | 18 …r & boolean extends boolean ? number : string)[] extends ((boolean extends & string ? typeof a : n… 20 var b: boolean & number extends A ? number : string; variable 21 var c: A | number extends string ? number : string; variable 22 var d: boolean | A & string extends string ? number : string; variable 23 var e: boolean & number | string extends string ? number : string; variable 25 type Bar<T> = T extends (infer U)[] 27 : T extends (...args: any[]) => infer U 29 : T extends Promise<infer U>
|
D | test_generic.ts | 17 function func1<Type, A, B extends readonly number[]>(arg: Type): Type { 21 function func2<A extends { a: number, b: string }>() { } 23 function func3<A extends keyof { a: { b: number, c: boolean }, b: [number, string] }>(a: A, b: stri… 29 interface R<K extends [number, string], T = string> { 34 interface U<A extends readonly [number, number, { a: number, b: string }], Z = boolean> extends R<[… 36 readonly<A extends number>(): [boolean, number[]]; 43 a: function <B, C extends typeof func1>() { }, 45 c<E, F extends readonly []>() { } 48 class A<T extends B, Z = { a: number, b: string }> { 50 private b<E extends (a: number, b: string) => any[]>() { } [all …]
|