diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 54283da848c72..e98fe863a3f4f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -18604,7 +18604,7 @@ namespace ts { if (node.expression.kind === SyntaxKind.SuperKeyword) { const superType = checkSuperExpression(node.expression); if (isTypeAny(superType)) { - forEach(node.arguments, checkExpression); // Still visit arguments so they get marked for visibility, etc + forEach(node.arguments, checkExpresionNoReturn); // Still visit arguments so they get marked for visibility, etc return anySignature; } if (superType !== unknownType) { @@ -20752,6 +20752,10 @@ namespace ts { return type; } + function checkExpresionNoReturn(node: Expression) { + checkExpression(node); + } + // Checks an expression and returns its type. The contextualMapper parameter serves two purposes: When // contextualMapper is not undefined and not equal to the identityMapper function object it indicates that the // expression is being inferentially typed (section 4.15.2 in spec) and provides the type mapper to use in diff --git a/tests/baselines/reference/importNotElidedWhenNotFound.errors.txt b/tests/baselines/reference/importNotElidedWhenNotFound.errors.txt index 51e1fe9b44de1..b8245c0081d24 100644 --- a/tests/baselines/reference/importNotElidedWhenNotFound.errors.txt +++ b/tests/baselines/reference/importNotElidedWhenNotFound.errors.txt @@ -1,8 +1,10 @@ tests/cases/compiler/importNotElidedWhenNotFound.ts(1,15): error TS2307: Cannot find module 'file'. tests/cases/compiler/importNotElidedWhenNotFound.ts(2,15): error TS2307: Cannot find module 'other_file'. +tests/cases/compiler/importNotElidedWhenNotFound.ts(10,16): error TS2307: Cannot find module 'file2'. +tests/cases/compiler/importNotElidedWhenNotFound.ts(11,16): error TS2307: Cannot find module 'file3'. -==== tests/cases/compiler/importNotElidedWhenNotFound.ts (2 errors) ==== +==== tests/cases/compiler/importNotElidedWhenNotFound.ts (4 errors) ==== import X from 'file'; ~~~~~~ !!! error TS2307: Cannot find module 'file'. @@ -14,4 +16,17 @@ tests/cases/compiler/importNotElidedWhenNotFound.ts(2,15): error TS2307: Cannot constructor() { super(X); } - } \ No newline at end of file + } + + import X2 from 'file2'; + ~~~~~~~ +!!! error TS2307: Cannot find module 'file2'. + import X3 from 'file3'; + ~~~~~~~ +!!! error TS2307: Cannot find module 'file3'. + class Q extends Z { + constructor() { + super(X2, X3); + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/importNotElidedWhenNotFound.js b/tests/baselines/reference/importNotElidedWhenNotFound.js index 303e5df8f22dc..9eef51f4052ef 100644 --- a/tests/baselines/reference/importNotElidedWhenNotFound.js +++ b/tests/baselines/reference/importNotElidedWhenNotFound.js @@ -6,7 +6,16 @@ class Y extends Z { constructor() { super(X); } -} +} + +import X2 from 'file2'; +import X3 from 'file3'; +class Q extends Z { + constructor() { + super(X2, X3); + } +} + //// [importNotElidedWhenNotFound.js] "use strict"; @@ -30,3 +39,12 @@ var Y = /** @class */ (function (_super) { } return Y; }(other_file_1["default"])); +var file2_1 = require("file2"); +var file3_1 = require("file3"); +var Q = /** @class */ (function (_super) { + __extends(Q, _super); + function Q() { + return _super.call(this, file2_1["default"], file3_1["default"]) || this; + } + return Q; +}(other_file_1["default"])); diff --git a/tests/baselines/reference/importNotElidedWhenNotFound.symbols b/tests/baselines/reference/importNotElidedWhenNotFound.symbols index 37558d6be3d66..c920eefb44e75 100644 --- a/tests/baselines/reference/importNotElidedWhenNotFound.symbols +++ b/tests/baselines/reference/importNotElidedWhenNotFound.symbols @@ -14,3 +14,21 @@ class Y extends Z { >X : Symbol(X, Decl(importNotElidedWhenNotFound.ts, 0, 6)) } } + +import X2 from 'file2'; +>X2 : Symbol(X2, Decl(importNotElidedWhenNotFound.ts, 9, 6)) + +import X3 from 'file3'; +>X3 : Symbol(X3, Decl(importNotElidedWhenNotFound.ts, 10, 6)) + +class Q extends Z { +>Q : Symbol(Q, Decl(importNotElidedWhenNotFound.ts, 10, 23)) +>Z : Symbol(Z, Decl(importNotElidedWhenNotFound.ts, 1, 6)) + + constructor() { + super(X2, X3); +>X2 : Symbol(X2, Decl(importNotElidedWhenNotFound.ts, 9, 6)) +>X3 : Symbol(X3, Decl(importNotElidedWhenNotFound.ts, 10, 6)) + } +} + diff --git a/tests/baselines/reference/importNotElidedWhenNotFound.types b/tests/baselines/reference/importNotElidedWhenNotFound.types index 02304b6e2d25d..ca29d98194412 100644 --- a/tests/baselines/reference/importNotElidedWhenNotFound.types +++ b/tests/baselines/reference/importNotElidedWhenNotFound.types @@ -16,3 +16,23 @@ class Y extends Z { >X : any } } + +import X2 from 'file2'; +>X2 : any + +import X3 from 'file3'; +>X3 : any + +class Q extends Z { +>Q : Q +>Z : any + + constructor() { + super(X2, X3); +>super(X2, X3) : void +>super : any +>X2 : any +>X3 : any + } +} + diff --git a/tests/cases/compiler/importNotElidedWhenNotFound.ts b/tests/cases/compiler/importNotElidedWhenNotFound.ts index 2ff7cd64d0d9b..7781dc9d430c7 100644 --- a/tests/cases/compiler/importNotElidedWhenNotFound.ts +++ b/tests/cases/compiler/importNotElidedWhenNotFound.ts @@ -5,4 +5,12 @@ class Y extends Z { constructor() { super(X); } -} \ No newline at end of file +} + +import X2 from 'file2'; +import X3 from 'file3'; +class Q extends Z { + constructor() { + super(X2, X3); + } +}