Skip to content

Fix inferring return type of var function #545

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

Merged
merged 1 commit into from
Oct 10, 2016

Conversation

arv
Copy link
Contributor

@arv arv commented Sep 13, 2016

I accidentally broke the detection of the return type in:

var f = function(x: number): boolean {}

@arv arv assigned tmcw Sep 13, 2016

// In case of `/** */ var x = function () {}` findTarget returns
// the declarator.
if (t.isVariableDeclarator(fn)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like my change to findTarget might have been bad. However, my other PR makes findTarget return a Path and then it would work to have it return the init again (because paths allows getting the parent).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, but do you want to update the top-level comment: Infers returns tags by using Flow return type annotations I'm not sure if this comment still applies int he same way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It still applies. The purpose of this function is to look at the ast node of the comment and infer the return tag based on the Flow return type annotation.

@arv arv force-pushed the fix-infer-var-returns branch from 1d84900 to 2bd59fc Compare October 9, 2016 20:53
@arv arv changed the title Fix issue with var function return Fix issue with inferring return type of var function Oct 9, 2016
I accidentally broke the detection of the return type in:

```js
var f = function(x: number): boolean {}
```
@arv arv changed the title Fix issue with inferring return type of var function Fix inferring return type of var function Oct 9, 2016
@arv arv force-pushed the fix-infer-var-returns branch from 2bd59fc to 36610b0 Compare October 9, 2016 20:59
@tmcw
Copy link
Member

tmcw commented Oct 10, 2016

👍 awesome, merging. Trying to pull together a release since there's so much new good work in master right now.

@tmcw tmcw merged commit 384ccbc into documentationjs:master Oct 10, 2016
@arv arv deleted the fix-infer-var-returns branch October 10, 2016 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy