mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-19 22:07:42 -05:00
Use constraint for default default value if possible (#28222)
This commit is contained in:
@@ -7653,7 +7653,7 @@ namespace ts {
|
||||
// If a type parameter does not have a default type, or if the default type
|
||||
// is a forward reference, the empty object type is used.
|
||||
for (let i = numTypeArguments; i < numTypeParameters; i++) {
|
||||
result[i] = getDefaultTypeArgumentType(isJavaScriptImplicitAny);
|
||||
result[i] = getConstraintFromTypeParameter(typeParameters![i]) || getDefaultTypeArgumentType(isJavaScriptImplicitAny);
|
||||
}
|
||||
for (let i = numTypeArguments; i < numTypeParameters; i++) {
|
||||
const mapper = createTypeMapper(typeParameters!, result);
|
||||
|
||||
Reference in New Issue
Block a user