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

Method DeclarationIsEquivalent

common/decls/decls.go:1094–1099  ·  view source on GitHub ↗

DeclarationIsEquivalent returns true if one variable declaration has the same name and same type as the input.

(other *VariableDecl)

Source from the content-addressed store, hash-verified

1092
1093// DeclarationIsEquivalent returns true if one variable declaration has the same name and same type as the input.
1094func (v *VariableDecl) DeclarationIsEquivalent(other *VariableDecl) bool {
1095 if v == other {
1096 return true
1097 }
1098 return v.Name() == other.Name() && v.Type().IsEquivalentType(other.Type())
1099}
1100
1101// TypeVariable creates a new type identifier for use within a types.Provider
1102func TypeVariable(t *types.Type) *VariableDecl {

Callers 5

addIdentMethod · 0.80
TestNewVariableFunction · 0.80
TestNewConstantFunction · 0.80
TestTypeVariableFunction · 0.80

Calls 5

NameMethod · 0.95
TypeMethod · 0.95
IsEquivalentTypeMethod · 0.80
NameMethod · 0.65
TypeMethod · 0.65

Tested by 4

TestNewVariableFunction · 0.64
TestNewConstantFunction · 0.64
TestTypeVariableFunction · 0.64