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

Method SignatureEquals

common/decls/decls.go:718–732  ·  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

716//
717// Result type, operand trait, and strict-ness are not considered as part of signature equality.
718func (o *OverloadDecl) SignatureEquals(other *OverloadDecl) bool {
719 if o == other {
720 return true
721 }
722 if o.ID() != other.ID() || o.IsMemberFunction() != other.IsMemberFunction() || len(o.ArgTypes()) != len(other.ArgTypes()) {
723 return false
724 }
725 for i, at := range o.ArgTypes() {
726 oat := other.ArgTypes()[i]
727 if !at.IsEquivalentType(oat) {
728 return false
729 }
730 }
731 return o.ResultType().IsEquivalentType(other.ResultType())
732}
733
734// SignatureOverlaps indicates whether two functions have non-equal, but overloapping function signatures.
735//

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