-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Infer from parameters annotated using JSDoc #55400
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
Infer from parameters annotated using JSDoc #55400
Conversation
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.
this is an existing test case, just rewritten to JSDoc, see: https://github.com/microsoft/TypeScript/pull/52609/files#diff-85ed3085ca9f5d4c893196581ea0785e5d6a5aca5ae449afe499fb4d4d159728
src/compiler/checker.ts
Outdated
@@ -35117,11 +35117,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { | |||
const len = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); | |||
for (let i = 0; i < len; i++) { | |||
const declaration = signature.parameters[i].valueDeclaration as ParameterDeclaration; | |||
if (declaration.type) { |
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 noticed that this check is somewhat redundant because getEffectiveTypeAnnotationNode
already resolves this and that it actually prevents this function from working on functions annotated using JSDoc
…ted-parameters-in-js-files
@typescript-bot perf test this |
Heya @DanielRosenwasser, I've started to run the regular perf test suite on this PR at 6be3219. You can monitor the build here. Update: The results are in! |
@DanielRosenwasser Here they are:
CompilerComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
tsserverComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
StartupComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
No description provided.