Closed
Description
Bug Report
π Search Terms
type union collapses
π Version & Regression Information
- I've tried from
3.3.3
to5.2.0-beta
and the result are the same.
β― Playground Link
π» Code
const a = (Math.random() > 0.5)
? Object.freeze({ok: false, hello: 'world'})
: Object.freeze({ok: false});
π Actual behavior
type A = typeof a;
// ^? shows type A = {readonly ok: false}
π Expected behavior
type A = typeof a;
// ^? shows type A = Readonly<{ok: false}> | Readonly<{ok: false, hello: 'world'}>
Metadata
Metadata
Assignees
Labels
No labels