Skip to content

Commit d96ede3

Browse files
committed
fix(49058): skip unresolved base members
1 parent cfbb517 commit d96ede3

File tree

7 files changed

+239
-1
lines changed

7 files changed

+239
-1
lines changed

src/services/services.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ namespace ts {
650650
return firstDefined(getAllSuperTypeNodes(classOrInterfaceDeclaration), superTypeNode => {
651651
const baseType = checker.getTypeAtLocation(superTypeNode);
652652
const symbol = isStaticMember
653-
? find(checker.getExportsOfModule(baseType.symbol), s => s.escapedName === declaration.symbol.name)
653+
? baseType.symbol && find(checker.getExportsOfModule(baseType.symbol), s => s.escapedName === declaration.symbol.name)
654654
: checker.getPropertyOfType(baseType, declaration.symbol.name);
655655
return symbol ? cb(symbol) : undefined;
656656
});
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
[
2+
{
3+
"marker": {
4+
"fileName": "/tests/cases/fourslash/quickInfoInheritDoc4.ts",
5+
"position": 44,
6+
"name": ""
7+
},
8+
"quickInfo": {
9+
"kind": "method",
10+
"kindModifiers": "static",
11+
"textSpan": {
12+
"start": 44,
13+
"length": 5
14+
},
15+
"displayParts": [
16+
{
17+
"text": "(",
18+
"kind": "punctuation"
19+
},
20+
{
21+
"text": "method",
22+
"kind": "text"
23+
},
24+
{
25+
"text": ")",
26+
"kind": "punctuation"
27+
},
28+
{
29+
"text": " ",
30+
"kind": "space"
31+
},
32+
{
33+
"text": "B",
34+
"kind": "className"
35+
},
36+
{
37+
"text": ".",
38+
"kind": "punctuation"
39+
},
40+
{
41+
"text": "value",
42+
"kind": "methodName"
43+
},
44+
{
45+
"text": "(",
46+
"kind": "punctuation"
47+
},
48+
{
49+
"text": ")",
50+
"kind": "punctuation"
51+
},
52+
{
53+
"text": ":",
54+
"kind": "punctuation"
55+
},
56+
{
57+
"text": " ",
58+
"kind": "space"
59+
},
60+
{
61+
"text": "any",
62+
"kind": "keyword"
63+
}
64+
],
65+
"documentation": []
66+
}
67+
}
68+
]
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
[
2+
{
3+
"marker": {
4+
"fileName": "/tests/cases/fourslash/quickInfoInheritDoc5.ts",
5+
"position": 48,
6+
"name": ""
7+
},
8+
"quickInfo": {
9+
"kind": "method",
10+
"kindModifiers": "static",
11+
"textSpan": {
12+
"start": 48,
13+
"length": 5
14+
},
15+
"displayParts": [
16+
{
17+
"text": "(",
18+
"kind": "punctuation"
19+
},
20+
{
21+
"text": "method",
22+
"kind": "text"
23+
},
24+
{
25+
"text": ")",
26+
"kind": "punctuation"
27+
},
28+
{
29+
"text": " ",
30+
"kind": "space"
31+
},
32+
{
33+
"text": "B",
34+
"kind": "className"
35+
},
36+
{
37+
"text": ".",
38+
"kind": "punctuation"
39+
},
40+
{
41+
"text": "value",
42+
"kind": "methodName"
43+
},
44+
{
45+
"text": "(",
46+
"kind": "punctuation"
47+
},
48+
{
49+
"text": ")",
50+
"kind": "punctuation"
51+
},
52+
{
53+
"text": ":",
54+
"kind": "punctuation"
55+
},
56+
{
57+
"text": " ",
58+
"kind": "space"
59+
},
60+
{
61+
"text": "any",
62+
"kind": "keyword"
63+
}
64+
],
65+
"documentation": []
66+
}
67+
}
68+
]
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
[
2+
{
3+
"marker": {
4+
"fileName": "/tests/cases/fourslash/quickInfoInheritDoc6.ts",
5+
"position": 72,
6+
"name": ""
7+
},
8+
"quickInfo": {
9+
"kind": "method",
10+
"kindModifiers": "static",
11+
"textSpan": {
12+
"start": 72,
13+
"length": 5
14+
},
15+
"displayParts": [
16+
{
17+
"text": "(",
18+
"kind": "punctuation"
19+
},
20+
{
21+
"text": "method",
22+
"kind": "text"
23+
},
24+
{
25+
"text": ")",
26+
"kind": "punctuation"
27+
},
28+
{
29+
"text": " ",
30+
"kind": "space"
31+
},
32+
{
33+
"text": "B",
34+
"kind": "className"
35+
},
36+
{
37+
"text": ".",
38+
"kind": "punctuation"
39+
},
40+
{
41+
"text": "value",
42+
"kind": "methodName"
43+
},
44+
{
45+
"text": "(",
46+
"kind": "punctuation"
47+
},
48+
{
49+
"text": ")",
50+
"kind": "punctuation"
51+
},
52+
{
53+
"text": ":",
54+
"kind": "punctuation"
55+
},
56+
{
57+
"text": " ",
58+
"kind": "space"
59+
},
60+
{
61+
"text": "any",
62+
"kind": "keyword"
63+
}
64+
],
65+
"documentation": []
66+
}
67+
}
68+
]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
// @Filename: quickInfoInheritDoc4.ts
4+
////var A: any;
5+
////
6+
////class B extends A {
7+
//// static /**/value() {
8+
//// return undefined;
9+
//// }
10+
////}
11+
12+
verify.baselineQuickInfo();
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
// @Filename: quickInfoInheritDoc5.ts
4+
////function A() {}
5+
////
6+
////class B extends A {
7+
//// static /**/value() {
8+
//// return undefined;
9+
//// }
10+
////}
11+
12+
verify.baselineQuickInfo();
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
// @Filename: quickInfoInheritDoc6.ts
4+
////class B extends UNRESOLVED_VALUE_DEFINITELY_DOES_NOT_EXIST {
5+
//// static /**/value() {
6+
//// return undefined;
7+
//// }
8+
////}
9+
10+
verify.baselineQuickInfo();

0 commit comments

Comments
 (0)