fix(experimental): widen var-bound inputs from parent scope and customize - #203
Conversation
…mize Used endpoints defined against a base var should pick up later parent-mounted v.extend and customize shadows at both the type and validation layers.
commit: |
|
| * top level; a var used as a field widens that field. `unknown` when | ||
| * nothing applies. | ||
| */ | ||
| export type InputVarExtra<PL, I> = I extends { |
There was a problem hiding this comment.
Replacement shadows become intersections
When a mounted var and its same-name customized re-export use replace to remove a field or change its type, VarArgsInScope and VarValuesInScope intersect both declarations instead of applying shadow precedence. For example, replacing { id: string } with { id: number } produces { id: never } at the call site and in c.input, while runtime applies both schemas in module order, rejecting valid customized calls or producing values that disagree with the declared type.
Used endpoints defined against a base var should pick up later parent-mounted v.extend and customize shadows at both the type and validation layers.