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

Incomplete forward typings #174

Closed
abliarsar opened this issue Aug 12, 2019 · 10 comments
Closed

Incomplete forward typings #174

abliarsar opened this issue Aug 12, 2019 · 10 comments
Labels
typings Typescript public type definitions issues

Comments

@abliarsar
Copy link
Contributor

abliarsar commented Aug 12, 2019

Flow example: link
TS example: link

@abliarsar abliarsar added the typings Typescript public type definitions issues label Aug 12, 2019
@zerobias
Copy link
Member

this is probably related with subtyping not sure what we might do there

@goodmind any ideas?

@goodmind
Copy link
Contributor

flow

No idea about TS

@abliarsar
Copy link
Contributor Author

possible ts solution

@zerobias
Copy link
Member

we can allow flow to assert type relations explicitly repl

Note that forward({ from: str, to: strOrNum }) now works without explicit generics

@zerobias
Copy link
Member

@abliarsar looks like we suggest similar solutions 🙃

@zerobias
Copy link
Member

Looks like my solution for flow don't work in practice

Could not decide which case to select bla bla bla
Perfect, flow prevent us from improve type inference again

@zerobias
Copy link
Member

@goodmind solution for flow works as expected

@zerobias
Copy link
Member

Not sure if I realize what changed in typescript errors
8f587a8#diff-c89e1c48f65366897054a19c423ee51cL1411
Did I miss something?

@abliarsar
Copy link
Contributor Author

I think, we cannot use only one generic argument in typescript, that is the reason why.
Signature with one type works incorrectly with unknown type

@abliarsar
Copy link
Contributor Author

Fixed in #229

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typings Typescript public type definitions issues
Projects
None yet
Development

No branches or pull requests

3 participants