mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
Visit super arguments even when no signature exists (#24591)
This commit is contained in:
parent
f8503f2632
commit
1b6d9229f2
@ -18678,6 +18678,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
|
||||
return anySignature;
|
||||
}
|
||||
if (superType !== errorType) {
|
||||
|
||||
@ -0,0 +1,17 @@
|
||||
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 (2 errors) ====
|
||||
import X from 'file';
|
||||
~~~~~~
|
||||
!!! error TS2307: Cannot find module 'file'.
|
||||
import Z from 'other_file';
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'other_file'.
|
||||
|
||||
class Y extends Z {
|
||||
constructor() {
|
||||
super(X);
|
||||
}
|
||||
}
|
||||
32
tests/baselines/reference/importNotElidedWhenNotFound.js
Normal file
32
tests/baselines/reference/importNotElidedWhenNotFound.js
Normal file
@ -0,0 +1,32 @@
|
||||
//// [importNotElidedWhenNotFound.ts]
|
||||
import X from 'file';
|
||||
import Z from 'other_file';
|
||||
|
||||
class Y extends Z {
|
||||
constructor() {
|
||||
super(X);
|
||||
}
|
||||
}
|
||||
|
||||
//// [importNotElidedWhenNotFound.js]
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
exports.__esModule = true;
|
||||
var file_1 = require("file");
|
||||
var other_file_1 = require("other_file");
|
||||
var Y = /** @class */ (function (_super) {
|
||||
__extends(Y, _super);
|
||||
function Y() {
|
||||
return _super.call(this, file_1["default"]) || this;
|
||||
}
|
||||
return Y;
|
||||
}(other_file_1["default"]));
|
||||
@ -0,0 +1,16 @@
|
||||
=== tests/cases/compiler/importNotElidedWhenNotFound.ts ===
|
||||
import X from 'file';
|
||||
>X : Symbol(X, Decl(importNotElidedWhenNotFound.ts, 0, 6))
|
||||
|
||||
import Z from 'other_file';
|
||||
>Z : Symbol(Z, Decl(importNotElidedWhenNotFound.ts, 1, 6))
|
||||
|
||||
class Y extends Z {
|
||||
>Y : Symbol(Y, Decl(importNotElidedWhenNotFound.ts, 1, 27))
|
||||
>Z : Symbol(Z, Decl(importNotElidedWhenNotFound.ts, 1, 6))
|
||||
|
||||
constructor() {
|
||||
super(X);
|
||||
>X : Symbol(X, Decl(importNotElidedWhenNotFound.ts, 0, 6))
|
||||
}
|
||||
}
|
||||
18
tests/baselines/reference/importNotElidedWhenNotFound.types
Normal file
18
tests/baselines/reference/importNotElidedWhenNotFound.types
Normal file
@ -0,0 +1,18 @@
|
||||
=== tests/cases/compiler/importNotElidedWhenNotFound.ts ===
|
||||
import X from 'file';
|
||||
>X : any
|
||||
|
||||
import Z from 'other_file';
|
||||
>Z : any
|
||||
|
||||
class Y extends Z {
|
||||
>Y : Y
|
||||
>Z : any
|
||||
|
||||
constructor() {
|
||||
super(X);
|
||||
>super(X) : void
|
||||
>super : any
|
||||
>X : any
|
||||
}
|
||||
}
|
||||
8
tests/cases/compiler/importNotElidedWhenNotFound.ts
Normal file
8
tests/cases/compiler/importNotElidedWhenNotFound.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import X from 'file';
|
||||
import Z from 'other_file';
|
||||
|
||||
class Y extends Z {
|
||||
constructor() {
|
||||
super(X);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user