Skip to content

refactor[cartesian]: Proper error messaging for functions in ifs#2023

Merged
romanc merged 2 commits into
GridTools:mainfrom
twicki:warn_function_ifs
May 8, 2025
Merged

refactor[cartesian]: Proper error messaging for functions in ifs#2023
romanc merged 2 commits into
GridTools:mainfrom
twicki:warn_function_ifs

Conversation

@twicki
Copy link
Copy Markdown
Contributor

@twicki twicki commented May 8, 2025

Description

It is currently illegal to use a function in a conditions of an if. This is due to the inliner not being able to do that properly.
Right now, this leads to a non-descriptive KeyError that is changed to a meaningful error message here.

Requirements

  • All fixes and/or new features come with corresponding tests.

@twicki twicki requested a review from romanc May 8, 2025 09:08
@romanc
Copy link
Copy Markdown
Contributor

romanc commented May 8, 2025

cscs-ci run

Copy link
Copy Markdown
Contributor

@romanc romanc left a comment

Choose a reason for hiding this comment

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

LGTM!

@romanc
Copy link
Copy Markdown
Contributor

romanc commented May 8, 2025

cscs-ci run

1 similar comment
@romanc
Copy link
Copy Markdown
Contributor

romanc commented May 8, 2025

cscs-ci run

@romanc romanc merged commit 476897a into GridTools:main May 8, 2025
31 checks passed
@romanc
Copy link
Copy Markdown
Contributor

romanc commented May 8, 2025

FYI @FlorianDeconinck as discussed yesterday

@romanc romanc deleted the warn_function_ifs branch May 8, 2025 11:53
stubbiali pushed a commit to stubbiali/gt4py that referenced this pull request Aug 19, 2025
…dTools#2023)

## Description

It is currently illegal to use a function in a conditions of an if. This
is due to the inliner not being able to do that properly.
Right now, this leads to a non-descriptive `KeyError` that is changed to
a meaningful error message here.

## Requirements

- [x] All fixes and/or new features come with corresponding tests.
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