Skip to content

Renaming namespace with const enum doesn't update enum references #61258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
xiaoxiyao opened this issue Feb 24, 2025 · 0 comments Β· Fixed by #61263
Closed

Renaming namespace with const enum doesn't update enum references #61258

xiaoxiyao opened this issue Feb 24, 2025 · 0 comments Β· Fixed by #61263
Labels
Bug A bug in TypeScript Help Wanted You can do this
Milestone

Comments

@xiaoxiyao
Copy link

πŸ”Ž Search Terms

"rename namespace const enum","const enum in namespace"

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about "enum"

⏯ Playground Link

https://www.typescriptlang.org/play/?#code/PTAECcFMDsEMFtKgC4AsCWBnUdGYA6wDGkAULpAcUspcqAN6miiQAe+A9uPUZ9JnowArvFABRRsxagAgqAC8oAOSxl0gL6ktpPgPqwAXCjoA6SUtqDzp2QG4gA

πŸ’» Code

// rename this namespace
namespace test {
  export const enum E {
    A = 'a'
  }
}

const a: test.E = test.E.A;

πŸ™ Actual behavior

Rename test to test1 via "Rename Symbol" or "F2".

// rename this namespace
namespace test1 {
  export const enum E {
    A = 'a'
  }
}

const a: test1.E = test.E.A; // this value remains unchanged

πŸ™‚ Expected behavior

// rename this namespace
namespace test1 {
  export const enum E {
    A = 'a'
  }
}

const a: test1.E = test1.E.A;

Additional information about the issue

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Help Wanted You can do this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants