mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-07 17:29:36 -05:00
fix(49449): change error location when passing objects/arrays to an argument of type (#49593)
This commit is contained in:
@@ -17840,7 +17840,7 @@ namespace ts {
|
||||
containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined,
|
||||
errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } | undefined
|
||||
) {
|
||||
if (target.flags & TypeFlags.Primitive) return false;
|
||||
if (target.flags & (TypeFlags.Primitive | TypeFlags.Never)) return false;
|
||||
if (isTupleLikeType(source)) {
|
||||
return elaborateElementwise(generateLimitedTupleElements(node, target), source, target, relation, containingMessageChain, errorOutputContainer);
|
||||
}
|
||||
@@ -17893,7 +17893,7 @@ namespace ts {
|
||||
containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined,
|
||||
errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } | undefined
|
||||
) {
|
||||
if (target.flags & TypeFlags.Primitive) return false;
|
||||
if (target.flags & (TypeFlags.Primitive | TypeFlags.Never)) return false;
|
||||
return elaborateElementwise(generateObjectLiteralElements(node), source, target, relation, containingMessageChain, errorOutputContainer);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user