-
Notifications
You must be signed in to change notification settings - Fork 228
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
Support custom overloads for standard operators. #252
Comments
The custom overloads are actually supported. The issue is actually in how they're resolved across declaration scopes. |
Any updates on this? I'm attempting to overload the 'add' operator however it's giving me an overlapping overloads error. |
No updates at this time, other priorities have come up that need attention, but I hope to be able to focus on this again in the future. |
The interest for this feature is growing 😄 |
It would actually appear as though this feature is working just fine from the declaration side, but is problematic from the runtime function registration side. This issue is closed and work toward fixes for evaluation dispatch will take place in #493. |
Is there documentation around overloading standard operators? This comment seemed to indicate some changes were needed for the standard operators
Then there's this PR #747 which has this in the description:
Is it still impossible to overload |
Feature request checklist
Change
The CEL standard environment declares function overloads for operators and built-in functions such as the type-conversion function
timestamp(<val>)
. To assist with extensions to the built-in operators and helper functions, it should be possible to add an overload to the existing set without overriding all overloads.Example
Desired behavior, add a new overload to an existing function:
Current behavior, replace the existing function with all current functions plus the custom one:
** Alternative Considered **
Alternatively, such overloads could be added at a function level, though the
cel.Declarations
functional option is the preferred way to specify declarations and there really shouldn't be two ways to do the same thing.A refinement on the approach would be to expose helper functions for creating the new functions and overloads.
The text was updated successfully, but these errors were encountered: