Revert "Make 'Omit' a distributive conditional type to support union prop types. Fixes #39300. (#39323)" (#40095)

This reverts commit f71b4a0526.
This commit is contained in:
Clay Miller
2019-11-05 13:28:39 -08:00
committed by Nathan Shively-Sanders
parent 1d5494e2a9
commit 47a8bdda3e
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -346,7 +346,7 @@ export type ThemedCssFunction<T extends object> = BaseThemedCssFunction<
>;
// Helper type operators
type Omit<T, K extends keyof T> = T extends any ? Pick<T, Exclude<keyof T, K>> : never;
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
type WithOptionalTheme<P extends { theme?: T }, T> = Omit<P, "theme"> & {
theme?: T;
};
+2 -1
View File
@@ -1052,7 +1052,8 @@ function unionTest() {
font-size: ${props => props.kind === 'book' ? 16 : 14}
`;
<StyledReadable kind="book" author="Hejlsberg" />;
// undesired, fix was reverted because of https://github.com/Microsoft/TypeScript/issues/30663
<StyledReadable kind="book" author="Hejlsberg" />; // $ExpectError
<StyledReadable kind="magazine" author="Hejlsberg" />; // $ExpectError
}