-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
In DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
TypeScript Version: 3.2.1
Search Terms:
Code
class C {
a = (() => this.b)();
b = '';
}Expected behavior:
Error Property 'b' is used before its initialization.
Control flow analysis inlines IIFEs, but it seems the use-before-declare check doesn't.
Actual behavior:
No error
Playground Link: https://agentcooper.github.io/typescript-play/#code/MYGwhgzhAEDC0G8BQ1XTNAvNAFDglFgHzQAuAFgJYQB0ARvgQNwpp1bQDknLAvkA
Related Issues: Found while investigating #29125
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
In DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript