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
r1 is inferred as unknown[] because a is unknown despite s being known. However, could we infer a from s and force the typechecker to insist a is a string?
Activity
sumneko commentedon Feb 6, 2023
I don't know how to design a strict rule.
lewis6991 commentedon Feb 6, 2023
Would that work?
sumneko commentedon Feb 6, 2023
I will try it, thank you.
itsfrank commentedon Dec 23, 2023
Interestingly, this does work as expected when using
list T[]instead oftable<any,T>(using version3.7.3)code:
Screenshots of inferred types
filtered array:

filter function param:
