Skip to content

Mark js-assignment functions' symbols as methods#23078

Merged
sandersn merged 1 commit into
masterfrom
js/mark-special-assignment-functions-as-methods
Apr 2, 2018
Merged

Mark js-assignment functions' symbols as methods#23078
sandersn merged 1 commit into
masterfrom
js/mark-special-assignment-functions-as-methods

Conversation

@sandersn
Copy link
Copy Markdown
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