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

Add explicit this annotation syntax for function types #7807

Closed
wants to merge 8 commits into from

Conversation

goodmind
Copy link
Contributor

@goodmind goodmind commented Jun 8, 2019

Fixes #452
This implements it only for types and declares, doesn't work on statements and expressions

@nmote
Copy link
Contributor

nmote commented Jun 10, 2019

CC @gabelevi

@goodmind goodmind requested a review from gabelevi June 14, 2019 19:46
@goodmind
Copy link
Contributor Author

/cc @gabelevi

@goodmind
Copy link
Contributor Author

goodmind commented Jul 14, 2019

I believe we had conversation with @mroch that it still isn't decided what syntax should be

@goodmind
Copy link
Contributor Author

I'm probably fine with function foo<this = T>() {} syntax for actual declaration, but not for function types and declare. I think it's impossible to take generic into consideration when doing overloading, is it?
Also this intuitively behaves more like implicit function parameter, rather than generic

@goodmind
Copy link
Contributor Author

@gabelevi can I close this if you're working on this annotations already?

@Mouvedia
Copy link
Contributor

@gkz can you at least put a reason for the closure?

@gkz
Copy link
Member

gkz commented Jun 11, 2021

Sorry, this has been implemented: https://medium.com/flow-type/sound-typing-for-this-in-flow-d62db2af969e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Annotation of this in function declarations
5 participants