Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardTypeScriptexcess property checksSingle-choice MCQ

For a union-typed parameter, when does the fresh-literal excess-property check flag a property?

type A = { kind: "a"; foo: number }; type B = { kind: "b"; bar: number }; function g(x: A | B) {} g({ kind: "a", foo: 1, bar: 2 });