-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Closed
Copy link
Labels
Domain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallyDomain: This-TypingThe issue relates to providing types to thisThe issue relates to providing types to thisIn DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScriptcheckJsRelates to checking JavaScript using TypeScriptRelates to checking JavaScript using TypeScript
Milestone
Description
Based on discussion in #37827, we could further improve typing of this-property assignments if we used autoType
whenever we can't tell what type they should have.
This has three open questions:
- Performance.
- Is there benefit in real code? This only helps if (1) we aren't getting the right type some of time where (2) the auto type would get the right type. This is likely to be when a property is used repeatedly in a long method.
- What changes are actually needed. Just returning autoType doesn't work, because control flow narrowing doesn't seem to track this-property assignments as references.
Metadata
Metadata
Assignees
Labels
Domain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallyDomain: This-TypingThe issue relates to providing types to thisThe issue relates to providing types to thisIn DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScriptcheckJsRelates to checking JavaScript using TypeScriptRelates to checking JavaScript using TypeScript