Closed
Description
Bug Report
TypeScript usually allows exporting values and types with the same name.
// a.ts
export const a = 1
export type a = string
But it doesn't work when re-exporting a type from a third-party library and exporting an arbitrary value at the same time.
// b.ts
export const a = 1
export type { a } from './a'
🔎 Search Terms
export type re-export error
🕗 Version & Regression Information
- Bug present in 4.1.3
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about re-export
⏯ Playground Link
https://codesandbox.io/s/misty-field-16f9f?file=/src/index.ts
💻 Code
export type { A } from "./a";
export const A = Symbol("A");
🙁 Actual behavior
Error:
Cannot redeclare exported variable 'A'. ts(2323)
🙂 Expected behavior
I would expect this to work since the re-exported name is purely a type.