Skip to content

Commit b5ed171

Browse files
committed
Fix errors from merge
1 parent 961a014 commit b5ed171

5 files changed

+24
-23
lines changed

Diff for: src/compiler/checker.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -38607,7 +38607,10 @@ namespace ts {
3860738607
error(node, message, symbolToString(symbol));
3860838608
}
3860938609

38610-
const isDeclaredTypeOnly = isTypeOnlyImportOrExportDeclaration(node);
38610+
// Type assertion to defeat the type predicate aliasing of `node` here because
38611+
// `isTypeOnlyImportOrExportDeclaration` is a one-sided type guard so `!isDeclaredTypeOnly`
38612+
// does not actually imply any narrowing effect on `node`.
38613+
const isDeclaredTypeOnly = isTypeOnlyImportOrExportDeclaration(node as never);
3861138614
if (compilerOptions.isolatedModules
3861238615
&& !isDeclaredTypeOnly
3861338616
&& !(node.flags & NodeFlags.Ambient)

Diff for: tests/baselines/reference/noErasingImportedNames(isolatedmodules=true).errors.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
tests/cases/conformance/externalModules/typeOnly/b.ts(1,19): error TS1434: 'D' is a type and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
1+
tests/cases/conformance/externalModules/typeOnly/b.ts(1,19): error TS1444: 'D' is a type and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
22
tests/cases/conformance/externalModules/typeOnly/d.ts(1,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead.
33
tests/cases/conformance/externalModules/typeOnly/e.ts(1,1): error TS1202: Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.
44
tests/cases/conformance/externalModules/typeOnly/e.ts(2,1): error TS1202: Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.
@@ -13,7 +13,7 @@ tests/cases/conformance/externalModules/typeOnly/e.ts(2,1): error TS1202: Import
1313
==== tests/cases/conformance/externalModules/typeOnly/b.ts (1 errors) ====
1414
import a, { b, c, D } from "./a";
1515
~
16-
!!! error TS1434: 'D' is a type and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
16+
!!! error TS1444: 'D' is a type and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
1717

1818
==== tests/cases/conformance/externalModules/typeOnly/c.ts (0 errors) ====
1919
import * as a from "./a";

Diff for: tests/baselines/reference/noErasingImportedNames_errors(isolatedmodules=false).js

+2-3
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,14 @@ export {};
6060
//// [c.fixed.js]
6161
export {};
6262
//// [d.js]
63-
export { A as AA } from "./a";
64-
export { B as BB } from "./b";
63+
export {};
6564
//// [d.fixed.js]
6665
export {};
6766
//// [e.js]
6867
export {};
6968
//// [e.fixed.js]
7069
export {};
7170
//// [f.js]
72-
export { A, B as BB };
71+
export {};
7372
//// [f.fixed.js]
7473
export {};

Diff for: tests/baselines/reference/noErasingImportedNames_errors(isolatedmodules=true).errors.txt

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
tests/cases/conformance/externalModules/typeOnly/c.ts(1,8): error TS1434: 'DefaultA' is a type and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
2-
tests/cases/conformance/externalModules/typeOnly/c.ts(2,10): error TS1434: 'A' is a type and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
3-
tests/cases/conformance/externalModules/typeOnly/c.ts(3,8): error TS1436: 'DefaultB' resolves to a type-only declaration and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
4-
tests/cases/conformance/externalModules/typeOnly/c.ts(4,10): error TS1436: 'B' resolves to a type-only declaration and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
1+
tests/cases/conformance/externalModules/typeOnly/c.ts(1,8): error TS1444: 'DefaultA' is a type and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
2+
tests/cases/conformance/externalModules/typeOnly/c.ts(2,10): error TS1444: 'A' is a type and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
3+
tests/cases/conformance/externalModules/typeOnly/c.ts(3,8): error TS1446: 'DefaultB' resolves to a type-only declaration and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
4+
tests/cases/conformance/externalModules/typeOnly/c.ts(4,10): error TS1446: 'B' resolves to a type-only declaration and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
55
tests/cases/conformance/externalModules/typeOnly/d.ts(1,10): error TS1205: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
6-
tests/cases/conformance/externalModules/typeOnly/d.ts(2,10): error TS1438: 'B' resolves to a type-only declaration and must be re-exported with a type-only re-export when 'isolatedModules' is enabled.
7-
tests/cases/conformance/externalModules/typeOnly/e.ts(1,10): error TS1434: 'AA' is a type and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
8-
tests/cases/conformance/externalModules/typeOnly/e.ts(1,14): error TS1436: 'BB' resolves to a type-only declaration and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
6+
tests/cases/conformance/externalModules/typeOnly/d.ts(2,10): error TS1448: 'B' resolves to a type-only declaration and must be re-exported with a type-only re-export when 'isolatedModules' is enabled.
7+
tests/cases/conformance/externalModules/typeOnly/e.ts(1,10): error TS1444: 'AA' is a type and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
8+
tests/cases/conformance/externalModules/typeOnly/e.ts(1,14): error TS1446: 'BB' resolves to a type-only declaration and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
99

1010

1111
==== tests/cases/conformance/externalModules/typeOnly/a.ts (0 errors) ====
@@ -19,17 +19,17 @@ tests/cases/conformance/externalModules/typeOnly/e.ts(1,14): error TS1436: 'BB'
1919
==== tests/cases/conformance/externalModules/typeOnly/c.ts (4 errors) ====
2020
import DefaultA from "./a";
2121
~~~~~~~~
22-
!!! error TS1434: 'DefaultA' is a type and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
22+
!!! error TS1444: 'DefaultA' is a type and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
2323
import { A } from "./a";
2424
~
25-
!!! error TS1434: 'A' is a type and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
25+
!!! error TS1444: 'A' is a type and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
2626
import DefaultB from "./b";
2727
~~~~~~~~
28-
!!! error TS1436: 'DefaultB' resolves to a type-only declaration and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
28+
!!! error TS1446: 'DefaultB' resolves to a type-only declaration and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
2929
!!! related TS1377 tests/cases/conformance/externalModules/typeOnly/b.ts:2:18: 'DefaultB' was exported here.
3030
import { B } from "./b";
3131
~
32-
!!! error TS1436: 'B' resolves to a type-only declaration and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
32+
!!! error TS1446: 'B' resolves to a type-only declaration and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
3333
!!! related TS1377 tests/cases/conformance/externalModules/typeOnly/b.ts:2:15: 'B' was exported here.
3434

3535
==== tests/cases/conformance/externalModules/typeOnly/c.fixed.ts (0 errors) ====
@@ -44,7 +44,7 @@ tests/cases/conformance/externalModules/typeOnly/e.ts(1,14): error TS1436: 'BB'
4444
!!! error TS1205: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
4545
export { B as BB } from "./b";
4646
~~~~~~~
47-
!!! error TS1438: 'B' resolves to a type-only declaration and must be re-exported with a type-only re-export when 'isolatedModules' is enabled.
47+
!!! error TS1448: 'B' resolves to a type-only declaration and must be re-exported with a type-only re-export when 'isolatedModules' is enabled.
4848
!!! related TS1377 tests/cases/conformance/externalModules/typeOnly/b.ts:2:15: 'B' was exported here.
4949

5050
==== tests/cases/conformance/externalModules/typeOnly/d.fixed.ts (0 errors) ====
@@ -54,9 +54,9 @@ tests/cases/conformance/externalModules/typeOnly/e.ts(1,14): error TS1436: 'BB'
5454
==== tests/cases/conformance/externalModules/typeOnly/e.ts (2 errors) ====
5555
import { AA, BB } from "./d";
5656
~~
57-
!!! error TS1434: 'AA' is a type and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
57+
!!! error TS1444: 'AA' is a type and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
5858
~~
59-
!!! error TS1436: 'BB' resolves to a type-only declaration and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
59+
!!! error TS1446: 'BB' resolves to a type-only declaration and must be imported with a type-only import when 'noErasingImportedNames' and 'isolatedModules' are both enabled.
6060
!!! related TS1377 tests/cases/conformance/externalModules/typeOnly/b.ts:2:15: 'BB' was exported here.
6161

6262
==== tests/cases/conformance/externalModules/typeOnly/e.fixed.ts (0 errors) ====

Diff for: tests/baselines/reference/noErasingImportedNames_errors(isolatedmodules=true).js

+2-3
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,14 @@ export {};
6060
//// [c.fixed.js]
6161
export {};
6262
//// [d.js]
63-
export { A as AA } from "./a";
64-
export { B as BB } from "./b";
63+
export {};
6564
//// [d.fixed.js]
6665
export {};
6766
//// [e.js]
6867
export {};
6968
//// [e.fixed.js]
7069
export {};
7170
//// [f.js]
72-
export { A, B as BB };
71+
export {};
7372
//// [f.fixed.js]
7473
export {};

0 commit comments

Comments
 (0)