forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recognize
export * as default
as a syntactic default export for syn…
…thetic default detection (microsoft#55985)
- Loading branch information
1 parent
e9f68cb
commit 21109b7
Showing
5 changed files
with
89 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//// [tests/cases/conformance/es2020/modules/exportAsNamespace5.ts] //// | ||
|
||
//// [three.d.ts] | ||
export type Named = 0; | ||
declare const Named: 0; | ||
|
||
//// [two.d.ts] | ||
export * as default from "./three"; | ||
|
||
//// [one.ts] | ||
import ns from "./two"; | ||
type Alias = ns.Named; | ||
ns.Named; | ||
|
||
|
||
//// [one.js] | ||
import ns from "./two"; | ||
ns.Named; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//// [tests/cases/conformance/es2020/modules/exportAsNamespace5.ts] //// | ||
|
||
=== three.d.ts === | ||
export type Named = 0; | ||
>Named : Symbol(Named, Decl(three.d.ts, 0, 0), Decl(three.d.ts, 1, 13)) | ||
|
||
declare const Named: 0; | ||
>Named : Symbol(Named, Decl(three.d.ts, 0, 0), Decl(three.d.ts, 1, 13)) | ||
|
||
=== two.d.ts === | ||
export * as default from "./three"; | ||
>default : Symbol(default, Decl(two.d.ts, 0, 6)) | ||
|
||
=== one.ts === | ||
import ns from "./two"; | ||
>ns : Symbol(ns, Decl(one.ts, 0, 6)) | ||
|
||
type Alias = ns.Named; | ||
>Alias : Symbol(Alias, Decl(one.ts, 0, 23)) | ||
>ns : Symbol(ns, Decl(one.ts, 0, 6)) | ||
>Named : Symbol(ns.Named, Decl(three.d.ts, 0, 0), Decl(three.d.ts, 1, 13)) | ||
|
||
ns.Named; | ||
>ns.Named : Symbol(ns.Named, Decl(three.d.ts, 0, 0), Decl(three.d.ts, 1, 13)) | ||
>ns : Symbol(ns, Decl(one.ts, 0, 6)) | ||
>Named : Symbol(ns.Named, Decl(three.d.ts, 0, 0), Decl(three.d.ts, 1, 13)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//// [tests/cases/conformance/es2020/modules/exportAsNamespace5.ts] //// | ||
|
||
=== three.d.ts === | ||
export type Named = 0; | ||
>Named : 0 | ||
|
||
declare const Named: 0; | ||
>Named : 0 | ||
|
||
=== two.d.ts === | ||
export * as default from "./three"; | ||
>default : typeof import("three") | ||
|
||
=== one.ts === | ||
import ns from "./two"; | ||
>ns : typeof ns | ||
|
||
type Alias = ns.Named; | ||
>Alias : 0 | ||
>ns : any | ||
|
||
ns.Named; | ||
>ns.Named : 0 | ||
>ns : typeof ns | ||
>Named : 0 | ||
|
14 changes: 14 additions & 0 deletions
14
tests/cases/conformance/es2020/modules/exportAsNamespace5.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// @module: esnext | ||
// @moduleResolution: bundler | ||
|
||
// @filename: three.d.ts | ||
export type Named = 0; | ||
declare const Named: 0; | ||
|
||
// @filename: two.d.ts | ||
export * as default from "./three"; | ||
|
||
// @filename: one.ts | ||
import ns from "./two"; | ||
type Alias = ns.Named; | ||
ns.Named; |