@@ -11768,7 +11768,7 @@ func (c *Checker) checkThisExpression(node *ast.Node) *Type {
1176811768 // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks
1176911769 }
1177011770 }
11771- t := c.TryGetThisTypeAtEx (node, true /*includeGlobalThis*/, container)
11771+ t := c.tryGetThisTypeAtEx (node, true /*includeGlobalThis*/, container)
1177211772 if c.noImplicitThis {
1177311773 globalThisType := c.getTypeOfSymbol(c.globalThisSymbol)
1177411774 if t == globalThisType && capturedByArrowFunction {
@@ -11791,10 +11791,18 @@ func (c *Checker) checkThisExpression(node *ast.Node) *Type {
1179111791}
1179211792
1179311793func (c *Checker) tryGetThisTypeAt(node *ast.Node) *Type {
11794- return c.TryGetThisTypeAtEx (node, true /*includeGlobalThis*/, nil /*container*/)
11794+ return c.tryGetThisTypeAtEx (node, true /*includeGlobalThis*/, nil /*container*/)
1179511795}
1179611796
1179711797func (c *Checker) TryGetThisTypeAtEx(node *ast.Node, includeGlobalThis bool, container *ast.Node) *Type {
11798+ reparsed := ast.GetReparsedNodeForNode(node)
11799+ if reparsed.Flags&ast.NodeFlagsJSDoc != 0 && reparsed.Flags&ast.NodeFlagsReparsed == 0 {
11800+ return nil // Binder doesn't process non-reparsed JSDoc nodes
11801+ }
11802+ return c.tryGetThisTypeAtEx(reparsed, includeGlobalThis, ast.GetReparsedNodeForNode(container))
11803+ }
11804+
11805+ func (c *Checker) tryGetThisTypeAtEx(node *ast.Node, includeGlobalThis bool, container *ast.Node) *Type {
1179811806 if container == nil {
1179911807 container = c.getThisContainer(node, false /*includeArrowFunctions*/, false /*includeClassComputedPropertyName*/)
1180011808 }
@@ -30674,7 +30682,7 @@ func (c *Checker) GetSymbolAtLocation(node *ast.Node) *ast.Symbol {
3067430682 if node.Parent == nil || node.Parent.Parent == nil {
3067530683 return nil
3067630684 }
30677- return c.getSymbolAtLocation(node, true /*ignoreErrors*/)
30685+ return c.getSymbolAtLocation(ast.GetReparsedNodeForNode( node) , true /*ignoreErrors*/)
3067830686}
3067930687
3068030688// Returns the symbol associated with a given AST node. Do *not* use this function in the checker itself! It should
@@ -31246,7 +31254,7 @@ func (c *Checker) containsArgumentsReference(node *ast.Node) bool {
3124631254}
3124731255
3124831256func (c *Checker) GetTypeAtLocation(node *ast.Node) *Type {
31249- return c.getTypeOfNode(node)
31257+ return c.getTypeOfNode(ast.GetReparsedNodeForNode( node) )
3125031258}
3125131259
3125231260func (c *Checker) GetEmitResolver() *EmitResolver {
0 commit comments