Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omit<Foo, 'foo'> does more than omitting the 'foo' property #53994

Closed
fabiospampinato opened this issue Apr 24, 2023 · 2 comments
Closed

Omit<Foo, 'foo'> does more than omitting the 'foo' property #53994

fabiospampinato opened this issue Apr 24, 2023 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@fabiospampinato
Copy link

Bug Report

Omit seems to not work as I'd expect it to, if I do an Omit<Foo, 'foo'> the result is not just that the 'foo' property is omitted from the Foo type.

🔎 Search Terms

  • omit in:title

🕗 Version & Regression Information

Reproduces in v5.0.4, not sure about the rest.

⏯ Playground Link

Playground link with relevant code

💻 Code

type Callback = () => void;

type Debounced = Callback & { cancel: Callback, flush: Callback };

type DebouncedNoFlush = Omit<Debounced, 'flush'>;

🙁 Actual behavior

DebouncedNoFlush is no longer a function for some reason.

🙂 Expected behavior

DebouncedNoFlush should still be a function.

@RyanCavanaugh
Copy link
Member

See discussion in #53169

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Apr 24, 2023
@fabiospampinato
Copy link
Author

Nice, I didn't search for "homomorphic" unfortunately 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants