Skip to content

Conversation

@sandersn
Copy link
Member

Previously it only handled types whose declaration was from require, but now it handles types whose reference is an import type as well.

Fixes #34671

This doesn't explain the differences in chrome-devtools-frontend, so I'm going to investigate those now.

Previously it only handled types whose declaration was from `require`,
but now it handles types whose reference is an import type as well.
class C {
s() { }
}
module.exports.C = C
Copy link
Member

@weswigham weswigham Oct 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is needed because this line isn't treated like an alias declaration, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and the fixup code in getTypeFromJSDocValueReference didn't handle import types before this.

@sandersn sandersn merged commit 8223c07 into master Oct 23, 2019
@sandersn sandersn deleted the fix-jsdoc-import-type-w/class branch October 23, 2019 22:53
@sandersn
Copy link
Member Author

@typescript-bot cherry-pick this to release-3.7

@typescript-bot
Copy link
Collaborator

Hey @sandersn, I've opened #34705 for you.

typescript-bot pushed a commit to typescript-bot/TypeScript that referenced this pull request Oct 24, 2019
Component commits:
2aa257d getTypeFromJSDocValueReference: handle import types
Previously it only handled types whose declaration was from `require`,
but now it handles types whose reference is an import type as well.
sandersn pushed a commit that referenced this pull request Oct 24, 2019
Component commits:
2aa257d getTypeFromJSDocValueReference: handle import types
Previously it only handled types whose declaration was from `require`,
but now it handles types whose reference is an import type as well.
mheiber pushed a commit to mheiber/TypeScript that referenced this pull request Oct 25, 2019
Previously it only handled types whose declaration was from `require`,
but now it handles types whose reference is an import type as well.
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
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.

In JS, imported class type references resolve to static, not instance type.

4 participants