Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix casts to scalars #5624

Merged
merged 5 commits into from Jun 9, 2023
Merged

Fix casts to scalars #5624

merged 5 commits into from Jun 9, 2023

Conversation

aljazerzen
Copy link
Contributor

@aljazerzen aljazerzen commented Jun 8, 2023

Closes #5616

We've had a codepath to fix this bug for enum already, but now I extended it to anything that:

  • is a scalar,
  • it not the top-most concrete base of itself,
  • is not an object (does not have a ir_set.path_id).

@aljazerzen aljazerzen requested a review from msullivan June 8, 2023 13:59
# here, where we have access to the enum type. Just turn
# it into json->str and str->enum.
# Casts from json to may have special handling.
# So we turn it into json->str and str->x.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to go through the scalar's base type, not always through str, I think

@aljazerzen aljazerzen requested a review from msullivan June 8, 2023 19:47
Copy link
Member

@msullivan msullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Thanks

@msullivan msullivan merged commit 7972b70 into master Jun 9, 2023
21 checks passed
@msullivan msullivan deleted the fix-scalar-constraints branch June 9, 2023 03:51
msullivan pushed a commit that referenced this pull request Jun 9, 2023
We've had a codepath to fix this bug for enum already, but now I extended it to anything that:

 * is a scalar,
 * it not the top-most concrete base of itself,

Closes #5616
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

casts from json to scalar subtypes don't check constraints
2 participants