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

bug[next]: fix lowering of astype on tuples containing scalars #1642

Merged
merged 3 commits into from
Sep 17, 2024

Conversation

havogt
Copy link
Contributor

@havogt havogt commented Sep 16, 2024

The unpacked tuple will contain as_fieldoped cast_s for fields, but direct cast_s for scalars.

Note: A similar change is not needed for where which also works on tuples in the true and false branches. The reason is that mask is required to be a Field, therefore true and false are promoted to Fields, too.

@@ -102,6 +102,7 @@ def process_elements(
process_func: Callable[..., itir.Expr],
objs: itir.Expr | Iterable[itir.Expr],
current_el_type: ts.TypeSpec,
with_type: bool = False,
Copy link
Contributor

Choose a reason for hiding this comment

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

Update to the docstring is missing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@havogt havogt merged commit 394868a into GridTools:main Sep 17, 2024
31 checks passed
@havogt havogt deleted the gtir_as_type_on_tuples branch September 17, 2024 11:29
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.

2 participants