Skip to content

Commit ad24904

Browse files
authored
resolvedJSDocType should cache on node, not symbol (#36561)
1 parent 86556d6 commit ad24904

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/compiler/checker.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ namespace ts {
163163
ResolvedReturnType,
164164
ImmediateBaseConstraint,
165165
EnumTagType,
166-
JSDocTypeReference,
167166
ResolvedTypeArguments,
168167
}
169168

@@ -6920,8 +6919,6 @@ namespace ts {
69206919
return !!(<Signature>target).resolvedReturnType;
69216920
case TypeSystemPropertyName.ImmediateBaseConstraint:
69226921
return !!(<Type>target).immediateBaseConstraint;
6923-
case TypeSystemPropertyName.JSDocTypeReference:
6924-
return !!getSymbolLinks(target as Symbol).resolvedJSDocType;
69256922
case TypeSystemPropertyName.ResolvedTypeArguments:
69266923
return !!(target as TypeReference).resolvedTypeArguments;
69276924
}
@@ -11184,7 +11181,7 @@ namespace ts {
1118411181
* but this function's special-case code fakes alias resolution as well.
1118511182
*/
1118611183
function getTypeFromJSDocValueReference(node: NodeWithTypeArguments, symbol: Symbol): Type | undefined {
11187-
const links = getSymbolLinks(symbol);
11184+
const links = getNodeLinks(node);
1118811185
if (!links.resolvedJSDocType) {
1118911186
const valueType = getTypeOfSymbol(symbol);
1119011187
let typeType = valueType;

src/compiler/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4063,7 +4063,6 @@ namespace ts {
40634063
nameType?: Type; // Type associated with a late-bound symbol
40644064
uniqueESSymbolType?: Type; // UniqueESSymbol type for a symbol
40654065
declaredType?: Type; // Type of class, interface, enum, type alias, or type parameter
4066-
resolvedJSDocType?: Type; // Resolved type of a JSDoc type reference
40674066
typeParameters?: TypeParameter[]; // Type parameters of type alias (undefined if non-generic)
40684067
outerTypeParameters?: TypeParameter[]; // Outer type parameters of anonymous object type
40694068
instantiations?: Map<Type>; // Instantiations of generic type alias (undefined if non-generic)
@@ -4239,6 +4238,7 @@ namespace ts {
42394238
jsxFlags: JsxFlags; // flags for knowing what kind of element/attributes we're dealing with
42404239
resolvedJsxElementAttributesType?: Type; // resolved element attributes type of a JSX openinglike element
42414240
resolvedJsxElementAllAttributesType?: Type; // resolved all element attributes type of a JSX openinglike element
4241+
resolvedJSDocType?: Type; // Resolved type of a JSDoc type reference
42424242
hasSuperCall?: boolean; // recorded result when we try to find super-call. We only try to find one if this flag is undefined, indicating that we haven't made an attempt.
42434243
superCall?: SuperCall; // Cached first super-call found in the constructor. Used in checking whether super is called before this-accessing
42444244
switchTypes?: Type[]; // Cached array of switch case expression types

0 commit comments

Comments
 (0)