Clear jsDocCache for reused nodes (#21099)

This commit is contained in:
Andy 2018-01-09 11:22:15 -08:00 committed by GitHub
parent 82fb294924
commit 191b9750c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View File

@ -1679,6 +1679,11 @@ namespace ts {
return undefined;
}
if ((node as JSDocContainer).jsDocCache) {
// jsDocCache may include tags from parent nodes, which might have been modified.
(node as JSDocContainer).jsDocCache = undefined;
}
return node;
}

View File

@ -0,0 +1,14 @@
/// <reference path='fourslash.ts'/>
// @allowJs: true
// @Filename: /a.js
/////** @type {/*type*/number} */
////let /*x*/x;
verify.quickInfoAt("x", "let x: number");
goTo.marker("type");
edit.replace(test.markers()[0].position, "number".length, "string");
verify.quickInfoAt("x", "let x: string");