Skip to content
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

Type printing does not detect that a name is shadowed in the current scope #58456

Open
dragomirtitian opened this issue May 7, 2024 · 0 comments

Comments

@dragomirtitian
Copy link
Contributor

πŸ”Ž Search Terms

global shadowed declarations

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed

⏯ Playground Link

Playground Link

πŸ’» Code

// @strict: true
// @declaration: true
// @target: es2020

// @filename: a.ts
export const o = {[Symbol.iterator]: 1}

// @filename: b.ts

import { o } from "./a";
export class Symbol { }
export const g = o;

πŸ™ Actual behavior

The typeof of g is { [Symbol.iterator]: number; }. This leads to an incorrect declaration since Symbol is shadowed in the current scope

πŸ™‚ Expected behavior

The typeof of g is { [globalThis.Symbol.iterator]: number; }.

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
None yet
Projects
None yet
Development

No branches or pull requests

1 participant