Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ad24904

Browse filesBrowse files
authored
resolvedJSDocType should cache on node, not symbol (microsoft#36561)
1 parent 86556d6 commit ad24904
Copy full SHA for ad24904

File tree

Expand file treeCollapse file tree

2 files changed

+2
-5
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+2
-5
lines changed

‎src/compiler/checker.ts

Copy file name to clipboardExpand all lines: src/compiler/checker.ts
+1-4Lines changed: 1 addition & 4 deletions
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

Copy file name to clipboardExpand all lines: src/compiler/types.ts
+1-1Lines changed: 1 addition & 1 deletion
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.