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

in untyped mode, emit no types near arrow functions #63

Merged
merged 1 commit into from
Feb 17, 2016
Merged

in untyped mode, emit no types near arrow functions #63

merged 1 commit into from
Feb 17, 2016

Conversation

evmar
Copy link
Contributor

@evmar evmar commented Feb 13, 2016

Emitting a type for arrow functions triggers ASI due to
the newlines in the JSDoc type annotation. Fix this by just
skipping type annotations.

Works around issue #57.

Emitting a type for arrow functions triggers ASI due to
the newlines in the JSDoc type annotation.  Fix this by just
skipping type annotations.

Works around issue #57.
@evmar
Copy link
Contributor Author

evmar commented Feb 13, 2016

Maybe I should just always skip arrow functions even in typed mode, 'cause we can't get the annotations right... what do you think?

@rkirov
Copy link
Contributor

rkirov commented Feb 16, 2016

LGTM, since we agreed to work towards turning off annotations for untyped, #59 and this is going in that direction.

For typed mode I think we have to fix this proper, how about adding extra parens?

function foo() {
    return (
/**
 * @param { string} x
 */
(x: string) => 3
);}

It does trigger the double emit bug, but at least it preserves the meaning of the original code.

@rkirov rkirov added the LGTM label Feb 16, 2016
@evmar evmar merged commit 16bdc11 into angular:master Feb 17, 2016
@evmar evmar deleted the function-types branch February 17, 2016 21:32
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.

None yet

3 participants