Mapped type reported as incompatible when passed through another mapped type (5.4 regression) #58060
Labels
Bug
A bug in TypeScript
Fix Available
A PR has been opened for this issue
Recent Regression
This is a new regression just found in the last major/minor version of TypeScript.
Milestone
Uh oh!
There was an error while loading. Please reload this page.
π Search Terms
mapped type assignability regression
π Version & Regression Information
β― Playground Link
Playground Link
π» Code
π Actual behavior
Test<Identity<UnboxArray<T>>>
is being reported as an error becauseIdentity<UnboxArray<T>>
is not assignable to the constraint ofTest
. Even more strange the error elaboration saysType 'Box<string>' is not assignable to type 'string'
which is strange since the type that comes out ofUnboxArray<T>
can't haveBox<string>
as an item type. If we don't pass the type though theIdentity
mapped type, thenUnboxArray<T>
is assignable toValueType[]
.π Expected behavior
Test<Identity<UnboxArray<T>>>
should not be an error as it is in 5.3Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: