diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index cf3bd49751a..1503da355c7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2176,7 +2176,12 @@ namespace ts { if (isRestParameter(parameterNode)) { writePunctuation(writer, SyntaxKind.DotDotDotToken); } - appendSymbolNameOnly(p, writer); + if (isBindingPattern(parameterNode.name)) { + buildBindingPatternDisplay(parameterNode.name, writer, enclosingDeclaration, flags, symbolStack); + } + else { + appendSymbolNameOnly(p, writer); + } if (isOptionalParameter(parameterNode)) { writePunctuation(writer, SyntaxKind.QuestionToken); } @@ -2186,20 +2191,65 @@ namespace ts { buildTypeDisplay(getTypeOfSymbol(p), writer, enclosingDeclaration, flags, symbolStack); } + function buildBindingPatternDisplay(bindingPattern: BindingPattern, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, symbolStack?: Symbol[]) { + // We have to explicitly emit square bracket and bracket because these tokens are not store inside the node. + if (bindingPattern.kind === SyntaxKind.ObjectBindingPattern) { + writePunctuation(writer, SyntaxKind.OpenBraceToken); + buildDisplatForCommaSeparatedList(bindingPattern.elements, writer, enclosingDeclaration, flags, symbolStack, buildBindingElementDisplay); + writePunctuation(writer, SyntaxKind.CloseBraceToken); + } + else if (bindingPattern.kind === SyntaxKind.ArrayBindingPattern) { + writePunctuation(writer, SyntaxKind.OpenBracketToken); + const elements = bindingPattern.elements; + buildDisplatForCommaSeparatedList(bindingPattern.elements, writer, enclosingDeclaration, flags, symbolStack, buildBindingElementDisplay); + if (elements && elements.hasTrailingComma) { + writePunctuation(writer, SyntaxKind.CommaToken); + } + writePunctuation(writer, SyntaxKind.CloseBracketToken); + } + } + + function buildBindingElementDisplay(bindingElement: BindingElement, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, symbolStack?: Symbol[]) { + if (bindingElement.kind === SyntaxKind.OmittedExpression) { + writeSpace(writer); + } + else if (bindingElement.kind === SyntaxKind.BindingElement) { + if (bindingElement.propertyName) { + writer.writeSymbol(getTextOfNode(bindingElement.propertyName), bindingElement.symbol); + writePunctuation(writer, SyntaxKind.ColonToken); + } + if (bindingElement.name) { + if (isBindingPattern(bindingElement.name)) { + buildBindingPatternDisplay(bindingElement.name, writer, enclosingDeclaration, flags, symbolStack); + } + else { + if (bindingElement.dotDotDotToken) { + writePunctuation(writer, SyntaxKind.DotDotDotToken); + } + appendSymbolNameOnly(bindingElement.symbol, writer); + } + } + } + } + function buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, symbolStack?: Symbol[]) { if (typeParameters && typeParameters.length) { writePunctuation(writer, SyntaxKind.LessThanToken); - for (let i = 0; i < typeParameters.length; i++) { - if (i > 0) { - writePunctuation(writer, SyntaxKind.CommaToken); - writeSpace(writer); - } - buildTypeParameterDisplay(typeParameters[i], writer, enclosingDeclaration, flags, symbolStack); - } + buildDisplatForCommaSeparatedList(typeParameters, writer, enclosingDeclaration, flags, symbolStack, buildTypeParameterDisplay); writePunctuation(writer, SyntaxKind.GreaterThanToken); } } + function buildDisplatForCommaSeparatedList(list: T[], writer: SymbolWriter, enclosingDeclaration: Node, flags: TypeFormatFlags, symbolStack: Symbol[], action: (item: T, writer: SymbolWriter, enclosingDeclaration: Node, flags: TypeFormatFlags, symbolStack: Symbol[]) => void) { + for (let i = 0; i < list.length; i++) { + if (i > 0) { + writePunctuation(writer, SyntaxKind.CommaToken); + writeSpace(writer); + } + action(list[i], writer, enclosingDeclaration, flags, symbolStack); + } + } + function buildDisplayForTypeArgumentsAndDelimiters(typeParameters: TypeParameter[], mapper: TypeMapper, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, symbolStack?: Symbol[]) { if (typeParameters && typeParameters.length) { writePunctuation(writer, SyntaxKind.LessThanToken); diff --git a/tests/baselines/reference/arrayBindingPatternOmittedExpressions.types b/tests/baselines/reference/arrayBindingPatternOmittedExpressions.types index e83aa6a17de..e529c7cdde5 100644 --- a/tests/baselines/reference/arrayBindingPatternOmittedExpressions.types +++ b/tests/baselines/reference/arrayBindingPatternOmittedExpressions.types @@ -25,7 +25,7 @@ var results: string[]; function f([, a, , b, , , , s, , , ] = results) { ->f : ([, a, , b, , , , s, , , ]?: string[]) => void +>f : ([ , a, , b, , , , s, , ,]?: string[]) => void > : undefined >a : string > : undefined diff --git a/tests/baselines/reference/arrowFunctionExpressions.types b/tests/baselines/reference/arrowFunctionExpressions.types index eedd20944fe..b2e6cf1e57b 100644 --- a/tests/baselines/reference/arrowFunctionExpressions.types +++ b/tests/baselines/reference/arrowFunctionExpressions.types @@ -65,43 +65,43 @@ var p2 = ([...a]) => { }; >a : any[] var p3 = ([, a]) => { }; ->p3 : ([, a]: [any, any]) => void ->([, a]) => { } : ([, a]: [any, any]) => void +>p3 : ([ , a]: [any, any]) => void +>([, a]) => { } : ([ , a]: [any, any]) => void > : undefined >a : any var p4 = ([, ...a]) => { }; ->p4 : ([, ...a]: any[]) => void ->([, ...a]) => { } : ([, ...a]: any[]) => void +>p4 : ([ , ...a]: any[]) => void +>([, ...a]) => { } : ([ , ...a]: any[]) => void > : undefined >a : any[] var p5 = ([a = 1]) => { }; ->p5 : ([a = 1]: [number]) => void ->([a = 1]) => { } : ([a = 1]: [number]) => void +>p5 : ([a]: [number]) => void +>([a = 1]) => { } : ([a]: [number]) => void >a : number >1 : number var p6 = ({ a }) => { }; ->p6 : ({ a }: { a: any; }) => void ->({ a }) => { } : ({ a }: { a: any; }) => void +>p6 : ({a}: { a: any; }) => void +>({ a }) => { } : ({a}: { a: any; }) => void >a : any var p7 = ({ a: { b } }) => { }; ->p7 : ({ a: { b } }: { a: { b: any; }; }) => void ->({ a: { b } }) => { } : ({ a: { b } }: { a: { b: any; }; }) => void +>p7 : ({a:{b}}: { a: { b: any; }; }) => void +>({ a: { b } }) => { } : ({a:{b}}: { a: { b: any; }; }) => void >a : any >b : any var p8 = ({ a = 1 }) => { }; ->p8 : ({ a = 1 }: { a?: number; }) => void ->({ a = 1 }) => { } : ({ a = 1 }: { a?: number; }) => void +>p8 : ({a}: { a?: number; }) => void +>({ a = 1 }) => { } : ({a}: { a?: number; }) => void >a : number >1 : number var p9 = ({ a: { b = 1 } = { b: 1 } }) => { }; ->p9 : ({ a: { b = 1 } = { b: 1 } }: { a?: { b?: number; }; }) => void ->({ a: { b = 1 } = { b: 1 } }) => { } : ({ a: { b = 1 } = { b: 1 } }: { a?: { b?: number; }; }) => void +>p9 : ({a:{b}}: { a?: { b?: number; }; }) => void +>({ a: { b = 1 } = { b: 1 } }) => { } : ({a:{b}}: { a?: { b?: number; }; }) => void >a : any >b : number >1 : number @@ -110,8 +110,8 @@ var p9 = ({ a: { b = 1 } = { b: 1 } }) => { }; >1 : number var p10 = ([{ value, done }]) => { }; ->p10 : ([{ value, done }]: [{ value: any; done: any; }]) => void ->([{ value, done }]) => { } : ([{ value, done }]: [{ value: any; done: any; }]) => void +>p10 : ([{value, done}]: [{ value: any; done: any; }]) => void +>([{ value, done }]) => { } : ([{value, done}]: [{ value: any; done: any; }]) => void >value : any >done : any diff --git a/tests/baselines/reference/declarationEmitDestructuring1.types b/tests/baselines/reference/declarationEmitDestructuring1.types index abba67981d8..a1c7acad853 100644 --- a/tests/baselines/reference/declarationEmitDestructuring1.types +++ b/tests/baselines/reference/declarationEmitDestructuring1.types @@ -21,7 +21,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 diff --git a/tests/baselines/reference/declarationEmitDestructuring5.types b/tests/baselines/reference/declarationEmitDestructuring5.types index f09b1ebf50c..0b36373ebe2 100644 --- a/tests/baselines/reference/declarationEmitDestructuring5.types +++ b/tests/baselines/reference/declarationEmitDestructuring5.types @@ -1,23 +1,23 @@ === tests/cases/compiler/declarationEmitDestructuring5.ts === function baz([, z, , ]) { } ->baz : ([, z, , ]: [any, any, any]) => void +>baz : ([ , z, ,]: [any, any, any]) => void > : undefined >z : any > : undefined function foo([, b, ]: [any, any]): void { } ->foo : ([, b, ]: [any, any]) => void +>foo : ([ , b,]: [any, any]) => void > : undefined >b : any function bar([z, , , ]) { } ->bar : ([z, , , ]: [any, any, any]) => void +>bar : ([z, , ,]: [any, any, any]) => void >z : any > : undefined > : undefined function bar1([z, , , ] = [1, 3, 4, 6, 7]) { } ->bar1 : ([z, , , ]?: [number, number, number, number, number]) => void +>bar1 : ([z, , ,]?: [number, number, number, number, number]) => void >z : number > : undefined > : undefined @@ -29,7 +29,7 @@ function bar1([z, , , ] = [1, 3, 4, 6, 7]) { } >7 : number function bar2([,,z, , , ]) { } ->bar2 : ([,,z, , , ]: [any, any, any, any, any]) => void +>bar2 : ([ , , z, , ,]: [any, any, any, any, any]) => void > : undefined > : undefined >z : any diff --git a/tests/baselines/reference/declarationEmitDestructuringOptionalBindingParametersInOverloads.types b/tests/baselines/reference/declarationEmitDestructuringOptionalBindingParametersInOverloads.types index 1c75466f0c3..9eabfebe877 100644 --- a/tests/baselines/reference/declarationEmitDestructuringOptionalBindingParametersInOverloads.types +++ b/tests/baselines/reference/declarationEmitDestructuringOptionalBindingParametersInOverloads.types @@ -12,7 +12,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 @@ -21,7 +21,7 @@ function foo2( { x, y, z }?: { x: string; y: number; z: boolean }); >z : boolean function foo2(...rest: any[]) { ->foo2 : ({ x, y, z }?: { x: string; y: number; z: boolean; }) => any +>foo2 : ({x, y, z}?: { x: string; y: number; z: boolean; }) => any >rest : any[] } diff --git a/tests/baselines/reference/destructuringInFunctionType.types b/tests/baselines/reference/destructuringInFunctionType.types index 8786bbd0bb9..93e702225b5 100644 --- a/tests/baselines/reference/destructuringInFunctionType.types +++ b/tests/baselines/reference/destructuringInFunctionType.types @@ -29,7 +29,7 @@ type T2 = ({ a }); >a : any type F2 = ({ a }) => void; ->F2 : ({ a }: { a: any; }) => void +>F2 : ({a}: { a: any; }) => void >a : any type T3 = ([{ a: b }, { b: a }]); @@ -40,7 +40,7 @@ type T3 = ([{ a: b }, { b: a }]); >a : a type F3 = ([{ a: b }, { b: a }]) => void; ->F3 : ([{ a: b }, { b: a }]: [{ a: any; }, { b: any; }]) => void +>F3 : ([{a:b}, {b:a}]: [{ a: any; }, { b: any; }]) => void >a : any >b : any >b : any @@ -53,13 +53,13 @@ type T4 = ([{ a: [b, c] }]); >c : c type F4 = ([{ a: [b, c] }]) => void; ->F4 : ([{ a: [b, c] }]: [{ a: [any, any]; }]) => void +>F4 : ([{a:[b, c]}]: [{ a: [any, any]; }]) => void >a : any >b : any >c : any type C1 = new ([{ a: [b, c] }]) => void; ->C1 : new ([{ a: [b, c] }]: [{ a: [any, any]; }]) => void +>C1 : new ([{a:[b, c]}]: [{ a: [any, any]; }]) => void >a : any >b : any >c : any diff --git a/tests/baselines/reference/destructuringWithLiteralInitializers.types b/tests/baselines/reference/destructuringWithLiteralInitializers.types index da1e4bfd6f3..97e9b8d095a 100644 --- a/tests/baselines/reference/destructuringWithLiteralInitializers.types +++ b/tests/baselines/reference/destructuringWithLiteralInitializers.types @@ -1,13 +1,13 @@ === tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers.ts === // (arg: { x: any, y: any }) => void function f1({ x, y }) { } ->f1 : ({ x, y }: { x: any; y: any; }) => void +>f1 : ({x, y}: { x: any; y: any; }) => void >x : any >y : any f1({ x: 1, y: 1 }); >f1({ x: 1, y: 1 }) : void ->f1 : ({ x, y }: { x: any; y: any; }) => void +>f1 : ({x, y}: { x: any; y: any; }) => void >{ x: 1, y: 1 } : { x: number; y: number; } >x : number >1 : number @@ -16,21 +16,21 @@ f1({ x: 1, y: 1 }); // (arg: { x: any, y?: number }) => void function f2({ x, y = 0 }) { } ->f2 : ({ x, y = 0 }: { x: any; y?: number; }) => void +>f2 : ({x, y}: { x: any; y?: number; }) => void >x : any >y : number >0 : number f2({ x: 1 }); >f2({ x: 1 }) : void ->f2 : ({ x, y = 0 }: { x: any; y?: number; }) => void +>f2 : ({x, y}: { x: any; y?: number; }) => void >{ x: 1 } : { x: number; } >x : number >1 : number f2({ x: 1, y: 1 }); >f2({ x: 1, y: 1 }) : void ->f2 : ({ x, y = 0 }: { x: any; y?: number; }) => void +>f2 : ({x, y}: { x: any; y?: number; }) => void >{ x: 1, y: 1 } : { x: number; y: number; } >x : number >1 : number @@ -39,7 +39,7 @@ f2({ x: 1, y: 1 }); // (arg: { x?: number, y?: number }) => void function f3({ x = 0, y = 0 }) { } ->f3 : ({ x = 0, y = 0 }: { x?: number; y?: number; }) => void +>f3 : ({x, y}: { x?: number; y?: number; }) => void >x : number >0 : number >y : number @@ -47,26 +47,26 @@ function f3({ x = 0, y = 0 }) { } f3({}); >f3({}) : void ->f3 : ({ x = 0, y = 0 }: { x?: number; y?: number; }) => void +>f3 : ({x, y}: { x?: number; y?: number; }) => void >{} : {} f3({ x: 1 }); >f3({ x: 1 }) : void ->f3 : ({ x = 0, y = 0 }: { x?: number; y?: number; }) => void +>f3 : ({x, y}: { x?: number; y?: number; }) => void >{ x: 1 } : { x: number; } >x : number >1 : number f3({ y: 1 }); >f3({ y: 1 }) : void ->f3 : ({ x = 0, y = 0 }: { x?: number; y?: number; }) => void +>f3 : ({x, y}: { x?: number; y?: number; }) => void >{ y: 1 } : { y: number; } >y : number >1 : number f3({ x: 1, y: 1 }); >f3({ x: 1, y: 1 }) : void ->f3 : ({ x = 0, y = 0 }: { x?: number; y?: number; }) => void +>f3 : ({x, y}: { x?: number; y?: number; }) => void >{ x: 1, y: 1 } : { x: number; y: number; } >x : number >1 : number @@ -75,7 +75,7 @@ f3({ x: 1, y: 1 }); // (arg?: { x: number, y: number }) => void function f4({ x, y } = { x: 0, y: 0 }) { } ->f4 : ({ x, y }?: { x: number; y: number; }) => void +>f4 : ({x, y}?: { x: number; y: number; }) => void >x : number >y : number >{ x: 0, y: 0 } : { x: number; y: number; } @@ -86,11 +86,11 @@ function f4({ x, y } = { x: 0, y: 0 }) { } f4(); >f4() : void ->f4 : ({ x, y }?: { x: number; y: number; }) => void +>f4 : ({x, y}?: { x: number; y: number; }) => void f4({ x: 1, y: 1 }); >f4({ x: 1, y: 1 }) : void ->f4 : ({ x, y }?: { x: number; y: number; }) => void +>f4 : ({x, y}?: { x: number; y: number; }) => void >{ x: 1, y: 1 } : { x: number; y: number; } >x : number >1 : number @@ -99,7 +99,7 @@ f4({ x: 1, y: 1 }); // (arg?: { x: number, y?: number }) => void function f5({ x, y = 0 } = { x: 0 }) { } ->f5 : ({ x, y = 0 }?: { x: number; y?: number; }) => void +>f5 : ({x, y}?: { x: number; y?: number; }) => void >x : number >y : number >0 : number @@ -109,18 +109,18 @@ function f5({ x, y = 0 } = { x: 0 }) { } f5(); >f5() : void ->f5 : ({ x, y = 0 }?: { x: number; y?: number; }) => void +>f5 : ({x, y}?: { x: number; y?: number; }) => void f5({ x: 1 }); >f5({ x: 1 }) : void ->f5 : ({ x, y = 0 }?: { x: number; y?: number; }) => void +>f5 : ({x, y}?: { x: number; y?: number; }) => void >{ x: 1 } : { x: number; } >x : number >1 : number f5({ x: 1, y: 1 }); >f5({ x: 1, y: 1 }) : void ->f5 : ({ x, y = 0 }?: { x: number; y?: number; }) => void +>f5 : ({x, y}?: { x: number; y?: number; }) => void >{ x: 1, y: 1 } : { x: number; y: number; } >x : number >1 : number @@ -129,7 +129,7 @@ f5({ x: 1, y: 1 }); // (arg?: { x?: number, y?: number }) => void function f6({ x = 0, y = 0 } = {}) { } ->f6 : ({ x = 0, y = 0 }?: { x?: number; y?: number; }) => void +>f6 : ({x, y}?: { x?: number; y?: number; }) => void >x : number >0 : number >y : number @@ -138,30 +138,30 @@ function f6({ x = 0, y = 0 } = {}) { } f6(); >f6() : void ->f6 : ({ x = 0, y = 0 }?: { x?: number; y?: number; }) => void +>f6 : ({x, y}?: { x?: number; y?: number; }) => void f6({}); >f6({}) : void ->f6 : ({ x = 0, y = 0 }?: { x?: number; y?: number; }) => void +>f6 : ({x, y}?: { x?: number; y?: number; }) => void >{} : {} f6({ x: 1 }); >f6({ x: 1 }) : void ->f6 : ({ x = 0, y = 0 }?: { x?: number; y?: number; }) => void +>f6 : ({x, y}?: { x?: number; y?: number; }) => void >{ x: 1 } : { x: number; } >x : number >1 : number f6({ y: 1 }); >f6({ y: 1 }) : void ->f6 : ({ x = 0, y = 0 }?: { x?: number; y?: number; }) => void +>f6 : ({x, y}?: { x?: number; y?: number; }) => void >{ y: 1 } : { y: number; } >y : number >1 : number f6({ x: 1, y: 1 }); >f6({ x: 1, y: 1 }) : void ->f6 : ({ x = 0, y = 0 }?: { x?: number; y?: number; }) => void +>f6 : ({x, y}?: { x?: number; y?: number; }) => void >{ x: 1, y: 1 } : { x: number; y: number; } >x : number >1 : number @@ -170,7 +170,7 @@ f6({ x: 1, y: 1 }); // (arg?: { a: { x?: number, y?: number } }) => void function f7({ a: { x = 0, y = 0 } } = { a: {} }) { } ->f7 : ({ a: { x = 0, y = 0 } }?: { a: { x?: number; y?: number; }; }) => void +>f7 : ({a:{x, y}}?: { a: { x?: number; y?: number; }; }) => void >a : any >x : number >0 : number @@ -182,18 +182,18 @@ function f7({ a: { x = 0, y = 0 } } = { a: {} }) { } f7(); >f7() : void ->f7 : ({ a: { x = 0, y = 0 } }?: { a: { x?: number; y?: number; }; }) => void +>f7 : ({a:{x, y}}?: { a: { x?: number; y?: number; }; }) => void f7({ a: {} }); >f7({ a: {} }) : void ->f7 : ({ a: { x = 0, y = 0 } }?: { a: { x?: number; y?: number; }; }) => void +>f7 : ({a:{x, y}}?: { a: { x?: number; y?: number; }; }) => void >{ a: {} } : { a: {}; } >a : {} >{} : {} f7({ a: { x: 1 } }); >f7({ a: { x: 1 } }) : void ->f7 : ({ a: { x = 0, y = 0 } }?: { a: { x?: number; y?: number; }; }) => void +>f7 : ({a:{x, y}}?: { a: { x?: number; y?: number; }; }) => void >{ a: { x: 1 } } : { a: { x: number; }; } >a : { x: number; } >{ x: 1 } : { x: number; } @@ -202,7 +202,7 @@ f7({ a: { x: 1 } }); f7({ a: { y: 1 } }); >f7({ a: { y: 1 } }) : void ->f7 : ({ a: { x = 0, y = 0 } }?: { a: { x?: number; y?: number; }; }) => void +>f7 : ({a:{x, y}}?: { a: { x?: number; y?: number; }; }) => void >{ a: { y: 1 } } : { a: { y: number; }; } >a : { y: number; } >{ y: 1 } : { y: number; } @@ -211,7 +211,7 @@ f7({ a: { y: 1 } }); f7({ a: { x: 1, y: 1 } }); >f7({ a: { x: 1, y: 1 } }) : void ->f7 : ({ a: { x = 0, y = 0 } }?: { a: { x?: number; y?: number; }; }) => void +>f7 : ({a:{x, y}}?: { a: { x?: number; y?: number; }; }) => void >{ a: { x: 1, y: 1 } } : { a: { x: number; y: number; }; } >a : { x: number; y: number; } >{ x: 1, y: 1 } : { x: number; y: number; } @@ -235,7 +235,7 @@ g1([1, 1]); // (arg: [number, number]) => void function g2([x = 0, y = 0]) { } ->g2 : ([x = 0, y = 0]: [number, number]) => void +>g2 : ([x, y]: [number, number]) => void >x : number >0 : number >y : number @@ -243,7 +243,7 @@ function g2([x = 0, y = 0]) { } g2([1, 1]); >g2([1, 1]) : void ->g2 : ([x = 0, y = 0]: [number, number]) => void +>g2 : ([x, y]: [number, number]) => void >[1, 1] : [number, number] >1 : number >1 : number @@ -270,7 +270,7 @@ g3([1, 1]); // (arg?: [number, number]) => void function g4([x, y = 0] = [0]) { } ->g4 : ([x, y = 0]?: [number, number]) => void +>g4 : ([x, y]?: [number, number]) => void >x : number >y : number >0 : number @@ -279,18 +279,18 @@ function g4([x, y = 0] = [0]) { } g4(); >g4() : void ->g4 : ([x, y = 0]?: [number, number]) => void +>g4 : ([x, y]?: [number, number]) => void g4([1, 1]); >g4([1, 1]) : void ->g4 : ([x, y = 0]?: [number, number]) => void +>g4 : ([x, y]?: [number, number]) => void >[1, 1] : [number, number] >1 : number >1 : number // (arg?: [number, number]) => void function g5([x = 0, y = 0] = []) { } ->g5 : ([x = 0, y = 0]?: [number, number]) => void +>g5 : ([x, y]?: [number, number]) => void >x : number >0 : number >y : number @@ -299,11 +299,11 @@ function g5([x = 0, y = 0] = []) { } g5(); >g5() : void ->g5 : ([x = 0, y = 0]?: [number, number]) => void +>g5 : ([x, y]?: [number, number]) => void g5([1, 1]); >g5([1, 1]) : void ->g5 : ([x = 0, y = 0]?: [number, number]) => void +>g5 : ([x, y]?: [number, number]) => void >[1, 1] : [number, number] >1 : number >1 : number diff --git a/tests/baselines/reference/emitArrowFunctionES6.types b/tests/baselines/reference/emitArrowFunctionES6.types index cc48cecd96a..21340956c59 100644 --- a/tests/baselines/reference/emitArrowFunctionES6.types +++ b/tests/baselines/reference/emitArrowFunctionES6.types @@ -52,43 +52,43 @@ var p2 = ([...a]) => { }; >a : any[] var p3 = ([, a]) => { }; ->p3 : ([, a]: [any, any]) => void ->([, a]) => { } : ([, a]: [any, any]) => void +>p3 : ([ , a]: [any, any]) => void +>([, a]) => { } : ([ , a]: [any, any]) => void > : undefined >a : any var p4 = ([, ...a]) => { }; ->p4 : ([, ...a]: Iterable) => void ->([, ...a]) => { } : ([, ...a]: Iterable) => void +>p4 : ([ , ...a]: Iterable) => void +>([, ...a]) => { } : ([ , ...a]: Iterable) => void > : undefined >a : any[] var p5 = ([a = 1]) => { }; ->p5 : ([a = 1]: [number]) => void ->([a = 1]) => { } : ([a = 1]: [number]) => void +>p5 : ([a]: [number]) => void +>([a = 1]) => { } : ([a]: [number]) => void >a : number >1 : number var p6 = ({ a }) => { }; ->p6 : ({ a }: { a: any; }) => void ->({ a }) => { } : ({ a }: { a: any; }) => void +>p6 : ({a}: { a: any; }) => void +>({ a }) => { } : ({a}: { a: any; }) => void >a : any var p7 = ({ a: { b } }) => { }; ->p7 : ({ a: { b } }: { a: { b: any; }; }) => void ->({ a: { b } }) => { } : ({ a: { b } }: { a: { b: any; }; }) => void +>p7 : ({a:{b}}: { a: { b: any; }; }) => void +>({ a: { b } }) => { } : ({a:{b}}: { a: { b: any; }; }) => void >a : any >b : any var p8 = ({ a = 1 }) => { }; ->p8 : ({ a = 1 }: { a?: number; }) => void ->({ a = 1 }) => { } : ({ a = 1 }: { a?: number; }) => void +>p8 : ({a}: { a?: number; }) => void +>({ a = 1 }) => { } : ({a}: { a?: number; }) => void >a : number >1 : number var p9 = ({ a: { b = 1 } = { b: 1 } }) => { }; ->p9 : ({ a: { b = 1 } = { b: 1 } }: { a?: { b?: number; }; }) => void ->({ a: { b = 1 } = { b: 1 } }) => { } : ({ a: { b = 1 } = { b: 1 } }: { a?: { b?: number; }; }) => void +>p9 : ({a:{b}}: { a?: { b?: number; }; }) => void +>({ a: { b = 1 } = { b: 1 } }) => { } : ({a:{b}}: { a?: { b?: number; }; }) => void >a : any >b : number >1 : number @@ -97,8 +97,8 @@ var p9 = ({ a: { b = 1 } = { b: 1 } }) => { }; >1 : number var p10 = ([{ value, done }]) => { }; ->p10 : ([{ value, done }]: [{ value: any; done: any; }]) => void ->([{ value, done }]) => { } : ([{ value, done }]: [{ value: any; done: any; }]) => void +>p10 : ([{value, done}]: [{ value: any; done: any; }]) => void +>([{ value, done }]) => { } : ([{value, done}]: [{ value: any; done: any; }]) => void >value : any >done : any diff --git a/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5.types b/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5.types index ed6b935db0f..a9a9366ae22 100644 --- a/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5.types +++ b/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5.types @@ -62,7 +62,7 @@ } function f({} = a, [] = a, { p: {} = a} = a) { ->f : ({}?: any, []?: any, { p: {} = a}?: any) => ({}?: any, []?: any, { p: {} = a }?: any) => any +>f : ({}?: any, []?: any, {p:{}}?: any) => ({}?: any, []?: any, {p:{}}?: any) => any >a : any >a : any >p : any @@ -70,7 +70,7 @@ >a : any return ({} = a, [] = a, { p: {} = a } = a) => a; ->({} = a, [] = a, { p: {} = a } = a) => a : ({}?: any, []?: any, { p: {} = a }?: any) => any +>({} = a, [] = a, { p: {} = a } = a) => a : ({}?: any, []?: any, {p:{}}?: any) => any >a : any >a : any >p : any diff --git a/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES6.types b/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES6.types index fcb48048148..09e1f0b853b 100644 --- a/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES6.types +++ b/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES6.types @@ -62,7 +62,7 @@ } function f({} = a, [] = a, { p: {} = a} = a) { ->f : ({}?: any, []?: any, { p: {} = a}?: any) => ({}?: any, []?: any, { p: {} = a }?: any) => any +>f : ({}?: any, []?: any, {p:{}}?: any) => ({}?: any, []?: any, {p:{}}?: any) => any >a : any >a : any >p : any @@ -70,7 +70,7 @@ >a : any return ({} = a, [] = a, { p: {} = a } = a) => a; ->({} = a, [] = a, { p: {} = a } = a) => a : ({}?: any, []?: any, { p: {} = a }?: any) => any +>({} = a, [] = a, { p: {} = a } = a) => a : ({}?: any, []?: any, {p:{}}?: any) => any >a : any >a : any >p : any diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types index 029e47cd3a0..323612ffc94 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types @@ -37,7 +37,7 @@ var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "no >"none" : string function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { ->foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) => void +>foo1 : ({skills:{primary:primaryA, secondary:secondaryA}}: Robot) => void >skills : any >primary : any >primaryA : string @@ -53,7 +53,7 @@ function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { >primaryA : string } function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { ->foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) => void +>foo2 : ({name:nameC, skills:{primary:primaryB, secondary:secondaryB}}: Robot) => void >name : any >nameC : string >skills : any @@ -71,7 +71,7 @@ function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB >secondaryB : string } function foo3({ skills }: Robot) { ->foo3 : ({ skills }: Robot) => void +>foo3 : ({skills}: Robot) => void >skills : { primary: string; secondary: string; } >Robot : Robot @@ -87,12 +87,12 @@ function foo3({ skills }: Robot) { foo1(robotA); >foo1(robotA) : void ->foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) => void +>foo1 : ({skills:{primary:primaryA, secondary:secondaryA}}: Robot) => void >robotA : Robot foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); >foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void ->foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) => void +>foo1 : ({skills:{primary:primaryA, secondary:secondaryA}}: Robot) => void >{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string >"Edger" : string @@ -105,12 +105,12 @@ foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" foo2(robotA); >foo2(robotA) : void ->foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) => void +>foo2 : ({name:nameC, skills:{primary:primaryB, secondary:secondaryB}}: Robot) => void >robotA : Robot foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); >foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void ->foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) => void +>foo2 : ({name:nameC, skills:{primary:primaryB, secondary:secondaryB}}: Robot) => void >{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string >"Edger" : string @@ -123,12 +123,12 @@ foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" foo3(robotA); >foo3(robotA) : void ->foo3 : ({ skills }: Robot) => void +>foo3 : ({skills}: Robot) => void >robotA : Robot foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); >foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void ->foo3 : ({ skills }: Robot) => void +>foo3 : ({skills}: Robot) => void >{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string >"Edger" : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types index a9e5c2d6ee6..5d8cbc311ae 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types @@ -37,12 +37,7 @@ var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "no >"none" : string function foo1( ->foo1 : ({ - skills: { - primary: primaryA = "primary", - secondary: secondaryA = "secondary" - } = { primary: "SomeSkill", secondary: "someSkill" } - }?: Robot) => void +>foo1 : ({skills:{primary:primaryA, secondary:secondaryA}}?: Robot) => void { skills: { >skills : any @@ -76,13 +71,7 @@ function foo1( >primaryA : string } function foo2( ->foo2 : ({ - name: nameC = "name", - skills: { - primary: primaryB = "primary", - secondary: secondaryB = "secondary" - } = { primary: "SomeSkill", secondary: "someSkill" } - }?: Robot) => void +>foo2 : ({name:nameC, skills:{primary:primaryB, secondary:secondaryB}}?: Robot) => void { name: nameC = "name", >name : any @@ -121,7 +110,7 @@ function foo2( >secondaryB : string } function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Robot = robotA) { ->foo3 : ({ skills = { primary: "SomeSkill", secondary: "someSkill" } }?: Robot) => void +>foo3 : ({skills}?: Robot) => void >skills : { primary?: string; secondary?: string; } >{ primary: "SomeSkill", secondary: "someSkill" } : { primary: string; secondary: string; } >primary : string @@ -143,22 +132,12 @@ function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Ro foo1(robotA); >foo1(robotA) : void ->foo1 : ({ - skills: { - primary: primaryA = "primary", - secondary: secondaryA = "secondary" - } = { primary: "SomeSkill", secondary: "someSkill" } - }?: Robot) => void +>foo1 : ({skills:{primary:primaryA, secondary:secondaryA}}?: Robot) => void >robotA : Robot foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); >foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void ->foo1 : ({ - skills: { - primary: primaryA = "primary", - secondary: secondaryA = "secondary" - } = { primary: "SomeSkill", secondary: "someSkill" } - }?: Robot) => void +>foo1 : ({skills:{primary:primaryA, secondary:secondaryA}}?: Robot) => void >{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string >"Edger" : string @@ -171,24 +150,12 @@ foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" foo2(robotA); >foo2(robotA) : void ->foo2 : ({ - name: nameC = "name", - skills: { - primary: primaryB = "primary", - secondary: secondaryB = "secondary" - } = { primary: "SomeSkill", secondary: "someSkill" } - }?: Robot) => void +>foo2 : ({name:nameC, skills:{primary:primaryB, secondary:secondaryB}}?: Robot) => void >robotA : Robot foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); >foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void ->foo2 : ({ - name: nameC = "name", - skills: { - primary: primaryB = "primary", - secondary: secondaryB = "secondary" - } = { primary: "SomeSkill", secondary: "someSkill" } - }?: Robot) => void +>foo2 : ({name:nameC, skills:{primary:primaryB, secondary:secondaryB}}?: Robot) => void >{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string >"Edger" : string @@ -201,12 +168,12 @@ foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" foo3(robotA); >foo3(robotA) : void ->foo3 : ({ skills = { primary: "SomeSkill", secondary: "someSkill" } }?: Robot) => void +>foo3 : ({skills}?: Robot) => void >robotA : Robot foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); >foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void ->foo3 : ({ skills = { primary: "SomeSkill", secondary: "someSkill" } }?: Robot) => void +>foo3 : ({skills}?: Robot) => void >{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string >"Edger" : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types index 894cd714c73..9154ba582d8 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types @@ -29,7 +29,7 @@ var robotA: Robot = { name: "mower", skill: "mowing" }; >"mowing" : string function foo1({ name: nameA }: Robot) { ->foo1 : ({ name: nameA }: Robot) => void +>foo1 : ({name:nameA}: Robot) => void >name : any >nameA : string >Robot : Robot @@ -42,7 +42,7 @@ function foo1({ name: nameA }: Robot) { >nameA : string } function foo2({ name: nameB, skill: skillB }: Robot) { ->foo2 : ({ name: nameB, skill: skillB }: Robot) => void +>foo2 : ({name:nameB, skill:skillB}: Robot) => void >name : any >nameB : string >skill : any @@ -57,7 +57,7 @@ function foo2({ name: nameB, skill: skillB }: Robot) { >nameB : string } function foo3({ name }: Robot) { ->foo3 : ({ name }: Robot) => void +>foo3 : ({name}: Robot) => void >name : string >Robot : Robot @@ -71,12 +71,12 @@ function foo3({ name }: Robot) { foo1(robotA); >foo1(robotA) : void ->foo1 : ({ name: nameA }: Robot) => void +>foo1 : ({name:nameA}: Robot) => void >robotA : Robot foo1({ name: "Edger", skill: "cutting edges" }); >foo1({ name: "Edger", skill: "cutting edges" }) : void ->foo1 : ({ name: nameA }: Robot) => void +>foo1 : ({name:nameA}: Robot) => void >{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } >name : string >"Edger" : string @@ -85,12 +85,12 @@ foo1({ name: "Edger", skill: "cutting edges" }); foo2(robotA); >foo2(robotA) : void ->foo2 : ({ name: nameB, skill: skillB }: Robot) => void +>foo2 : ({name:nameB, skill:skillB}: Robot) => void >robotA : Robot foo2({ name: "Edger", skill: "cutting edges" }); >foo2({ name: "Edger", skill: "cutting edges" }) : void ->foo2 : ({ name: nameB, skill: skillB }: Robot) => void +>foo2 : ({name:nameB, skill:skillB}: Robot) => void >{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } >name : string >"Edger" : string @@ -99,12 +99,12 @@ foo2({ name: "Edger", skill: "cutting edges" }); foo3(robotA); >foo3(robotA) : void ->foo3 : ({ name }: Robot) => void +>foo3 : ({name}: Robot) => void >robotA : Robot foo3({ name: "Edger", skill: "cutting edges" }); >foo3({ name: "Edger", skill: "cutting edges" }) : void ->foo3 : ({ name }: Robot) => void +>foo3 : ({name}: Robot) => void >{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } >name : string >"Edger" : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types index 669708f412f..ed7090d4fc8 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types @@ -29,7 +29,7 @@ var robotA: Robot = { name: "mower", skill: "mowing" }; >"mowing" : string function foo1({ name: nameA = "" }: Robot = { }) { ->foo1 : ({ name: nameA = "" }?: Robot) => void +>foo1 : ({name:nameA}?: Robot) => void >name : any >nameA : string >"" : string @@ -44,7 +44,7 @@ function foo1({ name: nameA = "" }: Robot = { }) { >nameA : string } function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = {}) { ->foo2 : ({ name: nameB = "", skill: skillB = "noSkill" }?: Robot) => void +>foo2 : ({name:nameB, skill:skillB}?: Robot) => void >name : any >nameB : string >"" : string @@ -62,7 +62,7 @@ function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = { >nameB : string } function foo3({ name = "" }: Robot = {}) { ->foo3 : ({ name = "" }?: Robot) => void +>foo3 : ({name}?: Robot) => void >name : string >"" : string >Robot : Robot @@ -78,12 +78,12 @@ function foo3({ name = "" }: Robot = {}) { foo1(robotA); >foo1(robotA) : void ->foo1 : ({ name: nameA = "" }?: Robot) => void +>foo1 : ({name:nameA}?: Robot) => void >robotA : Robot foo1({ name: "Edger", skill: "cutting edges" }); >foo1({ name: "Edger", skill: "cutting edges" }) : void ->foo1 : ({ name: nameA = "" }?: Robot) => void +>foo1 : ({name:nameA}?: Robot) => void >{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } >name : string >"Edger" : string @@ -92,12 +92,12 @@ foo1({ name: "Edger", skill: "cutting edges" }); foo2(robotA); >foo2(robotA) : void ->foo2 : ({ name: nameB = "", skill: skillB = "noSkill" }?: Robot) => void +>foo2 : ({name:nameB, skill:skillB}?: Robot) => void >robotA : Robot foo2({ name: "Edger", skill: "cutting edges" }); >foo2({ name: "Edger", skill: "cutting edges" }) : void ->foo2 : ({ name: nameB = "", skill: skillB = "noSkill" }?: Robot) => void +>foo2 : ({name:nameB, skill:skillB}?: Robot) => void >{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } >name : string >"Edger" : string @@ -106,12 +106,12 @@ foo2({ name: "Edger", skill: "cutting edges" }); foo3(robotA); >foo3(robotA) : void ->foo3 : ({ name = "" }?: Robot) => void +>foo3 : ({name}?: Robot) => void >robotA : Robot foo3({ name: "Edger", skill: "cutting edges" }); >foo3({ name: "Edger", skill: "cutting edges" }) : void ->foo3 : ({ name = "" }?: Robot) => void +>foo3 : ({name}?: Robot) => void >{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } >name : string >"Edger" : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.types index 9c695f1c0dd..fcdeba6becc 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.types @@ -18,7 +18,7 @@ var robotA: Robot = [1, "mower", "mowing"]; >"mowing" : string function foo1([, nameA]: Robot) { ->foo1 : ([, nameA]: [number, string, string]) => void +>foo1 : ([ , nameA]: [number, string, string]) => void > : undefined >nameA : string >Robot : [number, string, string] @@ -75,12 +75,12 @@ function foo4([numberA3, ...robotAInfo]: Robot) { foo1(robotA); >foo1(robotA) : void ->foo1 : ([, nameA]: [number, string, string]) => void +>foo1 : ([ , nameA]: [number, string, string]) => void >robotA : [number, string, string] foo1([2, "trimmer", "trimming"]); >foo1([2, "trimmer", "trimming"]) : void ->foo1 : ([, nameA]: [number, string, string]) => void +>foo1 : ([ , nameA]: [number, string, string]) => void >[2, "trimmer", "trimming"] : [number, string, string] >2 : number >"trimmer" : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.types index b3e09d962c3..14977147a7d 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.types @@ -19,7 +19,7 @@ var robotA: Robot = ["trimmer", ["trimming", "edging"]]; >"edging" : string function foo1([, skillA]: Robot) { ->foo1 : ([, skillA]: [string, [string, string]]) => void +>foo1 : ([ , skillA]: [string, [string, string]]) => void > : undefined >skillA : [string, string] >Robot : [string, [string, string]] @@ -75,12 +75,12 @@ function foo4([...multiRobotAInfo]: Robot) { foo1(robotA); >foo1(robotA) : void ->foo1 : ([, skillA]: [string, [string, string]]) => void +>foo1 : ([ , skillA]: [string, [string, string]]) => void >robotA : [string, [string, string]] foo1(["roomba", ["vaccum", "mopping"]]); >foo1(["roomba", ["vaccum", "mopping"]]) : void ->foo1 : ([, skillA]: [string, [string, string]]) => void +>foo1 : ([ , skillA]: [string, [string, string]]) => void >["roomba", ["vaccum", "mopping"]] : [string, [string, string]] >"roomba" : string >["vaccum", "mopping"] : [string, string] diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.types index 8e12e876b1d..328f003f7d1 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.types @@ -18,7 +18,7 @@ var robotA: Robot = [1, "mower", "mowing"]; >"mowing" : string function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) { ->foo1 : ([, nameA = "noName"]?: [number, string, string]) => void +>foo1 : ([ , nameA]?: [number, string, string]) => void > : undefined >nameA : string >"noName" : string @@ -38,7 +38,7 @@ function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) { } function foo2([numberB = -1]: Robot = [-1, "name", "skill"]) { ->foo2 : ([numberB = -1]?: [number, string, string]) => void +>foo2 : ([numberB]?: [number, string, string]) => void >numberB : number >-1 : number >1 : number @@ -58,7 +58,7 @@ function foo2([numberB = -1]: Robot = [-1, "name", "skill"]) { } function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"]) { ->foo3 : ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]?: [number, string, string]) => void +>foo3 : ([numberA2, nameA2, skillA2]?: [number, string, string]) => void >numberA2 : number >-1 : number >1 : number @@ -82,7 +82,7 @@ function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, } function foo4([numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"]) { ->foo4 : ([numberA3 = -1, ...robotAInfo]?: [number, string, string]) => void +>foo4 : ([numberA3, ...robotAInfo]?: [number, string, string]) => void >numberA3 : number >-1 : number >1 : number @@ -104,12 +104,12 @@ function foo4([numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"]) { foo1(robotA); >foo1(robotA) : void ->foo1 : ([, nameA = "noName"]?: [number, string, string]) => void +>foo1 : ([ , nameA]?: [number, string, string]) => void >robotA : [number, string, string] foo1([2, "trimmer", "trimming"]); >foo1([2, "trimmer", "trimming"]) : void ->foo1 : ([, nameA = "noName"]?: [number, string, string]) => void +>foo1 : ([ , nameA]?: [number, string, string]) => void >[2, "trimmer", "trimming"] : [number, string, string] >2 : number >"trimmer" : string @@ -117,12 +117,12 @@ foo1([2, "trimmer", "trimming"]); foo2(robotA); >foo2(robotA) : void ->foo2 : ([numberB = -1]?: [number, string, string]) => void +>foo2 : ([numberB]?: [number, string, string]) => void >robotA : [number, string, string] foo2([2, "trimmer", "trimming"]); >foo2([2, "trimmer", "trimming"]) : void ->foo2 : ([numberB = -1]?: [number, string, string]) => void +>foo2 : ([numberB]?: [number, string, string]) => void >[2, "trimmer", "trimming"] : [number, string, string] >2 : number >"trimmer" : string @@ -130,12 +130,12 @@ foo2([2, "trimmer", "trimming"]); foo3(robotA); >foo3(robotA) : void ->foo3 : ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]?: [number, string, string]) => void +>foo3 : ([numberA2, nameA2, skillA2]?: [number, string, string]) => void >robotA : [number, string, string] foo3([2, "trimmer", "trimming"]); >foo3([2, "trimmer", "trimming"]) : void ->foo3 : ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]?: [number, string, string]) => void +>foo3 : ([numberA2, nameA2, skillA2]?: [number, string, string]) => void >[2, "trimmer", "trimming"] : [number, string, string] >2 : number >"trimmer" : string @@ -143,12 +143,12 @@ foo3([2, "trimmer", "trimming"]); foo4(robotA); >foo4(robotA) : void ->foo4 : ([numberA3 = -1, ...robotAInfo]?: [number, string, string]) => void +>foo4 : ([numberA3, ...robotAInfo]?: [number, string, string]) => void >robotA : [number, string, string] foo4([2, "trimmer", "trimming"]); >foo4([2, "trimmer", "trimming"]) : void ->foo4 : ([numberA3 = -1, ...robotAInfo]?: [number, string, string]) => void +>foo4 : ([numberA3, ...robotAInfo]?: [number, string, string]) => void >[2, "trimmer", "trimming"] : [number, string, string] >2 : number >"trimmer" : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.types index 52423dfce21..d47aef363c9 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.types @@ -19,7 +19,7 @@ var robotA: Robot = ["trimmer", ["trimming", "edging"]]; >"edging" : string function foo1([, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]]) { ->foo1 : ([, skillA = ["noSkill", "noSkill"]]?: [string, string[]]) => void +>foo1 : ([ , skillA]?: [string, string[]]) => void > : undefined >skillA : string[] >["noSkill", "noSkill"] : string[] @@ -41,7 +41,7 @@ function foo1([, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "s } function foo2([nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]]) { ->foo2 : ([nameMB = "noName"]?: [string, string[]]) => void +>foo2 : ([nameMB]?: [string, string[]]) => void >nameMB : string >"noName" : string >Robot : [string, string[]] @@ -60,10 +60,7 @@ function foo2([nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]]) { } function foo3([nameMA = "noName", [ ->foo3 : ([nameMA = "noName", [ - primarySkillA = "primary", - secondarySkillA = "secondary" -] = ["noSkill", "noSkill"]]: [string, string[]]) => void +>foo3 : ([nameMA, [primarySkillA, secondarySkillA]]: [string, string[]]) => void >nameMA : string >"noName" : string @@ -91,12 +88,12 @@ function foo3([nameMA = "noName", [ foo1(robotA); >foo1(robotA) : void ->foo1 : ([, skillA = ["noSkill", "noSkill"]]?: [string, string[]]) => void +>foo1 : ([ , skillA]?: [string, string[]]) => void >robotA : [string, string[]] foo1(["roomba", ["vaccum", "mopping"]]); >foo1(["roomba", ["vaccum", "mopping"]]) : void ->foo1 : ([, skillA = ["noSkill", "noSkill"]]?: [string, string[]]) => void +>foo1 : ([ , skillA]?: [string, string[]]) => void >["roomba", ["vaccum", "mopping"]] : [string, string[]] >"roomba" : string >["vaccum", "mopping"] : string[] @@ -105,12 +102,12 @@ foo1(["roomba", ["vaccum", "mopping"]]); foo2(robotA); >foo2(robotA) : void ->foo2 : ([nameMB = "noName"]?: [string, string[]]) => void +>foo2 : ([nameMB]?: [string, string[]]) => void >robotA : [string, string[]] foo2(["roomba", ["vaccum", "mopping"]]); >foo2(["roomba", ["vaccum", "mopping"]]) : void ->foo2 : ([nameMB = "noName"]?: [string, string[]]) => void +>foo2 : ([nameMB]?: [string, string[]]) => void >["roomba", ["vaccum", "mopping"]] : [string, string[]] >"roomba" : string >["vaccum", "mopping"] : string[] @@ -119,18 +116,12 @@ foo2(["roomba", ["vaccum", "mopping"]]); foo3(robotA); >foo3(robotA) : void ->foo3 : ([nameMA = "noName", [ - primarySkillA = "primary", - secondarySkillA = "secondary" -] = ["noSkill", "noSkill"]]: [string, string[]]) => void +>foo3 : ([nameMA, [primarySkillA, secondarySkillA]]: [string, string[]]) => void >robotA : [string, string[]] foo3(["roomba", ["vaccum", "mopping"]]); >foo3(["roomba", ["vaccum", "mopping"]]) : void ->foo3 : ([nameMA = "noName", [ - primarySkillA = "primary", - secondarySkillA = "secondary" -] = ["noSkill", "noSkill"]]: [string, string[]]) => void +>foo3 : ([nameMA, [primarySkillA, secondarySkillA]]: [string, string[]]) => void >["roomba", ["vaccum", "mopping"]] : [string, string[]] >"roomba" : string >["vaccum", "mopping"] : string[]