Skip to content

Commit 9c4e14d

Browse files
authoredOct 25, 2022
Remove "No type information for this code" from baseline (#51311)
* Fix "No type information for this code" in baseline * Just remove the message
1 parent 88d25b4 commit 9c4e14d

File tree

880 files changed

+3813
-3409
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

880 files changed

+3813
-3409
lines changed
 

‎src/harness/harnessIO.ts

+6-13
Original file line numberDiff line numberDiff line change
@@ -808,21 +808,14 @@ namespace Harness {
808808
typeLines += ">" + formattedLine + "\r\n";
809809
}
810810

811-
// Preserve legacy behavior
812-
if (lastIndexWritten === undefined) {
813-
for (const codeLine of codeLines) {
814-
typeLines += codeLine + "\r\nNo type information for this code.";
811+
lastIndexWritten ??= -1;
812+
if (lastIndexWritten + 1 < codeLines.length) {
813+
if (!((lastIndexWritten + 1 < codeLines.length) && (codeLines[lastIndexWritten + 1].match(/^\s*[{|}]\s*$/) || codeLines[lastIndexWritten + 1].trim() === ""))) {
814+
typeLines += "\r\n";
815815
}
816+
typeLines += codeLines.slice(lastIndexWritten + 1).join("\r\n");
816817
}
817-
else {
818-
if (lastIndexWritten + 1 < codeLines.length) {
819-
if (!((lastIndexWritten + 1 < codeLines.length) && (codeLines[lastIndexWritten + 1].match(/^\s*[{|}]\s*$/) || codeLines[lastIndexWritten + 1].trim() === ""))) {
820-
typeLines += "\r\n";
821-
}
822-
typeLines += codeLines.slice(lastIndexWritten + 1).join("\r\n");
823-
}
824-
typeLines += "\r\n";
825-
}
818+
typeLines += "\r\n";
826819
yield [checkDuplicatedFileName(unitName, dupeCase), Utils.removeTestPathPrefixes(typeLines)];
827820
}
828821
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
=== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStringIndexerAndExportedFunctionWithTypeIncompatibleWithIndexer.ts ===
22

3-
No type information for this code.

0 commit comments

Comments
 (0)
Please sign in to comment.