- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.1k
Open
Labels
Design NotesNotes from our design meetingsNotes from our design meetings
Description
PR: error on variables that are used but never initialized
- new error on variable declaration when a use occurs inside a block scope
- the reason we don't previously error is we can't see the whole control flow graph—we only error in cases where a control flow walk produces certainty that there's no initialization
- the strategy in the PR is to walk the whole AST and error if there are no assignments anywhere
- implementation isn't quite right
- leverages the unused variable code, but maybe should be in control flow instead,
- errors would occur on use sites instead of declaration
- counterpoint: the fix is going to be at the declaration
- countercounterpoint: sure, but then you just go-to-def. It's a little harder to go to the references that are causing the error
 
- introduces an extra property on symbols, memory hit, 0.5% time increase as-is, possibly unavoidable but maybe some is due to the extra property
 
- next steps: pass on feedback
- add some code in checkIdentifier
- do some stuff with isPastLastAssignment
 
Metadata
Metadata
Assignees
Labels
Design NotesNotes from our design meetingsNotes from our design meetings