-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat(constructSignature): add construct signature #116
Conversation
case ts.SyntaxKind.CallSignature: | ||
return GetFunctionTypeDescriptor(node as ts.CallSignatureDeclaration, scope); | ||
return GetFunctionTypeDescriptor(node as ts.CallSignatureDeclaration | ts.ConstructSignatureDeclaration, scope); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can remove the OR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry. I didn't see that you may still want to keep the switch case separated. Once you've done that you can remove the OR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put the OR there to make sure the typings are correct... if for some reason we change GetFunctionTypeDescriptor
to only accept CallSignatureDeclaration
it would give error... if I remove one of the two then there is no check anymore.
Do you want me to split the 2 cases of the switch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I split the 2 cases
I'm going to treat construct signature in the same way as call signature.
Something doesn't work perfectly but I think it's a non-problem:
is an accepted signature but my implementation can handle only constructions of object-like values.
Let me know if this concerns you