MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / FindOverloads

Method FindOverloads

eval/compiler/resolver.cc:134–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132}
133
134std::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
155std::vector<cel::FunctionOverloadReference> Resolver::FindOverloads(
156 absl::string_view name, bool receiver_style, size_t arity,

Callers 5

FlatExprVisitorMethod · 0.45
IsConstExprFunction · 0.45
TEST_FFunction · 0.45
OverloadExistsFunction · 0.45

Calls 5

beginMethod · 0.45
endMethod · 0.45
FindStaticOverloadsMethod · 0.45
emptyMethod · 0.45

Tested by 1

TEST_FFunction · 0.36