Home
last modified time | relevance | path

Searched refs:T (Results 1 – 25 of 1153) sorted by relevance

12345678910>>...47

/arkcompiler/ets_runtime/test/typeinfer/automatedcases/
DdeeplyNestedConditionalTypes.ts22 type Foo<T> =
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' :
[all …]
DprivacyTypeParameterOfFunctionDeclFile.ts29 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 …]
DcallSignatureAssignabilityInInheritance4.ts31 a: <T>(x: T) => T[];
32 a2: <T>(x: T) => string[];
33 a3: <T>(x: T) => void;
34 a4: <T,U>(x: T, y: U) => string;
35 a5: <T,U>(x: (arg: T) => U) => T;
36 a6: <T extends Base>(x: (arg: T) => Derived) => T;
37 a11: <T>(x: { foo: T }, y: { foo: T; bar: T }) => Base;
38 a15: <T>(x: { a: T; b: T }) => T[];
39 a16: <T extends Base>(x: { a: T; b: T }) => T[];
41 <T extends Derived>(x: (a: T) => T): T[];
[all …]
DarrowFunctionParsingGenericInObject.ts23 AssertType(() => ({ test: <T = undefined>(value: T): T => value, extraValue: () => {},}), "()…
24 AssertType(({ test: <T = undefined>(value: T): T => value, extraValue: () => {},}), "{ test: …
25 AssertType({ test: <T = undefined>(value: T): T => value, extraValue: () => {},}, "{ test: <T…
27 test: <T = undefined>(value: T): T => value,
29 AssertType(<T = undefined>(value: T): T => value, "<T = undefined>(T) => T");
41 AssertType(() => ({ test: async <T = undefined>(value: T): Promise<T> => value, extraValue: (…
42 AssertType(({ test: async <T = undefined>(value: T): Promise<T> => value, extraValue: () => {…
43 AssertType({ test: async <T = undefined>(value: T): Promise<T> => value, extraValue: () => {}…
45 test: async <T = undefined>(value: T): Promise<T> => value,
47 AssertType(async <T = undefined>(value: T): Promise<T> => value, "<T = undefined>(T) => Promise<T>"…
[all …]
DconstructSignatureAssignabilityInInheritance4.ts31 a: new <T>(x: T) => T[];
32 a2: new <T>(x: T) => string[];
33 a3: new <T>(x: T) => void;
34 a4: new <T, U>(x: T, y: U) => string;
35 a5: new <T, U>(x: (arg: T) => U) => T;
36 a6: new <T extends Base>(x: (arg: T) => Derived) => T;
37 a11: new <T>(x: { foo: T }, y: { foo: T; bar: T }) => Base;
38 a15: new <T>(x: { a: T; b: T }) => T[];
39 a16: new <T extends Base>(x: { a: T; b: T }) => T[];
41 new <T extends Base>(x: T): T[];
[all …]
DtypeParametersAreIdenticalToThemselves.ts23 function foo1<T>(x: T);
24 function foo1<T>(x: T); // no error, different declaration for each T
25 function foo1<T>(x: T) { }
27 function foo2<T, U>(x: T);
28 function foo2<T, U>(x: T); // no error, different declaration for each T
29 function foo2<T, U>(x: T) { }
31 function foo3<T, U>(x: T, y: U) {
32 function inner(x: T);
36 function inner(x: T); // error, same T
40 function inner(x: T) {
[all …]
DprivacyTypeParametersOfClassDeclFile.ts27 export class publicClassWithPrivateTypeParameters<T extends privateClass> { // Error
28 myMethod(val: T): T {
34 export class publicClassWithPublicTypeParameters<T extends publicClass> {
35 myMethod(val: T): T {
41 class privateClassWithPrivateTypeParameters<T extends privateClass> {
42 myMethod(val: T): T {
48 class privateClassWithPublicTypeParameters<T extends publicClass> {
49 myMethod(val: T): T {
55 export class publicClassWithPublicTypeParametersWithoutExtends<T> {
56 myMethod(val: T): T {
[all …]
DprivacyTypeParameterOfFunction.ts30 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 …]
DtypeParameterUsedAsConstraint.ts21 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 …]
DprivacyTypeParametersOfInterfaceDeclFile.ts28 class privateClassT<T> {
31 export class publicClassT<T> {
34 export interface publicInterfaceWithPrivateTypeParameters<T extends privateClass> { // Error
35 myMethod(val: T): T;
36 myMethod0(): publicClassT<T>;
43 export interface publicInterfaceWithPublicTypeParameters<T extends publicClass> {
44 myMethod(val: T): T;
45 myMethod0(): publicClassT<T>
52 interface privateInterfaceWithPrivateTypeParameters<T extends privateClass> {
53 myMethod(val: T): T;
[all …]
DsubtypingWithCallSignatures4.ts28 declare function foo1(a: <T>(x: T) => T[]);
31 declare function foo2(a2: <T>(x: T) => string[]);
34 declare function foo3(a3: <T>(x: T) => void);
37 declare function foo4(a4: <T, U>(x: T, y: U) => string);
40 declare function foo5(a5: <T, U>(x: (arg: T) => U) => T);
43 declare function foo6(a6: <T extends Base>(x: (arg: T) => Derived) => T);
46 declare function foo11(a11: <T>(x: { foo: T }, y: { foo: T; bar: T }) => Base);
49 declare function foo15(a15: <T>(x: { a: T; b: T }) => T[]);
52 declare function foo16(a16: <T extends Base>(x: { a: T; b: T }) => T[]);
56 <T extends Derived>(x: (a: T) => T): T[];
[all …]
DisDeclarationVisibleNodeKinds.ts23 export function createValidator1(schema: any): <T>(data: T) => T {
31 export function createValidator2(schema: any): new <T>(data: T) => T {
39 export function createValidator3(schema: any): number | { new <T>(data: T): T; } {
47 export function createValidator4(schema: any): { new <T>(data: T): T; }[] {
56 export function createValidator5(schema: any): { new <T>(data: T): T } {
64 export function createValidator6(schema: any): [ new <T>(data: T) => T, number] {
72 export function createValidator7(schema: any): (new <T>(data: T)=>T )[] {
80 export function createValidator8(schema: any): Array<{ <T>(data: T) : T}> {
88 export class T { class
89 get createValidator9(): <T>(data: T) => T {
[all …]
DinferTypesWithExtends1.ts22 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 …]
DgenericOverloadSignatures.ts22 <T>(x: T): void;
23 <T>(x: T): void;
26 function f<T>(a: T);
27 function f<T>(a: T);
31 f<T>(x: T): number;
32 f<T>(x: T): string;
35 interface I3<T> {
36 f(x: T): number;
37 f(x: T): string;
40 class C2<T> {
[all …]
DconstructSignatureAssignabilityInInheritance2.ts50 new <T extends Derived>(x: T): number[];
72 a: new <T>(x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number
73 a2: new <T>(x: T) => string[]; // ok
74 a3: new <T>(x: T) => T; // ok since Base returns void
75 …a4: new <T, U>(x: T, y: U) => T; // ok, instantiation of N is a subtype of M, T is string, U is nu…
76 …a5: new <T, U>(x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be ma…
77 …a6: new <T extends Base, U extends Derived>(x: (arg: T) => U) => T; // ok, same as a5 but with obj…
78 a7: new <T extends Base, U extends Derived>(x: (arg: T) => U) => (r: T) => U; // ok
79 …a8: new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; /…
80 …a9: new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: numbe…
[all …]
DcallSignatureAssignabilityInInheritance2.ts50 <T extends Derived>(x: T): number[];
72 a: <T>(x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number
73 a2: <T>(x: T) => string[]; // ok
74 a3: <T>(x: T) => T; // ok since Base returns void
75 … a4: <T, U>(x: T, y: U) => T; // ok, instantiation of N is a subtype of M, T is string, U is number
76 a5: <T, U>(x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made
77 …a6: <T extends Base, U extends Derived>(x: (arg: T) => U) => T; // ok, same as a5 but with object …
78 a7: <T extends Base, U extends Derived>(x: (arg: T) => U) => (r: T) => U; // ok
79 … a8: <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; // ok
80 …a9: <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number })…
[all …]
DsubtypingWithConstructSignatures5.ts49 a: new <T>(x: T) => T[];
55 a: new <T>(x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number
56 a2: new <T>(x: T) => string[]; // ok
57 a3: new <T>(x: T) => T; // ok since Base returns void
58 …a4: new <T, U>(x: T, y: U) => T; // ok, instantiation of N is a subtype of M, T is string, U is nu…
59 …a5: new <T, U>(x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be ma…
60 …a6: new <T extends Base, U extends Derived>(x: (arg: T) => U) => T; // ok, same as a5 but with obj…
61 a7: new <T extends Base, U extends Derived>(x: (arg: T) => U) => (r: T) => U; // ok
62 …a8: new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; /…
63 …a9: new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: numbe…
[all …]
DcallSignatureAssignabilityInInheritance5.ts49 a: <T>(x: T) => T[];
55 a: <T>(x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number
56 a2: <T>(x: T) => string[]; // ok
57 a3: <T>(x: T) => T; // ok since Base returns void
58 … a4: <T, U>(x: T, y: U) => T; // ok, instantiation of N is a subtype of M, T is string, U is number
59 a5: <T, U>(x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made
60 …a6: <T extends Base, U extends Derived>(x: (arg: T) => U) => T; // ok, same as a5 but with object …
61 a7: <T extends Base, U extends Derived>(x: (arg: T) => U) => (r: T) => U; // ok
62 … a8: <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; // ok
63 …a9: <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number })…
[all …]
DconstructSignatureAssignabilityInInheritance5.ts49 a: new <T>(x: T) => T[];
55 a: new <T>(x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number
56 a2: new <T>(x: T) => string[]; // ok
57 a3: new <T>(x: T) => T; // ok since Base returns void
58 …a4: new <T, U>(x: T, y: U) => T; // ok, instantiation of N is a subtype of M, T is string, U is nu…
59 …a5: new <T, U>(x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be ma…
60 …a6: new <T extends Base, U extends Derived>(x: (arg: T) => U) => T; // ok, same as a5 but with obj…
61 a7: new <T extends Base, U extends Derived>(x: (arg: T) => U) => (r: T) => U; // ok
62 …a8: new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; /…
63 …a9: new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: numbe…
[all …]
DperformanceComparisonOfStructurallyIdenticalInterfacesWithGenericSignatures.ts21 export declare type ThenArg<T> = T extends any ? any : T extends PromiseLike<infer U> ? U : T;
23 export interface InterfaceA<T> {
24 filter(callback: (newValue: T, oldValue: T) => boolean): InterfaceA<T>;
25 map<D>(callback: (value: T) => D): InterfaceA<D>;
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>;
[all …]
DgenericCallWithOverloadedFunctionTypedArguments.ts36 let r2 = foo4(<T>(x: T) => x);
41 function foo5<T>(cb: { (x: T): string; (x: number): T }) {
47 let a: { <T>(x: T): string; <T>(x: number): T; }
50 function foo6<T>(cb: { (x: T): string; (x: T, y?: T): string }) {
56 let r9 = foo6(<T>(x: T) => ''); // any => string (+1 overload)
57 let r11 = foo6(<T>(x: T, y?: T) => ''); // any => string (+1 overload)
59 function foo7<T>(x:T, cb: { (x: T): string; (x: T, y?: T): string }) {
65 …let r13 = foo7(1, <T>(x: T) => ''); // any => string (+1 overload) [inferences are made for T, but…
66 let a: { <T>(x: T): string; <T>(x: number): T; }
DtypeParameterUsedAsTypeParameterConstraint.ts23 function foo<T, U extends T>(x: T, y: U): T {
33 function foo2<U extends T, T>(x: T, y: U): T {
43 let f = function <T, U extends T>(x: T, y: U): T {
47 AssertType(function <T, U extends T>(x: T, y: U): T { x = y; return y;}, "<T, U extends T>(T,…
58 let f2 = function <U extends T, T>(x: T, y: U): T {
62 AssertType(function <U extends T, T>(x: T, y: U): T { x = y; return y;}, "<U extends T, T>(T,…
73 let f3 = <T, U extends T>(x: T, y: U): T => {
77 AssertType(<T, U extends T>(x: T, y: U): T => { x = y; return y;}, "<T, U extends T>(T, U) =>…
88 let f4 = <U extends T, T>(x: T, y: U): T => {
92 AssertType(<U extends T, T>(x: T, y: U): T => { x = y; return y;}, "<U extends T, T>(T, U) =>…
/arkcompiler/ets_runtime/ecmascript/compiler/
Dbc_call_signature.h24 #define ASM_UNUSED_BC_STUB_LIST(T) \ argument
25 T(HandleOverflowD8) \
26 T(HandleOverflowD9) \
27 T(HandleOverflowDA) \
28 T(HandleOverflowDB) \
29 T(HandleOverflowDC) \
30 T(HandleOverflowDD) \
31 T(HandleOverflowDE) \
32 T(HandleOverflowDF) \
33 T(HandleOverflowE0) \
[all …]
/arkcompiler/ets_frontend/es2panda/util/
Denumbitops.h21 #define DEFINE_BITOPS(T) \ argument
22 inline T operator~(T a) \
24 using utype = std::underlying_type_t<T>; \
26 return static_cast<T>(~static_cast<utype>(a)); \
29 inline bool operator!(T a) \
31 using utype = std::underlying_type_t<T>; \
36 inline T operator|(T a, T b) \
38 using utype = std::underlying_type_t<T>; \
40 return static_cast<T>(static_cast<utype>(a) | static_cast<utype>(b)); \
43 inline std::underlying_type_t<T> operator&(T a, T b) \
[all …]
/arkcompiler/ets_runtime/ecmascript/base/
Datomic_helper.h27 template<typename T>
28 T operator()(T *ptr, const T *arg) const in operator()
30 std::atomic<T> *atomicValue = reinterpret_cast<std::atomic<T> *>(ptr); in operator()
36 template<typename T>
37 T operator()(T *ptr, const T *arg) const in operator()
39 std::atomic<T> *atomicValue = reinterpret_cast<std::atomic<T> *>(ptr); in operator()
45 template<typename T>
46 T operator()(T *ptr, const T *arg) const in operator()
48 std::atomic<T> *atomicValue = reinterpret_cast<std::atomic<T> *>(ptr); in operator()
54 template<typename T>
[all …]

12345678910>>...47