fix(library): correct type inference in ArgsAction
#976
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Actually, I found that
type Output = v.InferOutput<typeof ComplexSchema>
will be deduced as:Is this the expected behavior? Is there a problem with my writing for the
args_0
of theargsWithFn
?Originally posted by @shulaoda in #968 (comment)
The second generic of
BaseTransformation
should beInferOutput<...>
.Playground: https://valibot.dev/playground/?code=JYWwDg9gTgLgBAKjgQwM5wG5wGZQiOAcg2QBtgAjCGQgbgCh6BjCAO1XgGF8xSBTAB4BlJgAs+IZHAC8mAHQcowJjADyFAFZ8VACgDe9ODlYAueWGBg+Ow0fnYArqxXA2OgJQAaW0YxzkUADmqDp+MA681gDaforArIEeALruXj7yUHzhUOyhclQQ-MisHmlGZShBqADqwDCiAGKm5pbW6X6OzjCuJRW+-lU2dnZhEfw6UenDfhZWQ8MLHU4ubn0L-QHBeeGRE34FRb0pa+t+mdm5sTBKCaXe6+X3CylPj+1y5w45IVc3ialPNIAX3cDHoMAAnlY4KoHDAwHCZPIAJKsbB8KCw+FwgA8kKsEGwcG44H4wjEEmQAD4wSx2PAIHCETAzFjmUiDEZsM0dJszHEEu4ZFS4Ho4J8cnB8XxCZVAjJpLJCALAoQ4ECnpsanVGjzuWZeUEzAc+MUhdIRSrzSKxRLWMYdNgyKg+EKgfR3cw2KhCnw5KQIIlGdiYO56EA