mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
16 lines
287 B
TypeScript
16 lines
287 B
TypeScript
// @strict: true
|
|
// @noEmit: true
|
|
|
|
// @filename: types.d.ts
|
|
type U =
|
|
| { kind: "a"; payload: number }
|
|
| { kind: "b"; payload: string };
|
|
|
|
declare function make(): U;
|
|
|
|
// @filename: a.ts
|
|
const { kind, payload }: U = make();
|
|
|
|
// @filename: b.ts
|
|
if (kind === "a") payload.toFixed();
|