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

Method SignatureEquals

common/decls/decls.go:762–776  ·  view source on GitHub ↗

SignatureEquals determines whether the incoming overload declaration signature is equal to the current signature. Result type, operand trait, and strict-ness are not considered as part of signature equality.

(other *OverloadDecl)

Source from the content-addressed store, hash-verified

760//
761// Result type, operand trait, and strict-ness are not considered as part of signature equality.
762func (o *OverloadDecl) SignatureEquals(other *OverloadDecl) bool {
763 if o == other {
764 return true
765 }
766 if o.ID() != other.ID() || o.IsMemberFunction() != other.IsMemberFunction() || len(o.ArgTypes()) != len(other.ArgTypes()) {
767 return false
768 }
769 for i, at := range o.ArgTypes() {
770 oat := other.ArgTypes()[i]
771 if !at.IsEquivalentType(oat) {
772 return false
773 }
774 }
775 return o.ResultType().IsEquivalentType(other.ResultType())
776}
777
778// SignatureOverlaps indicates whether two functions have non-equal, but overloapping function signatures.
779//

Callers 1

AddOverloadMethod · 0.80

Calls 7

IDMethod · 0.95
IsMemberFunctionMethod · 0.95
ArgTypesMethod · 0.95
ResultTypeMethod · 0.95
IsEquivalentTypeMethod · 0.80
IDMethod · 0.65
IsMemberFunctionMethod · 0.65

Tested by

no test coverage detected