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
Cannot use mapped types to create new mapped types #48246
This looks strange to me too - especially given that this worked before. As a temporary workaround you can use a Prop helper, like here.
What I've also noticed is that when indexing this BarLookup[K][/*HERE*/] we get string methods in the autocomplete as if would think that the type of BarLookup[K] is a string or something
This and #48157 are caused by the same core issue. We need to exclude mapped types with optionality modifiers and/or as clauses from the new constraint logic introduced in #47370.
Activity
Andarist commentedon Mar 14, 2022
This looks strange to me too - especially given that this worked before. As a temporary workaround you can use a
Prophelper, like here.What I've also noticed is that when indexing this
BarLookup[K][/*HERE*/]we get string methods in the autocomplete as if would think that the type ofBarLookup[K]is a string or somethingRyanCavanaugh commentedon Mar 14, 2022
Bisected to #47370
ahejlsberg commentedon Mar 15, 2022
This and #48157 are caused by the same core issue. We need to exclude mapped types with optionality modifiers and/or
asclauses from the new constraint logic introduced in #47370.