File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -74,9 +74,17 @@ type ArrayLikeTestType = {
7474 [ index : number ] : string ;
7575} ;
7676
77+ type PlainObjectTestType = {
78+ readonly [ key : string ] : number | undefined ;
79+ } ;
80+
7781expectType < ArrayLikeTestType > ( { } as UnwrapPartial < Partial < ArrayLikeTestType > > ) ;
82+ expectType < PlainObjectTestType > ( { } as UnwrapPartial < PlainObjectTestType > ) ;
7883expectType < Record < number , string > > ( { } as UnwrapPartial < Partial < Record < number , string > > > ) ;
7984expectType < string [ ] > ( { } as UnwrapPartial < Partial < string [ ] > > ) ;
85+ expectType < Array < string | undefined > > ( { } as UnwrapPartial < Array < string | undefined > > ) ;
86+ expectNever ( { } as UnwrapPartial < string [ ] > ) ;
87+ expectNever ( { } as UnwrapPartial < { [ p : string ] : number } > ) ;
8088
8189// `UnwrapPartial` works with tuples
8290type TestTuple = [ string , number , boolean ] ;
You can’t perform that action at this time.
0 commit comments