Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8f4af49

Browse filesBrowse files
authored
Merge pull request microsoft#16194 from Microsoft/fix-reexported-missing-alias
Fix reexported missing alias
2 parents bb54a6a + 9bcbeff commit 8f4af49
Copy full SHA for 8f4af49

4 files changed

+64Lines changed: 64 additions & 0 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/compiler/checker.ts‎

Copy file name to clipboardExpand all lines: src/compiler/checker.ts
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,6 +1370,9 @@ namespace ts {
13701370
// An 'import { Point } from "graphics"' needs to create a symbol that combines the value side 'Point'
13711371
// property with the type/namespace side interface 'Point'.
13721372
function combineValueAndTypeSymbols(valueSymbol: Symbol, typeSymbol: Symbol): Symbol {
1373+
if (valueSymbol === unknownSymbol && typeSymbol === unknownSymbol) {
1374+
return unknownSymbol;
1375+
}
13731376
if (valueSymbol.flags & (SymbolFlags.Type | SymbolFlags.Namespace)) {
13741377
return valueSymbol;
13751378
}
Collapse file
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
tests/cases/compiler/second.d.ts(2,27): error TS2304: Cannot find name 'CompletelyMissing'.
2+
tests/cases/compiler/second.d.ts(2,27): error TS2503: Cannot find namespace 'CompletelyMissing'.
3+
4+
5+
==== tests/cases/compiler/second.d.ts (2 errors) ====
6+
// Fixes #15094
7+
export import Component = CompletelyMissing;
8+
~~~~~~~~~~~~~~~~~
9+
!!! error TS2304: Cannot find name 'CompletelyMissing'.
10+
~~~~~~~~~~~~~~~~~
11+
!!! error TS2503: Cannot find namespace 'CompletelyMissing'.
12+
==== tests/cases/compiler/first.d.ts (0 errors) ====
13+
import * as Second from './second';
14+
export = Second;
15+
==== tests/cases/compiler/crash.ts (0 errors) ====
16+
import { Component } from './first';
17+
class C extends Component { }
18+
Collapse file
+34Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//// [tests/cases/compiler/reexportedMissingAlias.ts] ////
2+
3+
//// [second.d.ts]
4+
// Fixes #15094
5+
export import Component = CompletelyMissing;
6+
//// [first.d.ts]
7+
import * as Second from './second';
8+
export = Second;
9+
//// [crash.ts]
10+
import { Component } from './first';
11+
class C extends Component { }
12+
13+
14+
//// [crash.js]
15+
"use strict";
16+
var __extends = (this && this.__extends) || (function () {
17+
var extendStatics = Object.setPrototypeOf ||
18+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
20+
return function (d, b) {
21+
extendStatics(d, b);
22+
function __() { this.constructor = d; }
23+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
24+
};
25+
})();
26+
exports.__esModule = true;
27+
var first_1 = require("./first");
28+
var C = (function (_super) {
29+
__extends(C, _super);
30+
function C() {
31+
return _super !== null && _super.apply(this, arguments) || this;
32+
}
33+
return C;
34+
}(first_1.Component));
Collapse file
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Fixes #15094
2+
// @Filename: second.d.ts
3+
export import Component = CompletelyMissing;
4+
// @Filename: first.d.ts
5+
import * as Second from './second';
6+
export = Second;
7+
// @Filename: crash.ts
8+
import { Component } from './first';
9+
class C extends Component { }

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.