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

Method DeclarationIsEquivalent

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

1180
1181// DeclarationIsEquivalent returns true if one variable declaration has the same name and same type as the input.
1182func (v *VariableDecl) DeclarationIsEquivalent(other *VariableDecl) bool {
1183 if v == other {
1184 return true
1185 }
1186 return v.Name() == other.Name() && v.Type().IsEquivalentType(other.Type())
1187}
1188
1189// TypeVariable creates a new type identifier for use within a types.Provider
1190func 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