Apply same single-line style to copied nodes as manufactured ones (#57890)

Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
This commit is contained in:
Wesley WighamandTypeScript Bot authored and GitHub committed 2024-03-27 10:40:05 -07:00
1 parent 32a1370fa8
commit 47f48d3bac
503 files changed
+1411 -1406

No files matched your search

+8 -3
View File
@@ -272,6 +272,7 @@ import {
getEffectiveTypeParameterDeclarations,
getElementOrPropertyAccessName,
getEmitDeclarations,
getEmitFlags,
getEmitModuleKind,
getEmitModuleResolutionKind,
getEmitScriptTarget,
@@ -632,6 +633,7 @@ import {
isLiteralTypeNode,
isLogicalOrCoalescingBinaryExpression,
isLogicalOrCoalescingBinaryOperator,
isMappedTypeNode,
isMetaProperty,
isMethodDeclaration,
isMethodSignature,
@@ -8620,7 +8622,6 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
cancellationToken.throwIfCancellationRequested();
}
let hadError = false;
const file = getSourceFileOfNode(existing);
const transformed = visitNode(existing, visitExistingNodeTreeSymbols, isTypeNode);
if (hadError) {
return undefined;
@@ -8756,8 +8757,12 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
}
}
if (file && isTupleTypeNode(node) && !nodeIsSynthesized(node) && (getLineAndCharacterOfPosition(file, node.pos).line === getLineAndCharacterOfPosition(file, node.end).line)) {
setEmitFlags(node, EmitFlags.SingleLine);
if (isTupleTypeNode(node) || isTypeLiteralNode(node) || isMappedTypeNode(node)) {
const visited = visitEachChild(node, visitExistingNodeTreeSymbols, /*context*/ undefined);
const clone = setTextRange(visited === node ? factory.cloneNode(node) : visited, node);
const flags = getEmitFlags(clone);
setEmitFlags(clone, flags | (context.flags & NodeBuilderFlags.MultilineObjectLiterals && isTypeLiteralNode(node) ? 0 : EmitFlags.SingleLine));
return clone;
}
return visitEachChild(node, visitExistingNodeTreeSymbols, /*context*/ undefined);
@@ -13,7 +13,7 @@ module A {
}
export var UnitSquare : {
>UnitSquare : { top: { left: Point; right: Point;}; bottom: { left: Point; right: Point;}; }
>UnitSquare : { top: { left: Point; right: Point; }; bottom: { left: Point; right: Point; }; }
top: { left: Point, right: Point },
>top : { left: Point; right: Point; }
@@ -35,7 +35,7 @@ module A {
=== test.ts ===
var fn: () => { x: number; y: number };
>fn : () => { x: number; y: number;}
>fn : () => { x: number; y: number; }
>x : number
>y : number
@@ -35,7 +35,7 @@ module B {
=== test.ts ===
var fn: () => { x: number; y: number };
>fn : () => { x: number; y: number;}
>fn : () => { x: number; y: number; }
>x : number
>y : number
@@ -84,7 +84,7 @@ var p = Geometry.Origin;
>Origin : A.Point
var line: { start: { x: number; y: number }; end: { x: number; y: number; } };
>line : { start: { x: number; y: number;}; end: { x: number; y: number;}; }
>line : { start: { x: number; y: number; }; end: { x: number; y: number; }; }
>start : { x: number; y: number; }
>x : number
>y : number
@@ -16,7 +16,7 @@ type AnyCtor<P extends object> = new (...a: any[]) => P
>a : any[]
declare function classWithProperties<T extends { [key: string]: Types }, P extends object>(properties: T, klass: AnyCtor<P>): {
>classWithProperties : <T extends { [key: string]: Types; }, P extends object>(properties: T, klass: AnyCtor<P>) => { new (): P & Properties<T>; prototype: P & Properties<T>;}
>classWithProperties : <T extends { [key: string]: Types; }, P extends object>(properties: T, klass: AnyCtor<P>) => { new (): P & Properties<T>; prototype: P & Properties<T>; }
>key : string
>properties : T
>klass : AnyCtor<P>
@@ -30,7 +30,7 @@ var b: { x: IHasVisualizationModel } = { x: moduleA };
>moduleA : typeof moduleA
var c: { y: { z: IHasVisualizationModel } } = { y: { z: moduleA } };
>c : { y: { z: IHasVisualizationModel;}; }
>c : { y: { z: IHasVisualizationModel; }; }
>y : { z: IHasVisualizationModel; }
>z : IHasVisualizationModel
>{ y: { z: moduleA } } : { y: { z: typeof moduleA; }; }
@@ -4,7 +4,7 @@
// from webpack/lib/Compilation.js and filed at #26427
/** @param {{ [s: string]: number }} map */
function mappy(map) {}
>mappy : (map: { [s: string]: number;}) => void
>mappy : (map: { [s: string]: number; }) => void
>map : { [s: string]: number; }
export class C {
+1 -1
View File
@@ -8,7 +8,7 @@ module M {
>C : C
m(fn:{ (n:number):string; },n2:number):string {
>m : (fn: { (n: number): string;}, n2: number) => string
>m : (fn: { (n: number): string; }, n2: number) => string
>fn : (n: number) => string
>n : number
>n2 : number
@@ -85,7 +85,7 @@ var r3 = foo3(a); // any
>a : any
declare function foo7(x: { bar: number }): { bar: number };
>foo7 : { (x: { bar: number;}): { bar: number;}; (x: any): any; }
>foo7 : { (x: { bar: number; }): { bar: number; }; (x: any): any; }
>x : { bar: number; }
>bar : number
>bar : number
@@ -47,7 +47,7 @@ var o = { x: ["string", 1], y: { c: true, d: "world", e: 3 } };
>3 : 3
var o1: { x: [string, number], y: { c: boolean, d: string, e: number } } = { x: ["string", 1], y: { c: true, d: "world", e: 3 } };
>o1 : { x: [string, number]; y: { c: boolean; d: string; e: number;}; }
>o1 : { x: [string, number]; y: { c: boolean; d: string; e: number; }; }
>x : [string, number]
>y : { c: boolean; d: string; e: number; }
>c : boolean
@@ -35,7 +35,7 @@ function foo(animals: IAnimal[]) { }
>animals : IAnimal[]
function bar(animals: { [n: number]: IAnimal }) { }
>bar : (animals: { [n: number]: IAnimal;}) => void
>bar : (animals: { [n: number]: IAnimal; }) => void
>animals : { [n: number]: IAnimal; }
>n : number
@@ -58,28 +58,28 @@ var es = [(x: string) => 2, (x: Object) => 1]; // { (x:string) => number }[]
>1 : 1
var fs = [(a: { x: number; y?: number }) => 1, (b: { x: number; z?: number }) => 2]; // (a: { x: number; y?: number }) => number[]
>fs : (((a: { x: number; y?: number;}) => number) | ((b: { x: number; z?: number;}) => number))[]
>[(a: { x: number; y?: number }) => 1, (b: { x: number; z?: number }) => 2] : (((a: { x: number; y?: number;}) => number) | ((b: { x: number; z?: number;}) => number))[]
>(a: { x: number; y?: number }) => 1 : (a: { x: number; y?: number;}) => number
>fs : (((a: { x: number; y?: number; }) => number) | ((b: { x: number; z?: number; }) => number))[]
>[(a: { x: number; y?: number }) => 1, (b: { x: number; z?: number }) => 2] : (((a: { x: number; y?: number; }) => number) | ((b: { x: number; z?: number; }) => number))[]
>(a: { x: number; y?: number }) => 1 : (a: { x: number; y?: number; }) => number
>a : { x: number; y?: number; }
>x : number
>y : number
>1 : 1
>(b: { x: number; z?: number }) => 2 : (b: { x: number; z?: number;}) => number
>(b: { x: number; z?: number }) => 2 : (b: { x: number; z?: number; }) => number
>b : { x: number; z?: number; }
>x : number
>z : number
>2 : 2
var gs = [(b: { x: number; z?: number }) => 2, (a: { x: number; y?: number }) => 1]; // (b: { x: number; z?: number }) => number[]
>gs : (((b: { x: number; z?: number;}) => number) | ((a: { x: number; y?: number;}) => number))[]
>[(b: { x: number; z?: number }) => 2, (a: { x: number; y?: number }) => 1] : (((b: { x: number; z?: number;}) => number) | ((a: { x: number; y?: number;}) => number))[]
>(b: { x: number; z?: number }) => 2 : (b: { x: number; z?: number;}) => number
>gs : (((b: { x: number; z?: number; }) => number) | ((a: { x: number; y?: number; }) => number))[]
>[(b: { x: number; z?: number }) => 2, (a: { x: number; y?: number }) => 1] : (((b: { x: number; z?: number; }) => number) | ((a: { x: number; y?: number; }) => number))[]
>(b: { x: number; z?: number }) => 2 : (b: { x: number; z?: number; }) => number
>b : { x: number; z?: number; }
>x : number
>z : number
>2 : 2
>(a: { x: number; y?: number }) => 1 : (a: { x: number; y?: number;}) => number
>(a: { x: number; y?: number }) => 1 : (a: { x: number; y?: number; }) => number
>a : { x: number; y?: number; }
>x : number
>y : number
@@ -52,7 +52,7 @@ myArray = [[1, 2]];
>2 : 2
function isEmpty(l: { length: number }) {
>isEmpty : (l: { length: number;}) => boolean
>isEmpty : (l: { length: number; }) => boolean
>l : { length: number; }
>length : number
@@ -2,7 +2,7 @@
=== assignmentCompatBug5.ts ===
function foo1(x: { a: number; }) { }
>foo1 : (x: { a: number;}) => void
>foo1 : (x: { a: number; }) => void
>x : { a: number; }
>a : number
@@ -2,7 +2,7 @@
=== assignmentCompatFunctionsWithOptionalArgs.ts ===
function foo(x: { id: number; name?: string; }): void;
>foo : (x: { id: number; name?: string;}) => void
>foo : (x: { id: number; name?: string; }) => void
>x : { id: number; name?: string; }
>id : number
>name : string
@@ -5,7 +5,7 @@ class Foo{};
>Foo : Foo
function bar(x: {new(): Foo;}){}
>bar : (x: { new (): Foo;}) => void
>bar : (x: { new (): Foo; }) => void
>x : new () => Foo
bar(Foo); // Error, but should be allowed
@@ -76,7 +76,7 @@ var a10: (...x: Derived[]) => Derived;
>x : Derived[]
var a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base;
>a11 : (x: { foo: string;}, y: { foo: string; bar: string;}) => Base
>a11 : (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>x : { foo: string; }
>foo : string
>y : { foo: string; bar: string; }
@@ -94,7 +94,7 @@ var a13: (x: Array<Base>, y: Array<Derived>) => Array<Derived>;
>y : Derived[]
var a14: (x: { a: string; b: number }) => Object;
>a14 : (x: { a: string; b: number;}) => Object
>a14 : (x: { a: string; b: number; }) => Object
>x : { a: string; b: number; }
>a : string
>b : number
@@ -130,7 +130,7 @@ var a17: {
};
var a18: {
>a18 : { (x: { (a: number): number; (a: string): string;}): any[]; (x: { (a: boolean): boolean; (a: Date): Date;}): any[]; }
>a18 : { (x: { (a: number): number; (a: string): string; }): any[]; (x: { (a: boolean): boolean; (a: Date): Date; }): any[]; }
(x: {
>x : { (a: number): number; (a: string): string; }
@@ -276,10 +276,10 @@ b8 = a8; // ok
>a8 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived
var b9: <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U;
>b9 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number;}) => U) => (r: T) => U
>b9 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U
>x : (arg: T) => U
>arg : T
>y : (arg2: { foo: string; bing: number;}) => U
>y : (arg2: { foo: string; bing: number; }) => U
>arg2 : { foo: string; bing: number; }
>foo : string
>bing : number
@@ -355,7 +355,7 @@ b13 = a13; // ok
>a13 : (x: Base[], y: Derived[]) => Derived[]
var b14: <T>(x: { a: T; b: T }) => T;
>b14 : <T>(x: { a: T; b: T;}) => T
>b14 : <T>(x: { a: T; b: T; }) => T
>x : { a: T; b: T; }
>a : T
>b : T
@@ -52,7 +52,7 @@ module Errors {
>x : Base[]
var a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base;
>a11 : (x: { foo: string;}, y: { foo: string; bar: string;}) => Base
>a11 : (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>x : { foo: string; }
>foo : string
>y : { foo: string; bar: string; }
@@ -75,13 +75,13 @@ module Errors {
};
var a15: (x: { a: string; b: number }) => number;
>a15 : (x: { a: string; b: number;}) => number
>a15 : (x: { a: string; b: number; }) => number
>x : { a: string; b: number; }
>a : string
>b : number
var a16: {
>a16 : { (x: { (a: number): number; (a?: number): number;}): number[]; (x: { (a: boolean): boolean; (a?: boolean): boolean;}): boolean[]; }
>a16 : { (x: { (a: number): number; (a?: number): number; }): number[]; (x: { (a: boolean): boolean; (a?: boolean): boolean; }): boolean[]; }
(x: {
>x : { (a: number): number; (a?: number): number; }
@@ -160,10 +160,10 @@ module Errors {
>a7 : (x: (arg: Base) => Derived) => (r: Base) => Derived2
var b8: <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U;
>b8 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number;}) => U) => (r: T) => U
>b8 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U
>x : (arg: T) => U
>arg : T
>y : (arg2: { foo: number;}) => U
>y : (arg2: { foo: number; }) => U
>arg2 : { foo: number; }
>foo : number
>r : T
@@ -224,7 +224,7 @@ module Errors {
>a12 : (x: Base[], y: Derived2[]) => Derived[]
var b15: <T>(x: { a: T; b: T }) => T;
>b15 : <T>(x: { a: T; b: T;}) => T
>b15 : <T>(x: { a: T; b: T; }) => T
>x : { a: T; b: T; }
>a : T
>b : T
@@ -240,7 +240,7 @@ module Errors {
>a15 : (x: { a: string; b: number; }) => number
var b15a: <T extends Base>(x: { a: T; b: T }) => number;
>b15a : <T extends Base>(x: { a: T; b: T;}) => number
>b15a : <T extends Base>(x: { a: T; b: T; }) => number
>x : { a: T; b: T; }
>a : T
>b : T
@@ -50,7 +50,7 @@ var a6: <T extends Base>(x: (arg: T) => Derived) => T;
>arg : T
var a11: <T>(x: { foo: T }, y: { foo: T; bar: T }) => Base;
>a11 : <T>(x: { foo: T;}, y: { foo: T; bar: T;}) => Base
>a11 : <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base
>x : { foo: T; }
>foo : T
>y : { foo: T; bar: T; }
@@ -58,13 +58,13 @@ var a11: <T>(x: { foo: T }, y: { foo: T; bar: T }) => Base;
>bar : T
var a15: <T>(x: { a: T; b: T }) => T[];
>a15 : <T>(x: { a: T; b: T;}) => T[]
>a15 : <T>(x: { a: T; b: T; }) => T[]
>x : { a: T; b: T; }
>a : T
>b : T
var a16: <T extends Base>(x: { a: T; b: T }) => T[];
>a16 : <T extends Base>(x: { a: T; b: T;}) => T[]
>a16 : <T extends Base>(x: { a: T; b: T; }) => T[]
>x : { a: T; b: T; }
>a : T
>b : T
@@ -194,7 +194,7 @@ b6 = a6; // ok
>a6 : <T extends Base>(x: (arg: T) => Derived) => T
var b11: <T, U>(x: { foo: T }, y: { foo: U; bar: U }) => Base;
>b11 : <T, U>(x: { foo: T;}, y: { foo: U; bar: U;}) => Base
>b11 : <T, U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base
>x : { foo: T; }
>foo : T
>y : { foo: U; bar: U; }
@@ -212,7 +212,7 @@ b11 = a11; // ok
>a11 : <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base
var b15: <U, V>(x: { a: U; b: V; }) => U[];
>b15 : <U, V>(x: { a: U; b: V;}) => U[]
>b15 : <U, V>(x: { a: U; b: V; }) => U[]
>x : { a: U; b: V; }
>a : U
>b : V
@@ -228,7 +228,7 @@ b15 = a15; // ok
>a15 : <T>(x: { a: T; b: T; }) => T[]
var b16: <T>(x: { a: T; b: T }) => T[];
>b16 : <T>(x: { a: T; b: T;}) => T[]
>b16 : <T>(x: { a: T; b: T; }) => T[]
>x : { a: T; b: T; }
>a : T
>b : T
@@ -51,7 +51,7 @@ interface A {
>arg : T
a11: <T>(x: { foo: T }, y: { foo: T; bar: T }) => Base;
>a11 : <T>(x: { foo: T;}, y: { foo: T; bar: T;}) => Base
>a11 : <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base
>x : { foo: T; }
>foo : T
>y : { foo: T; bar: T; }
@@ -59,13 +59,13 @@ interface A {
>bar : T
a15: <T>(x: { a: T; b: T }) => T[];
>a15 : <T>(x: { a: T; b: T;}) => T[]
>a15 : <T>(x: { a: T; b: T; }) => T[]
>x : { a: T; b: T; }
>a : T
>b : T
a16: <T extends Base>(x: { a: T; b: T }) => T[];
>a16 : <T extends Base>(x: { a: T; b: T;}) => T[]
>a16 : <T extends Base>(x: { a: T; b: T; }) => T[]
>x : { a: T; b: T; }
>a : T
>b : T
@@ -167,7 +167,7 @@ b5 = x.a5;
>a5 : <T, U>(x: (arg: T) => U) => T
var b11: <T, U>(x: { foo: T }, y: { foo: U; bar: U }) => Base;
>b11 : <T, U>(x: { foo: T;}, y: { foo: U; bar: U;}) => Base
>b11 : <T, U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base
>x : { foo: T; }
>foo : T
>y : { foo: U; bar: U; }
@@ -189,7 +189,7 @@ b11 = x.a11;
>a11 : <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base
var b16: <T>(x: { a: T; b: T }) => T[];
>b16 : <T>(x: { a: T; b: T;}) => T[]
>b16 : <T>(x: { a: T; b: T; }) => T[]
>x : { a: T; b: T; }
>a : T
>b : T
@@ -76,7 +76,7 @@ var a10: new (...x: Derived[]) => Derived;
>x : Derived[]
var a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base;
>a11 : new (x: { foo: string;}, y: { foo: string; bar: string;}) => Base
>a11 : new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>x : { foo: string; }
>foo : string
>y : { foo: string; bar: string; }
@@ -94,7 +94,7 @@ var a13: new (x: Array<Base>, y: Array<Derived>) => Array<Derived>;
>y : Derived[]
var a14: new (x: { a: string; b: number }) => Object;
>a14 : new (x: { a: string; b: number;}) => Object
>a14 : new (x: { a: string; b: number; }) => Object
>x : { a: string; b: number; }
>a : string
>b : number
@@ -130,7 +130,7 @@ var a17: {
};
var a18: {
>a18 : { new (x: { new (a: number): number; new (a: string): string;}): any[]; new (x: { new (a: boolean): boolean; new (a: Date): Date;}): any[]; }
>a18 : { new (x: { new (a: number): number; new (a: string): string; }): any[]; new (x: { new (a: boolean): boolean; new (a: Date): Date; }): any[]; }
new (x: {
>x : { new (a: number): number; new (a: string): string; }
@@ -276,10 +276,10 @@ b8 = a8; // ok
>a8 : new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived
var b9: new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U;
>b9 : new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number;}) => U) => (r: T) => U
>b9 : new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U
>x : (arg: T) => U
>arg : T
>y : (arg2: { foo: string; bing: number;}) => U
>y : (arg2: { foo: string; bing: number; }) => U
>arg2 : { foo: string; bing: number; }
>foo : string
>bing : number
@@ -355,7 +355,7 @@ b13 = a13; // ok
>a13 : new (x: Base[], y: Derived[]) => Derived[]
var b14: new <T>(x: { a: T; b: T }) => T;
>b14 : new <T>(x: { a: T; b: T;}) => T
>b14 : new <T>(x: { a: T; b: T; }) => T
>x : { a: T; b: T; }
>a : T
>b : T
@@ -52,7 +52,7 @@ module Errors {
>x : Base[]
var a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base;
>a11 : new (x: { foo: string;}, y: { foo: string; bar: string;}) => Base
>a11 : new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>x : { foo: string; }
>foo : string
>y : { foo: string; bar: string; }
@@ -75,13 +75,13 @@ module Errors {
};
var a15: new (x: { a: string; b: number }) => number;
>a15 : new (x: { a: string; b: number;}) => number
>a15 : new (x: { a: string; b: number; }) => number
>x : { a: string; b: number; }
>a : string
>b : number
var a16: {
>a16 : { new (x: { new (a: number): number; new (a?: number): number;}): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean;}): boolean[]; }
>a16 : { new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }
new (x: {
>x : { new (a: number): number; new (a?: number): number; }
@@ -160,10 +160,10 @@ module Errors {
>a7 : new (x: (arg: Base) => Derived) => (r: Base) => Derived2
var b8: new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U;
>b8 : new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number;}) => U) => (r: T) => U
>b8 : new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U
>x : (arg: T) => U
>arg : T
>y : (arg2: { foo: number;}) => U
>y : (arg2: { foo: number; }) => U
>arg2 : { foo: number; }
>foo : number
>r : T
@@ -224,7 +224,7 @@ module Errors {
>a12 : new (x: Base[], y: Derived2[]) => Derived[]
var b15: new <T>(x: { a: T; b: T }) => T;
>b15 : new <T>(x: { a: T; b: T;}) => T
>b15 : new <T>(x: { a: T; b: T; }) => T
>x : { a: T; b: T; }
>a : T
>b : T
@@ -240,7 +240,7 @@ module Errors {
>a15 : new (x: { a: string; b: number; }) => number
var b15a: new <T extends Base>(x: { a: T; b: T }) => number;
>b15a : new <T extends Base>(x: { a: T; b: T;}) => number
>b15a : new <T extends Base>(x: { a: T; b: T; }) => number
>x : { a: T; b: T; }
>a : T
>b : T
@@ -50,7 +50,7 @@ var a6: new <T extends Base>(x: new (arg: T) => Derived) => T;
>arg : T
var a11: new <T>(x: { foo: T }, y: { foo: T; bar: T }) => Base;
>a11 : new <T>(x: { foo: T;}, y: { foo: T; bar: T;}) => Base
>a11 : new <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base
>x : { foo: T; }
>foo : T
>y : { foo: T; bar: T; }
@@ -58,13 +58,13 @@ var a11: new <T>(x: { foo: T }, y: { foo: T; bar: T }) => Base;
>bar : T
var a15: new <T>(x: { a: T; b: T }) => T[];
>a15 : new <T>(x: { a: T; b: T;}) => T[]
>a15 : new <T>(x: { a: T; b: T; }) => T[]
>x : { a: T; b: T; }
>a : T
>b : T
var a16: new <T extends Base>(x: { a: T; b: T }) => T[];
>a16 : new <T extends Base>(x: { a: T; b: T;}) => T[]
>a16 : new <T extends Base>(x: { a: T; b: T; }) => T[]
>x : { a: T; b: T; }
>a : T
>b : T
@@ -194,7 +194,7 @@ b6 = a6; // ok
>a6 : new <T extends Base>(x: new (arg: T) => Derived) => T
var b11: new <T, U>(x: { foo: T }, y: { foo: U; bar: U }) => Base;
>b11 : new <T, U>(x: { foo: T;}, y: { foo: U; bar: U;}) => Base
>b11 : new <T, U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base
>x : { foo: T; }
>foo : T
>y : { foo: U; bar: U; }
@@ -212,7 +212,7 @@ b11 = a11; // ok
>a11 : new <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base
var b15: new <U, V>(x: { a: U; b: V; }) => U[];
>b15 : new <U, V>(x: { a: U; b: V;}) => U[]
>b15 : new <U, V>(x: { a: U; b: V; }) => U[]
>x : { a: U; b: V; }
>a : U
>b : V
@@ -228,7 +228,7 @@ b15 = a15; // ok
>a15 : new <T>(x: { a: T; b: T; }) => T[]
var b16: new <T>(x: { a: T; b: T }) => T[];
>b16 : new <T>(x: { a: T; b: T;}) => T[]
>b16 : new <T>(x: { a: T; b: T; }) => T[]
>x : { a: T; b: T; }
>a : T
>b : T
@@ -51,7 +51,7 @@ interface A {
>arg : T
a11: new <T>(x: { foo: T }, y: { foo: T; bar: T }) => Base;
>a11 : new <T>(x: { foo: T;}, y: { foo: T; bar: T;}) => Base
>a11 : new <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base
>x : { foo: T; }
>foo : T
>y : { foo: T; bar: T; }
@@ -59,13 +59,13 @@ interface A {
>bar : T
a15: new <T>(x: { a: T; b: T }) => T[];
>a15 : new <T>(x: { a: T; b: T;}) => T[]
>a15 : new <T>(x: { a: T; b: T; }) => T[]
>x : { a: T; b: T; }
>a : T
>b : T
a16: new <T extends Base>(x: { a: T; b: T }) => T[];
>a16 : new <T extends Base>(x: { a: T; b: T;}) => T[]
>a16 : new <T extends Base>(x: { a: T; b: T; }) => T[]
>x : { a: T; b: T; }
>a : T
>b : T
@@ -167,7 +167,7 @@ b5 = x.a5;
>a5 : new <T, U>(x: (arg: T) => U) => T
var b11: new <T, U>(x: { foo: T }, y: { foo: U; bar: U }) => Base;
>b11 : new <T, U>(x: { foo: T;}, y: { foo: U; bar: U;}) => Base
>b11 : new <T, U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base
>x : { foo: T; }
>foo : T
>y : { foo: U; bar: U; }
@@ -189,7 +189,7 @@ b11 = x.a11;
>a11 : new <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base
var b16: new <T>(x: { a: T; b: T }) => T[];
>b16 : new <T>(x: { a: T; b: T;}) => T[]
>b16 : new <T>(x: { a: T; b: T; }) => T[]
>x : { a: T; b: T; }
>a : T
>b : T
@@ -186,7 +186,7 @@ fn = () => 3; // Bug 823548: Should be error (fn is not a reference)
>3 : 3
function fn2(x: number, y: { t: number }) {
>fn2 : (x: number, y: { t: number;}) => void
>fn2 : (x: number, y: { t: number; }) => void
>x : number
>y : { t: number; }
>t : number
@@ -3,10 +3,10 @@
=== asyncFunctionReturnExpressionErrorSpans.ts ===
interface Foo {
bar: {
>bar : { baz: { inner: { thing: string; };}; }
>bar : { baz: { inner: { thing: string; }; }; }
baz: {
>baz : { inner: { thing: string;}; }
>baz : { inner: { thing: string; }; }
inner: {
>inner : { thing: string; }
@@ -5,7 +5,7 @@ declare const foo: ["a", string, number] | ["b", string, boolean];
>foo : ["a", string, number] | ["b", string, boolean]
export function test(arg: { index?: number }) {
>test : (arg: { index?: number;}) => void
>test : (arg: { index?: number; }) => void
>arg : { index?: number | undefined; }
>index : number | undefined
@@ -17,7 +17,7 @@ interface IAsyncEnumerator<T> {
>next3 : () => Promise<T | {}>
next4(): Promise<T | { x: string }>;
>next4 : () => Promise<T | { x: string;}>
>next4 : () => Promise<T | { x: string; }>
>x : string
}
@@ -175,7 +175,7 @@ interface Obj { x: number }
>x : number
async function fn<T>(): Promise<T extends object ? { [K in keyof T]: Obj } : Obj> {
>fn : <T>() => Promise<T extends object ? { [K in keyof T]: Obj;} : Obj>
>fn : <T>() => Promise<T extends object ? { [K in keyof T]: Obj; } : Obj>
// Per #45924, this was failing due to incorrect inference both above and here.
// Should not error.
+2 -2
View File
@@ -19,8 +19,8 @@ o2?.b();
>b : () => number
declare const o3: { b: (() => { c: string }) | undefined };
>o3 : { b: (() => { c: string;}) | undefined; }
>b : () => { c: string;}
>o3 : { b: (() => { c: string; }) | undefined; }
>b : () => { c: string; }
>c : string
o3.b?.().c;
+2 -2
View File
@@ -5,8 +5,8 @@ declare function absorb<T>(): T;
>absorb : <T>() => T
declare const a: { m?<T>(obj: {x: T}): T } | undefined;
>a : { m?<T>(obj: { x: T;}): T; } | undefined
>m : (<T>(obj: { x: T;}) => T) | undefined
>a : { m?<T>(obj: { x: T; }): T; } | undefined
>m : (<T>(obj: { x: T; }) => T) | undefined
>obj : { x: T; }
>x : T
+2 -2
View File
@@ -108,8 +108,8 @@ o2?.["b"](1, ...[2, 3], 4);
>4 : 4
declare const o3: { b: ((...args: any[]) => { c: string }) | undefined };
>o3 : { b: ((...args: any[]) => { c: string;}) | undefined; }
>b : ((...args: any[]) => { c: string;}) | undefined
>o3 : { b: ((...args: any[]) => { c: string; }) | undefined; }
>b : ((...args: any[]) => { c: string; }) | undefined
>args : any[]
>c : string
@@ -78,7 +78,7 @@ interface A { // T
>x : Derived[]
a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base;
>a11 : (x: { foo: string;}, y: { foo: string; bar: string;}) => Base
>a11 : (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>x : { foo: string; }
>foo : string
>y : { foo: string; bar: string; }
@@ -96,7 +96,7 @@ interface A { // T
>y : Derived[]
a14: (x: { a: string; b: number }) => Object;
>a14 : (x: { a: string; b: number;}) => Object
>a14 : (x: { a: string; b: number; }) => Object
>x : { a: string; b: number; }
>a : string
>b : number
@@ -134,7 +134,7 @@ interface A { // T
};
a18: {
>a18 : { (x: { (a: number): number; (a: string): string;}): any[]; (x: { (a: boolean): boolean; (a: Date): Date;}): any[]; }
>a18 : { (x: { (a: number): number; (a: string): string; }): any[]; (x: { (a: boolean): boolean; (a: Date): Date; }): any[]; }
(x: {
>x : { (a: number): number; (a: string): string; }
@@ -204,10 +204,10 @@ interface I extends A {
>r : T
a9: <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal
>a9 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number;}) => U) => (r: T) => U
>a9 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U
>x : (arg: T) => U
>arg : T
>y : (arg2: { foo: string; bing: number;}) => U
>y : (arg2: { foo: string; bing: number; }) => U
>arg2 : { foo: string; bing: number; }
>foo : string
>bing : number
@@ -233,7 +233,7 @@ interface I extends A {
>y : T
a14: <T, U>(x: { a: T; b: U }) => T; // ok
>a14 : <T, U>(x: { a: T; b: U;}) => T
>a14 : <T, U>(x: { a: T; b: U; }) => T
>x : { a: T; b: U; }
>a : T
>b : U
@@ -52,7 +52,7 @@ module Errors {
>x : Base[]
a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base;
>a11 : (x: { foo: string;}, y: { foo: string; bar: string;}) => Base
>a11 : (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>x : { foo: string; }
>foo : string
>y : { foo: string; bar: string; }
@@ -75,13 +75,13 @@ module Errors {
};
a15: (x: { a: string; b: number }) => number;
>a15 : (x: { a: string; b: number;}) => number
>a15 : (x: { a: string; b: number; }) => number
>x : { a: string; b: number; }
>a : string
>b : number
a16: {
>a16 : { (x: { (a: number): number; (a?: number): number;}): number[]; (x: { (a: boolean): boolean; (a?: boolean): boolean;}): boolean[]; }
>a16 : { (x: { (a: number): number; (a?: number): number; }): number[]; (x: { (a: boolean): boolean; (a?: boolean): boolean; }): boolean[]; }
// type of parameter is overload set which means we can't do inference based on this type
(x: {
@@ -154,10 +154,10 @@ module Errors {
interface I4 extends A {
a8: <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; // error, type mismatch
>a8 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number;}) => U) => (r: T) => U
>a8 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U
>x : (arg: T) => U
>arg : T
>y : (arg2: { foo: number;}) => U
>y : (arg2: { foo: number; }) => U
>arg2 : { foo: number; }
>foo : number
>r : T
@@ -185,7 +185,7 @@ module Errors {
interface I6 extends A {
a15: <T>(x: { a: T; b: T }) => T; // error, T is {} which isn't an acceptable return type
>a15 : <T>(x: { a: T; b: T;}) => T
>a15 : <T>(x: { a: T; b: T; }) => T
>x : { a: T; b: T; }
>a : T
>b : T
@@ -193,7 +193,7 @@ module Errors {
interface I7 extends A {
a15: <T extends Base>(x: { a: T; b: T }) => number; // error, T defaults to Base, which is not compatible with number or string
>a15 : <T extends Base>(x: { a: T; b: T;}) => number
>a15 : <T extends Base>(x: { a: T; b: T; }) => number
>x : { a: T; b: T; }
>a : T
>b : T
@@ -52,7 +52,7 @@ interface A { // T
>arg : T
a11: <T>(x: { foo: T }, y: { foo: T; bar: T }) => Base;
>a11 : <T>(x: { foo: T;}, y: { foo: T; bar: T;}) => Base
>a11 : <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base
>x : { foo: T; }
>foo : T
>y : { foo: T; bar: T; }
@@ -60,13 +60,13 @@ interface A { // T
>bar : T
a15: <T>(x: { a: T; b: T }) => T[];
>a15 : <T>(x: { a: T; b: T;}) => T[]
>a15 : <T>(x: { a: T; b: T; }) => T[]
>x : { a: T; b: T; }
>a : T
>b : T
a16: <T extends Base>(x: { a: T; b: T }) => T[];
>a16 : <T extends Base>(x: { a: T; b: T;}) => T[]
>a16 : <T extends Base>(x: { a: T; b: T; }) => T[]
>x : { a: T; b: T; }
>a : T
>b : T
@@ -140,7 +140,7 @@ interface I extends A {
>arg : T
a11: <T, U>(x: { foo: T }, y: { foo: U; bar: U }) => Base; // ok
>a11 : <T, U>(x: { foo: T;}, y: { foo: U; bar: U;}) => Base
>a11 : <T, U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base
>x : { foo: T; }
>foo : T
>y : { foo: U; bar: U; }
@@ -148,13 +148,13 @@ interface I extends A {
>bar : U
a15: <U, V>(x: { a: U; b: V; }) => U[]; // ok, T = U, T = V
>a15 : <U, V>(x: { a: U; b: V;}) => U[]
>a15 : <U, V>(x: { a: U; b: V; }) => U[]
>x : { a: U; b: V; }
>a : U
>b : V
a16: <T>(x: { a: T; b: T }) => T[]; // ok, more general parameter type
>a16 : <T>(x: { a: T; b: T;}) => T[]
>a16 : <T>(x: { a: T; b: T; }) => T[]
>x : { a: T; b: T; }
>a : T
>b : T
@@ -79,7 +79,7 @@ interface A { // T
>x : Derived[]
a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base;
>a11 : (x: { foo: string;}, y: { foo: string; bar: string;}) => Base
>a11 : (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>x : { foo: string; }
>foo : string
>y : { foo: string; bar: string; }
@@ -97,7 +97,7 @@ interface A { // T
>y : Derived[]
a14: (x: { a: string; b: number }) => Object;
>a14 : (x: { a: string; b: number;}) => Object
>a14 : (x: { a: string; b: number; }) => Object
>x : { a: string; b: number; }
>a : string
>b : number
@@ -154,10 +154,10 @@ interface I extends B {
>r : T
a9: <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal
>a9 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number;}) => U) => (r: T) => U
>a9 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U
>x : (arg: T) => U
>arg : T
>y : (arg2: { foo: string; bing: number;}) => U
>y : (arg2: { foo: string; bing: number; }) => U
>arg2 : { foo: string; bing: number; }
>foo : string
>bing : number
@@ -183,7 +183,7 @@ interface I extends B {
>y : T
a14: <T, U>(x: { a: T; b: U }) => T; // ok
>a14 : <T, U>(x: { a: T; b: U;}) => T
>a14 : <T, U>(x: { a: T; b: U; }) => T
>x : { a: T; b: U; }
>a : T
>b : U
@@ -54,7 +54,7 @@ interface A { // T
>arg : T
a11: <T>(x: { foo: T }, y: { foo: T; bar: T }) => Base;
>a11 : <T>(x: { foo: T;}, y: { foo: T; bar: T;}) => Base
>a11 : <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base
>x : { foo: T; }
>foo : T
>y : { foo: T; bar: T; }
@@ -62,13 +62,13 @@ interface A { // T
>bar : T
a15: <T>(x: { a: T; b: T }) => T[];
>a15 : <T>(x: { a: T; b: T;}) => T[]
>a15 : <T>(x: { a: T; b: T; }) => T[]
>x : { a: T; b: T; }
>a : T
>b : T
a16: <T extends Base>(x: { a: T; b: T }) => T[];
>a16 : <T extends Base>(x: { a: T; b: T;}) => T[]
>a16 : <T extends Base>(x: { a: T; b: T; }) => T[]
>x : { a: T; b: T; }
>a : T
>b : T
@@ -109,7 +109,7 @@ interface I5<T> extends A {
interface I7<T> extends A {
a11: <U>(x: { foo: T }, y: { foo: U; bar: U }) => Base;
>a11 : <U>(x: { foo: T;}, y: { foo: U; bar: U;}) => Base
>a11 : <U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base
>x : { foo: T; }
>foo : T
>y : { foo: U; bar: U; }
@@ -119,7 +119,7 @@ interface I7<T> extends A {
interface I9<T> extends A {
a16: (x: { a: T; b: T }) => T[];
>a16 : (x: { a: T; b: T;}) => T[]
>a16 : (x: { a: T; b: T; }) => T[]
>x : { a: T; b: T; }
>a : T
>b : T
@@ -53,13 +53,13 @@ function test2() {
interface Messages {
readonly foo: (options: { [key: string]: any, b: number }) => string;
>foo : (options: { [key: string]: any; b: number;}) => string
>foo : (options: { [key: string]: any; b: number; }) => string
>options : { [key: string]: any; b: number; }
>key : string
>b : number
readonly bar: (options: { [key: string]: any, a: string }) => string;
>bar : (options: { [key: string]: any; a: string;}) => string
>bar : (options: { [key: string]: any; a: string; }) => string
>options : { [key: string]: any; a: string; }
>key : string
>a : string
@@ -119,17 +119,17 @@ function test3(items: string[] | number[]) {
}
function test4(
>test4 : (arg1: ((...objs: { x: number;}[]) => number) | ((...objs: { y: number;}[]) => number), arg2: ((a: { x: number;}, b: object) => number) | ((a: object, b: { x: number;}) => number), arg3: ((a: { x: number;}, ...objs: { y: number;}[]) => number) | ((...objs: { x: number;}[]) => number), arg4: ((a?: { x: number;}, b?: { x: number;}) => number) | ((a?: { y: number;}) => number), arg5: ((a?: { x: number;}, ...b: { x: number;}[]) => number) | ((a?: { y: number;}) => number), arg6: ((a?: { x: number;}, b?: { x: number;}) => number) | ((...a: { y: number;}[]) => number)) => void
>test4 : (arg1: ((...objs: { x: number; }[]) => number) | ((...objs: { y: number; }[]) => number), arg2: ((a: { x: number; }, b: object) => number) | ((a: object, b: { x: number; }) => number), arg3: ((a: { x: number; }, ...objs: { y: number; }[]) => number) | ((...objs: { x: number; }[]) => number), arg4: ((a?: { x: number; }, b?: { x: number; }) => number) | ((a?: { y: number; }) => number), arg5: ((a?: { x: number; }, ...b: { x: number; }[]) => number) | ((a?: { y: number; }) => number), arg6: ((a?: { x: number; }, b?: { x: number; }) => number) | ((...a: { y: number; }[]) => number)) => void
arg1: ((...objs: {x: number}[]) => number) | ((...objs: {y: number}[]) => number),
>arg1 : ((...objs: { x: number;}[]) => number) | ((...objs: { y: number;}[]) => number)
>arg1 : ((...objs: { x: number; }[]) => number) | ((...objs: { y: number; }[]) => number)
>objs : { x: number; }[]
>x : number
>objs : { y: number; }[]
>y : number
arg2: ((a: {x: number}, b: object) => number) | ((a: object, b: {x: number}) => number),
>arg2 : ((a: { x: number;}, b: object) => number) | ((a: object, b: { x: number;}) => number)
>arg2 : ((a: { x: number; }, b: object) => number) | ((a: object, b: { x: number; }) => number)
>a : { x: number; }
>x : number
>b : object
@@ -138,7 +138,7 @@ function test4(
>x : number
arg3: ((a: {x: number}, ...objs: {y: number}[]) => number) | ((...objs: {x: number}[]) => number),
>arg3 : ((a: { x: number;}, ...objs: { y: number;}[]) => number) | ((...objs: { x: number;}[]) => number)
>arg3 : ((a: { x: number; }, ...objs: { y: number; }[]) => number) | ((...objs: { x: number; }[]) => number)
>a : { x: number; }
>x : number
>objs : { y: number; }[]
@@ -147,7 +147,7 @@ function test4(
>x : number
arg4: ((a?: {x: number}, b?: {x: number}) => number) | ((a?: {y: number}) => number),
>arg4 : ((a?: { x: number;}, b?: { x: number;}) => number) | ((a?: { y: number;}) => number)
>arg4 : ((a?: { x: number; }, b?: { x: number; }) => number) | ((a?: { y: number; }) => number)
>a : { x: number; } | undefined
>x : number
>b : { x: number; } | undefined
@@ -156,7 +156,7 @@ function test4(
>y : number
arg5: ((a?: {x: number}, ...b: {x: number}[]) => number) | ((a?: {y: number}) => number),
>arg5 : ((a?: { x: number;}, ...b: { x: number;}[]) => number) | ((a?: { y: number;}) => number)
>arg5 : ((a?: { x: number; }, ...b: { x: number; }[]) => number) | ((a?: { y: number; }) => number)
>a : { x: number; } | undefined
>x : number
>b : { x: number; }[]
@@ -165,7 +165,7 @@ function test4(
>y : number
arg6: ((a?: {x: number}, b?: {x: number}) => number) | ((...a: {y: number}[]) => number),
>arg6 : ((a?: { x: number;}, b?: { x: number;}) => number) | ((...a: { y: number;}[]) => number)
>arg6 : ((a?: { x: number; }, b?: { x: number; }) => number) | ((...a: { y: number; }[]) => number)
>a : { x: number; } | undefined
>x : number
>b : { x: number; } | undefined
@@ -367,7 +367,7 @@ function test5() {
// Union of all intrinsics and components of `any`
function App(props: { component:React.ReactType }) {
>App : (props: { component: React.ReactType;}) => JSX.Element
>App : (props: { component: React.ReactType; }) => JSX.Element
>props : { component: React.ReactType; }
>component : React.ReactType<any>
>React : any
@@ -18,7 +18,7 @@ interface Sequence<T> {
>value : T
groupBy<K>(keySelector: (value: T) => K): Sequence<{ key: K; items: T[]; }>;
>groupBy : <K>(keySelector: (value: T) => K) => Sequence<{ key: K; items: T[];}>
>groupBy : <K>(keySelector: (value: T) => K) => Sequence<{ key: K; items: T[]; }>
>keySelector : (value: T) => K
>value : T
>key : K
@@ -29,7 +29,7 @@ class AsyncLoader<TResult> extends React.Component<AsyncLoaderProps<TResult>> {
}
async function load(): Promise<{ success: true } | ErrorResult> {
>load : () => Promise<{ success: true;} | ErrorResult>
>load : () => Promise<{ success: true; } | ErrorResult>
>success : true
>true : true
@@ -179,7 +179,7 @@ Object.defineProperty(x, "zipStr", {
* @param {{name: string}} named
*/
function takeName(named) { return named.name; }
>takeName : (named: { name: string;}) => string
>takeName : (named: { name: string; }) => string
>named : { name: string; }
>named.name : string
>named : { name: string; }
@@ -27,7 +27,7 @@ type Field<Source, Key extends string> = {
};
declare const object: <Source>() => <
>object : <Source>() => <Fields extends { [Key in keyof Fields]: Field<Source, Key & string>; }>(config: { name: string; fields: Fields | (() => Fields);}) => ObjectType<Source>
>object : <Source>() => <Fields extends { [Key in keyof Fields]: Field<Source, Key & string>; }>(config: { name: string; fields: Fields | (() => Fields); }) => ObjectType<Source>
Fields extends {
[Key in keyof Fields]: Field<Source, Key & string>;
@@ -4,7 +4,7 @@
interface A {}
function factory(a: any): {new(): Object} {
>factory : (a: any) => { new (): Object;}
>factory : (a: any) => { new (): Object; }
>a : any
return null;
@@ -20,10 +20,10 @@ declare function fab(arg: A | B): void;
>arg : A | B
declare function foo<T>(x: { kind: T }, f: (arg: { kind: T }) => void): void;
>foo : <T>(x: { kind: T;}, f: (arg: { kind: T;}) => void) => void
>foo : <T>(x: { kind: T; }, f: (arg: { kind: T; }) => void) => void
>x : { kind: T; }
>kind : T
>f : (arg: { kind: T;}) => void
>f : (arg: { kind: T; }) => void
>arg : { kind: T; }
>kind : T
@@ -425,12 +425,12 @@ declare module Immutable {
>value : this
merge(...collections: Array<Collection<K, V> | {[key: string]: V}>): this;
>merge : (...collections: Array<Collection<K, V> | { [key: string]: V;}>) => this
>merge : (...collections: Array<Collection<K, V> | { [key: string]: V; }>) => this
>collections : (Collection<K, V> | { [key: string]: V; })[]
>key : string
mergeWith(merger: (oldVal: V, newVal: V, key: K) => V, ...collections: Array<Collection<K, V> | {[key: string]: V}>): this;
>mergeWith : (merger: (oldVal: V, newVal: V, key: K) => V, ...collections: Array<Collection<K, V> | { [key: string]: V;}>) => this
>mergeWith : (merger: (oldVal: V, newVal: V, key: K) => V, ...collections: Array<Collection<K, V> | { [key: string]: V; }>) => this
>merger : (oldVal: V, newVal: V, key: K) => V
>oldVal : V
>newVal : V
@@ -439,12 +439,12 @@ declare module Immutable {
>key : string
mergeDeep(...collections: Array<Collection<K, V> | {[key: string]: V}>): this;
>mergeDeep : (...collections: Array<Collection<K, V> | { [key: string]: V;}>) => this
>mergeDeep : (...collections: Array<Collection<K, V> | { [key: string]: V; }>) => this
>collections : (Collection<K, V> | { [key: string]: V; })[]
>key : string
mergeDeepWith(merger: (oldVal: V, newVal: V, key: K) => V, ...collections: Array<Collection<K, V> | {[key: string]: V}>): this;
>mergeDeepWith : (merger: (oldVal: V, newVal: V, key: K) => V, ...collections: Array<Collection<K, V> | { [key: string]: V;}>) => this
>mergeDeepWith : (merger: (oldVal: V, newVal: V, key: K) => V, ...collections: Array<Collection<K, V> | { [key: string]: V; }>) => this
>merger : (oldVal: V, newVal: V, key: K) => V
>oldVal : V
>newVal : V
@@ -507,7 +507,7 @@ declare module Immutable {
>collections : Iterable<[KC, VC]>[]
concat<C>(...collections: Array<{[key: string]: C}>): Map<K | string, V | C>;
>concat : { <KC, VC>(...collections: Iterable<[KC, VC]>[]): Map<K | KC, V | VC>; <C>(...collections: Array<{ [key: string]: C;}>): Map<K | string, V | C>; }
>concat : { <KC, VC>(...collections: Iterable<[KC, VC]>[]): Map<K | KC, V | VC>; <C>(...collections: Array<{ [key: string]: C; }>): Map<K | string, V | C>; }
>collections : { [key: string]: C; }[]
>key : string
@@ -592,7 +592,7 @@ declare module Immutable {
>collections : Iterable<[KC, VC]>[]
concat<C>(...collections: Array<{[key: string]: C}>): OrderedMap<K | string, V | C>;
>concat : { <KC, VC>(...collections: Iterable<[KC, VC]>[]): OrderedMap<K | KC, V | VC>; <C>(...collections: Array<{ [key: string]: C;}>): OrderedMap<K | string, V | C>; }
>concat : { <KC, VC>(...collections: Iterable<[KC, VC]>[]): OrderedMap<K | KC, V | VC>; <C>(...collections: Array<{ [key: string]: C; }>): OrderedMap<K | string, V | C>; }
>collections : { [key: string]: C; }[]
>key : string
@@ -660,7 +660,7 @@ declare module Immutable {
>iter : Collection<T, any>
function fromKeys(obj: {[key: string]: any}): Set<string>;
>fromKeys : { <T>(iter: Collection<T, any>): Set<T>; (obj: { [key: string]: any;}): Set<string>; }
>fromKeys : { <T>(iter: Collection<T, any>): Set<T>; (obj: { [key: string]: any; }): Set<string>; }
>obj : { [key: string]: any; }
>key : string
@@ -782,7 +782,7 @@ declare module Immutable {
>iter : Collection<T, any>
function fromKeys(obj: {[key: string]: any}): OrderedSet<string>;
>fromKeys : { <T>(iter: Collection<T, any>): OrderedSet<T>; (obj: { [key: string]: any;}): OrderedSet<string>; }
>fromKeys : { <T>(iter: Collection<T, any>): OrderedSet<T>; (obj: { [key: string]: any; }): OrderedSet<string>; }
>obj : { [key: string]: any; }
>key : string
}
@@ -1104,7 +1104,7 @@ declare module Immutable {
// Conversion to JavaScript types
toJS(): { [K in keyof T]: any };
>toJS : () => { [K in keyof T]: any;}
>toJS : () => { [K in keyof T]: any; }
toJSON(): T;
>toJSON : () => T
@@ -1163,7 +1163,7 @@ declare module Immutable {
>Seq : any
export function Keyed<V>(obj: {[key: string]: V}): Seq.Keyed<string, V>;
>Keyed : { <K, V_1>(collection: Iterable<[K, V_1]>): Keyed<K, V_1>; <V>(obj: { [key: string]: V;}): Seq.Keyed<string, V>; <K_1, V_2>(): Keyed<K_1, V_2>; (): Keyed<any, any>; }
>Keyed : { <K, V_1>(collection: Iterable<[K, V_1]>): Keyed<K, V_1>; <V>(obj: { [key: string]: V; }): Seq.Keyed<string, V>; <K_1, V_2>(): Keyed<K_1, V_2>; (): Keyed<any, any>; }
>obj : { [key: string]: V; }
>key : string
>Seq : any
@@ -1183,7 +1183,7 @@ declare module Immutable {
>toJS : () => Object
toJSON(): { [key: string]: V };
>toJSON : () => { [key: string]: V;}
>toJSON : () => { [key: string]: V; }
>key : string
toSeq(): this;
@@ -1195,7 +1195,7 @@ declare module Immutable {
>Seq : any
concat<C>(...collections: Array<{[key: string]: C}>): Seq.Keyed<K | string, V | C>;
>concat : { <KC, VC>(...collections: Iterable<[KC, VC]>[]): Keyed<K | KC, V | VC>; <C>(...collections: Array<{ [key: string]: C;}>): Seq.Keyed<K | string, V | C>; }
>concat : { <KC, VC>(...collections: Iterable<[KC, VC]>[]): Keyed<K | KC, V | VC>; <C>(...collections: Array<{ [key: string]: C; }>): Seq.Keyed<K | string, V | C>; }
>collections : { [key: string]: C; }[]
>key : string
>Seq : any
@@ -1507,7 +1507,7 @@ declare module Immutable {
>Collection : any
export function Keyed<V>(obj: {[key: string]: V}): Collection.Keyed<string, V>;
>Keyed : { <K, V_1>(collection: Iterable<[K, V_1]>): Keyed<K, V_1>; <V>(obj: { [key: string]: V;}): Collection.Keyed<string, V>; }
>Keyed : { <K, V_1>(collection: Iterable<[K, V_1]>): Keyed<K, V_1>; <V>(obj: { [key: string]: V; }): Collection.Keyed<string, V>; }
>obj : { [key: string]: V; }
>key : string
>Collection : any
@@ -1517,7 +1517,7 @@ declare module Immutable {
>toJS : () => Object
toJSON(): { [key: string]: V };
>toJSON : () => { [key: string]: V;}
>toJSON : () => { [key: string]: V; }
>key : string
toSeq(): Seq.Keyed<K, V>;
@@ -1534,7 +1534,7 @@ declare module Immutable {
>Collection : any
concat<C>(...collections: Array<{[key: string]: C}>): Collection.Keyed<K | string, V | C>;
>concat : { <KC, VC>(...collections: Iterable<[KC, VC]>[]): Keyed<K | KC, V | VC>; <C>(...collections: Array<{ [key: string]: C;}>): Collection.Keyed<K | string, V | C>; }
>concat : { <KC, VC>(...collections: Iterable<[KC, VC]>[]): Keyed<K | KC, V | VC>; <C>(...collections: Array<{ [key: string]: C; }>): Collection.Keyed<K | string, V | C>; }
>collections : { [key: string]: C; }[]
>key : string
>Collection : any
@@ -1882,18 +1882,18 @@ declare module Immutable {
// Conversion to JavaScript types
toJS(): Array<any> | { [key: string]: any };
>toJS : () => Array<any> | { [key: string]: any;}
>toJS : () => Array<any> | { [key: string]: any; }
>key : string
toJSON(): Array<V> | { [key: string]: V };
>toJSON : () => Array<V> | { [key: string]: V;}
>toJSON : () => Array<V> | { [key: string]: V; }
>key : string
toArray(): Array<V>;
>toArray : () => Array<V>
toObject(): { [key: string]: V };
>toObject : () => { [key: string]: V;}
>toObject : () => { [key: string]: V; }
>key : string
// Conversion to Collections
@@ -45,14 +45,14 @@ module m1 {
}
export function f2(arg1: { x?: C1, y: number }) {
>f2 : (arg1: { x?: C1; y: number;}) => void
>f2 : (arg1: { x?: C1; y: number; }) => void
>arg1 : { x?: C1; y: number; }
>x : C1
>y : number
}
export function f3(): {
>f3 : () => { (a: number): C1;}
>f3 : () => { (a: number): C1; }
(a: number) : C1;
>a : number
@@ -62,7 +62,7 @@ module m1 {
}
export function f4(arg1:
>f4 : (arg1: { [number]: C1;}) => void
>f4 : (arg1: { [number]: C1; }) => void
>arg1 : {}
{
[number]: C1; // Used to be indexer, now it is a computed property
@@ -74,7 +74,7 @@ module m1 {
export function f5(arg2: {
>f5 : (arg2: { new (arg1: C1): C1;}) => void
>f5 : (arg2: { new (arg1: C1): C1; }) => void
>arg2 : new (arg1: C1) => C1
new (arg1: C1) : C1
@@ -51,32 +51,32 @@ let [{[foo2()]: bar5}] = [{bar: "bar"}];
>"bar" : "bar"
function f1({["bar"]: x}: { bar: number }) {}
>f1 : ({ ["bar"]: x }: { bar: number;}) => void
>f1 : ({ ["bar"]: x }: { bar: number; }) => void
>"bar" : "bar"
>x : number
>bar : number
function f2({[foo]: x}: { bar: number }) {}
>f2 : ({ [foo]: x }: { bar: number;}) => void
>f2 : ({ [foo]: x }: { bar: number; }) => void
>foo : string
>x : any
>bar : number
function f3({[foo2()]: x}: { bar: number }) {}
>f3 : ({ [foo2()]: x }: { bar: number;}) => void
>f3 : ({ [foo2()]: x }: { bar: number; }) => void
>foo2() : string
>foo2 : () => string
>x : any
>bar : number
function f4([{[foo]: x}]: [{ bar: number }]) {}
>f4 : ([{ [foo]: x }]: [{ bar: number;}]) => void
>f4 : ([{ [foo]: x }]: [{ bar: number; }]) => void
>foo : string
>x : any
>bar : number
function f5([{[foo2()]: x}]: [{ bar: number }]) {}
>f5 : ([{ [foo2()]: x }]: [{ bar: number;}]) => void
>f5 : ([{ [foo2()]: x }]: [{ bar: number; }]) => void
>foo2() : string
>foo2 : () => string
>x : any
@@ -58,32 +58,32 @@ let [{[foo2()]: bar5}] = [{bar: "bar"}];
>"bar" : "bar"
function f1({["bar"]: x}: { bar: number }) {}
>f1 : ({ ["bar"]: x }: { bar: number;}) => void
>f1 : ({ ["bar"]: x }: { bar: number; }) => void
>"bar" : "bar"
>x : number
>bar : number
function f2({[foo]: x}: { bar: number }) {}
>f2 : ({ [foo]: x }: { bar: number;}) => void
>f2 : ({ [foo]: x }: { bar: number; }) => void
>foo : string
>x : any
>bar : number
function f3({[foo2()]: x}: { bar: number }) {}
>f3 : ({ [foo2()]: x }: { bar: number;}) => void
>f3 : ({ [foo2()]: x }: { bar: number; }) => void
>foo2() : string
>foo2 : () => string
>x : any
>bar : number
function f4([{[foo]: x}]: [{ bar: number }]) {}
>f4 : ([{ [foo]: x }]: [{ bar: number;}]) => void
>f4 : ([{ [foo]: x }]: [{ bar: number; }]) => void
>foo : string
>x : any
>bar : number
function f5([{[foo2()]: x}]: [{ bar: number }]) {}
>f5 : ([{ [foo2()]: x }]: [{ bar: number;}]) => void
>f5 : ([{ [foo2()]: x }]: [{ bar: number; }]) => void
>foo2() : string
>foo2 : () => string
>x : any
@@ -2,7 +2,7 @@
=== computedPropertyNames48_ES5.ts ===
declare function extractIndexer<T>(p: { [n: number]: T }): T;
>extractIndexer : <T>(p: { [n: number]: T;}) => T
>extractIndexer : <T>(p: { [n: number]: T; }) => T
>p : { [n: number]: T; }
>n : number
@@ -2,7 +2,7 @@
=== computedPropertyNames48_ES6.ts ===
declare function extractIndexer<T>(p: { [n: number]: T }): T;
>extractIndexer : <T>(p: { [n: number]: T;}) => T
>extractIndexer : <T>(p: { [n: number]: T; }) => T
>p : { [n: number]: T; }
>n : number
@@ -19,7 +19,7 @@ function select<
>valueProp : TValueProp
export function func<XX extends string>(x: XX, tipos: { value: XX }[]) {
>func : <XX extends string>(x: XX, tipos: { value: XX;}[]) => void
>func : <XX extends string>(x: XX, tipos: { value: XX; }[]) => void
>x : XX
>tipos : { value: XX; }[]
>value : XX
@@ -100,7 +100,7 @@ function f<T>(t: T) {
}
function f2<T>(t1: { x: T; y: T }, t2: T extends T ? { x: T; y: T } : never) {
>f2 : <T>(t1: { x: T; y: T;}, t2: T extends T ? { x: T; y: T;} : never) => void
>f2 : <T>(t1: { x: T; y: T; }, t2: T extends T ? { x: T; y: T; } : never) => void
>t1 : { x: T; y: T; }
>x : T
>y : T
@@ -46,7 +46,7 @@ export enum PubSubRecordIsStoredInRedisAsA {
>name : any
name: <TYPE>(t?: TYPE) => BuildPubSubRecordType<SO_FAR & {name: TYPE}>
>name : <TYPE>(t?: TYPE) => BuildPubSubRecordType<SO_FAR & { name: TYPE;}>
>name : <TYPE>(t?: TYPE) => BuildPubSubRecordType<SO_FAR & { name: TYPE; }>
>t : TYPE
>name : TYPE
}
@@ -98,12 +98,12 @@ export enum PubSubRecordIsStoredInRedisAsA {
>storedAs : any
storedAsJsonEncodedRedisString: () => BuildPubSubRecordType<SO_FAR & {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString}>;
>storedAsJsonEncodedRedisString : () => BuildPubSubRecordType<SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString;}>
>storedAsJsonEncodedRedisString : () => BuildPubSubRecordType<SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString; }>
>storedAs : PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString
>PubSubRecordIsStoredInRedisAsA : any
storedRedisHash: () => BuildPubSubRecordType<SO_FAR & {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash}>;
>storedRedisHash : () => BuildPubSubRecordType<SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA.redisHash;}>
>storedRedisHash : () => BuildPubSubRecordType<SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA.redisHash; }>
>storedAs : PubSubRecordIsStoredInRedisAsA.redisHash
>PubSubRecordIsStoredInRedisAsA : any
}
@@ -182,7 +182,7 @@ export enum PubSubRecordIsStoredInRedisAsA {
>record : any
identifier: <TYPE extends Partial<SO_FAR["record"]>>(t?: TYPE) => BuildPubSubRecordType<SO_FAR & {identifier: TYPE}>
>identifier : <TYPE extends Partial<SO_FAR["record"]>>(t?: TYPE) => BuildPubSubRecordType<SO_FAR & { identifier: TYPE;}>
>identifier : <TYPE extends Partial<SO_FAR["record"]>>(t?: TYPE) => BuildPubSubRecordType<SO_FAR & { identifier: TYPE; }>
>t : TYPE
>identifier : TYPE
@@ -242,7 +242,7 @@ export enum PubSubRecordIsStoredInRedisAsA {
>record : any
record: <TYPE>(t?: TYPE) => BuildPubSubRecordType<SO_FAR & {record: TYPE}>
>record : <TYPE>(t?: TYPE) => BuildPubSubRecordType<SO_FAR & { record: TYPE;}>
>record : <TYPE>(t?: TYPE) => BuildPubSubRecordType<SO_FAR & { record: TYPE; }>
>t : TYPE
>record : TYPE
}
@@ -294,12 +294,12 @@ export enum PubSubRecordIsStoredInRedisAsA {
>maxMsToWaitBeforePublishing : any
maxMsToWaitBeforePublishing: (t: number) => BuildPubSubRecordType<SO_FAR & {maxMsToWaitBeforePublishing: number}>,
>maxMsToWaitBeforePublishing : (t: number) => BuildPubSubRecordType<SO_FAR & { maxMsToWaitBeforePublishing: number;}>
>maxMsToWaitBeforePublishing : (t: number) => BuildPubSubRecordType<SO_FAR & { maxMsToWaitBeforePublishing: number; }>
>t : number
>maxMsToWaitBeforePublishing : number
neverDelayPublishing: () => BuildPubSubRecordType<SO_FAR & {maxMsToWaitBeforePublishing: 0}>,
>neverDelayPublishing : () => BuildPubSubRecordType<SO_FAR & { maxMsToWaitBeforePublishing: 0;}>
>neverDelayPublishing : () => BuildPubSubRecordType<SO_FAR & { maxMsToWaitBeforePublishing: 0; }>
>maxMsToWaitBeforePublishing : 0
}
@@ -142,7 +142,7 @@ type T15 = Extract<Options, { q: "a" }>; // never
>q : "a"
declare function f5<T extends Options, K extends string>(p: K): Extract<T, { k: K }>;
>f5 : <T extends Options, K extends string>(p: K) => Extract<T, { k: K;}>
>f5 : <T extends Options, K extends string>(p: K) => Extract<T, { k: K; }>
>p : K
>k : K
@@ -151,13 +151,13 @@ type Bar = { bar: string };
>bar : string
declare function fooBar(x: { foo: string, bar: string }): void;
>fooBar : (x: { foo: string; bar: string;}) => void
>fooBar : (x: { foo: string; bar: string; }) => void
>x : { foo: string; bar: string; }
>foo : string
>bar : string
declare function fooBat(x: { foo: string, bat: string }): void;
>fooBat : (x: { foo: string; bat: string;}) => void
>fooBat : (x: { foo: string; bat: string; }) => void
>x : { foo: string; bat: string; }
>foo : string
>bat : string
@@ -3,7 +3,7 @@
=== constraintWithIndexedAccess.ts ===
// #52399
type DataFetchFns = {
>DataFetchFns : { Boat: { requiresLicense: (id: string) => boolean; maxGroundSpeed: (id: string) => number; description: (id: string) => string; displacement: (id: string) => number; name: (id: string) => string;}; Plane: { requiresLicense: (id: string) => boolean; maxGroundSpeed: (id: string) => number; maxTakeoffWeight: (id: string) => number; maxCruisingAltitude: (id: string) => number; name: (id: string) => string;}; }
>DataFetchFns : { Boat: { requiresLicense: (id: string) => boolean; maxGroundSpeed: (id: string) => number; description: (id: string) => string; displacement: (id: string) => number; name: (id: string) => string; }; Plane: { requiresLicense: (id: string) => boolean; maxGroundSpeed: (id: string) => number; maxTakeoffWeight: (id: string) => number; maxCruisingAltitude: (id: string) => number; name: (id: string) => string; }; }
Boat: {
>Boat : { requiresLicense: (id: string) => boolean; maxGroundSpeed: (id: string) => number; description: (id: string) => string; displacement: (id: string) => number; name: (id: string) => string; }
@@ -78,7 +78,7 @@ interface A { // T
>x : Derived[]
a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base;
>a11 : new (x: { foo: string;}, y: { foo: string; bar: string;}) => Base
>a11 : new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>x : { foo: string; }
>foo : string
>y : { foo: string; bar: string; }
@@ -96,7 +96,7 @@ interface A { // T
>y : Derived[]
a14: new (x: { a: string; b: number }) => Object;
>a14 : new (x: { a: string; b: number;}) => Object
>a14 : new (x: { a: string; b: number; }) => Object
>x : { a: string; b: number; }
>a : string
>b : number
@@ -134,7 +134,7 @@ interface A { // T
};
a18: {
>a18 : { new (x: { new (a: number): number; new (a: string): string;}): any[]; new (x: { new (a: boolean): boolean; new (a: Date): Date;}): any[]; }
>a18 : { new (x: { new (a: number): number; new (a: string): string; }): any[]; new (x: { new (a: boolean): boolean; new (a: Date): Date; }): any[]; }
new (x: {
>x : { new (a: number): number; new (a: string): string; }
@@ -204,10 +204,10 @@ interface I extends A {
>r : T
a9: new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal
>a9 : new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number;}) => U) => (r: T) => U
>a9 : new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U
>x : (arg: T) => U
>arg : T
>y : (arg2: { foo: string; bing: number;}) => U
>y : (arg2: { foo: string; bing: number; }) => U
>arg2 : { foo: string; bing: number; }
>foo : string
>bing : number
@@ -233,7 +233,7 @@ interface I extends A {
>y : T
a14: new <T, U>(x: { a: T; b: U }) => T; // ok
>a14 : new <T, U>(x: { a: T; b: U;}) => T
>a14 : new <T, U>(x: { a: T; b: U; }) => T
>x : { a: T; b: U; }
>a : T
>b : U
@@ -52,7 +52,7 @@ module Errors {
>x : Base[]
a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base;
>a11 : new (x: { foo: string;}, y: { foo: string; bar: string;}) => Base
>a11 : new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>x : { foo: string; }
>foo : string
>y : { foo: string; bar: string; }
@@ -75,13 +75,13 @@ module Errors {
};
a15: new (x: { a: string; b: number }) => number;
>a15 : new (x: { a: string; b: number;}) => number
>a15 : new (x: { a: string; b: number; }) => number
>x : { a: string; b: number; }
>a : string
>b : number
a16: {
>a16 : { new (x: { new (a: number): number; new (a?: number): number;}): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean;}): boolean[]; }
>a16 : { new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }
// type of parameter is overload set which means we can't do inference based on this type
new (x: {
@@ -130,10 +130,10 @@ module Errors {
interface I4 extends A {
a8: new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; // error, type mismatch
>a8 : new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number;}) => U) => (r: T) => U
>a8 : new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U
>x : (arg: T) => U
>arg : T
>y : (arg2: { foo: number;}) => U
>y : (arg2: { foo: number; }) => U
>arg2 : { foo: number; }
>foo : number
>r : T
@@ -161,7 +161,7 @@ module Errors {
interface I6 extends A {
a15: new <T>(x: { a: T; b: T }) => T; // error, T is {} which isn't an acceptable return type
>a15 : new <T>(x: { a: T; b: T;}) => T
>a15 : new <T>(x: { a: T; b: T; }) => T
>x : { a: T; b: T; }
>a : T
>b : T
@@ -169,7 +169,7 @@ module Errors {
interface I7 extends A {
a15: new <T extends Base>(x: { a: T; b: T }) => number; // error, T defaults to Base, which is not compatible with number or string
>a15 : new <T extends Base>(x: { a: T; b: T;}) => number
>a15 : new <T extends Base>(x: { a: T; b: T; }) => number
>x : { a: T; b: T; }
>a : T
>b : T
@@ -52,7 +52,7 @@ interface A { // T
>arg : T
a11: new <T>(x: { foo: T }, y: { foo: T; bar: T }) => Base;
>a11 : new <T>(x: { foo: T;}, y: { foo: T; bar: T;}) => Base
>a11 : new <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base
>x : { foo: T; }
>foo : T
>y : { foo: T; bar: T; }
@@ -60,13 +60,13 @@ interface A { // T
>bar : T
a15: new <T>(x: { a: T; b: T }) => T[];
>a15 : new <T>(x: { a: T; b: T;}) => T[]
>a15 : new <T>(x: { a: T; b: T; }) => T[]
>x : { a: T; b: T; }
>a : T
>b : T
a16: new <T extends Base>(x: { a: T; b: T }) => T[];
>a16 : new <T extends Base>(x: { a: T; b: T;}) => T[]
>a16 : new <T extends Base>(x: { a: T; b: T; }) => T[]
>x : { a: T; b: T; }
>a : T
>b : T
@@ -160,7 +160,7 @@ interface I extends A {
>arg : T
a11: new <T, U>(x: { foo: T }, y: { foo: U; bar: U }) => Base; // ok
>a11 : new <T, U>(x: { foo: T;}, y: { foo: U; bar: U;}) => Base
>a11 : new <T, U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base
>x : { foo: T; }
>foo : T
>y : { foo: U; bar: U; }
@@ -168,13 +168,13 @@ interface I extends A {
>bar : U
a15: new <U, V>(x: { a: U; b: V; }) => U[]; // ok, T = U, T = V
>a15 : new <U, V>(x: { a: U; b: V;}) => U[]
>a15 : new <U, V>(x: { a: U; b: V; }) => U[]
>x : { a: U; b: V; }
>a : U
>b : V
a16: new <T>(x: { a: T; b: T }) => T[]; // ok, more general parameter type
>a16 : new <T>(x: { a: T; b: T;}) => T[]
>a16 : new <T>(x: { a: T; b: T; }) => T[]
>x : { a: T; b: T; }
>a : T
>b : T
@@ -79,7 +79,7 @@ interface A { // T
>x : Derived[]
a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base;
>a11 : new (x: { foo: string;}, y: { foo: string; bar: string;}) => Base
>a11 : new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>x : { foo: string; }
>foo : string
>y : { foo: string; bar: string; }
@@ -97,7 +97,7 @@ interface A { // T
>y : Derived[]
a14: new (x: { a: string; b: number }) => Object;
>a14 : new (x: { a: string; b: number;}) => Object
>a14 : new (x: { a: string; b: number; }) => Object
>x : { a: string; b: number; }
>a : string
>b : number
@@ -154,10 +154,10 @@ interface I extends B {
>r : T
a9: new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal
>a9 : new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number;}) => U) => (r: T) => U
>a9 : new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U
>x : (arg: T) => U
>arg : T
>y : (arg2: { foo: string; bing: number;}) => U
>y : (arg2: { foo: string; bing: number; }) => U
>arg2 : { foo: string; bing: number; }
>foo : string
>bing : number
@@ -183,7 +183,7 @@ interface I extends B {
>y : T
a14: new <T, U>(x: { a: T; b: U }) => T; // ok
>a14 : new <T, U>(x: { a: T; b: U;}) => T
>a14 : new <T, U>(x: { a: T; b: U; }) => T
>x : { a: T; b: U; }
>a : T
>b : U
@@ -54,7 +54,7 @@ interface A { // T
>arg : T
a11: new <T>(x: { foo: T }, y: { foo: T; bar: T }) => Base;
>a11 : new <T>(x: { foo: T;}, y: { foo: T; bar: T;}) => Base
>a11 : new <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base
>x : { foo: T; }
>foo : T
>y : { foo: T; bar: T; }
@@ -62,13 +62,13 @@ interface A { // T
>bar : T
a15: new <T>(x: { a: T; b: T }) => T[];
>a15 : new <T>(x: { a: T; b: T;}) => T[]
>a15 : new <T>(x: { a: T; b: T; }) => T[]
>x : { a: T; b: T; }
>a : T
>b : T
a16: new <T extends Base>(x: { a: T; b: T }) => T[];
>a16 : new <T extends Base>(x: { a: T; b: T;}) => T[]
>a16 : new <T extends Base>(x: { a: T; b: T; }) => T[]
>x : { a: T; b: T; }
>a : T
>b : T
@@ -109,7 +109,7 @@ interface I5<T> extends A {
interface I7<T> extends A {
a11: new <U>(x: { foo: T }, y: { foo: U; bar: U }) => Base;
>a11 : new <U>(x: { foo: T;}, y: { foo: U; bar: U;}) => Base
>a11 : new <U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base
>x : { foo: T; }
>foo : T
>y : { foo: U; bar: U; }
@@ -119,7 +119,7 @@ interface I7<T> extends A {
interface I9<T> extends A {
a16: new (x: { a: T; b: T }) => T[];
>a16 : new (x: { a: T; b: T;}) => T[]
>a16 : new (x: { a: T; b: T; }) => T[]
>x : { a: T; b: T; }
>a : T
>b : T
@@ -2,7 +2,7 @@
=== constructorAsType.ts ===
var Person:new () => {name: string;} = function () {return {name:"joe"};};
>Person : new () => { name: string;}
>Person : new () => { name: string; }
>name : string
>function () {return {name:"joe"};} : () => { name: string; }
>{name:"joe"} : { name: string; }
@@ -10,7 +10,7 @@ var Person:new () => {name: string;} = function () {return {name:"joe"};};
>"joe" : "joe"
var Person2:{new() : {name:string;};};
>Person2 : new () => { name: string;}
>Person2 : new () => { name: string; }
>name : string
Person = Person2;
@@ -13,7 +13,7 @@ interface FullRule {
>validate : string | RegExp | Validate
normalize?: (match: {x: string}) => void;
>normalize : ((match: { x: string;}) => void) | undefined
>normalize : ((match: { x: string; }) => void) | undefined
>match : { x: string; }
>x : string
}
@@ -5,7 +5,7 @@ declare namespace app {
>app : typeof app
var foo: {
>foo : { bar: { someFun: (arg: number) => void;}; }
>foo : { bar: { someFun: (arg: number) => void; }; }
bar: {
>bar : { someFun: (arg: number) => void; }
@@ -20,7 +20,7 @@ type ActionFunction<TEvent extends { type: string }> = (event: TEvent) => void;
>event : TEvent
declare function createMachine<
>createMachine : <TTypesMeta extends TypegenDisabled | TypegenEnabled = TypegenDisabled>(config: { types?: TTypesMeta;}, implementations: TTypesMeta extends TypegenEnabled ? ActionFunction<{ type: "test";}> : ActionFunction<{ type: string;}>) => void
>createMachine : <TTypesMeta extends TypegenDisabled | TypegenEnabled = TypegenDisabled>(config: { types?: TTypesMeta; }, implementations: TTypesMeta extends TypegenEnabled ? ActionFunction<{ type: "test"; }> : ActionFunction<{ type: string; }>) => void
TTypesMeta extends TypegenEnabled | TypegenDisabled = TypegenDisabled
>(
@@ -24,7 +24,7 @@ const arr = [
/** @return {Array<[string, {x?:number, y?:number}]>} */
function f() {
>f : () => Array<[string, { x?: number; y?: number;}]>
>f : () => Array<[string, { x?: number; y?: number; }]>
return [
>[ ['a', { x: 1 }], ['b', { y: 2 }] ] : ([string, { x: number; }] | [string, { y: number; }])[]
@@ -5,7 +5,7 @@ type Keys = "a" | "b";
>Keys : "a" | "b"
type OptionsForKey = { a: { cb: (p: number) => number } } & { b: {} };
>OptionsForKey : { a: { cb: (p: number) => number;}; } & { b: {}; }
>OptionsForKey : { a: { cb: (p: number) => number; }; } & { b: {}; }
>a : { cb: (p: number) => number; }
>cb : (p: number) => number
>p : number
@@ -31,7 +31,7 @@ f("a", {
});
function g<
>g : <K extends "a" | "b">(x: ({ a: string;} & { b: string;})[K], y: string) => void
>g : <K extends "a" | "b">(x: ({ a: string; } & { b: string; })[K], y: string) => void
K extends "a" | "b">(x: ({ a: string } & { b: string })[K], y: string) {
>x : ({ a: string; } & { b: string; })[K]
@@ -327,7 +327,7 @@ interface IPlaceHolder {
}
var objc8: {
>objc8 : { t1: (s: string) => string; t2: IFoo; t3: number[]; t4: () => IFoo; t5: (n: number) => IFoo; t6: (n: number, s: string) => IFoo; t7: { (n: number, s: string): number;}; t8: (n: number, s: string) => number; t9: number[][]; t10: IFoo[]; t11: { (n: number, s: string): string;}[]; t12: IBar; t13: IFoo; t14: IFoo; }
>objc8 : { t1: (s: string) => string; t2: IFoo; t3: number[]; t4: () => IFoo; t5: (n: number) => IFoo; t6: (n: number, s: string) => IFoo; t7: { (n: number, s: string): number; }; t8: (n: number, s: string) => number; t9: number[][]; t10: IFoo[]; t11: { (n: number, s: string): string; }[]; t12: IBar; t13: IFoo; t14: IFoo; }
t1: (s: string) => string;
>t1 : (s: string) => string
@@ -2,7 +2,7 @@
=== contextualTyping23.ts ===
var foo:(a:{():number; (i:number):number; })=>number; foo = function(a){return 5};
>foo : (a: { (): number; (i: number): number;}) => number
>foo : (a: { (): number; (i: number): number; }) => number
>a : { (): number; (i: number): number; }
>i : number
>foo = function(a){return 5} : (a: { (): number; (i: number): number; }) => number
@@ -2,7 +2,7 @@
=== contextualTyping24.ts ===
var foo:(a:{():number; (i:number):number; })=>number; foo = function(this: void, a:string){return 5};
>foo : (a: { (): number; (i: number): number;}) => number
>foo : (a: { (): number; (i: number): number; }) => number
>a : { (): number; (i: number): number; }
>i : number
>foo = function(this: void, a:string){return 5} : (this: void, a: string) => number
@@ -2,7 +2,7 @@
=== contextualTyping25.ts ===
function foo(param:{id:number;}){}; foo(<{id:number;}>({}));
>foo : (param: { id: number;}) => void
>foo : (param: { id: number; }) => void
>param : { id: number; }
>id : number
>foo(<{id:number;}>({})) : void
@@ -2,7 +2,7 @@
=== contextualTyping26.ts ===
function foo(param:{id:number;}){}; foo(<{id:number;}>({}));
>foo : (param: { id: number;}) => void
>foo : (param: { id: number; }) => void
>param : { id: number; }
>id : number
>foo(<{id:number;}>({})) : void
@@ -2,7 +2,7 @@
=== contextualTyping27.ts ===
function foo(param:{id:number;}){}; foo(<{id:number;}>({}));
>foo : (param: { id: number;}) => void
>foo : (param: { id: number; }) => void
>param : { id: number; }
>id : number
>foo(<{id:number;}>({})) : void
@@ -2,7 +2,7 @@
=== contextualTyping32.ts ===
function foo(param: {():number; (i:number):number; }[]) { }; foo([function(){return 1;}, function(){return 4}]);
>foo : (param: { (): number; (i: number): number;}[]) => void
>foo : (param: { (): number; (i: number): number; }[]) => void
>param : { (): number; (i: number): number; }[]
>i : number
>foo([function(){return 1;}, function(){return 4}]) : void
@@ -2,7 +2,7 @@
=== contextualTyping33.ts ===
function foo(param: {():number; (i:number):number; }[]) { }; foo([function(){return 1;}, function(){return "foo"}]);
>foo : (param: { (): number; (i: number): number;}[]) => void
>foo : (param: { (): number; (i: number): number; }[]) => void
>param : { (): number; (i: number): number; }[]
>i : number
>foo([function(){return 1;}, function(){return "foo"}]) : void
@@ -22,7 +22,7 @@ obj1 = obj2; // Error - indexer doesn't match
>obj2 : { x: string; }
function f(x: { [s: string]: string }) { }
>f : (x: { [s: string]: string;}) => void
>f : (x: { [s: string]: string; }) => void
>x : { [s: string]: string; }
>s : string
@@ -174,7 +174,7 @@ interface ActionsObjectOr<State> {
}
declare function App4<State, Actions extends ActionsObjectOr<State>>(props: Options<State, Actions>["actions"] & { state: State }): JSX.Element;
>App4 : <State, Actions extends ActionsObjectOr<State>>(props: Options<State, Actions>["actions"] & { state: State;}) => JSX.Element
>App4 : <State, Actions extends ActionsObjectOr<State>>(props: Options<State, Actions>["actions"] & { state: State; }) => JSX.Element
>props : (string | Actions) & { state: State; }
>state : State
>JSX : any
@@ -12,7 +12,7 @@ declare class StateMachine<T> {
}
declare function createMachine<T>(implementations: {
>createMachine : <T>(implementations: { services: Record<string, () => Promise<T> | StateMachine<T>>;}) => void
>createMachine : <T>(implementations: { services: Record<string, () => Promise<T> | StateMachine<T>>; }) => void
>implementations : { services: Record<string, () => Promise<T> | StateMachine<T>>; }
services: Record<string, () => Promise<T> | StateMachine<T>>;
@@ -54,7 +54,7 @@ createMachine<{ count: number }>({
});
function fn1(): () => Promise<{ count: number }> | StateMachine<{ count: number }> {
>fn1 : () => () => Promise<{ count: number;}> | StateMachine<{ count: number;}>
>fn1 : () => () => Promise<{ count: number; }> | StateMachine<{ count: number; }>
>count : number
>count : number
@@ -23,7 +23,7 @@ declare namespace DropdownMenu {
}
interface PropsWithChildren extends BaseProps {
children(props: { onClose: () => void }): JSX.Element;
>children : (props: { onClose: () => void;}) => JSX.Element
>children : (props: { onClose: () => void; }) => JSX.Element
>props : { onClose: () => void; }
>onClose : () => void
>JSX : any
@@ -9,7 +9,7 @@ declare function match<T>(cb: (value: T) => boolean): T;
>value : T
declare function foo(pos: { x?: number; y?: number }): boolean;
>foo : (pos: { x?: number; y?: number;}) => boolean
>foo : (pos: { x?: number; y?: number; }) => boolean
>pos : { x?: number | undefined; y?: number | undefined; }
>x : number | undefined
>y : number | undefined
@@ -9,7 +9,7 @@ declare function match<T>(cb: (value: T) => boolean): T;
>value : T
declare function foo(pos: { x?: number; y?: number }): boolean;
>foo : (pos: { x?: number; y?: number;}) => boolean
>foo : (pos: { x?: number; y?: number; }) => boolean
>pos : { x?: number; y?: number; }
>x : number | undefined
>y : number | undefined
@@ -11,13 +11,13 @@ declare function id2<T extends (x: any) => any>(input: T): T;
>input : T
declare function id3<T extends (x: { foo: any }) => any>(input: T): T;
>id3 : <T extends (x: { foo: any;}) => any>(input: T) => T
>id3 : <T extends (x: { foo: any; }) => any>(input: T) => T
>x : { foo: any; }
>foo : any
>input : T
declare function id4<T extends (x: { foo?: number }) => any>(input: T): T;
>id4 : <T extends (x: { foo?: number;}) => any>(input: T) => T
>id4 : <T extends (x: { foo?: number; }) => any>(input: T) => T
>x : { foo?: number | undefined; }
>foo : number | undefined
>input : T
@@ -25,7 +25,7 @@ test1(
},
{
>{ checkLimit: (ctx, max = 500) => {}, hasAccess: (ctx, user: { name: string }) => {}, } : { checkLimit: (ctx: { count: number; }, max?: number) => void; hasAccess: (ctx: { count: number; }, user: { name: string;}) => void; }
>{ checkLimit: (ctx, max = 500) => {}, hasAccess: (ctx, user: { name: string }) => {}, } : { checkLimit: (ctx: { count: number; }, max?: number) => void; hasAccess: (ctx: { count: number; }, user: { name: string; }) => void; }
checkLimit: (ctx, max = 500) => {},
>checkLimit : (ctx: { count: number; }, max?: number) => void
@@ -35,8 +35,8 @@ test1(
>500 : 500
hasAccess: (ctx, user: { name: string }) => {},
>hasAccess : (ctx: { count: number; }, user: { name: string;}) => void
>(ctx, user: { name: string }) => {} : (ctx: { count: number; }, user: { name: string;}) => void
>hasAccess : (ctx: { count: number; }, user: { name: string; }) => void
>(ctx, user: { name: string }) => {} : (ctx: { count: number; }, user: { name: string; }) => void
>ctx : { count: number; }
>user : { name: string; }
>name : string
@@ -13,8 +13,8 @@ namespace JSX {
}
const FooComponent = (props: { foo: "A" | "B" | "C" }) => <span>{props.foo}</span>;
>FooComponent : (props: { foo: "A" | "B" | "C";}) => JSX.Element
>(props: { foo: "A" | "B" | "C" }) => <span>{props.foo}</span> : (props: { foo: "A" | "B" | "C";}) => JSX.Element
>FooComponent : (props: { foo: "A" | "B" | "C"; }) => JSX.Element
>(props: { foo: "A" | "B" | "C" }) => <span>{props.foo}</span> : (props: { foo: "A" | "B" | "C"; }) => JSX.Element
>props : { foo: "A" | "B" | "C"; }
>foo : "A" | "B" | "C"
><span>{props.foo}</span> : JSX.Element
@@ -279,7 +279,7 @@ declare function getArrayResult(): [true, number] | [false, undefined];
}
type Nested = {
>Nested : { type: 'string'; resp: { data: string;}; } | { type: 'number'; resp: { data: number;}; }
>Nested : { type: 'string'; resp: { data: string; }; } | { type: 'number'; resp: { data: number; }; }
type: 'string';
>type : "string"
@@ -138,7 +138,7 @@ function f14(x: number | null | undefined): number | null {
}
function f15(obj: { readonly x: string | number }) {
>f15 : (obj: { readonly x: string | number;}) => void
>f15 : (obj: { readonly x: string | number; }) => void
>obj : { readonly x: string | number; }
>x : string | number
@@ -163,7 +163,7 @@ function f15(obj: { readonly x: string | number }) {
}
function f16(obj: { readonly x: string | number }) {
>f16 : (obj: { readonly x: string | number;}) => void
>f16 : (obj: { readonly x: string | number; }) => void
>obj : { readonly x: string | number; }
>x : string | number
@@ -249,7 +249,7 @@ function f18(obj: readonly [string | number]) {
}
function f20(obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
>f20 : (obj: { kind: 'foo'; foo: string;} | { kind: 'bar'; bar: number;}) => void
>f20 : (obj: { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }) => void
>obj : { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }
>kind : "foo"
>foo : string
@@ -281,7 +281,7 @@ function f20(obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
}
function f21(obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
>f21 : (obj: { kind: 'foo'; foo: string;} | { kind: 'bar'; bar: number;}) => void
>f21 : (obj: { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }) => void
>obj : { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }
>kind : "foo"
>foo : string
@@ -313,7 +313,7 @@ function f21(obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
}
function f22(obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
>f22 : (obj: { kind: 'foo'; foo: string;} | { kind: 'bar'; bar: number;}) => void
>f22 : (obj: { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }) => void
>obj : { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }
>kind : "foo"
>foo : string
@@ -345,7 +345,7 @@ function f22(obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
}
function f23(obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
>f23 : (obj: { kind: 'foo'; foo: string;} | { kind: 'bar'; bar: number;}) => void
>f23 : (obj: { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }) => void
>obj : { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }
>kind : "foo"
>foo : string
@@ -382,7 +382,7 @@ function f23(obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
}
function f24(arg: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
>f24 : (arg: { kind: 'foo'; foo: string;} | { kind: 'bar'; bar: number;}) => void
>f24 : (arg: { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }) => void
>arg : { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }
>kind : "foo"
>foo : string
@@ -418,7 +418,7 @@ function f24(arg: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
}
function f25(arg: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
>f25 : (arg: { kind: 'foo'; foo: string;} | { kind: 'bar'; bar: number;}) => void
>f25 : (arg: { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }) => void
>arg : { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }
>kind : "foo"
>foo : string
@@ -454,8 +454,8 @@ function f25(arg: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
}
function f26(outer: { readonly obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number } }) {
>f26 : (outer: { readonly obj: { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; };}) => void
>outer : { readonly obj: { kind: 'foo'; foo: string;} | { kind: 'bar'; bar: number;}; }
>f26 : (outer: { readonly obj: { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }; }) => void
>outer : { readonly obj: { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }; }
>obj : { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }
>kind : "foo"
>foo : string
@@ -493,8 +493,8 @@ function f26(outer: { readonly obj: { kind: 'foo', foo: string } | { kind: 'bar'
}
function f27(outer: { obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number } }) {
>f27 : (outer: { obj: { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; };}) => void
>outer : { obj: { kind: 'foo'; foo: string;} | { kind: 'bar'; bar: number;}; }
>f27 : (outer: { obj: { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }; }) => void
>outer : { obj: { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }; }
>obj : { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }
>kind : "foo"
>foo : string
@@ -532,7 +532,7 @@ function f27(outer: { obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: nu
}
function f28(obj?: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
>f28 : (obj?: { kind: 'foo'; foo: string;} | { kind: 'bar'; bar: number;}) => void
>f28 : (obj?: { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }) => void
>obj : { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; } | undefined
>kind : "foo"
>foo : string
@@ -580,7 +580,7 @@ function f28(obj?: { kind: 'foo', foo: string } | { kind: 'bar', bar: number })
// Narrowing by aliased discriminant property access
function f30(obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
>f30 : (obj: { kind: 'foo'; foo: string;} | { kind: 'bar'; bar: number;}) => void
>f30 : (obj: { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }) => void
>obj : { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }
>kind : "foo"
>foo : string
@@ -612,7 +612,7 @@ function f30(obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
}
function f31(obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
>f31 : (obj: { kind: 'foo'; foo: string;} | { kind: 'bar'; bar: number;}) => void
>f31 : (obj: { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }) => void
>obj : { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }
>kind : "foo"
>foo : string
@@ -642,7 +642,7 @@ function f31(obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
}
function f32(obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
>f32 : (obj: { kind: 'foo'; foo: string;} | { kind: 'bar'; bar: number;}) => void
>f32 : (obj: { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }) => void
>obj : { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }
>kind : "foo"
>foo : string
@@ -673,7 +673,7 @@ function f32(obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
}
function f33(obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
>f33 : (obj: { kind: 'foo'; foo: string;} | { kind: 'bar'; bar: number;}) => void
>f33 : (obj: { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }) => void
>obj : { kind: 'foo'; foo: string; } | { kind: 'bar'; bar: number; }
>kind : "foo"
>foo : string
@@ -809,7 +809,7 @@ class C11 {
// Mixing of aliased discriminants and conditionals
function f40(obj: { kind: 'foo', foo?: string } | { kind: 'bar', bar?: number }) {
>f40 : (obj: { kind: 'foo'; foo?: string;} | { kind: 'bar'; bar?: number;}) => void
>f40 : (obj: { kind: 'foo'; foo?: string; } | { kind: 'bar'; bar?: number; }) => void
>obj : { kind: 'foo'; foo?: string | undefined; } | { kind: 'bar'; bar?: number | undefined; }
>kind : "foo"
>foo : string | undefined
@@ -617,7 +617,7 @@ function f18() {
// Repro from #39470
declare function foo(arg: { val: number }[]): void;
>foo : (arg: { val: number;}[]) => void
>foo : (arg: { val: number; }[]) => void
>arg : { val: number; }[]
>val : number
@@ -8,7 +8,7 @@ declare function f2(): [b: string];
>f2 : () => [b: string]
declare function f3(): { c: string };
>f3 : () => { c: string;}
>f3 : () => { c: string; }
>c : string
try {
@@ -2,7 +2,7 @@
=== controlFlowGenericTypes.ts ===
function f1<T extends string | undefined>(x: T, y: { a: T }, z: [T]): string {
>f1 : <T extends string | undefined>(x: T, y: { a: T;}, z: [T]) => string
>f1 : <T extends string | undefined>(x: T, y: { a: T; }, z: [T]) => string
>x : T
>y : { a: T; }
>a : T
@@ -75,7 +75,7 @@ if (d in c) {
// repro from https://github.com/microsoft/TypeScript/issues/54790
function uniqueID_54790(
>uniqueID_54790 : (id: string | undefined, seenIDs: { [key: string]: string;}) => string
>uniqueID_54790 : (id: string | undefined, seenIDs: { [key: string]: string; }) => string
id: string | undefined,
>id : string
@@ -348,7 +348,7 @@ async () => {
// repro #43047#issuecomment-874221939
declare function myQuery(input: { lastId: number | undefined }): Promise<{ entities: number[] }>;
>myQuery : (input: { lastId: number | undefined;}) => Promise<{ entities: number[];}>
>myQuery : (input: { lastId: number | undefined; }) => Promise<{ entities: number[]; }>
>input : { lastId: number | undefined; }
>lastId : number | undefined
>entities : number[]
@@ -321,8 +321,8 @@ o4.x.y;
>y : boolean
declare const o5: { x?: { y: { z?: { w: boolean } } } };
>o5 : { x?: { y: { z?: { w: boolean; };}; } | undefined; }
>x : { y: { z?: { w: boolean; };}; } | undefined
>o5 : { x?: { y: { z?: { w: boolean; }; }; } | undefined; }
>x : { y: { z?: { w: boolean; }; }; } | undefined
>y : { z?: { w: boolean; } | undefined; }
>z : { w: boolean; } | undefined
>w : boolean
@@ -58,7 +58,7 @@ function test2(foo: Foo | undefined) {
}
function Test3({ foo }: { foo: Foo | undefined }) {
>Test3 : ({ foo }: { foo: Foo | undefined;}) => JSX.Element
>Test3 : ({ foo }: { foo: Foo | undefined; }) => JSX.Element
>foo : Foo | undefined
>foo : Foo | undefined
@@ -93,7 +93,7 @@ function Test3({ foo }: { foo: Foo | undefined }) {
}
function test4(options?: { a?: boolean; b?: boolean }) {
>test4 : (options?: { a?: boolean; b?: boolean;}) => void
>test4 : (options?: { a?: boolean; b?: boolean; }) => void
>options : { a?: boolean | undefined; b?: boolean | undefined; } | undefined
>a : boolean | undefined
>b : boolean | undefined
@@ -11,7 +11,7 @@ function f2(x: (...args) => void) { }
>args : any[]
function f3(x: { (...args): void }) { }
>f3 : (x: { (...args: any): void;}) => void
>f3 : (x: { (...args: any): void; }) => void
>x : (...args: any[]) => void
>args : any[]
@@ -2,7 +2,7 @@
=== locale.d.ts ===
export type Locale = {
>Locale : { weekdays: { shorthand: [string, string, string, string, string, string, string]; longhand: [string, string, string, string, string, string, string];}; }
>Locale : { weekdays: { shorthand: [string, string, string, string, string, string, string]; longhand: [string, string, string, string, string, string, string]; }; }
weekdays: {
>weekdays : { shorthand: [string, string, string, string, string, string, string]; longhand: [string, string, string, string, string, string, string]; }
@@ -16,7 +16,7 @@ export type Locale = {
};
};
export type CustomLocale = {
>CustomLocale : { weekdays: { shorthand: [string, string, string, string, string, string, string]; longhand: [string, string, string, string, string, string, string];}; }
>CustomLocale : { weekdays: { shorthand: [string, string, string, string, string, string, string]; longhand: [string, string, string, string, string, string, string]; }; }
weekdays: {
>weekdays : { shorthand: [string, string, string, string, string, string, string]; longhand: [string, string, string, string, string, string, string]; }
@@ -18,10 +18,10 @@ export type BoundedInteger<
> = Brand<number, "BoundedInteger">;
export const toBoundedInteger =
>toBoundedInteger : <LowerBound extends number, UpperBound extends number>(bounds: { lowerBound: LowerBound; upperBound: UpperBound;}) => (n: number) => BoundedInteger<LowerBound, UpperBound>
>toBoundedInteger : <LowerBound extends number, UpperBound extends number>(bounds: { lowerBound: LowerBound; upperBound: UpperBound; }) => (n: number) => BoundedInteger<LowerBound, UpperBound>
<LowerBound extends number, UpperBound extends number>(bounds: {
><LowerBound extends number, UpperBound extends number>(bounds: { lowerBound: LowerBound; upperBound: UpperBound; }) => ( n: number ): BoundedInteger<LowerBound, UpperBound> => // Implementation doesn't matter here ({} as any) : <LowerBound extends number, UpperBound extends number>(bounds: { lowerBound: LowerBound; upperBound: UpperBound;}) => (n: number) => BoundedInteger<LowerBound, UpperBound>
><LowerBound extends number, UpperBound extends number>(bounds: { lowerBound: LowerBound; upperBound: UpperBound; }) => ( n: number ): BoundedInteger<LowerBound, UpperBound> => // Implementation doesn't matter here ({} as any) : <LowerBound extends number, UpperBound extends number>(bounds: { lowerBound: LowerBound; upperBound: UpperBound; }) => (n: number) => BoundedInteger<LowerBound, UpperBound>
>bounds : { lowerBound: LowerBound; upperBound: UpperBound; }
lowerBound: LowerBound;
@@ -44,8 +44,8 @@ let value = "";
// 2.Can change in meaning for typeof value if we remove alias
const shadowedVariable = ({ value: alias }: { value: string }): typeof value => value;
>shadowedVariable : ({ value: alias }: { value: string;}) => typeof value
>({ value: alias }: { value: string }): typeof value => value : ({ value: alias }: { value: string;}) => typeof value
>shadowedVariable : ({ value: alias }: { value: string; }) => typeof value
>({ value: alias }: { value: string }): typeof value => value : ({ value: alias }: { value: string; }) => typeof value
>value : any
>alias : string
>value : string
@@ -34,7 +34,7 @@ let value = "";
// 2.Can change in meaning for typeof value if we remove alias
function shadowedVariable({ value: alias }: { value: string }): typeof value { return value }
>shadowedVariable : ({ value: alias }: { value: string;}) => typeof value
>shadowedVariable : ({ value: alias }: { value: string; }) => typeof value
>value : any
>alias : string
>value : string
@@ -48,7 +48,7 @@ function notReferenced({ name: alias }: Named) {
}
function notReferencedNestedAlias({ p: { name: alias } }: { p: Named }) {
>notReferencedNestedAlias : ({ p: { name: alias } }: { p: Named;}) => void
>notReferencedNestedAlias : ({ p: { name: alias } }: { p: Named; }) => void
>p : any
>name : any
>alias : string
@@ -82,7 +82,7 @@ function referencedInSignarture({ name: alias }: Named): typeof alias {
}
function referencedInSignartureKeyword({ function: alias }: { function: string }): typeof alias {
>referencedInSignartureKeyword : ({ function: alias }: { function: string;}) => typeof alias
>referencedInSignartureKeyword : ({ function: alias }: { function: string; }) => typeof alias
>function : any
>alias : string
>function : string
@@ -121,7 +121,7 @@ function referencedInNestedFunction({ name: alias }: Named) {
}
function referencedNestedAlias({ p: { name: alias } }: { p: Named }): typeof alias {
>referencedNestedAlias : ({ p: { name: alias } }: { p: Named;}) => typeof alias
>referencedNestedAlias : ({ p: { name: alias } }: { p: Named; }) => typeof alias
>p : any
>name : any
>alias : string
@@ -14,7 +14,7 @@ function far([a, [b], [[c]]]: [number, boolean[], string[][]]): void { }
>c : string
function bar({a1, b1, c1}: { a1: number, b1: boolean, c1: string }): void { }
>bar : ({ a1, b1, c1 }: { a1: number; b1: boolean; c1: string;}) => void
>bar : ({ a1, b1, c1 }: { a1: number; b1: boolean; c1: string; }) => void
>a1 : number
>b1 : boolean
>c1 : string
@@ -23,7 +23,7 @@ function bar({a1, b1, c1}: { a1: number, b1: boolean, c1: string }): void { }
>c1 : string
function baz({a2, b2: {b1, c1}}: { a2: number, b2: { b1: boolean, c1: string } }): void { }
>baz : ({ a2, b2: { b1, c1 } }: { a2: number; b2: { b1: boolean; c1: string; };}) => void
>baz : ({ a2, b2: { b1, c1 } }: { a2: number; b2: { b1: boolean; c1: string; }; }) => void
>a2 : number
>b2 : any
>b1 : boolean
@@ -13,7 +13,7 @@ function foo(...rest: any[]) {
}
function foo2( { x, y, z }?: { x: string; y: number; z: boolean });
>foo2 : ({ x, y, z }?: { x: string; y: number; z: boolean;}) => any
>foo2 : ({ x, y, z }?: { x: string; y: number; z: boolean; }) => any
>x : string
>y : number
>z : boolean
Loaded 100 of 503 files, more files were not shown because too many files have changed in this diff. Show more