Skip to content

"export type * as namespace" also exports value #36966

Description

@whzx5byb

TypeScript Version: 3.9.0-dev.20200222

Search Terms: export type * as namespace

Code

// provider.tsexportconstfoo=42;exportinterfaceBar{};
// index1.tsimporttype*asAfrom'./provider';export{A};
// index2.tsexporttype*asAfrom'./provider';
// 1.tsimport{A}from'./index1';constfoo=A.foo;typeBar=A.Bar;
// 2.tsimport{A}from'./index2';constfoo=A.foo;// **expected an error, but succeed.**typeBar=A.Bar;

Expected behavior:
index1.ts and index2.ts should have the same behaviour: export a namespace which only contain types, and the assignment to foo should result in an error.

Actual behavior:
In index2.ts the assignment succeed.

Playground Link:

Related Issues:

Metadata

Metadata

Labels

BugA bug in TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions