fix(types): backport fix for withDefaults
when used together with generics
#13223
+72
−21
withDefaults
when used together with generics
#13223