You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The handbook recomments using overloads rather than a union when only the argument type changes. But this does not produce the same behavior regarding catching extra object literal properties.
🔎 Search Terms
overload, argument, union
🕗 Version & Regression Information
This is the behavior in every version I tried, and I reviewed the FAQ for entries about type system
Bug Report
The handbook recomments using overloads rather than a union when only the argument type changes. But this does not produce the same behavior regarding catching extra object literal properties.
🔎 Search Terms
overload, argument, union
🕗 Version & Regression Information
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
SassColorOverload reports an invalid object literal, but SassColorUnion does not.
🙂 Expected behavior
Same behavior regarding catching extra properties in object literals when using the union type, especially given that this is the recommended implementation in https://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html#use-union-types
The text was updated successfully, but these errors were encountered: