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

Make Function alias to { [[call]]: any } #8020

Closed
goodmind opened this issue Aug 14, 2019 · 3 comments
Closed

Make Function alias to { [[call]]: any } #8020

goodmind opened this issue Aug 14, 2019 · 3 comments

Comments

@goodmind
Copy link
Contributor

Proposal

Make Function alias to { [[call]]: any } instead of any

Use case

It would error if you provide non-callable things and also seems more safe, instead of outright any

@kevinbarabash
Copy link

Is { [[call]]: any } equivalent to { (...args: any[]): any }?

I didn't know about [[call]], are there any docs for it? I can't seem to find docs for callable types either.

@goodmind
Copy link
Contributor Author

There's PR for call property #7790 docs, not sure about equivalency

@SamChou19815
Copy link
Contributor

We now updated the docs to recommend other safer patterns: https://flow.org/en/docs/types/functions/#any-function

@SamChou19815 SamChou19815 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants