You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Weird uninitialized variable error for destructured members of type parameter constrained to homomorphic mapped type where member is declared optional #20994
interfaceOptions{a?: number|object;b: ()=>void;}classC<TextendsOptions>{foo!: {[PinkeyofT]: T[P]}method(){let{ a, b }=this.foo;!(a&&b)a// TypeScript issues an error on 'a' above:// Variable 'a' is used before being assigned.'}}
Activity
rozzzly commentedon Jan 4, 2018
Daniel Rosenwasser (@DanielRosenwasser)
Is the
!:some new/obscure syntax I'm not aware of? Or just a typo?ahejlsberg commentedon Jan 4, 2018
Patrick Lienau (@rozzzly) See #20166.
sandersn commentedon Jan 19, 2018
Should be fixed #20995