Skip to content

Commit 4240d9d

Browse files
authored
always visit them all (microsoft#24802)
1 parent f17fe87 commit 4240d9d

File tree

6 files changed

+88
-5
lines changed

6 files changed

+88
-5
lines changed

src/compiler/checker.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18620,7 +18620,7 @@ namespace ts {
1862018620
if (node.expression.kind === SyntaxKind.SuperKeyword) {
1862118621
const superType = checkSuperExpression(node.expression);
1862218622
if (isTypeAny(superType)) {
18623-
forEach(node.arguments, checkExpression); // Still visit arguments so they get marked for visibility, etc
18623+
forEach(node.arguments, checkExpresionNoReturn); // Still visit arguments so they get marked for visibility, etc
1862418624
return anySignature;
1862518625
}
1862618626
if (superType !== errorType) {
@@ -20781,6 +20781,10 @@ namespace ts {
2078120781
return type;
2078220782
}
2078320783

20784+
function checkExpresionNoReturn(node: Expression) {
20785+
checkExpression(node);
20786+
}
20787+
2078420788
// Checks an expression and returns its type. The contextualMapper parameter serves two purposes: When
2078520789
// contextualMapper is not undefined and not equal to the identityMapper function object it indicates that the
2078620790
// expression is being inferentially typed (section 4.15.2 in spec) and provides the type mapper to use in

tests/baselines/reference/importNotElidedWhenNotFound.errors.txt

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
tests/cases/compiler/importNotElidedWhenNotFound.ts(1,15): error TS2307: Cannot find module 'file'.
22
tests/cases/compiler/importNotElidedWhenNotFound.ts(2,15): error TS2307: Cannot find module 'other_file'.
3+
tests/cases/compiler/importNotElidedWhenNotFound.ts(10,16): error TS2307: Cannot find module 'file2'.
4+
tests/cases/compiler/importNotElidedWhenNotFound.ts(11,16): error TS2307: Cannot find module 'file3'.
35

46

5-
==== tests/cases/compiler/importNotElidedWhenNotFound.ts (2 errors) ====
7+
==== tests/cases/compiler/importNotElidedWhenNotFound.ts (4 errors) ====
68
import X from 'file';
79
~~~~~~
810
!!! error TS2307: Cannot find module 'file'.
@@ -14,4 +16,17 @@ tests/cases/compiler/importNotElidedWhenNotFound.ts(2,15): error TS2307: Cannot
1416
constructor() {
1517
super(X);
1618
}
17-
}
19+
}
20+
21+
import X2 from 'file2';
22+
~~~~~~~
23+
!!! error TS2307: Cannot find module 'file2'.
24+
import X3 from 'file3';
25+
~~~~~~~
26+
!!! error TS2307: Cannot find module 'file3'.
27+
class Q extends Z {
28+
constructor() {
29+
super(X2, X3);
30+
}
31+
}
32+

tests/baselines/reference/importNotElidedWhenNotFound.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@ class Y extends Z {
66
constructor() {
77
super(X);
88
}
9-
}
9+
}
10+
11+
import X2 from 'file2';
12+
import X3 from 'file3';
13+
class Q extends Z {
14+
constructor() {
15+
super(X2, X3);
16+
}
17+
}
18+
1019

1120
//// [importNotElidedWhenNotFound.js]
1221
"use strict";
@@ -30,3 +39,12 @@ var Y = /** @class */ (function (_super) {
3039
}
3140
return Y;
3241
}(other_file_1["default"]));
42+
var file2_1 = require("file2");
43+
var file3_1 = require("file3");
44+
var Q = /** @class */ (function (_super) {
45+
__extends(Q, _super);
46+
function Q() {
47+
return _super.call(this, file2_1["default"], file3_1["default"]) || this;
48+
}
49+
return Q;
50+
}(other_file_1["default"]));

tests/baselines/reference/importNotElidedWhenNotFound.symbols

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,21 @@ class Y extends Z {
1414
>X : Symbol(X, Decl(importNotElidedWhenNotFound.ts, 0, 6))
1515
}
1616
}
17+
18+
import X2 from 'file2';
19+
>X2 : Symbol(X2, Decl(importNotElidedWhenNotFound.ts, 9, 6))
20+
21+
import X3 from 'file3';
22+
>X3 : Symbol(X3, Decl(importNotElidedWhenNotFound.ts, 10, 6))
23+
24+
class Q extends Z {
25+
>Q : Symbol(Q, Decl(importNotElidedWhenNotFound.ts, 10, 23))
26+
>Z : Symbol(Z, Decl(importNotElidedWhenNotFound.ts, 1, 6))
27+
28+
constructor() {
29+
super(X2, X3);
30+
>X2 : Symbol(X2, Decl(importNotElidedWhenNotFound.ts, 9, 6))
31+
>X3 : Symbol(X3, Decl(importNotElidedWhenNotFound.ts, 10, 6))
32+
}
33+
}
34+

tests/baselines/reference/importNotElidedWhenNotFound.types

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,23 @@ class Y extends Z {
1616
>X : any
1717
}
1818
}
19+
20+
import X2 from 'file2';
21+
>X2 : any
22+
23+
import X3 from 'file3';
24+
>X3 : any
25+
26+
class Q extends Z {
27+
>Q : Q
28+
>Z : any
29+
30+
constructor() {
31+
super(X2, X3);
32+
>super(X2, X3) : void
33+
>super : any
34+
>X2 : any
35+
>X3 : any
36+
}
37+
}
38+

tests/cases/compiler/importNotElidedWhenNotFound.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,12 @@ class Y extends Z {
55
constructor() {
66
super(X);
77
}
8-
}
8+
}
9+
10+
import X2 from 'file2';
11+
import X3 from 'file3';
12+
class Q extends Z {
13+
constructor() {
14+
super(X2, X3);
15+
}
16+
}

0 commit comments

Comments
 (0)