/third_party/typescript/tests/baselines/reference/ |
D | deeplyNestedConditionalTypes.types | 5 T extends 0 ? '0' : 6 T extends 1 ? '1' : 7 T extends 2 ? '2' : 8 T extends 3 ? '3' : 9 T extends 4 ? '4' : 10 T extends 5 ? '5' : 11 T extends 6 ? '6' : 12 T extends 7 ? '7' : 13 T extends 8 ? '8' : 14 T extends 9 ? '9' : [all …]
|
D | typeParameterUsedAsConstraint.types | 2 class C<T, U extends T> { } 5 class C2<T extends U, U> { } 8 class C3<T extends Date, U extends T> { } 11 class C4<T extends U, U extends Date> { } 14 class C5<T extends U, U extends V, V> { } 17 class C6<T, U extends T, V extends U> { } 20 interface I<T, U extends T> { } 21 interface I2<T extends U, U> { } 22 interface I3<T extends Date, U extends T> { } 23 interface I4<T extends U, U extends Date> { } [all …]
|
D | privacyTypeParameterOfFunctionDeclFile.types | 11 new <T extends privateClass>(): privateClass; // Error 12 <T extends privateClass>(): privateClass; // Error 13 myMethod<T extends privateClass>(): privateClass; // Error 14 >myMethod : <T extends privateClass>() => privateClass 18 new <T extends publicClass>(): publicClass; 19 <T extends publicClass>(): publicClass; 20 myMethod<T extends publicClass>(): publicClass; 21 >myMethod : <T extends publicClass>() => publicClass 25 new <T extends privateClass>(): privateClass; 26 <T extends privateClass>(): privateClass; [all …]
|
D | arrayFakeFlatNoCrashInferenceDeclarations.types | 2 type BadFlatArray<Arr, Depth extends number> = {obj: { 3 …extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer In… 4 …extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer In… 9 "recur": Arr extends ReadonlyArray<infer InnerArr> 10 …extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer In… 17 }[Depth extends -1 ? "done" : "recur"]}["obj"]; 21 declare function flat<A, D extends number = 1>( 22 >flat : <A, D extends number = 1>(arr: A, depth?: D | undefined) => BadFlatArray<A, D>[] 33 … : <T>(arr: T[], depth: number) => (T | (T extends readonly (infer InnerArr)[] ? InnerArr | (Inner… 38 >flat(arr, depth) : (T | (T extends readonly (infer InnerArr)[] ? InnerArr | (InnerArr extends read… [all …]
|
D | typeParameterUsedAsTypeParameterConstraint2.types | 5 function foo<T, U extends T>(x: T, y: U) { 6 >foo : <T, U extends T>(x: T, y: U) => void 10 function bar<V extends T, W extends U>() { 11 >bar : <V extends T, W extends U>() => void 13 function baz<X extends W, Y extends V>(a: X, b: Y): T { 14 >baz : <X extends W, Y extends V>(a: X, b: Y) => T 29 function foo2<U extends T, T>(x: T, y: U) { 30 >foo2 : <U extends T, T>(x: T, y: U) => void 34 function bar<V extends T, W extends U>() { 35 >bar : <V extends T, W extends U>() => void [all …]
|
D | deeplyNestedConditionalTypes.symbols | 6 T extends 0 ? '0' : 9 T extends 1 ? '1' : 12 T extends 2 ? '2' : 15 T extends 3 ? '3' : 18 T extends 4 ? '4' : 21 T extends 5 ? '5' : 24 T extends 6 ? '6' : 27 T extends 7 ? '7' : 30 T extends 8 ? '8' : 33 T extends 9 ? '9' : [all …]
|
D | typeParameterUsedAsTypeParameterConstraint4.types | 5 class C<T, U extends T, V extends U> { 11 foo<W extends V>(x: W): T { 12 >foo : <W extends V>(x: W) => T 23 interface I<T, U extends T, V extends U> { 33 foo<W extends V>(x: W): T; 34 >foo : <W extends V>(x: W) => T 38 function foo<T, U extends T>(x: T, y: U): V { // error 39 >foo : <T, U extends T>(x: T, y: U) => any 43 function bar<V extends T, W extends U>(): X { // error 44 >bar : <V extends T, W extends U>() => any [all …]
|
D | privacyTypeParameterOfFunction.types | 12 new <T extends privateClass>(): privateClass; 15 <T extends privateClass>(): privateClass; 18 myMethod<T extends privateClass>(): privateClass; 19 >myMethod : <T extends privateClass>() => privateClass 23 new <T extends publicClass>(): publicClass; 24 <T extends publicClass>(): publicClass; 25 myMethod<T extends publicClass>(): publicClass; 26 >myMethod : <T extends publicClass>() => publicClass 30 new <T extends privateClass>(): privateClass; 31 <T extends privateClass>(): privateClass; [all …]
|
D | typeParameterIndirectlyConstrainedToItself.types | 2 class C<U extends T, T extends U> { } 5 class C2<T extends U, U extends V, V extends T> { } 8 interface I<U extends T, T extends U> { } 9 interface I2<T extends U, U extends V, V extends T> { } 11 function f<U extends T, T extends U>() { } 14 function f2<T extends U, U extends V, V extends T>() { } 20 <U extends T, T extends U>(): void; 21 <T extends U, U extends V, V extends T>(): void; 24 var b = <U extends T, T extends U>() => { } 26 ><U extends T, T extends U>() => { } : <U, T>() => void [all …]
|
D | subtypesOfTypeParameterWithConstraints.types | 11 class D1<T extends U, U> extends C3<T> { 22 class D2<T extends U, U> extends C3<U> { 33 class D3<T extends U, U> extends C3<T> { 44 class D4<T extends U, U> extends C3<U> { 59 class D5<T extends U, U extends V, V> extends C3<T> { 70 class D6<T extends U, U extends V, V> extends C3<U> { 81 class D7<T extends U, U extends V, V> extends C3<V> { 94 class D8<T extends U, U extends V, V> extends C3<T> { 105 class D9<T extends U, U extends V, V> extends C3<U> { 116 class D10<T extends U, U extends V, V> extends C3<V> { [all …]
|
D | genericCallWithConstraintsTypeArgumentInference.types | 8 class Derived extends Base { bar: string; } 13 class Derived2 extends Derived { baz: string; } 27 function foo<T extends Base>(t: T) { 28 >foo : <T extends Base>(t: T) => T 38 >foo : <T extends Base>(t: T) => T 44 >foo : <T extends Base>(t: T) => T 47 function foo2<T extends Base, U extends Derived>(t: T, u: U) { 48 >foo2 : <T extends Base, U extends Derived>(t: T, u: U) => U 56 function foo2b<T extends Base, U extends Derived>(u: U) { 57 >foo2b : <T extends Base, U extends Derived>(u: U) => T [all …]
|
D | deepKeysIndexing.types | 16 O extends DeepObject, 17 K1 extends keyof O 18 > = O[K1] extends object ? Extract<keyof O[K1], string> : never; 23 O extends DeepObject, 24 K1 extends keyof O 25 > = O[K1] extends object ? keyof O[K1] : never; 27 type keys2workaround<O extends DeepObject, K1 extends keyof O> = Extract< 30 O[K1] extends object ? keyof O[K1] : never, 34 interface Foo extends DeepObject { 50 class Bar<O extends DeepObject> { [all …]
|
D | ramdaToolsNoInfinite.types | 6 type Head<T extends any[]> = 9 T extends [any, ...any[]] 13 type Tail<T extends any[]> = 16 ((...t: T) => any) extends ((_: any, ...tail: infer TT) => any) 24 type HasTail<T extends any[]> = 27 T extends ([] | [any]) 34 type Last<T extends any[]> = { 44 HasTail<T> extends true 51 type Length<T extends any[]> = 56 type Prepend<E, T extends any[]> = [all …]
|
D | propertyAccessOnTypeParameterWithConstraints2.types | 12 class B extends A { 24 class C<U extends A, T extends A> { 69 //class C<U extends T, T extends A> { 102 interface I<U extends A, T extends A> { 106 //interface I<U extends T, T extends A> { 131 >a : { <U extends A, T extends A>(): U; <U extends A, T extends A>(x: U): U; <U extends A, T extend… 133 <U extends A, T extends A>(): U; 134 <U extends A, T extends A>(x: U): U; 137 <U extends A, T extends A>(x: U, y: T): U; 142 // <U extends T, T extends A>(): U; [all …]
|
D | typeParameterConstraints1.types | 2 function foo1<T extends any>(test: T) { } 3 >foo1 : <T extends unknown>(test: T) => void 6 function foo2<T extends number>(test: T) { } 7 >foo2 : <T extends number>(test: T) => void 10 function foo3<T extends string>(test: T) { } 11 >foo3 : <T extends string>(test: T) => void 14 function foo4<T extends Date>(test: T) { } // valid 15 >foo4 : <T extends Date>(test: T) => void 18 function foo5<T extends RegExp>(test: T) { } // valid 19 >foo5 : <T extends RegExp>(test: T) => void [all …]
|
D | nonPrimitiveConstraintOfIndexAccessType.types | 3 function f<T extends object, P extends keyof T>(s: string, tp: T[P]): void { 4 >f : <T extends object, P extends keyof T>(s: string, tp: T[P]) => void 13 function g<T extends null, P extends keyof T>(s: string, tp: T[P]): void { 14 >g : <T extends null, P extends keyof T>(s: string, tp: T[P]) => void 24 function h<T extends undefined, P extends keyof T>(s: string, tp: T[P]): void { 25 >h : <T extends undefined, P extends keyof T>(s: string, tp: T[P]) => void 34 function i<T extends void, P extends keyof T>(s: string, tp: T[P]): void { 35 >i : <T extends void, P extends keyof T>(s: string, tp: T[P]) => void 44 function j<T extends never, P extends keyof T>(s: string, tp: T[P]): void { 45 >j : <T extends never, P extends keyof T>(s: string, tp: T[P]) => void [all …]
|
D | typeArgumentConstraintResolution1.types | 2 function foo1<T extends Date>(test: T); 3 >foo1 : { <T extends Date>(test: T): any; <T extends Number>(test: string): any; } 6 function foo1<T extends Number>(test: string); 7 >foo1 : { <T extends Date>(test: T): any; <T extends Number>(test: string): any; } 10 function foo1<T extends String>(test: any) { } 11 >foo1 : { <T extends Date>(test: T): any; <T extends Number>(test: string): any; } 16 >foo1 : { <T extends Date>(test: T): any; <T extends Number>(test: string): any; } 21 function foo2<T extends Date>(test: T): T; 22 >foo2 : { <T extends Date>(test: T): T; <T extends Number>(test: string): T; } 25 function foo2<T extends Number>(test: string): T; [all …]
|
D | objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.types | 6 class B<T extends U, U extends Array<number>> { 15 class C<T extends U, U extends String> { 24 class D<T extends U, U extends Number> { 33 interface I<T extends U, U extends Number> { 40 new<T extends U, U extends Boolean>(x: T, y: U): string; 45 var a: { new<T extends U, U extends Array<string>>(x: T, y: U): string } 46 >a : new <T extends U, U extends string[]>(x: T, y: U) => string 50 var b = { new<T extends U, U extends RegExp>(x: T, y: U) { return ''; } }; // not a construct signa… 51 >b : { new<T extends U, U extends RegExp>(x: T, y: U): string; } 52 >{ new<T extends U, U extends RegExp>(x: T, y: U) { return ''; } } : { new<T extends U, U extends R… [all …]
|
D | propertyAccessOnTypeParameterWithConstraints3.types | 12 class B extends A { 24 class C<U extends A, T extends U> { 92 interface I<U extends A, T extends U> { 118 >a : { <U extends A, T extends U>(): T; <U extends T, T extends A>(x: U): U; } 120 <U extends A, T extends U>(): T; 121 <U extends T, T extends A>(x: U): U; 129 >a : { <U extends A, T extends U>(): T; <U extends T, T extends A>(x: U): U; } 137 >a : { <U extends A, T extends U>(): T; <U extends T, T extends A>(x: U): U; } 146 >a : { <U extends A, T extends U>(): T; <U extends T, T extends A>(x: U): U; } 156 >a : { <U extends A, T extends U>(): T; <U extends T, T extends A>(x: U): U; } [all …]
|
D | objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.types | 9 foo<T extends U, U extends Date>(x: T, y: U): string { return null; } 10 >foo : <T extends U, U extends Date>(x: T, y: U) => string 16 class B<T extends U, U extends Array<number>> { 26 class C<T extends U, U extends String> { 36 class D<T extends U, U extends Number> { 46 interface I<T extends U, U extends Number> { 54 foo<T extends U, U extends Boolean>(x: T, y: U): string; 55 >foo : <T extends U, U extends Boolean>(x: T, y: U) => string 60 var a: { foo<T extends U, U extends Array<string>>(x: T, y: U): string } 61 >a : { foo<T extends U, U extends string[]>(x: T, y: U): string; } [all …]
|
D | subtypesOfTypeParameterWithRecursiveConstraints.types | 8 function f<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>>(t: T, u: U, v: V) { 9 >f : <T extends Foo<U>, U extends Foo<T>, V extends Foo<V>>(t: T, u: U, v: V) => void 225 class D1<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base<T> { 236 class D2<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base<T> { 247 class D3<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base<T> { 258 class D4<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base<U> { 269 class D5<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base<U> { 280 class D6<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base<U> { 291 class D7<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base<V> { 302 class D8<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base<V> { [all …]
|
D | objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.types | 20 interface Five<T> extends Four<T> { } 26 class B<T extends U, U extends Two> { 35 class C<T extends U, U extends Three> { 44 class D<T extends U, U extends Four<string>> { 53 interface I<T extends U, U extends Five<string>> { 60 new<T extends U, U extends Six<string, string>>(x: T, y: U): string; 65 var a: { new<T extends U, U extends One>(x: T, y: U): string } 66 >a : new <T extends U, U extends One>(x: T, y: U) => string 70 var b = { new<T extends U, U extends Two>(x: T, y: U) { return ''; } }; // not a construct signatur… 71 >b : { new<T extends U, U extends Two>(x: T, y: U): string; } [all …]
|
D | privacyClassExtendsClauseDeclFile.errors.txt | 15 class privateClassExtendingPublicClassInModule extends publicClassInPublicModule { 17 class privateClassExtendingPrivateClassInModule extends privateClassInPublicModule { 19 export class publicClassExtendingPublicClassInModule extends publicClassInPublicModule { 21 …export class publicClassExtendingPrivateClassInModule extends privateClassInPublicModule { // Shou… 24 …class privateClassExtendingFromPrivateModuleClass extends privateModule.publicClassInPrivateModule… 29 …export class publicClassExtendingFromPrivateModuleClass extends privateModule.publicClassInPrivate… 45 class privateClassExtendingPublicClassInModule extends publicClassInPrivateModule { 47 class privateClassExtendingPrivateClassInModule extends privateClassInPrivateModule { 49 export class publicClassExtendingPublicClassInModule extends publicClassInPrivateModule { 51 export class publicClassExtendingPrivateClassInModule extends privateClassInPrivateModule { [all …]
|
D | objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.types | 20 interface Five<T> extends Four<T> { } 29 foo<T extends U, U extends One>(x: T, y: U): string { return null; } 30 >foo : <T extends U, U extends One>(x: T, y: U) => string 36 class B<T extends U, U extends Two> { 46 class C<T extends U, U extends Three> { 56 class D<T extends U, U extends Four<string>> { 66 interface I<T extends U, U extends Five<string>> { 74 foo<T extends U, U extends Six<string, string>>(x: T, y: U): string; 75 >foo : <T extends U, U extends Six<string, string>>(x: T, y: U) => string 80 var a: { foo<T extends U, U extends One>(x: T, y: U): string } [all …]
|
D | staticMethodWithTypeParameterExtendsClauseDeclFile.types | 13 private static myPrivateStaticMethod1<T extends privateClass>() { // do not emit extends clause 14 >myPrivateStaticMethod1 : <T extends privateClass>() => void 16 private myPrivateMethod1<T extends privateClass>() { // do not emit extends clause 17 >myPrivateMethod1 : <T extends privateClass>() => void 19 private static myPrivateStaticMethod2<T extends publicClass>() { // do not emit extends clause 20 >myPrivateStaticMethod2 : <T extends publicClass>() => void 22 private myPrivateMethod2<T extends publicClass>() { // do not emit extends clause 23 >myPrivateMethod2 : <T extends publicClass>() => void 25 public static myPublicStaticMethod<T extends publicClass>() { 26 >myPublicStaticMethod : <T extends publicClass>() => void [all …]
|