Fix label names when internalSignature has optional params#1615
Fix label names when internalSignature has optional params#1615aswinsvijay wants to merge 1 commit intoarktypeio:mainfrom
internalSignature has optional params#1615Conversation
|
Reviewed PR #1615 — approved. The one-line fix correctly wraps Task list (5/5 completed)
|
There was a problem hiding this comment.
Reviewed — no issues found.
The fix is correct: Required<Parameters<internalSignature>> ensures the labels tuple passed to applyElementLabels is always fully required, which is the right semantics since parameter optionality in the external signature is determined by distill.In<paramsT> (the first arg), not the implementation's parameter declarations. The recursive [unknown, ...infer labelsTail] destructuring in applyElementLabels can break when the labels tuple has optional elements — this cleanly prevents that.
There was a problem hiding this comment.
Reviewed — no issues found.
The fix is correct: Required<Parameters<internalSignature>> ensures the labels tuple passed to applyElementLabels is always fully required, which is the right semantics since parameter optionality in the external signature is determined by distill.In<paramsT> (the first arg), not the implementation's parameter declarations. The recursive [unknown, ...infer labelsTail] destructuring in applyElementLabels can break when the labels tuple has optional elements — this cleanly prevents that.
internalSignature has optional paramsinternalSignature has optional params

Fixes #1614
mainbranchpnpm prCheckslocallyUnsure how this can be tested since tuple labels are not part of the type system.