;
clearProps?(): void;
+ isStaticSourceFile?(fileName: string): boolean;
clearFileCache?(): void;
}
diff --git a/src/services/utilities.ts b/src/services/utilities.ts
index 058460cbce497c7fa9c85ed1557bffbeee3139a3..1731ef889aa10f46c9f14b72222b6a65d3583e5c 100644
--- a/src/services/utilities.ts
+++ b/src/services/utilities.ts
@@ -2115,6 +2115,7 @@ export function createModuleSpecifierResolutionHost(program: Program, host: Lang
isSourceOfProjectReferenceRedirect: fileName => program.isSourceOfProjectReferenceRedirect(fileName),
getNearestAncestorDirectoryWithPackageJson: maybeBind(host, host.getNearestAncestorDirectoryWithPackageJson),
getFileIncludeReasons: () => program.getFileIncludeReasons(),
+ getCommonSourceDirectory: () => program.getCommonSourceDirectory(),
};
}
diff --git a/src/testRunner/_namespaces/Harness.ts b/src/testRunner/_namespaces/Harness.ts
index 267863580e7a1bbc48cbd14fdc6a0a35ff4c6eb1..7929933fc917168877c223e11fd43cf5c869575c 100644
--- a/src/testRunner/_namespaces/Harness.ts
+++ b/src/testRunner/_namespaces/Harness.ts
@@ -8,6 +8,7 @@ export * from "../fourslashRunner";
export * from "../compilerRunner";
export * from "../externalCompileRunner";
export * from "../test262Runner";
+export * from "../transpileRunner";
export * from "../runner";
// If running bundled, we want this to be here so that esbuild places the tests after runner.ts.
diff --git a/src/testRunner/compilerRunner.ts b/src/testRunner/compilerRunner.ts
index bb654ecf6ff278b05c0d7ff0d35d6c6e1976f7b6..51070db63e166f6e0f38b8e115fe551ccff6cc82 100644
--- a/src/testRunner/compilerRunner.ts
+++ b/src/testRunner/compilerRunner.ts
@@ -50,9 +50,10 @@ export class CompilerBaselineRunner extends RunnerBase {
return this.testSuiteName;
}
+ private testFiles: string[] | undefined;
public enumerateTestFiles() {
// see also: `enumerateTestFiles` in tests/webTestServer.ts
- return this.enumerateFiles(this.basePath, /\.(ets|tsx?)$/, { recursive: true }).map(CompilerTest.getConfigurations);
+ return this.testFiles ??= this.enumerateFiles(this.basePath, /\.(ets|tsx?)$/, { recursive: true });
}
public initializeTests() {
@@ -63,9 +64,8 @@ export class CompilerBaselineRunner extends RunnerBase {
// this will set up a series of describe/it blocks to run between the setup and cleanup phases
const files = this.tests.length > 0 ? this.tests : IO.enumerateTestFiles(this);
- files.forEach(test => {
- const file = typeof test === "string" ? test : test.file;
- this.checkTestCodeOutput(vpath.normalizeSeparators(file), typeof test === "string" ? CompilerTest.getConfigurations(test) : test);
+ files.forEach(file => {
+ this.checkTestCodeOutput(vpath.normalizeSeparators(file), CompilerTest.getConfigurations(file));
});
});
}
@@ -164,7 +164,7 @@ class CompilerTest {
private lastUnit: TestCaseParser.TestUnitData;
private harnessSettings: TestCaseParser.CompilerSettings;
private hasNonDtsFiles: boolean;
- private result: compiler.CompilationResult;
+ private result: Compiler.CompileFilesResult;
private options: ts.CompilerOptions;
private tsConfigFiles: Compiler.TestFile[];
// equivalent to the files that will be passed on the command line
diff --git a/src/testRunner/externalCompileRunner.ts b/src/testRunner/externalCompileRunner.ts
index 2099d2f5762c7e74478a389f34b658aa0a48ce8d..30b5335293f7dd77a4f90f00bf60d39e14175d4b 100644
--- a/src/testRunner/externalCompileRunner.ts
+++ b/src/testRunner/externalCompileRunner.ts
@@ -37,7 +37,7 @@ abstract class ExternalCompileRunnerBase extends RunnerBase {
describe(`${this.kind()} code samples`, function (this: Mocha.Suite) {
this.timeout(600_000); // 10 minutes
for (const test of testList) {
- cls.runTest(typeof test === "string" ? test : test.file);
+ cls.runTest(test);
}
});
}
@@ -142,7 +142,7 @@ export class DockerfileRunner extends ExternalCompileRunnerBase {
cls.exec("docker", ["build", ".", "-t", "typescript/typescript"], { cwd: IO.getWorkspaceRoot() }); // cached because workspace is hashed to determine cacheability
});
for (const test of testList) {
- const directory = typeof test === "string" ? test : test.file;
+ const directory = test;
const cwd = path.join(IO.getWorkspaceRoot(), cls.testDir, directory);
it(`should build ${directory} successfully`, () => {
const imageName = `tstest/${directory}`;
diff --git a/src/testRunner/fourslashRunner.ts b/src/testRunner/fourslashRunner.ts
index cdaef8c48f119e45fea44f0b5889bfd4550a056d..caa757a44934723073639739c8cf2415f292bb16 100644
--- a/src/testRunner/fourslashRunner.ts
+++ b/src/testRunner/fourslashRunner.ts
@@ -49,8 +49,7 @@ export class FourSlashRunner extends RunnerBase {
}
describe(this.testSuiteName + " tests", () => {
- this.tests.forEach(test => {
- const file = typeof test === "string" ? test : test.file;
+ this.tests.forEach(file => {
describe(file, () => {
let fn = ts.normalizeSlashes(file);
const justName = fn.replace(/^.*[\\\/]/, "");
diff --git a/src/testRunner/parallel/host.ts b/src/testRunner/parallel/host.ts
index c0e38a3eb27219d99673b824c4b493d008655d50..77177e4a008ed0f1e75c39e406dfbe481aff7694 100644
--- a/src/testRunner/parallel/host.ts
+++ b/src/testRunner/parallel/host.ts
@@ -200,8 +200,7 @@ export function start() {
console.log("Discovering runner-based tests...");
const discoverStart = +(new Date());
for (const runner of runners) {
- for (const test of runner.getTestFiles()) {
- const file = typeof test === "string" ? test : test.file;
+ for (const file of runner.getTestFiles()) {
let size: number;
if (!perfData) {
try {
diff --git a/src/testRunner/projectsRunner.ts b/src/testRunner/projectsRunner.ts
index 6c1cfddaa07b2ada542a22b51f547c7e7aa3b3ee..821906a70f00644744b02d96beebf1fa524c3d78 100644
--- a/src/testRunner/projectsRunner.ts
+++ b/src/testRunner/projectsRunner.ts
@@ -54,7 +54,7 @@ export class ProjectRunner extends Harness.RunnerBase {
describe("projects tests", () => {
const tests = this.tests.length === 0 ? this.enumerateTestFiles() : this.tests;
for (const test of tests) {
- this.runProjectTestCase(typeof test === "string" ? test : test.file);
+ this.runProjectTestCase(test);
}
});
}
@@ -178,7 +178,7 @@ class ProjectTestCase {
};
}
- private get vfs() {
+ private get vfs(): vfs.FileSystem {
return this.sys.vfs;
}
@@ -200,15 +200,37 @@ class ProjectTestCase {
throw assert(false, "Testcase: " + testCaseFileName + " does not contain valid json format: " + e.message);
}
- const fs = vfs.createFromFileSystem(Harness.IO, /*ignoreCase*/ false);
- fs.mountSync(vpath.resolve(Harness.IO.getWorkspaceRoot(), "tests"), vpath.combine(vfs.srcFolder, "tests"), vfs.createResolver(Harness.IO));
- fs.mkdirpSync(vpath.combine(vfs.srcFolder, testCase.projectRoot));
- fs.chdir(vpath.combine(vfs.srcFolder, testCase.projectRoot));
- fs.makeReadonly();
+ function makeFileSystem(): vfs.FileSystem {
+ const fs = vfs.createFromFileSystem(Harness.IO, /*ignoreCase*/ false);
+ fs.mountSync(vpath.resolve(Harness.IO.getWorkspaceRoot(), "tests"), vpath.combine(vfs.srcFolder, "tests"), vfs.createResolver(Harness.IO));
+ fs.mkdirpSync(vpath.combine(vfs.srcFolder, testCase.projectRoot));
+ fs.chdir(vpath.combine(vfs.srcFolder, testCase.projectRoot));
+ fs.makeReadonly();
+ return fs;
+ }
+ let fs: vfs.FileSystem | undefined;
return [
- { name: `@module: commonjs`, payload: { testCase, moduleKind: ts.ModuleKind.CommonJS, vfs: fs } },
- { name: `@module: amd`, payload: { testCase, moduleKind: ts.ModuleKind.AMD, vfs: fs } }
+ {
+ name: `@module: commonjs`,
+ payload: {
+ testCase,
+ moduleKind: ts.ModuleKind.CommonJS,
+ get vfs(): vfs.FileSystem {
+ return fs ??= makeFileSystem();
+ },
+ },
+ },
+ {
+ name: `@module: amd`,
+ payload: {
+ testCase,
+ moduleKind: ts.ModuleKind.AMD,
+ get vfs(): vfs.FileSystem {
+ return fs ??= makeFileSystem();
+ },
+ },
+ },
];
}
diff --git a/src/testRunner/runner.ts b/src/testRunner/runner.ts
index 6481fd00c11d8afbf6008adea32e7a5cfc54c62b..6633c3e25e31fec875408d70324f90f2bd81c735 100644
--- a/src/testRunner/runner.ts
+++ b/src/testRunner/runner.ts
@@ -6,7 +6,7 @@ import * as RWC from "./_namespaces/RWC";
import {
CompilerBaselineRunner, CompilerTestType, DefinitelyTypedRunner, DockerfileRunner, FourSlashRunner,
GeneratedFourslashRunner, IO, Parallel, RunnerBase, setLightMode, setShardId, setShards, Test262BaselineRunner,
- TestRunnerKind, UserCodeRunner,
+ TestRunnerKind, TranspileRunner, UserCodeRunner
} from "./_namespaces/Harness";
/* eslint-disable prefer-const */
@@ -20,8 +20,7 @@ function runTests(runners: RunnerBase[]) {
const dupes: [string, string][] = [];
for (const runner of runners) {
if (runner instanceof CompilerBaselineRunner || runner instanceof FourSlashRunner) {
- for (const sf of runner.enumerateTestFiles()) {
- const full = typeof sf === "string" ? sf : sf.file;
+ for (const full of runner.enumerateTestFiles()) {
const base = vpath.basename(full).toLowerCase();
// allow existing dupes in fourslash/shims and fourslash/server
if (seen.has(base) && !/fourslash\/(shim|server)/.test(full)) {
@@ -68,6 +67,8 @@ export function createRunner(kind: TestRunnerKind): RunnerBase {
return new FourSlashRunner(FourSlash.FourSlashTestType.Server);
case "project":
return new project.ProjectRunner();
+ case "transpile":
+ return new TranspileRunner();
case "rwc":
return new RWC.RWCRunner();
case "test262":
@@ -215,6 +216,9 @@ function handleTestConfig() {
case "fourslash-generated":
runners.push(new GeneratedFourslashRunner(FourSlash.FourSlashTestType.Native));
break;
+ case "transpile":
+ runners.push(new TranspileRunner());
+ break;
case "rwc":
runners.push(new RWC.RWCRunner());
break;
@@ -250,6 +254,9 @@ function handleTestConfig() {
runners.push(new FourSlashRunner(FourSlash.FourSlashTestType.Server));
// runners.push(new GeneratedFourslashRunner());
+ // transpile
+ runners.push(new TranspileRunner());
+
// CRON-only tests
if (process.env.TRAVIS_EVENT_TYPE === "cron") {
runners.push(new UserCodeRunner());
diff --git a/src/testRunner/rwcRunner.ts b/src/testRunner/rwcRunner.ts
index a60657574ed0a01cd043402c3d689b1d528626a9..409b10d540120bc75d2d013873f64c3160352567 100644
--- a/src/testRunner/rwcRunner.ts
+++ b/src/testRunner/rwcRunner.ts
@@ -229,7 +229,7 @@ export class RWCRunner extends Harness.RunnerBase {
public initializeTests(): void {
// Read in and evaluate the test list
for (const test of this.tests && this.tests.length ? this.tests : this.getTestFiles()) {
- this.runTest(typeof test === "string" ? test : test.file);
+ this.runTest(test);
}
}
diff --git a/src/testRunner/test262Runner.ts b/src/testRunner/test262Runner.ts
index 87aee2bf57401fe7cca5751fe2ef21d8087eb9e2..f8b8b9b27713492ca83810e9f4cb5b73d37df841 100644
--- a/src/testRunner/test262Runner.ts
+++ b/src/testRunner/test262Runner.ts
@@ -107,7 +107,7 @@ export class Test262BaselineRunner extends RunnerBase {
});
}
else {
- this.tests.forEach(test => this.runTest(typeof test === "string" ? test : test.file));
+ this.tests.forEach(file => this.runTest(file));
}
}
}
\ No newline at end of file
diff --git a/src/testRunner/transpileRunner.ts b/src/testRunner/transpileRunner.ts
new file mode 100644
index 0000000000000000000000000000000000000000..7ff49dea05f816bec85be41b7845190829d8fc33
--- /dev/null
+++ b/src/testRunner/transpileRunner.ts
@@ -0,0 +1,127 @@
+import * as ts from "./_namespaces/ts";
+import * as vpath from "./_namespaces/vpath";
+import {
+ Baseline,
+ Compiler,
+ getFileBasedTestConfigurations,
+ IO,
+ RunnerBase,
+ TestCaseParser,
+ TestRunnerKind
+} from "./_namespaces/Harness";
+export class TranspileRunner extends RunnerBase {
+ protected basePath = "tests/cases/transpile";
+ protected testSuiteName: TestRunnerKind = "transpile";
+
+ public enumerateTestFiles(): string[] {
+ // see also: `enumerateTestFiles` in tests/webTestServer.ts
+ return this.enumerateFiles(this.basePath, /\.[cm]?[tj]sx?/i, { recursive: true });
+ }
+
+ public kind(): TestRunnerKind {
+ return this.testSuiteName;
+ }
+
+ public initializeTests(): void {
+ if (this.tests.length === 0) {
+ this.tests = IO.enumerateTestFiles(this);
+ }
+
+ describe(this.testSuiteName + " tests", () => {
+ this.tests.forEach(file => {
+ file = vpath.normalizeSeparators(file);
+ describe(file, () => {
+ const tests = TranspileTestCase.getConfigurations(file);
+ for (const test of tests) {
+ test.run();
+ }
+ });
+ });
+ });
+ }
+}
+
+enum TranspileKind {
+ Module,
+ Declaration,
+}
+
+class TranspileTestCase {
+ static varyBy = [];
+
+ static getConfigurations(file: string): TranspileTestCase[] {
+ const ext = vpath.extname(file);
+ const baseName = vpath.basename(file);
+ const justName = baseName.slice(0, baseName.length - ext.length);
+ const content = IO.readFile(file)!;
+ const settings = TestCaseParser.extractCompilerSettings(content);
+ const settingConfigurations = getFileBasedTestConfigurations(settings, TranspileTestCase.varyBy);
+ return settingConfigurations?.map(c => {
+ const desc = Object.entries(c).map(([key, value]) => `${key}=${value}`).join(",");
+ return new TranspileTestCase(`${justName}(${desc})`, ext, content, { ...settings, ...c });
+ }) ?? [new TranspileTestCase(justName, ext, content, settings)];
+ }
+
+ private jsOutName;
+ private dtsOutName;
+ private units;
+ constructor(
+ private justName: string,
+ ext: string,
+ content: string,
+ private settings: TestCaseParser.CompilerSettings,
+ ) {
+ this.jsOutName = justName + this.getJsOutputExtension(`${justName}${ext}`);
+ this.dtsOutName = justName + ts.getDeclarationEmitExtensionForPath(`${justName}${ext}`);
+ this.units = TestCaseParser.makeUnitsFromTest(content, `${justName}${ext}`, undefined, settings);
+ }
+
+ getJsOutputExtension(name: string): ts.Extension {
+ return ts.getOutputExtension(name, { jsx: this.settings.jsx === "preserve" ? ts.JsxEmit.Preserve : undefined });
+ }
+
+ runKind(kind: TranspileKind): void {
+ it(`transpile test ${this.justName} has expected ${kind === TranspileKind.Module ? "js" : "declaration"} output`, () => {
+ let baselineText = "";
+
+ // include inputs in output so how the test is parsed and broken down is more obvious
+ this.units.testUnitData.forEach(unit => {
+ baselineText += `//// [${unit.name}] ////\r\n`;
+ baselineText += unit.content;
+ if (!unit.content.endsWith("\n")) {
+ baselineText += "\r\n";
+ }
+ });
+
+ this.units.testUnitData.forEach(unit => {
+ const opts: ts.CompilerOptions = {};
+ Compiler.setCompilerOptionsFromHarnessSetting(this.settings, opts);
+ const result = (kind === TranspileKind.Module ? ts.transpileModule : ts.transpileDeclaration)(unit.content, { compilerOptions: opts, fileName: unit.name, reportDiagnostics: this.settings.reportDiagnostics === "true" });
+
+ baselineText += `//// [${ts.changeExtension(unit.name, kind === TranspileKind.Module ? this.getJsOutputExtension(unit.name) : ts.getDeclarationEmitExtensionForPath(unit.name))}] ////\r\n`;
+ baselineText += result.outputText;
+ if (!result.outputText.endsWith("\n")) {
+ baselineText += "\r\n";
+ }
+ if (result.diagnostics && result.diagnostics.length) {
+ baselineText += "\r\n\r\n//// [Diagnostics reported]\r\n";
+ baselineText += Compiler.getErrorBaseline([{ content: unit.content, unitName: unit.name }], result.diagnostics, !!opts.pretty);
+ if (!baselineText.endsWith("\n")) {
+ baselineText += "\r\n";
+ }
+ }
+ });
+
+ Baseline.runBaseline(`transpile/${kind === TranspileKind.Module ? this.jsOutName : this.dtsOutName}`, baselineText);
+ });
+ }
+
+ run(): void {
+ if (!this.settings.emitDeclarationOnly) {
+ this.runKind(TranspileKind.Module);
+ }
+ if (this.settings.declaration) {
+ this.runKind(TranspileKind.Declaration);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/testRunner/unittests/tsbuild/helpers.ts b/src/testRunner/unittests/tsbuild/helpers.ts
index 6637e9e6caf6f77141c93e710754f046b14d6984..1866e2fce3923b545238da45e28f6ae5eb3cff90 100644
--- a/src/testRunner/unittests/tsbuild/helpers.ts
+++ b/src/testRunner/unittests/tsbuild/helpers.ts
@@ -548,7 +548,7 @@ function getBuildInfoForIncrementalCorrectnessCheck(text: string | undefined): {
fileNamesList: undefined,
fileInfos: sanitizedFileInfos,
// Ignore noEmit since that shouldnt be reason to emit the tsbuild info and presence of it in the buildinfo file does not matter
- options: { ...readableBuildInfo.program.options, noEmit: undefined },
+ options: readableBuildInfo.program.options ? { ...readableBuildInfo.program.options, noEmit: undefined } : undefined,
exportedModulesMap: undefined,
affectedFilesPendingEmit: undefined,
latestChangedDtsFile: readableBuildInfo.program.latestChangedDtsFile ? "FakeFileName" : undefined,
diff --git a/src/testRunner/unittests/tsbuild/noCheck.ts b/src/testRunner/unittests/tsbuild/noCheck.ts
new file mode 100644
index 0000000000000000000000000000000000000000..832d6224a3cef139622339925f4618f01eac8b94
--- /dev/null
+++ b/src/testRunner/unittests/tsbuild/noCheck.ts
@@ -0,0 +1,77 @@
+namespace ts {
+ function verifyNoCheckFlag(variant: string): void {
+ function verifyNoCheckWorker(subScenario: string, declAText: string, commandLineArgs: readonly string[]): void {
+ verifyTscWithEdits({
+ scenario: variant,
+ subScenario,
+ fs: () =>
+ loadProjectFromFiles({
+ "/src/a.ts": getATsContent(declAText),
+ "/src/tsconfig.json": JSON.stringify({
+ compilerOptions: { noCheck: true, emitDeclarationOnly: true, declaration: true },
+ }),
+ }),
+ commandLineArgs,
+ edits: [
+ noChangeRun,
+ {
+ subScenario: "Fix `a` error",
+ modifyFs: fs => fs.writeFileSync("/src/a.ts", getATsContent(`const a = "hello"`)),
+ },
+ noChangeRun,
+ {
+ subScenario: "Disable noCheck",
+ modifyFs: fs =>
+ fs.writeFileSync(
+ "/src/tsconfig.json",
+ JSON.stringify({
+ compilerOptions: { emitDeclarationOnly: true, declaration: true },
+ }),
+ ),
+ },
+ noChangeRun,
+ ],
+ baselinePrograms: true,
+ });
+
+ function getATsContent(declAText: string): string {
+ return `const err: number = "error";
+ ${declAText}`;
+ }
+ }
+
+ function verifyNoCheck(subScenario: string, aTsContent: string): void {
+ verifyNoCheckWorker(subScenario, aTsContent, ["--b", "/src/tsconfig.json", "-v"]);
+ verifyNoCheckWorker(`${subScenario} with incremental`, aTsContent, ["--b", "/src/tsconfig.json", "-v", "--incremental"]);
+ }
+
+ verifyNoCheck("syntax errors", `const a = "hello`);
+ verifyNoCheck("semantic errors", `const a: number = "hello"`);
+ }
+
+ describe("unittests:: tsbuild:: noCheck", () => {
+ // Enable the `noCheck` option on the CLI for testing purposes, to ensure it works with incremental/build
+ let validate: CommandLineOption["extraValidation"];
+ before(() => {
+ for (const opt of optionDeclarations) {
+ if (opt.name === "noCheck") {
+ validate = opt.extraValidation;
+ opt.extraValidation = () => undefined;
+ }
+ }
+ });
+ after(() => {
+ for (const opt of optionDeclarations) {
+ if (opt.name === "noCheck") {
+ opt.extraValidation = validate;
+ }
+ }
+ });
+
+ verifyNoCheckFlag("noCheck");
+ });
+
+ describe("unittests:: tsbuild:: noCheck:: errors", () => {
+ verifyNoCheckFlag("noCheck-errors");
+ });
+}
\ No newline at end of file
diff --git a/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.types b/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.types
index 4c3c8e654ece0d06d321d2b6da089a75b9e59b68..ea42217a198c2406db2257dcdab184951ba013b1 100644
--- a/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.types
+++ b/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.types
@@ -2,50 +2,50 @@
Intl.NumberFormat.prototype.formatRange
>Intl.NumberFormat.prototype.formatRange : any
>Intl.NumberFormat.prototype : Intl.NumberFormat
->Intl.NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; }
+>Intl.NumberFormat : { (locales?: string | string[], options?: NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; }
>Intl : typeof Intl
->NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; }
+>NumberFormat : { (locales?: string | string[], options?: NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; }
>prototype : Intl.NumberFormat
>formatRange : any
Intl.DateTimeFormat.prototype.formatRange
->Intl.DateTimeFormat.prototype.formatRange : (startDate: number | bigint | Date, endDate: number | bigint | Date) => string
+>Intl.DateTimeFormat.prototype.formatRange : (startDate: Date | number | bigint, endDate: Date | number | bigint) => string
>Intl.DateTimeFormat.prototype : Intl.DateTimeFormat
->Intl.DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; }
+>Intl.DateTimeFormat : { (locales?: string | string[], options?: DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; }
>Intl : typeof Intl
->DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; }
+>DateTimeFormat : { (locales?: string | string[], options?: DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; }
>prototype : Intl.DateTimeFormat
->formatRange : (startDate: number | bigint | Date, endDate: number | bigint | Date) => string
+>formatRange : (startDate: Date | number | bigint, endDate: Date | number | bigint) => string
new Intl.NumberFormat().formatRange
>new Intl.NumberFormat().formatRange : any
>new Intl.NumberFormat() : Intl.NumberFormat
->Intl.NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; }
+>Intl.NumberFormat : { (locales?: string | string[], options?: NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; }
>Intl : typeof Intl
->NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; }
+>NumberFormat : { (locales?: string | string[], options?: NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; }
>formatRange : any
new Intl.NumberFormat().formatRangeToParts
>new Intl.NumberFormat().formatRangeToParts : any
>new Intl.NumberFormat() : Intl.NumberFormat
->Intl.NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; }
+>Intl.NumberFormat : { (locales?: string | string[], options?: NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; }
>Intl : typeof Intl
->NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; }
+>NumberFormat : { (locales?: string | string[], options?: NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; }
>formatRangeToParts : any
new Intl.DateTimeFormat().formatRange
->new Intl.DateTimeFormat().formatRange : (startDate: number | bigint | Date, endDate: number | bigint | Date) => string
+>new Intl.DateTimeFormat().formatRange : (startDate: Date | number | bigint, endDate: Date | number | bigint) => string
>new Intl.DateTimeFormat() : Intl.DateTimeFormat
->Intl.DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; }
+>Intl.DateTimeFormat : { (locales?: string | string[], options?: DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; }
>Intl : typeof Intl
->DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; }
->formatRange : (startDate: number | bigint | Date, endDate: number | bigint | Date) => string
+>DateTimeFormat : { (locales?: string | string[], options?: DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; }
+>formatRange : (startDate: Date | number | bigint, endDate: Date | number | bigint) => string
new Intl.DateTimeFormat().formatRangeToParts
->new Intl.DateTimeFormat().formatRangeToParts : (startDate: number | bigint | Date, endDate: number | bigint | Date) => Intl.DateTimeRangeFormatPart[]
+>new Intl.DateTimeFormat().formatRangeToParts : (startDate: Date | number | bigint, endDate: Date | number | bigint) => Intl.DateTimeRangeFormatPart[]
>new Intl.DateTimeFormat() : Intl.DateTimeFormat
->Intl.DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; }
+>Intl.DateTimeFormat : { (locales?: string | string[], options?: DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; }
>Intl : typeof Intl
->DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; }
->formatRangeToParts : (startDate: number | bigint | Date, endDate: number | bigint | Date) => Intl.DateTimeRangeFormatPart[]
+>DateTimeFormat : { (locales?: string | string[], options?: DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; }
+>formatRangeToParts : (startDate: Date | number | bigint, endDate: Date | number | bigint) => Intl.DateTimeRangeFormatPart[]
diff --git a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.types b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.types
index 80b2496f2d8494a6fb434507b906e984f84da614..e3286a644c59cedf2e2721f6a1f8b53543d08195 100644
--- a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.types
+++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.types
@@ -11,7 +11,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; }
diff --git a/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.types b/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.types
index 898039eb6cb2e830a920018daac0057d8a693218..a38a459f9e5b0c308ebba55c9d4ea8f4a3f771a2 100644
--- a/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.types
+++ b/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.types
@@ -33,7 +33,7 @@ module A {
=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts ===
var fn: () => { x: number; y: number };
->fn : () => { x: number; y: number;}
+>fn : () => { x: number; y: number; }
>x : number
>y : number
diff --git a/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.types b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.types
index c0c50ee3caa599c0f07251dedebecc19c3bb7f56..f070f422a52c65f7d3f44d509650682a4f483775 100644
--- a/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.types
+++ b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.types
@@ -33,7 +33,7 @@ module B {
=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts ===
var fn: () => { x: number; y: number };
->fn : () => { x: number; y: number;}
+>fn : () => { x: number; y: number; }
>x : number
>y : number
diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.types b/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.types
index 34afcbe4c174eb25e1009bc016c62eaf357d9485..f6edef1fb91670883e96e82f55322d7a9f73e03b 100644
--- a/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.types
+++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.types
@@ -82,7 +82,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
diff --git a/tests/baselines/reference/accessorsOverrideProperty8.types b/tests/baselines/reference/accessorsOverrideProperty8.types
index 1379593d280a425e22ee83f87ed802ffe4f6b46d..f45ee864d1573933df19dbb3f14d38cfa9c599e3 100644
--- a/tests/baselines/reference/accessorsOverrideProperty8.types
+++ b/tests/baselines/reference/accessorsOverrideProperty8.types
@@ -14,7 +14,7 @@ type AnyCtor = new (...a: any[]) => P
>a : any[]
declare function classWithProperties(properties: T, klass: AnyCtor): {
->classWithProperties : (properties: T, klass: AnyCtor) => { new (): P & Properties; prototype: P & Properties;}
+>classWithProperties : (properties: T, klass: AnyCtor) => { new (): P & Properties; prototype: P & Properties; }
>key : string
>properties : T
>klass : AnyCtor
diff --git a/tests/baselines/reference/aliasUsageInObjectLiteral.types b/tests/baselines/reference/aliasUsageInObjectLiteral.types
index 40d4de4b747f52d1c7dcd43ddc026438c0b7ebf9..d729e2b2536c3cf775a49848c31718e35bca7164 100644
--- a/tests/baselines/reference/aliasUsageInObjectLiteral.types
+++ b/tests/baselines/reference/aliasUsageInObjectLiteral.types
@@ -28,7 +28,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; }; }
diff --git a/tests/baselines/reference/ambientErrors.types b/tests/baselines/reference/ambientErrors.types
index 24aebd357acd4b496f8f032d035acb7a94541991..a1d33d29eeb7fb5bc3820d48fe37d6f3ce18b199 100644
--- a/tests/baselines/reference/ambientErrors.types
+++ b/tests/baselines/reference/ambientErrors.types
@@ -10,7 +10,7 @@ declare function fn(x: number): string;
>x : number
declare function fn(x: 'foo'): number;
->fn : { (x: number): string; (x: 'foo'): number; }
+>fn : { (x: number): string; (x: "foo"): number; }
>x : "foo"
// Ambient functions with duplicate signatures
diff --git a/tests/baselines/reference/anonterface.types b/tests/baselines/reference/anonterface.types
index a6c244b28859f6ea452d9dd5cca6ea1b4bddb2bf..11786e1efcd253ec7b20b9224634537b9bdb42ff 100644
--- a/tests/baselines/reference/anonterface.types
+++ b/tests/baselines/reference/anonterface.types
@@ -6,7 +6,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
@@ -28,9 +28,9 @@ var c=new M.C();
c.m(function(n) { return "hello: "+n; },18);
>c.m(function(n) { return "hello: "+n; },18) : string
->c.m : (fn: (n: number) => string, n2: number) => string
+>c.m : (fn: { (n: number): string; }, n2: number) => string
>c : M.C
->m : (fn: (n: number) => string, n2: number) => string
+>m : (fn: { (n: number): string; }, n2: number) => string
>function(n) { return "hello: "+n; } : (n: number) => string
>n : number
>"hello: "+n : string
diff --git a/tests/baselines/reference/anyAssignabilityInInheritance.types b/tests/baselines/reference/anyAssignabilityInInheritance.types
index 4f9e8fdc9c99eb5cbe501ccde67722f9bfb555c3..7afcf99fb2c036002e3f387a30fb822c389291c5 100644
--- a/tests/baselines/reference/anyAssignabilityInInheritance.types
+++ b/tests/baselines/reference/anyAssignabilityInInheritance.types
@@ -83,7 +83,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
diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts
index 1dc9d863215efad55afbc5e784fce151d3920e65..61937744f2bd21c756db6a01f13b8b9ad43eb7ee 100644
--- a/tests/baselines/reference/api/tsserverlibrary.d.ts
+++ b/tests/baselines/reference/api/tsserverlibrary.d.ts
@@ -5447,7 +5447,7 @@ declare namespace ts {
readonly expression: EntityNameExpression;
readonly name: Identifier;
}
- interface ElementAccessExpression extends MemberExpression {
+ interface ElementAccessExpression extends MemberExpression, Declaration {
readonly kind: SyntaxKind.ElementAccessExpression;
readonly expression: LeftHandSideExpression;
readonly questionDotToken?: QuestionDotToken;
@@ -6236,7 +6236,7 @@ declare namespace ts {
}
type FlowType = Type | IncompleteType;
interface IncompleteType {
- flags: TypeFlags;
+ flags: TypeFlags | 0;
type: Type;
}
interface AmdDependency {
@@ -6253,6 +6253,7 @@ declare namespace ts {
interface SourceFileLike {
getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
}
+ type ResolutionMode = ModuleKind.ESNext | ModuleKind.CommonJS | undefined;
interface SourceFile extends Declaration {
readonly kind: SyntaxKind.SourceFile;
readonly statements: NodeArray;
@@ -6644,6 +6645,7 @@ declare namespace ts {
getConstEnumRelate?(): ESMap>;
clearConstEnumRelate?(): void;
deleteConstEnumRelate?(path: string): void;
+ isStaticRecord?(type: Type): boolean;
getTypeArgumentsForResolvedSignature(signature: Signature): readonly Type[] | undefined;
getCheckedSourceFiles(): Set;
collectHaveTsNoCheckFilesForLinter(sourceFile: SourceFile): void;
@@ -6920,6 +6922,7 @@ declare namespace ts {
StringMapping = 268435456,
Literal = 2944,
Unit = 109440,
+ Freshable = 2976,
StringOrNumberLiteral = 384,
PossiblyFalsy = 117724,
StringLike = 402653316,
@@ -6971,10 +6974,12 @@ declare namespace ts {
isClass(): this is InterfaceType;
isIndexType(): this is IndexType;
}
- interface LiteralType extends Type {
+ interface FreshableType extends Type {
+ freshType: FreshableType;
+ regularType: FreshableType;
+ }
+ interface LiteralType extends FreshableType {
value: string | number | PseudoBigInt;
- freshType: LiteralType;
- regularType: LiteralType;
}
interface UniqueESSymbolType extends Type {
symbol: Symbol;
@@ -6989,7 +6994,7 @@ declare namespace ts {
interface BigIntLiteralType extends LiteralType {
value: PseudoBigInt;
}
- interface EnumType extends Type {
+ interface EnumType extends FreshableType {
}
enum ObjectFlags {
Class = 1,
@@ -7311,6 +7316,7 @@ declare namespace ts {
inlineSourceMap?: boolean;
inlineSources?: boolean;
isolatedModules?: boolean;
+ isolatedDeclarations?: boolean;
jsx?: JsxEmit;
keyofStringsOnly?: boolean;
lib?: string[];
@@ -7323,6 +7329,7 @@ declare namespace ts {
moduleDetection?: ModuleDetectionKind;
newLine?: NewLineKind;
noEmit?: boolean;
+ noCheck?: boolean;
noEmitHelpers?: boolean;
noEmitOnError?: boolean;
noErrorTruncation?: boolean;
@@ -7727,6 +7734,7 @@ declare namespace ts {
getJsDocNodeConditionCheckedResult?(jsDocFileCheckedInfo: FileCheckModuleInfo, jsDocTagInfos: JsDocTagInfo[], jsDocs?: JSDoc[]): ConditionCheckResult;
getFileCheckedModuleInfo?(containFilePath: string): FileCheckModuleInfo;
getLastCompiledProgram?(): Program;
+ isStaticSourceFile?(filePath: string): boolean;
}
interface SourceMapRange extends TextRange {
source?: SourceMapSource;
@@ -8748,6 +8756,7 @@ declare namespace ts {
readonly redirectTargetsMap: RedirectTargetsMap;
getProjectReferenceRedirect(fileName: string): string | undefined;
isSourceOfProjectReferenceRedirect(fileName: string): boolean;
+ getCommonSourceDirectory(): string;
}
interface ModulePath {
path: string;
@@ -8786,6 +8795,7 @@ declare namespace ts {
reportNonlocalAugmentation?(containingFile: SourceFile, parentSymbol: Symbol, augmentingSymbol: Symbol): void;
reportNonSerializableProperty?(propertyName: string): void;
reportImportTypeNodeResolutionModeOverride?(): void;
+ reportInferenceFallback?(node: Node): void;
}
interface TextSpan {
start: number;
@@ -9650,6 +9660,7 @@ declare namespace ts {
function parseJsonText(fileName: string, sourceText: string): JsonSourceFile;
function isExternalModule(file: SourceFile): boolean;
function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean, option?: CompilerOptions): SourceFile;
+ function getLanguageVersionByFilePath(getLanguageVersion: ((filePath: string) => boolean) | undefined): void;
interface CreateSourceFileOptions {
languageVersion: ScriptTarget;
/**
@@ -9964,7 +9975,7 @@ declare namespace ts {
* @param visitor The callback used to visit each child.
* @param context A lexical environment context for the visitor.
*/
- function visitEachChild(node: T, visitor: Visitor, context: TransformationContext): T;
+ function visitEachChild(node: T, visitor: Visitor, context: TransformationContext | undefined): T;
/**
* Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place.
*
@@ -9972,7 +9983,7 @@ declare namespace ts {
* @param visitor The callback used to visit each child.
* @param context A lexical environment context for the visitor.
*/
- function visitEachChild(node: T | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor?: typeof visitNodes, tokenVisitor?: Visitor): T | undefined;
+ function visitEachChild(node: T | undefined, visitor: Visitor, context: TransformationContext | undefined, nodesVisitor?: typeof visitNodes, tokenVisitor?: Visitor): T | undefined;
function createSourceMapGenerator(host: EmitHost, file: string, sourceRoot: string, sourcesDirectoryPath: string, generatorOptions: SourceMapGeneratorOptions): SourceMapGenerator;
interface SourceMapGeneratorOptions {
extendedDiagnostics?: boolean;
@@ -10535,6 +10546,7 @@ declare namespace ts {
shouldCompletionSortCustom?: boolean;
uiProps?: Set;
clearProps?(): void;
+ isStaticSourceFile?(fileName: string): boolean;
clearFileCache?(): void;
}
type WithMetadata = T & {
@@ -11675,6 +11687,7 @@ declare namespace ts {
};
function preProcessFile(sourceText: string, readImportFiles?: boolean, detectJavaScriptImports?: boolean): PreProcessedFileInfo;
function transpileModule(input: string, transpileOptions: TranspileOptions): TranspileOutput;
+ function transpileDeclaration(input: string, transpileOptions: TranspileOptions): TranspileOutput;
function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[], moduleName?: string): string;
interface TranspileOptions {
compilerOptions?: CompilerOptions;
@@ -12777,7 +12790,7 @@ declare namespace ts {
staticBlocks: Set;
libraryTypeCallDiagnosticChecker: LibraryTypeCallDiagnosticChecker;
skipArkTSStaticBlocksCheck: boolean;
- constructor(sourceFile: SourceFile, tsProgram: Program, tscStrictDiagnostics?: ts.Map | undefined);
+ constructor(sourceFile: SourceFile, tsProgram: Program, tscStrictDiagnostics?: Map | undefined);
static clearTsTypeChecker(): void;
static clearQualifiedNameCache(): void;
readonly handlersMap: ts.ESMap void>;
@@ -13390,7 +13403,7 @@ declare namespace ts {
private fileExportDeclCaches?;
private compatibleSdkVersionStage;
private compatibleSdkVersion;
- constructor(sourceFile: SourceFile, tsProgram: Program, tscStrictDiagnostics?: ts.Map | undefined);
+ constructor(sourceFile: SourceFile, tsProgram: Program, tscStrictDiagnostics?: Map | undefined);
static clearTsTypeChecker(): void;
static clearQualifiedNameCache(): void;
readonly handlersMap: ts.ESMap;
@@ -2641,6 +2642,7 @@ declare namespace ts {
getConstEnumRelate?(): ESMap>;
clearConstEnumRelate?(): void;
deleteConstEnumRelate?(path: string): void;
+ isStaticRecord?(type: Type): boolean;
getTypeArgumentsForResolvedSignature(signature: Signature): readonly Type[] | undefined;
getCheckedSourceFiles(): Set;
collectHaveTsNoCheckFilesForLinter(sourceFile: SourceFile): void;
@@ -2917,6 +2919,7 @@ declare namespace ts {
StringMapping = 268435456,
Literal = 2944,
Unit = 109440,
+ Freshable = 2976,
StringOrNumberLiteral = 384,
PossiblyFalsy = 117724,
StringLike = 402653316,
@@ -2968,10 +2971,12 @@ declare namespace ts {
isClass(): this is InterfaceType;
isIndexType(): this is IndexType;
}
- interface LiteralType extends Type {
+ interface FreshableType extends Type {
+ freshType: FreshableType;
+ regularType: FreshableType;
+ }
+ interface LiteralType extends FreshableType {
value: string | number | PseudoBigInt;
- freshType: LiteralType;
- regularType: LiteralType;
}
interface UniqueESSymbolType extends Type {
symbol: Symbol;
@@ -2986,7 +2991,7 @@ declare namespace ts {
interface BigIntLiteralType extends LiteralType {
value: PseudoBigInt;
}
- interface EnumType extends Type {
+ interface EnumType extends FreshableType {
}
enum ObjectFlags {
Class = 1,
@@ -3308,6 +3313,7 @@ declare namespace ts {
inlineSourceMap?: boolean;
inlineSources?: boolean;
isolatedModules?: boolean;
+ isolatedDeclarations?: boolean;
jsx?: JsxEmit;
keyofStringsOnly?: boolean;
lib?: string[];
@@ -3320,6 +3326,7 @@ declare namespace ts {
moduleDetection?: ModuleDetectionKind;
newLine?: NewLineKind;
noEmit?: boolean;
+ noCheck?: boolean;
noEmitHelpers?: boolean;
noEmitOnError?: boolean;
noErrorTruncation?: boolean;
@@ -3724,6 +3731,7 @@ declare namespace ts {
getJsDocNodeConditionCheckedResult?(jsDocFileCheckedInfo: FileCheckModuleInfo, jsDocTagInfos: JsDocTagInfo[], jsDocs?: JSDoc[]): ConditionCheckResult;
getFileCheckedModuleInfo?(containFilePath: string): FileCheckModuleInfo;
getLastCompiledProgram?(): Program;
+ isStaticSourceFile?(filePath: string): boolean;
}
interface SourceMapRange extends TextRange {
source?: SourceMapSource;
@@ -4745,6 +4753,7 @@ declare namespace ts {
readonly redirectTargetsMap: RedirectTargetsMap;
getProjectReferenceRedirect(fileName: string): string | undefined;
isSourceOfProjectReferenceRedirect(fileName: string): boolean;
+ getCommonSourceDirectory(): string;
}
interface ModulePath {
path: string;
@@ -4783,6 +4792,7 @@ declare namespace ts {
reportNonlocalAugmentation?(containingFile: SourceFile, parentSymbol: Symbol, augmentingSymbol: Symbol): void;
reportNonSerializableProperty?(propertyName: string): void;
reportImportTypeNodeResolutionModeOverride?(): void;
+ reportInferenceFallback?(node: Node): void;
}
interface TextSpan {
start: number;
@@ -5647,6 +5657,7 @@ declare namespace ts {
function parseJsonText(fileName: string, sourceText: string): JsonSourceFile;
function isExternalModule(file: SourceFile): boolean;
function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean, option?: CompilerOptions): SourceFile;
+ function getLanguageVersionByFilePath(getLanguageVersion: ((filePath: string) => boolean) | undefined): void;
interface CreateSourceFileOptions {
languageVersion: ScriptTarget;
/**
@@ -5961,7 +5972,7 @@ declare namespace ts {
* @param visitor The callback used to visit each child.
* @param context A lexical environment context for the visitor.
*/
- function visitEachChild(node: T, visitor: Visitor, context: TransformationContext): T;
+ function visitEachChild(node: T, visitor: Visitor, context: TransformationContext | undefined): T;
/**
* Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place.
*
@@ -5969,7 +5980,7 @@ declare namespace ts {
* @param visitor The callback used to visit each child.
* @param context A lexical environment context for the visitor.
*/
- function visitEachChild(node: T | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor?: typeof visitNodes, tokenVisitor?: Visitor): T | undefined;
+ function visitEachChild(node: T | undefined, visitor: Visitor, context: TransformationContext | undefined, nodesVisitor?: typeof visitNodes, tokenVisitor?: Visitor): T | undefined;
function createSourceMapGenerator(host: EmitHost, file: string, sourceRoot: string, sourcesDirectoryPath: string, generatorOptions: SourceMapGeneratorOptions): SourceMapGenerator;
interface SourceMapGeneratorOptions {
extendedDiagnostics?: boolean;
@@ -6605,6 +6616,7 @@ declare namespace ts {
shouldCompletionSortCustom?: boolean;
uiProps?: Set;
clearProps?(): void;
+ isStaticSourceFile?(fileName: string): boolean;
clearFileCache?(): void;
}
type WithMetadata = T & {
@@ -7745,6 +7757,7 @@ declare namespace ts {
};
function preProcessFile(sourceText: string, readImportFiles?: boolean, detectJavaScriptImports?: boolean): PreProcessedFileInfo;
function transpileModule(input: string, transpileOptions: TranspileOptions): TranspileOutput;
+ function transpileDeclaration(input: string, transpileOptions: TranspileOptions): TranspileOutput;
function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[], moduleName?: string): string;
interface TranspileOptions {
compilerOptions?: CompilerOptions;
@@ -8847,7 +8860,7 @@ declare namespace ts {
staticBlocks: Set;
libraryTypeCallDiagnosticChecker: LibraryTypeCallDiagnosticChecker;
skipArkTSStaticBlocksCheck: boolean;
- constructor(sourceFile: SourceFile, tsProgram: Program, tscStrictDiagnostics?: ts.Map | undefined);
+ constructor(sourceFile: SourceFile, tsProgram: Program, tscStrictDiagnostics?: Map | undefined);
static clearTsTypeChecker(): void;
static clearQualifiedNameCache(): void;
readonly handlersMap: ts.ESMap void>;
@@ -9460,7 +9473,7 @@ declare namespace ts {
private fileExportDeclCaches?;
private compatibleSdkVersionStage;
private compatibleSdkVersion;
- constructor(sourceFile: SourceFile, tsProgram: Program, tscStrictDiagnostics?: ts.Map | undefined);
+ constructor(sourceFile: SourceFile, tsProgram: Program, tscStrictDiagnostics?: Map | undefined);
static clearTsTypeChecker(): void;
static clearQualifiedNameCache(): void;
readonly handlersMap: ts.ESMap3 : 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
diff --git a/tests/baselines/reference/arrayFakeFlatNoCrashInferenceDeclarations.types b/tests/baselines/reference/arrayFakeFlatNoCrashInferenceDeclarations.types
index 692e007dd92bac799143c95cdec900db04262d45..411b8984efa1b9fe6bd429ceeccd5fe42974eff1 100644
--- a/tests/baselines/reference/arrayFakeFlatNoCrashInferenceDeclarations.types
+++ b/tests/baselines/reference/arrayFakeFlatNoCrashInferenceDeclarations.types
@@ -1,7 +1,7 @@
=== tests/cases/compiler/arrayFakeFlatNoCrashInferenceDeclarations.ts ===
type BadFlatArray = {obj: {
->BadFlatArray : { done: Arr; recur: Arr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? any[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]]]]]]]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]]]]]]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]]]]]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]]]]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]]]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth] extends -1 ? "done" : "recur"] : Arr; }[Depth extends -1 ? "done" : "recur"]
->obj : { done: Arr; recur: Arr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? any[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]]]]]]]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]]]]]]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]]]]]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]]]]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]]]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth] extends -1 ? "done" : "recur"] : Arr; }[Depth extends -1 ? "done" : "recur"]
+>BadFlatArray : { done: Arr; recur: Arr extends ReadonlyArray ? BadFlatArray : Arr; }[Depth extends -1 ? "done" : "recur"]
+>obj : { done: Arr; recur: Arr extends ReadonlyArray ? BadFlatArray : Arr; }[Depth extends -1 ? "done" : "recur"]
"done": Arr,
>"done" : Arr
@@ -36,7 +36,7 @@ function foo(arr: T[], depth: number) {
return flat(arr, depth);
>flat(arr, depth) : (T | (T extends readonly (infer InnerArr)[] ? InnerArr | (InnerArr extends readonly (infer InnerArr)[] ? any : InnerArr) : T))[]
->flat : (arr: A, depth?: D | undefined) => { done: A; recur: A extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? any[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][D]]]]]]]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][D]]]]]]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][D]]]]]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][D]]]]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][D]]]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][D]]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][D]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][D]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][D]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][D]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][D] extends -1 ? "done" : "recur"] : A; }[D extends -1 ? "done" : "recur"][]
+>flat : (arr: A, depth?: D) => { done: A; recur: A extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? { done: InnerArr; recur: InnerArr extends readonly (infer InnerArr)[] ? any[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][D]]]]]]]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][D]]]]]]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][D]]]]]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][D]]]]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][D]]]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][D]]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][D]]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][D]]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][D]]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][D]] extends -1 ? "done" : "recur"] : InnerArr; }[[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][D] extends -1 ? "done" : "recur"] : A; }[D extends -1 ? "done" : "recur"][]
>arr : T[]
>depth : number
}
diff --git a/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types
index a7553fd5cd5f035214df849f1b12a85532cfe3e4..25c1878cd5a039867f6af290c4c424c14b9cf0b8 100644
--- a/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types
+++ b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types
@@ -56,28 +56,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
diff --git a/tests/baselines/reference/arraySigChecking.types b/tests/baselines/reference/arraySigChecking.types
index bbde4920731a68d8d8ddb6aa11297fafddf9fcbf..bfd8b878bca67d322c9503b39cde237b71272c1c 100644
--- a/tests/baselines/reference/arraySigChecking.types
+++ b/tests/baselines/reference/arraySigChecking.types
@@ -50,7 +50,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
diff --git a/tests/baselines/reference/assertionTypePredicates1.types b/tests/baselines/reference/assertionTypePredicates1.types
index c8f4c2e063ae4e5354e0896ecf878f1bbaebefe6..da7a18b3a22e10f33e72efe0253a7c749bae110e 100644
--- a/tests/baselines/reference/assertionTypePredicates1.types
+++ b/tests/baselines/reference/assertionTypePredicates1.types
@@ -83,9 +83,9 @@ function f01(x: unknown) {
>"number" : "number"
x.toLocaleString;
->x.toLocaleString : ((locales?: string | string[] | undefined, options?: Intl.NumberFormatOptions | undefined) => string) | (() => string)
+>x.toLocaleString : ((locales?: string | string[], options?: Intl.NumberFormatOptions) => string) | (() => string)
>x : number | boolean
->toLocaleString : ((locales?: string | string[] | undefined, options?: Intl.NumberFormatOptions | undefined) => string) | (() => string)
+>toLocaleString : ((locales?: string | string[], options?: Intl.NumberFormatOptions) => string) | (() => string)
}
if (!!true) {
>!!true : true
@@ -290,9 +290,9 @@ function f10(x: string | undefined) {
Debug.assert(x);
>Debug.assert(x) : void
->Debug.assert : (value: unknown, message?: string | undefined) => asserts value
+>Debug.assert : (value: unknown, message?: string) => asserts value
>Debug : typeof Debug
->assert : (value: unknown, message?: string | undefined) => asserts value
+>assert : (value: unknown, message?: string) => asserts value
>x : string | undefined
x.length;
@@ -307,9 +307,9 @@ function f10(x: string | undefined) {
Debug.assert(x !== undefined);
>Debug.assert(x !== undefined) : void
->Debug.assert : (value: unknown, message?: string | undefined) => asserts value
+>Debug.assert : (value: unknown, message?: string) => asserts value
>Debug : typeof Debug
->assert : (value: unknown, message?: string | undefined) => asserts value
+>assert : (value: unknown, message?: string) => asserts value
>x !== undefined : boolean
>x : string | undefined
>undefined : undefined
@@ -343,9 +343,9 @@ function f10(x: string | undefined) {
Debug.assert(false);
>Debug.assert(false) : void
->Debug.assert : (value: unknown, message?: string | undefined) => asserts value
+>Debug.assert : (value: unknown, message?: string) => asserts value
>Debug : typeof Debug
->assert : (value: unknown, message?: string | undefined) => asserts value
+>assert : (value: unknown, message?: string) => asserts value
>false : false
x; // Unreachable
diff --git a/tests/baselines/reference/assigningFromObjectToAnythingElse.types b/tests/baselines/reference/assigningFromObjectToAnythingElse.types
index 65e7012ffc34e32ec5814c1a6287f6a7dc681dc5..a2eea63e608751a8b18851dc63ffc03cc282dd36 100644
--- a/tests/baselines/reference/assigningFromObjectToAnythingElse.types
+++ b/tests/baselines/reference/assigningFromObjectToAnythingElse.types
@@ -13,17 +13,17 @@ y = x;
var a: String = Object.create