MCPcopy Create free account
hub / github.com/cel-expr/cel-go / SignatureOverlaps

Method SignatureOverlaps

common/decls/decls.go:737–749  ·  view source on GitHub ↗

SignatureOverlaps indicates whether two functions have non-equal, but overloapping function signatures. For example, list(dyn) collides with list(string) since the 'dyn' type can contain a 'string' type.

(other *OverloadDecl)

Source from the content-addressed store, hash-verified

735//
736// For example, list(dyn) collides with list(string) since the 'dyn' type can contain a 'string' type.
737func (o *OverloadDecl) SignatureOverlaps(other *OverloadDecl) bool {
738 if o.IsMemberFunction() != other.IsMemberFunction() || len(o.ArgTypes()) != len(other.ArgTypes()) {
739 return false
740 }
741 argsOverlap := true
742 for i, argType := range o.ArgTypes() {
743 otherArgType := other.ArgTypes()[i]
744 argsOverlap = argsOverlap &&
745 (argType.IsAssignableType(otherArgType) ||
746 otherArgType.IsAssignableType(argType))
747 }
748 return argsOverlap
749}
750
751// HasBinding indicates whether the overload already has a definition.
752func (o *OverloadDecl) HasBinding() bool {

Callers 1

AddOverloadMethod · 0.80

Calls 4

IsMemberFunctionMethod · 0.95
ArgTypesMethod · 0.95
IsAssignableTypeMethod · 0.80
IsMemberFunctionMethod · 0.65

Tested by

no test coverage detected