Skip to content

Commit

Permalink
Remove "No type information for this code" from baseline (#51311)
Browse files Browse the repository at this point in the history
* Fix "No type information for this code" in baseline

* Just remove the message
  • Loading branch information
andrewbranch committed Oct 25, 2022
1 parent 88d25b4 commit 9c4e14d
Show file tree
Hide file tree
Showing 880 changed files with 3,813 additions and 3,409 deletions.
19 changes: 6 additions & 13 deletions src/harness/harnessIO.ts
Expand Up @@ -808,21 +808,14 @@ namespace Harness {
typeLines += ">" + formattedLine + "\r\n";
}

// Preserve legacy behavior
if (lastIndexWritten === undefined) {
for (const codeLine of codeLines) {
typeLines += codeLine + "\r\nNo type information for this code.";
lastIndexWritten ??= -1;
if (lastIndexWritten + 1 < codeLines.length) {
if (!((lastIndexWritten + 1 < codeLines.length) && (codeLines[lastIndexWritten + 1].match(/^\s*[{|}]\s*$/) || codeLines[lastIndexWritten + 1].trim() === ""))) {
typeLines += "\r\n";
}
typeLines += codeLines.slice(lastIndexWritten + 1).join("\r\n");
}
else {
if (lastIndexWritten + 1 < codeLines.length) {
if (!((lastIndexWritten + 1 < codeLines.length) && (codeLines[lastIndexWritten + 1].match(/^\s*[{|}]\s*$/) || codeLines[lastIndexWritten + 1].trim() === ""))) {
typeLines += "\r\n";
}
typeLines += codeLines.slice(lastIndexWritten + 1).join("\r\n");
}
typeLines += "\r\n";
}
typeLines += "\r\n";
yield [checkDuplicatedFileName(unitName, dupeCase), Utils.removeTestPathPrefixes(typeLines)];
}
}
Expand Down
@@ -1,3 +1,2 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStringIndexerAndExportedFunctionWithTypeIncompatibleWithIndexer.ts ===

No type information for this code.
@@ -1,3 +1,2 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStringIndexerAndExportedFunctionWithTypeIncompatibleWithIndexer.ts ===

No type information for this code.
2 changes: 1 addition & 1 deletion tests/baselines/reference/ES5For-of12.symbols
@@ -1,3 +1,3 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of12.ts ===

for ([""] of [[""]]) { }
No type information for this code.
4 changes: 2 additions & 2 deletions tests/baselines/reference/InterfaceDeclaration8.types
@@ -1,4 +1,4 @@
=== tests/cases/compiler/InterfaceDeclaration8.ts ===

interface string {
No type information for this code.}
No type information for this code.
}
4 changes: 2 additions & 2 deletions tests/baselines/reference/Protected2.types
@@ -1,4 +1,4 @@
=== tests/cases/conformance/parser/ecmascript5/Protected/Protected2.ts ===

protected module M {
No type information for this code.}
No type information for this code.
}
2 changes: 1 addition & 1 deletion tests/baselines/reference/TypeArgumentList1.symbols
@@ -1,3 +1,3 @@
=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/TypeArgumentLists/TypeArgumentList1.ts ===

Foo<A,B,\ C>(4, 5, 6);
No type information for this code.
4 changes: 2 additions & 2 deletions tests/baselines/reference/VariableDeclaration11_es6.symbols
@@ -1,4 +1,4 @@
=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration11_es6.ts ===

"use strict";
No type information for this code.let
No type information for this code.
let
2 changes: 1 addition & 1 deletion tests/baselines/reference/VariableDeclaration1_es6.symbols
@@ -1,3 +1,3 @@
=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration1_es6.ts ===

const
No type information for this code.
2 changes: 1 addition & 1 deletion tests/baselines/reference/VariableDeclaration1_es6.types
@@ -1,3 +1,3 @@
=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration1_es6.ts ===

const
No type information for this code.
2 changes: 1 addition & 1 deletion tests/baselines/reference/VariableDeclaration6_es6.symbols
@@ -1,3 +1,3 @@
=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration6_es6.ts ===

let
No type information for this code.
4 changes: 2 additions & 2 deletions tests/baselines/reference/YieldExpression18_es6.symbols
@@ -1,4 +1,4 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression18_es6.ts ===

"use strict";
No type information for this code.yield(foo);
No type information for this code.
yield(foo);
2 changes: 1 addition & 1 deletion tests/baselines/reference/YieldExpression1_es6.symbols
@@ -1,3 +1,3 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression1_es6.ts ===

yield;
No type information for this code.
2 changes: 1 addition & 1 deletion tests/baselines/reference/YieldExpression2_es6.symbols
@@ -1,3 +1,3 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression2_es6.ts ===

yield foo;
No type information for this code.
2 changes: 1 addition & 1 deletion tests/baselines/reference/YieldStarExpression1_es6.symbols
@@ -1,3 +1,3 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldStarExpression1_es6.ts ===

yield * [];
No type information for this code.
2 changes: 1 addition & 1 deletion tests/baselines/reference/YieldStarExpression2_es6.symbols
@@ -1,3 +1,3 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldStarExpression2_es6.ts ===

yield *;
No type information for this code.
13 changes: 7 additions & 6 deletions tests/baselines/reference/ambientExportDefaultErrors.symbols
@@ -1,11 +1,12 @@
=== tests/cases/compiler/consumer.ts ===

/// <reference path="./indirection.d.ts" />
No type information for this code./// <reference path="./indirection2.d.ts" />
No type information for this code.import "indirect";
No type information for this code.import "foo";
No type information for this code.import "indirect2";
No type information for this code.import "foo2";
No type information for this code.=== tests/cases/compiler/foo.d.ts ===
/// <reference path="./indirection2.d.ts" />
import "indirect";
import "foo";
import "indirect2";
import "foo2";
=== tests/cases/compiler/foo.d.ts ===
export default 2 + 2;
export as namespace Foo;
>Foo : Symbol(Foo, Decl(foo.d.ts, 0, 21))
Expand Down
13 changes: 7 additions & 6 deletions tests/baselines/reference/ambientExportDefaultErrors.types
@@ -1,11 +1,12 @@
=== tests/cases/compiler/consumer.ts ===

/// <reference path="./indirection.d.ts" />
No type information for this code./// <reference path="./indirection2.d.ts" />
No type information for this code.import "indirect";
No type information for this code.import "foo";
No type information for this code.import "indirect2";
No type information for this code.import "foo2";
No type information for this code.=== tests/cases/compiler/foo.d.ts ===
/// <reference path="./indirection2.d.ts" />
import "indirect";
import "foo";
import "indirect2";
import "foo2";
=== tests/cases/compiler/foo.d.ts ===
export default 2 + 2;
>2 + 2 : number
>2 : 2
Expand Down
5 changes: 3 additions & 2 deletions tests/baselines/reference/ambientShorthand_reExport.symbols
Expand Up @@ -7,9 +7,10 @@ export {x} from "jquery";
>x : Symbol(x, Decl(reExportX.ts, 0, 8))

=== tests/cases/conformance/ambient/reExportAll.ts ===

export * from "jquery";
No type information for this code.
No type information for this code.=== tests/cases/conformance/ambient/reExportUser.ts ===

=== tests/cases/conformance/ambient/reExportUser.ts ===
import {x} from "./reExportX";
>x : Symbol(x, Decl(reExportUser.ts, 0, 8))

Expand Down
5 changes: 3 additions & 2 deletions tests/baselines/reference/ambientShorthand_reExport.types
Expand Up @@ -7,9 +7,10 @@ export {x} from "jquery";
>x : any

=== tests/cases/conformance/ambient/reExportAll.ts ===

export * from "jquery";
No type information for this code.
No type information for this code.=== tests/cases/conformance/ambient/reExportUser.ts ===

=== tests/cases/conformance/ambient/reExportUser.ts ===
import {x} from "./reExportX";
>x : any

Expand Down
7 changes: 4 additions & 3 deletions tests/baselines/reference/anonymousDefaultExportsAmd.symbols
@@ -1,6 +1,7 @@
=== tests/cases/conformance/es6/moduleExportsAmd/a.ts ===

export default class {}
No type information for this code.
No type information for this code.=== tests/cases/conformance/es6/moduleExportsAmd/b.ts ===

=== tests/cases/conformance/es6/moduleExportsAmd/b.ts ===

export default function() {}
No type information for this code.
7 changes: 4 additions & 3 deletions tests/baselines/reference/anonymousDefaultExportsAmd.types
@@ -1,6 +1,7 @@
=== tests/cases/conformance/es6/moduleExportsAmd/a.ts ===

export default class {}
No type information for this code.
No type information for this code.=== tests/cases/conformance/es6/moduleExportsAmd/b.ts ===

=== tests/cases/conformance/es6/moduleExportsAmd/b.ts ===

export default function() {}
No type information for this code.
@@ -1,6 +1,7 @@
=== tests/cases/conformance/es6/moduleExportsCommonjs/a.ts ===

export default class {}
No type information for this code.
No type information for this code.=== tests/cases/conformance/es6/moduleExportsCommonjs/b.ts ===

=== tests/cases/conformance/es6/moduleExportsCommonjs/b.ts ===

export default function() {}
No type information for this code.
@@ -1,6 +1,7 @@
=== tests/cases/conformance/es6/moduleExportsCommonjs/a.ts ===

export default class {}
No type information for this code.
No type information for this code.=== tests/cases/conformance/es6/moduleExportsCommonjs/b.ts ===

=== tests/cases/conformance/es6/moduleExportsCommonjs/b.ts ===

export default function() {}
No type information for this code.
@@ -1,6 +1,7 @@
=== tests/cases/conformance/es6/moduleExportsSystem/a.ts ===

export default class {}
No type information for this code.
No type information for this code.=== tests/cases/conformance/es6/moduleExportsSystem/b.ts ===

=== tests/cases/conformance/es6/moduleExportsSystem/b.ts ===

export default function() {}
No type information for this code.
7 changes: 4 additions & 3 deletions tests/baselines/reference/anonymousDefaultExportsSystem.types
@@ -1,6 +1,7 @@
=== tests/cases/conformance/es6/moduleExportsSystem/a.ts ===

export default class {}
No type information for this code.
No type information for this code.=== tests/cases/conformance/es6/moduleExportsSystem/b.ts ===

=== tests/cases/conformance/es6/moduleExportsSystem/b.ts ===

export default function() {}
No type information for this code.
7 changes: 4 additions & 3 deletions tests/baselines/reference/anonymousDefaultExportsUmd.symbols
@@ -1,6 +1,7 @@
=== tests/cases/conformance/es6/moduleExportsUmd/a.ts ===

export default class {}
No type information for this code.
No type information for this code.=== tests/cases/conformance/es6/moduleExportsUmd/b.ts ===

=== tests/cases/conformance/es6/moduleExportsUmd/b.ts ===

export default function() {}
No type information for this code.
7 changes: 4 additions & 3 deletions tests/baselines/reference/anonymousDefaultExportsUmd.types
@@ -1,6 +1,7 @@
=== tests/cases/conformance/es6/moduleExportsUmd/a.ts ===

export default class {}
No type information for this code.
No type information for this code.=== tests/cases/conformance/es6/moduleExportsUmd/b.ts ===

=== tests/cases/conformance/es6/moduleExportsUmd/b.ts ===

export default function() {}
No type information for this code.
@@ -1,3 +1,3 @@
=== tests/cases/compiler/arrowFunctionInExpressionStatement1.ts ===

() => 0;
No type information for this code.
2 changes: 1 addition & 1 deletion tests/baselines/reference/asiBreak.symbols
@@ -1,3 +1,3 @@
=== tests/cases/compiler/asiBreak.ts ===

while (true) break
No type information for this code.
2 changes: 1 addition & 1 deletion tests/baselines/reference/asiContinue.symbols
@@ -1,3 +1,3 @@
=== tests/cases/compiler/asiContinue.ts ===

while (true) continue
No type information for this code.
4 changes: 2 additions & 2 deletions tests/baselines/reference/asiReturn.symbols
@@ -1,4 +1,4 @@
=== tests/cases/compiler/asiReturn.ts ===

// This should be an error for using a return outside a function, but ASI should work properly
No type information for this code.return
No type information for this code.
return
4 changes: 2 additions & 2 deletions tests/baselines/reference/asiReturn.types
@@ -1,4 +1,4 @@
=== tests/cases/compiler/asiReturn.ts ===

// This should be an error for using a return outside a function, but ASI should work properly
No type information for this code.return
No type information for this code.
return
@@ -1,3 +1,2 @@
=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithWithGenericConstructSignatures.ts ===

No type information for this code.
@@ -1,3 +1,2 @@
=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithWithGenericConstructSignatures.ts ===

No type information for this code.
4 changes: 2 additions & 2 deletions tests/baselines/reference/asyncInterface_es5.types
@@ -1,4 +1,4 @@
=== tests/cases/conformance/async/es5/asyncInterface_es5.ts ===

async interface I {
No type information for this code.}
No type information for this code.
}
4 changes: 2 additions & 2 deletions tests/baselines/reference/asyncInterface_es6.types
@@ -1,4 +1,4 @@
=== tests/cases/conformance/async/es6/asyncInterface_es6.ts ===

async interface I {
No type information for this code.}
No type information for this code.
}
4 changes: 2 additions & 2 deletions tests/baselines/reference/asyncModule_es5.types
@@ -1,4 +1,4 @@
=== tests/cases/conformance/async/es5/asyncModule_es5.ts ===

async module M {
No type information for this code.}
No type information for this code.
}
4 changes: 2 additions & 2 deletions tests/baselines/reference/asyncModule_es6.types
@@ -1,4 +1,4 @@
=== tests/cases/conformance/async/es6/asyncModule_es6.ts ===

async module M {
No type information for this code.}
No type information for this code.
}
6 changes: 3 additions & 3 deletions tests/baselines/reference/augmentArray.types
@@ -1,5 +1,5 @@
=== tests/cases/compiler/augmentArray.ts ===

interface Array<T> {
No type information for this code. (): any[];
No type information for this code.}
No type information for this code.
(): any[];
}
1 change: 0 additions & 1 deletion tests/baselines/reference/bind2.symbols
@@ -1,3 +1,2 @@
=== tests/cases/compiler/bind2.ts ===

No type information for this code.
1 change: 0 additions & 1 deletion tests/baselines/reference/bind2.types
@@ -1,3 +1,2 @@
=== tests/cases/compiler/bind2.ts ===

No type information for this code.
@@ -1,5 +1,5 @@
=== tests/cases/compiler/breakInIterationOrSwitchStatement1.ts ===

while (true) {
No type information for this code. break;
No type information for this code.}
No type information for this code.
break;
}

0 comments on commit 9c4e14d

Please sign in to comment.