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

Loose inferred return type of generator function #114

Open
purepear opened this issue Feb 16, 2023 · 0 comments
Open

Loose inferred return type of generator function #114

purepear opened this issue Feb 16, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@purepear
Copy link

Description

The inferred type of the generator allows for extra properties(variant 1).
In the case of class extension it also requires narrowing the literal types(variant 3).
It seems to work well when the return type is set explicitly(variant 2, variant 4).

Looking at the source code(the generic types), I would expect the generator return type to be inferred properly 🤔

I'm not sure if this is a bug or a feature 😄

image

To Reproduce

https://stackblitz.com/edit/fishery-test?file=Post.ts

Additional context
Fishery version: 2.2.2

@purepear purepear added the bug Something isn't working label Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant