Skip to content

Mark js-assignment functions' symbols as methods #23078

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
Apr 2, 2018

Conversation

sandersn
Copy link
Member

@sandersn sandersn commented Apr 2, 2018

This is a better fix than #23068 and #22935 because it makes js-assigned functions work more like methods, so they reuse more of the existing method machinery.

This make display more accurate:

  1. The functions now print as methods
  2. When the type of the function references the class, the type of the function itself is now printed correctly instead of as any.

Other benefits:

  1. isMethodLike no longer needs to have a js special case.
  2. The check in convertFunctionToEs6Class makes more sense.

Downsides:

  1. Both getTypeOfFunc and getTypeOfVariable need js special cases, as does getSignatureOfSymbol.

This make display more accurate:
1. The functions now print as methods
2. When the type of the function references the class, the type of the
function itself is now printed correctly instead of as `any`.
@sandersn sandersn requested review from a user and mhegazy April 2, 2018 18:23
@sandersn sandersn merged commit d3e0929 into master Apr 2, 2018
@sandersn sandersn deleted the js/mark-special-assignment-functions-as-methods branch April 2, 2018 19:17
@microsoft microsoft locked and limited conversation to collaborators Jul 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant