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

Method DeclarationIsEquivalent

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

1082
1083// DeclarationIsEquivalent returns true if one variable declaration has the same name and same type as the input.
1084func (v *VariableDecl) DeclarationIsEquivalent(other *VariableDecl) bool {
1085 if v == other {
1086 return true
1087 }
1088 return v.Name() == other.Name() && v.Type().IsEquivalentType(other.Type())
1089}
1090
1091// TypeVariable creates a new type identifier for use within a types.Provider
1092func 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