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

Comments

@abliarsar
Copy link
Contributor

@abliarsar abliarsar commented Aug 12, 2019

Flow example: link
TS example: link

@abliarsar abliarsar added the typings label Aug 12, 2019
@zerobias

This comment has been minimized.

Copy link
Owner

@zerobias zerobias commented Aug 13, 2019

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

@goodmind any ideas?

@goodmind

This comment has been minimized.

Copy link
Contributor

@goodmind goodmind commented Aug 13, 2019

flow

No idea about TS

@abliarsar

This comment has been minimized.

Copy link
Contributor Author

@abliarsar abliarsar commented Aug 13, 2019

@zerobias

This comment has been minimized.

Copy link
Owner

@zerobias zerobias commented Aug 14, 2019

we can allow flow to assert type relations explicitly repl

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

@zerobias

This comment has been minimized.

Copy link
Owner

@zerobias zerobias commented Aug 14, 2019

@abliarsar looks like we suggest similar solutions 🙃

@zerobias

This comment has been minimized.

Copy link
Owner

@zerobias zerobias commented Aug 14, 2019

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

This comment has been minimized.

Copy link
Owner

@zerobias zerobias commented Aug 14, 2019

@goodmind solution for flow works as expected

zerobias added a commit that referenced this issue Aug 14, 2019
@zerobias

This comment has been minimized.

Copy link
Owner

@zerobias zerobias commented Aug 14, 2019

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

@abliarsar

This comment has been minimized.

Copy link
Contributor Author

@abliarsar abliarsar commented Aug 14, 2019

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

This comment has been minimized.

Copy link
Contributor Author

@abliarsar abliarsar commented Oct 19, 2019

Fixed in #229

@abliarsar abliarsar closed this Oct 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.