| 132 | } |
| 133 | |
| 134 | std::vector<cel::FunctionOverloadReference> Resolver::FindOverloads( |
| 135 | absl::string_view name, bool receiver_style, |
| 136 | const std::vector<cel::Kind>& types, int64_t expr_id) const { |
| 137 | // Resolve the fully qualified names and then search the function registry |
| 138 | // for possible matches. |
| 139 | std::vector<cel::FunctionOverloadReference> funcs; |
| 140 | auto names = FullyQualifiedNames(name, expr_id); |
| 141 | for (auto it = names.begin(); it != names.end(); it++) { |
| 142 | // Only one set of overloads is returned along the namespace hierarchy as |
| 143 | // the function name resolution follows the same behavior as variable name |
| 144 | // resolution, meaning the most specific definition wins. This is different |
| 145 | // from how C++ namespaces work, as they will accumulate the overload set |
| 146 | // over the namespace hierarchy. |
| 147 | funcs = function_registry_.FindStaticOverloads(*it, receiver_style, types); |
| 148 | if (!funcs.empty()) { |
| 149 | return funcs; |
| 150 | } |
| 151 | } |
| 152 | return funcs; |
| 153 | } |
| 154 | |
| 155 | std::vector<cel::FunctionOverloadReference> Resolver::FindOverloads( |
| 156 | absl::string_view name, bool receiver_style, size_t arity, |