-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
Experience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Description
🔎 Search Terms
type named undefined
🕗 Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ
⏯ Playground Link
💻 Code
namespace ns {
export type undefined = "";
export function x(p: undefined): undefined { // global undefined
}
}
function x(p: ns.undefined) { // undefined from the namespace
}🙁 Actual behavior
Inside the namespace undefined is the global undefined type. We can access the type if we qualify it with the namespace
🙂 Expected behavior
undefined should not be allowed as a type name. (null is not)
Additional information about the issue
No response
Metadata
Metadata
Assignees
Labels
Experience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsSuggestionAn idea for TypeScriptAn idea for TypeScript