Closed
Description
TypeScript Version: 3.9.0-dev.20200222
Search Terms: export type * as namespace
Code
// provider.ts
export const foo = 42;
export interface Bar {};
// index1.ts
import type * as A from './provider';
export { A };
// index2.ts
export type * as A from './provider';
// 1.ts
import { A } from './index1';
const foo = A.foo;
type Bar = A.Bar;
// 2.ts
import { A } from './index2';
const foo = A.foo; // **expected an error, but succeed.**
type Bar = 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: