Skip to content

Add explicit this annotation syntax for function types - #7807

Closed
goodmind wants to merge 8 commits into
facebook:masterfrom
goodmind:fn-this-annotation
Closed

goodmind wants to merge 8 commits into
facebook:masterfrom
goodmind:fn-this-annotation

Conversation

@goodmind

@goodmind goodmind commented Jun 8, 2019 •

Copy link
Copy Markdown
Contributor

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

@nmote

nmote commented Jun 10, 2019

Copy link
Copy Markdown
Contributor

CC @gabelevi

@goodmind
goodmind requested a review from gabelevi June 14, 2019 19:46
@goodmind

Copy link
Copy Markdown
Contributor Author

/cc @gabelevi

@goodmind

goodmind commented Jul 14, 2019 •

Copy link
Copy Markdown
Contributor Author

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

@goodmind

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

@Mouvedia

Copy link
Copy Markdown
Contributor

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

@gkz

gkz commented Jun 11, 2021

Copy link
Copy Markdown
Member

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