-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
Jsdoc property description #49818
Jsdoc property description #49818
Conversation
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
src/compiler/checker.ts
Outdated
const expressionType = checkExpressionCached(name.expression); | ||
let infos = getApplicableIndexInfos(expressionType, getLiteralTypeFromPropertyName(name.name)); | ||
if(infos.length === 0 && getIndexInfosOfType(expressionType).filter(type => type.keyType.flags & TypeFlags.TemplateLiteral || type.keyType.flags & TypeFlags.ESSymbol).length > 0){ | ||
infos = getApplicableIndexInfos(expressionType, checkExpressionCached(name.name)); |
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.
Can you comment on what examples/tests you needed this case for? AFAIK, checkExpressionCached
on the name of a property access doesn't usually return the literal type of the name itself, but instead returns the type of the member the name refers to, which makes this line feel kinda nonsensical, since it's indexing the left-hand side type by the type of the whole expression, which is weird.
src/compiler/checker.ts
Outdated
const copy = createSymbol(SymbolFlags.Signature, InternalSymbolName.Index); | ||
copy.declarations = mapDefined(infos, i => i.declaration); | ||
copy.parent = expressionType.symbol ? expressionType.symbol : getSymbolAtLocation(copy.declarations[0].parent); | ||
return copy; |
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.
Need to assign to link.resolvedSymbol
before returning
ecfbf8b
to
924c68c
Compare
Fixes #47933