Home
last modified time | relevance | path

Searched refs:f2 (Results 1 – 25 of 232) sorted by relevance

12345678910

/arkcompiler/ets_runtime/test/typeinfer/automatedcases/
DunionAndIntersectionInference2.ts67 declare function f2<T>(x: T & { name: string }): T; function
86 f2(a2); // string
87 AssertType(f2(a2), "string");
88 AssertType(f2, "<T>(T & { name: string; }) => T");
91 f2(b2); // string[]
92 AssertType(f2(b2), "string[]");
93 AssertType(f2, "<T>(T & { name: string; }) => T");
96 f2(c2); // never
97 AssertType(f2(c2), "never");
98 AssertType(f2, "<T>(T & { name: string; }) => T");
[all …]
DcontextualSignatureInstatiationCovariance.ts25 let f2: <T extends Giraffe>(x: T, y: T) => void; variable
26 AssertType(f2, "<T extends Giraffe>(T, T) => void");
35 g2 = f2; // While neither Animal nor TallThing satisfy the constraint, T is at worst a Giraffe and …
36 AssertType(g2 = f2, "<T extends Giraffe>(T, T) => void");
38 AssertType(f2, "<T extends Giraffe>(T, T) => void");
45 h2 = f2; // Animal does not satisfy the constraint, but T is at worst a Giraffe and compatible with…
46 AssertType(h2 = f2, "<T extends Giraffe>(T, T) => void");
48 AssertType(f2, "<T extends Giraffe>(T, T) => void");
DunionTypeCallSignatures2.ts64 let f2: C | B | A; variable
65 AssertType(f2, "union");
67 let n2 = f2(42); // number
69 AssertType(f2(42), "number");
70 AssertType(f2, "union");
73 let s2 = f2("abc"); // number | string | boolean
75 AssertType(f2("abc"), "union");
76 AssertType(f2, "union");
79 let a2 = f2([true, false]); // boolean[]
81 AssertType(f2([true, false]), "boolean[]");
[all …]
DcontravariantTypeAliasInference.ts27 declare let f2: Func1<"a">;
28 AssertType(f2, "Func1<"a">");
30 declare function foo<T>(f1: Func1<T>, f2: Func1<T>): void;
32 foo(f1, f2);
33 AssertType(foo(f1, f2), "void");
36 AssertType(f2, "Func1<"a">");
46 bar(f1, f2);
47 AssertType(bar(f1, f2), "void");
50 AssertType(f2, "Func1<"a">");
DconstEnum3.ts25 function f2(f: TestTypeStr) { } function
37 f2('foo')
38 AssertType(f2('foo'), "void");
39 AssertType(f2, "(union) => void");
42 f2('bar')
43 AssertType(f2('bar'), "void");
44 AssertType(f2, "(union) => void");
DintersectionTypeInference2.ts44 declare function f2<T, Key extends keyof T>(obj: {[K in keyof T]: T[K]}, key: Key): T[Key]; function
51 f2(obj, 'a');
52 AssertType(f2(obj, 'a'), "string");
53 AssertType(f2, "<T, Key extends keyof T>({ [K in keyof T]: T[K]; }, Key) => T[Key]");
57 f2(obj, 'b');
58 AssertType(f2(obj, 'b'), "string");
59 AssertType(f2, "<T, Key extends keyof T>({ [K in keyof T]: T[K]; }, Key) => T[Key]");
DgenericInstantiationEquivalentToObjectLiteral.ts44 declare function f2<T, U>(x: { first: T; second: U; });
56 f2(x);
57 AssertType(f2(x), "any");
58 AssertType(f2, "<T, U>({ first: T; second: U; }) => any");
61 f2(y);
62 AssertType(f2(y), "any");
63 AssertType(f2, "<T, U>({ first: T; second: U; }) => any");
DcontextualTypingWithGenericSignature.ts23 let f2: {
24 AssertType(f2, "<T, U>(T, U) => T");
32 f2 = (x, y) => {
33 AssertType(f2 = (x, y) => { return x }, "<T, U>(T, U) => T");
36 AssertType(f2, "<T, U>(T, U) => T");
DconstructorOverloads2.ts48 let f2 = new Foo(0); variable
49 AssertType(f2, "Foo");
60 let f4 = new Foo([f1,f2,f3]);
62 AssertType(new Foo([f1,f2,f3]), "Foo");
64 AssertType([f1,f2,f3], "Foo[]");
66 AssertType(f2, "Foo");
DmultiCallOverloads.ts35 let f2: ICallback = function(z?) { variable
36 AssertType(f2, "ICallback");
48 load(f2) // ok
49 AssertType(load(f2), "void");
51 AssertType(f2, "ICallback");
DnonNullableReductionNonStrict.ts26 function test<T>(f1: Transform1<T>, f2: Transform2<T>) {
32 f2?.("hello");
33 AssertType(f2?.("hello"), "T");
34 AssertType(f2, "union");
45 function f2<T, U extends null | undefined>(x: T | U) { function
DnonNullableReduction.ts26 function test<T>(f1: Transform1<T>, f2: Transform2<T>) {
32 f2?.("hello");
33 AssertType(f2?.("hello"), "union");
34 AssertType(f2, "union");
45 function f2<T, U extends null | undefined>(x: T | U) { function
DunusedParametersThis.ts73 let f2 = function f2(this: A): number { variable
74 AssertType(f2, "(A) => number");
75 AssertType(f2, "(A) => number");
77 AssertType(function f2(this: A): number { return this.a;}, "(A) => number"); function
DinstanceofOperatorWithRHSIsSubtypeOfFunction.ts29 let f2: I; variable
30 AssertType(f2, "I");
44 let r2 = x instanceof f2; variable
46 AssertType(x instanceof f2, "boolean");
48 AssertType(f2, "I");
DcontextualTypingWithGenericAndNonGenericSignature.ts23 let f2: {
24 AssertType(f2, "{ (string, number): string; <T, U>(T, U): T; }");
36 f2 = (x, y) => {
37 AssertType(f2 = (x, y) => { return x }, "(any, any) => any");
40 AssertType(f2, "{ (string, number): string; <T, U>(T, U): T; }");
DrecursiveTypeParameterReferenceError1.ts39 let f2: Foo2<number>; variable
40 AssertType(f2, "Foo2<number>");
42 let r2 = f2.ofC4;
44 AssertType(f2.ofC4, "C2<{ x: number; }>");
DgenericCallWithObjectTypeArgs2.ts64 function f2<T extends Base, U extends Base>(a: { x: T; y: U }) { function
71 let r3 = f2({ x: new Derived(), y: new Derived2() }); // Derived => Derived2
73 AssertType(f2({ x: new Derived(), y: new Derived2() }), "(Derived) => Derived2");
74 AssertType(f2, "<T extends Base, U extends Base>({ x: T; y: U; }) => (T) => U");
91 let r4 = f2(i); // Base => Derived
93 AssertType(f2(i), "(Base) => Derived");
94 AssertType(f2, "<T extends Base, U extends Base>({ x: T; y: U; }) => (T) => U");
DinstantiatedTypeAliasDisplay.ts32 declare function f2<A, B, C, D, E>(a: A, b: B, c: C, d: D): Z<A, string[]>;
39 const x2 = f2({}, {}, {}, {}); // Z<{}, string[]>
41 AssertType(f2({}, {}, {}, {}), "Z<{}, string[]>");
42 AssertType(f2, "<A, B, C, D, E>(A, B, C, D) => Z<A, string[]>");
DcommentsOverloads.ts38 function f2(a: number): number; function
40 function f2(b: string): number;
42 function f2(aOrb: any) {
46 f2("hello");
47 AssertType(f2("hello"), "number");
48 AssertType(f2, "{ (number): number; (string): number; }");
51 f2(10);
52 AssertType(f2(10), "number");
53 AssertType(f2, "{ (number): number; (string): number; }");
DprivacyInterface.ts53 f2(a1: C2_private);
80 f2(a1: C2_private);
119 f2(a1: C2_private); method
146 f2(a1: C2_private); method
183 f2(a1: C6_private); method
210 f2(a1: C6_private); method
222 f2(): string; method
247 f2(): string; method
270 f2(): string; method
DdeferredLookupTypeResolution.ts39 function f2<A extends string>(a: A) { function
48 AssertType(f2(x), "{ a: any; b: any; x: any; }");
49 AssertType(f2, "<A extends string>(A) => { [P in union]: any; }");
51 return f2(x);
/arkcompiler/ets_runtime/test/typeinfer/module_test/module_member_initialization/
Dmodule_member_initialization.ts21 let f2 = new foo2(); variable
26 AssertType(f2.a1, "number");
27 AssertType(f2.a2, "string");
28 AssertType(f2.a3, "foo1");
29 AssertType(f2.a3.b2, "number");
30 AssertType(f2.a4, "(number, number) => number");
/arkcompiler/ets_runtime/test/typeinfer/automatedcases/exportsAndImports4-amd/
Dt3.ts44 import f1, { default as f2 } from "./t1";
48 f2;
49 AssertType(f2, "string");
51 export { a, b, c, d, e1, e2, f1, f2 };
/arkcompiler/ets_runtime/test/typeinfer/automatedcases/exportsAndImports4-es6/
Dt3.ts44 import f1, { default as f2 } from "./t1";
48 f2;
49 AssertType(f2, "string");
51 export { a, b, c, d, e1, e2, f1, f2 };
/arkcompiler/ets_runtime/test/typeinfer/automatedcases/exportsAndImports4/
Dt3.ts44 import f1, { default as f2 } from "./t1";
48 f2;
49 AssertType(f2, "string");
51 export { a, b, c, d, e1, e2, f1, f2 };

12345678910