Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/harness/typeWriter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ export class TypeWriterWalker {
return undefined;
}

if (ts.isOmittedExpression(node)) {
return undefined;
}

// Workaround to ensure we output 'C' instead of 'typeof C' for base class expressions
// let type = this.checker.getTypeAtLocation(node);
let type = ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent) ? this.checker.getTypeAtLocation(node.parent) : undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@ var results: string[];

{
let [, b, , a] = results;
> : undefined
> : ^^^^^^^^^
>b : string
> : ^^^^^^
> : undefined
> : ^^^^^^^^^
>a : string
> : ^^^^^^
>results : string[]
Expand All @@ -38,26 +34,12 @@ var results: string[];
function f([, a, , b, , , , s, , , ] = results) {
>f : ([, a, , b, , , , s, , ,]?: string[]) => void
> : ^ ^^^^^^^^^^^^^^^^^^^^
> : undefined
> : ^^^^^^^^^
>a : string
> : ^^^^^^
> : undefined
> : ^^^^^^^^^
>b : string
> : ^^^^^^
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^
>s : string
> : ^^^^^^
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^
>results : string[]
> : ^^^^^^^^

Expand Down
6 changes: 0 additions & 6 deletions tests/baselines/reference/arrayLiteralWidened.types
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ var a = [,,];
> : ^^^^^
>[,,] : undefined[]
> : ^^^^^^^^^^^
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^

var a = [null, null];
>a : any[]
Expand Down Expand Up @@ -112,8 +108,6 @@ var d = [, x];
> : ^^^^^^^^^^^
>[, x] : undefined[]
> : ^^^^^^^^^^^
> : undefined
> : ^^^^^^^^^
>x : undefined
> : ^^^^^^^^^

Expand Down
16 changes: 0 additions & 16 deletions tests/baselines/reference/arrayLiterals2ES5.types
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ var a0 = [,, 2, 3, 4]
> : ^^^^^^^^
>[,, 2, 3, 4] : number[]
> : ^^^^^^^^
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^
>2 : 2
> : ^
>3 : 3
Expand All @@ -41,12 +37,6 @@ var a2 = [, , , ...a0, "hello"];
> : ^^^^^^^^^^^^^^^^^^^
>[, , , ...a0, "hello"] : (string | number)[]
> : ^^^^^^^^^^^^^^^^^^^
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^
>...a0 : number
> : ^^^^^^
>a0 : number[]
Expand All @@ -59,10 +49,6 @@ var a3 = [,, ...a0]
> : ^^^^^^^^
>[,, ...a0] : number[]
> : ^^^^^^^^
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^
>...a0 : number
> : ^^^^^^
>a0 : number[]
Expand All @@ -87,8 +73,6 @@ var a5 = [...a0, , ]
> : ^^^^^^
>a0 : number[]
> : ^^^^^^^^
> : undefined
> : ^^^^^^^^^

// Each element expression in a non-empty array literal is processed as follows:
// - If the array literal contains no spread elements, and if the array literal is contextually typed (section 4.19)
Expand Down
16 changes: 0 additions & 16 deletions tests/baselines/reference/arrayLiterals2ES6.types
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ var a0 = [, , 2, 3, 4]
> : ^^^^^^^^
>[, , 2, 3, 4] : number[]
> : ^^^^^^^^
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^
>2 : 2
> : ^
>3 : 3
Expand All @@ -41,12 +37,6 @@ var a2 = [, , , ...a0, "hello"];
> : ^^^^^^^^^^^^^^^^^^^
>[, , , ...a0, "hello"] : (string | number)[]
> : ^^^^^^^^^^^^^^^^^^^
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^
>...a0 : number
> : ^^^^^^
>a0 : number[]
Expand All @@ -59,10 +49,6 @@ var a3 = [, , ...a0]
> : ^^^^^^^^
>[, , ...a0] : number[]
> : ^^^^^^^^
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^
>...a0 : number
> : ^^^^^^
>a0 : number[]
Expand All @@ -87,8 +73,6 @@ var a5 = [...a0, , ]
> : ^^^^^^
>a0 : number[]
> : ^^^^^^^^
> : undefined
> : ^^^^^^^^^

// Each element expression in a non-empty array literal is processed as follows:
// - If the array literal contains no spread elements, and if the array literal is contextually typed (section 4.19)
Expand Down
4 changes: 0 additions & 4 deletions tests/baselines/reference/arrowFunctionExpressions.types
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ var p3 = ([, a]) => { };
> : ^ ^^^^^^^^^^^^^^^^^^^^^
>([, a]) => { } : ([, a]: [any, any]) => void
> : ^ ^^^^^^^^^^^^^^^^^^^^^
> : undefined
> : ^^^^^^^^^
>a : any
> : ^^^

Expand All @@ -113,8 +111,6 @@ var p4 = ([, ...a]) => { };
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>([, ...a]) => { } : ([, ...a]: [any?, ...any[]]) => void
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> : undefined
> : ^^^^^^^^^
>a : any[]
> : ^^^^^

Expand Down
2 changes: 0 additions & 2 deletions tests/baselines/reference/asyncWithVarShadowing_es6.types
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ async function fn14(x) {
>x : any

var [, x] = y;
> : undefined
> : ^^^^^^^^^
>x : any
> : ^^^
>y : any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@

=== bindingPatternOmittedExpressionNesting.ts ===
export let [,,[,[],,[],]] = undefined as any;
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^
>undefined as any : any
>undefined : undefined
> : ^^^^^^^^^
Expand Down
4 changes: 0 additions & 4 deletions tests/baselines/reference/coAndContraVariantInferences3.types
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,6 @@ buildOverload("updateImportDeclaration")
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>([, modifiers, importClause, moduleSpecifier, assertClause, other]) => (other === undefined) && (modifiers === undefined || every(modifiers, isModifier)) && (importClause === undefined || !isArray(importClause)) && (moduleSpecifier === undefined || isExpression(moduleSpecifier)) && (assertClause === undefined || isAssertClause(assertClause)) : ([, modifiers, importClause, moduleSpecifier, assertClause, other]: [node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined] | [node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined]) => boolean
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> : undefined
> : ^^^^^^^^^
>modifiers : readonly Modifier[] | readonly Decorator[] | undefined
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>importClause : ImportClause | readonly Modifier[] | undefined
Expand Down Expand Up @@ -508,8 +506,6 @@ buildOverload("updateImportDeclaration")
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>([, decorators, modifiers, importClause, moduleSpecifier, assertClause]) => (decorators === undefined || every(decorators, isDecorator)) && (modifiers === undefined || isArray(modifiers)) && (importClause === undefined || isImportClause(importClause)) && (moduleSpecifier !== undefined && isExpression(moduleSpecifier)) && (assertClause === undefined || isAssertClause(assertClause)) : ([, decorators, modifiers, importClause, moduleSpecifier, assertClause]: [node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined] | [node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined]) => boolean
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> : undefined
> : ^^^^^^^^^
>decorators : readonly Modifier[] | readonly Decorator[] | undefined
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>modifiers : ImportClause | readonly Modifier[] | undefined
Expand Down
4 changes: 0 additions & 4 deletions tests/baselines/reference/commentOnArrayElement10.types
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,4 @@ const array = [,, /* comment */];
> : ^^^^^
>[,, /* comment */] : undefined[]
> : ^^^^^^^^^^^
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^

3 changes: 0 additions & 3 deletions tests/baselines/reference/commentOnArrayElement11.types
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,5 @@ const array = [
> : ^^^^^^^^^^^

, /* comment */
> : undefined
> : ^^^^^^^^^

];

5 changes: 0 additions & 5 deletions tests/baselines/reference/commentOnArrayElement12.types
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,5 @@ const array = [
> : ^^^^^^^^^^^

,, /* comment */
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^

];

3 changes: 0 additions & 3 deletions tests/baselines/reference/commentOnArrayElement3.types
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,5 @@ const array = [
> : ^

/* end of element 2 */, ,
> : undefined
> : ^^^^^^^^^

/* extra comment */
];
22 changes: 0 additions & 22 deletions tests/baselines/reference/declarationEmitDestructuring5.types
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,12 @@
function baz([, z, , ]) { }
>baz : ([, z, ,]: [any, any, any?]) => void
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> : undefined
> : ^^^^^^^^^
>z : any
> : ^^^
> : undefined
> : ^^^^^^^^^

function foo([, b, ]: [any, any]): void { }
>foo : ([, b,]: [any, any]) => void
> : ^ ^^ ^^^^^
> : undefined
> : ^^^^^^^^^
>b : any
> : ^^^

Expand All @@ -24,20 +18,12 @@ function bar([z, , , ]) { }
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>z : any
> : ^^^
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^

function bar1([z, , , ] = [1, 3, 4, 6, 7]) { }
>bar1 : ([z, , ,]?: [number, number, number, number, number]) => void
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>z : number
> : ^^^^^^
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^
>[1, 3, 4, 6, 7] : [number, number, number, number, number]
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>1 : 1
Expand All @@ -54,14 +40,6 @@ function bar1([z, , , ] = [1, 3, 4, 6, 7]) { }
function bar2([,,z, , , ]) { }
>bar2 : ([, , z, , ,]: [any, any, any, any?, any?]) => void
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^
>z : any
> : ^^^
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^

Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ var [x1, y1] = [1, "hello"]; // emit x1: number, y1: string
> : ^^^^^^^

var [, , z1] = [0, 1, 2]; // emit z1: number
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^
>z1 : number
> : ^^^^^^
>[0, 1, 2] : [number, number, number]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

=== declarationEmitDestructuringArrayPattern5.ts ===
var [, , z] = [1, 2, 4];
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^
>z : number
> : ^^^^^^
>[1, 2, 4] : [number, number, number]
Expand All @@ -18,12 +14,8 @@ var [, , z] = [1, 2, 4];
> : ^

var [, a, , ] = [3, 4, 5];
> : undefined
> : ^^^^^^^^^
>a : number
> : ^^^^^^
> : undefined
> : ^^^^^^^^^
>[3, 4, 5] : [number, number, number]
> : ^^^^^^^^^^^^^^^^^^^^^^^^
>3 : 3
Expand All @@ -34,12 +26,6 @@ var [, a, , ] = [3, 4, 5];
> : ^

var [, , [, b, ]] = [3,5,[0, 1]];
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^
>b : number
> : ^^^^^^
>[3,5,[0, 1]] : [number, number, [number, number]]
Expand Down
4 changes: 0 additions & 4 deletions tests/baselines/reference/declarationsAndAssignments.types
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ function f0() {
> : ^^^^^^^

var [,, x] = [0, 1, 2];
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^
>x : number
> : ^^^^^^
>[0, 1, 2] : [number, number, number]
Expand Down
10 changes: 0 additions & 10 deletions tests/baselines/reference/destructuredDeclarationEmit.types
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,10 @@ export { baz, ibaz };
> : ^^^^^^

const [ , one, , [, bee, , [, {sec} ]]] = arr;
> : undefined
> : ^^^^^^^^^
>one : 1
> : ^
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^
>bee : "b"
> : ^^^
> : undefined
> : ^^^^^^^^^
> : undefined
> : ^^^^^^^^^
>sec : "sec"
> : ^^^^^
>arr : [0, 1, 2, ["a", "b", "c", [{ def: "def"; }, { sec: "sec"; }]]]
Expand Down
Loading
Loading