Preserve type narrowing of readonly properties of classes for use in closures #57884
Closed
6 tasks done
Labels
Duplicate
An existing issue was already created
π Search Terms
flow typing, type narrowing, closures
β Viability Checklist
β Suggestion
Type narrowing of readonly properties of classes should be preserved in closures that are defined after the narrowing.
π Motivating Example
We use handler classes that capture events as member properties. When narrowing on the
this.event
member the narrowed type should be preserved when a closure is created that accesses that member.π» Use Cases
const
values or evenlet
values after their last assignment.The text was updated successfully, but these errors were encountered: