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: A unary-test expression with ? returns true/false #959

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

saig0
Copy link
Member

@saig0 saig0 commented Dec 18, 2024

Description

The engine restricts the usage of ? to an unary-test expression. It is implemented by returning a ValFatalError when accessing ?. If the expression is a unary-test, it evaluates the expression again and assigns the input value to ?.

Previously, the engine invoked a function without checking the arguments before. As a result, a function with an Any parameter (e.g. list contains(list, any)) accepted a ValError/ValFatalError as a regular value and didn't forward the error.

Fix the issue by adding the validation of the arguments before invoking the function.

Related issues

closes camunda/camunda#26054

Add a test case to verify an unary-tests expression with the special variable `?` for a parameter with ANY type.
Check if a function argument is an error before invoking the function. Otherwise, the function may handle the argument not as an error but a regular value.
Move the function validation in the interpreter before invoking the function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEEL/DMN] A unary-test expression with ? returns null instead of true/false
1 participant