Support non-overlapping overload dispatch using function
cel-go allows for dispatch either by function name or overload ID. For example, given
cel.Declarations(
decls.NewFunction("isSorted",
decls.NewParameterizedInstanceOverload("list_a_is_sorted_bool",
[]*exprpb.Type{decls.NewListType(paramA)},
decls.Bool, typeParamAList),
),
What works:
CEL will dispatch to functions.Overload{Operator: "list_a_is_sorted_bool"...} if it is declared in ProgramOptions otherwise it will dispatch to "isSorted".
What doesn't work:
If two cel.Functions() are registered that both declare "isSorted", CEL will report that the function name is already in use when the 2nd Functions are registered.
Proposal: If the two Functions declare non-overlapping overloads, allow them both to be registered using function name.
This has been updated for all extension functions, but has yet to be implemented for all of the standard operators, including type conversion methods which I think are essential for ensuring that non-standard types can be converted into standard ones.