File tree 3 files changed +13
-1
lines changed
test/library-tests/UnderlyingTypes
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 {
27
27
result = this .getAVariable ( ) and
28
28
result .getName ( ) = name
29
29
}
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
+ }
30
36
}
31
37
32
38
/**
Original file line number Diff line number Diff line change @@ -132,6 +132,12 @@ module TypeResolution {
132
132
node1 = type .getExpressionName ( ) and
133
133
node2 = type
134
134
)
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
+ )
135
141
}
136
142
137
143
/**
Original file line number Diff line number Diff line change @@ -10,5 +10,5 @@ function t1(req) { // $ hasUnderlyingType='express'.Request SPURIOUS: hasUnderly
10
10
/**
11
11
* @param {Response } res
12
12
*/
13
- function t2 ( res ) { // $ MISSING: hasUnderlyingType='express'.Response SPURIOUS: hasUnderlyingType=Response
13
+ function t2 ( res ) { // $ hasUnderlyingType='express'.Response SPURIOUS: hasUnderlyingType=Response
14
14
}
You can’t perform that action at this time.
0 commit comments