Reuse type nodes from optional parameters even when not written as a union with undefined (#48605)

* Reuse type nodes from optional parameters and properties even when not written as a union with `undefined`

* Remove newly unneeded NodeBuilderFlag

* Update public API

* Update baselines from main
This commit is contained in:
Andrew Branch
2022-04-08 14:28:36 -07:00
committed by GitHub
parent 12c4ea8542
commit af3e1d4dfd
51 changed files with 246 additions and 113 deletions

View File

@@ -0,0 +1,22 @@
// @module: esnext
// @outDir: dist
// @declaration: true
// @emitDeclarationOnly: true
// @strictNullChecks: true
// @Filename: a.ts
export interface Foo {}
// @Filename: b.ts
import * as a from "./a";
declare global {
namespace teams {
export namespace calling {
export import Foo = a.Foo;
}
}
}
// @Filename: c.ts
type Foo = teams.calling.Foo;
export const bar = (p?: Foo) => {}