-
Notifications
You must be signed in to change notification settings - Fork 13k
Open
Labels
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
Bug Report
You can destructure or use bracket notation on never
type, but you can't access props using the dot notation. It should disallow all forms of property access.
🔎 Search Terms
never destructuring destructure bracket dot notation
🕗 Version & Regression Information
⏯ Playground Link
🙁 Actual behavior
const { prop } = ({} as never); // does not error
const prop2 = ({} as never)["prop"]; // does not error
🙂 Expected behavior
TS should not allow this, same as you can't access props using the dot notation:
const prop = ({} as never).prop; // error
jarrodldavis, A1yks, richardsimko, RobertBorg, ajmeese7 and 6 more
Metadata
Metadata
Assignees
Labels
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScriptAn idea for TypeScript