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

Return type of function incorrectly resolved #6387

Open
overlookmotel opened this issue Oct 9, 2024 · 0 comments · May be fixed by #6388
Open

Return type of function incorrectly resolved #6387

overlookmotel opened this issue Oct 9, 2024 · 0 comments · May be fixed by #6388
Assignees
Labels
A-semantic Area - Semantic C-bug Category - Bug

Comments

@overlookmotel
Copy link
Collaborator

export type T = number;

function foo(n: number): T {
  type T = string;
  return n;
}

T in return type of foo should resolve to top level export type T, but instead gets resolved to type T inside the function body. Oxc Playground

TypeScript resolves it to the top-level T. TS Playground. If it was resolving to type T, the code would fail type check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-semantic Area - Semantic C-bug Category - Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants