File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
test/library-tests/UnderlyingTypes Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,12 @@ class Scope extends @scope {
2727 result = this .getAVariable ( ) and
2828 result .getName ( ) = name
2929 }
30+
31+ /** Gets the local type name with the given name declared in this scope. */
32+ LocalTypeName getLocalTypeName ( string name ) {
33+ result .getScope ( ) = this and
34+ result .getName ( ) = name
35+ }
3036}
3137
3238/**
Original file line number Diff line number Diff line change @@ -132,6 +132,12 @@ module TypeResolution {
132132 node1 = type .getExpressionName ( ) and
133133 node2 = type
134134 )
135+ or
136+ exists ( JSDocNamedTypeExpr type , string name |
137+ type .hasNameParts ( name , "" ) and
138+ node1 = type .getTopLevel ( ) .getScope ( ) .getLocalTypeName ( name ) and
139+ node2 = type
140+ )
135141 }
136142
137143 /**
Original file line number Diff line number Diff line change @@ -10,5 +10,5 @@ function t1(req) { // $ hasUnderlyingType='express'.Request SPURIOUS: hasUnderly
1010/**
1111 * @param {Response } res
1212 */
13- function t2 ( res ) { // $ MISSING: hasUnderlyingType='express'.Response SPURIOUS: hasUnderlyingType=Response
13+ function t2 ( res ) { // $ hasUnderlyingType='express'.Response SPURIOUS: hasUnderlyingType=Response
1414}
You can’t perform that action at this time.
0 commit comments