You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
guess_coerce_type's result was overwriting @coerce_type in place, so type: Array + values: [...] param coerced at runtime using the guessed element type instead of Array — rejecting valid array input and duplicating the values error on invalid input.
The guessed type is now only used locally for the existing declaration-time validate_value_coercion check, never for coerce_options.
schinery
changed the title
Fix type: Array + scalar values: coercing to the guessed element type instead of Array
Fix type: Array + values: [...] coercing to the guessed element type instead of Array
Jul 23, 2026
👋 @schinery I think the local guessed_coerce_type will always have the same result overtime since its value is based on previously initialized ivar and not any runtime values. Maybe we could add a @guessed_coerce_type in the initialize so we would have the original @coerce_type and the "guessed" one. Wdyt ?
@ericproulx yeah good point. I've added @guessed_coerce_type into the initialize so it's computed once alongside @coerce_type rather than recomputed as a local inside validate! as well as an additional spec in 888cab8
@ericproulx yeah good point. I've added @guessed_coerce_type into the initialize so it's computed once alongside @coerce_type rather than recomputed as a local inside validate! as well as an additional spec in 888cab8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
guess_coerce_type's result was overwriting@coerce_typein place, sotype: Array+values: [...]param coerced at runtime using the guessed element type instead ofArray— rejecting valid array input and duplicating thevalueserror on invalid input.The guessed type is now only used locally for the existing declaration-time
validate_value_coercioncheck, never forcoerce_options.Fixes #2812.