Bump cel-go to v0.11.2

This commit is contained in:
cici37
2022-05-04 18:32:06 -07:00
parent cb7beb5912
commit a86dd29157
83 changed files with 653 additions and 974 deletions

View File

@@ -53,6 +53,10 @@ const (
// Enable the use of cross-type numeric comparisons at the type-checker.
featureCrossTypeNumericComparisons
// Enable eager validation of declarations to ensure that Env values created
// with `Extend` inherit a validated list of declarations from the parent Env.
featureEagerlyValidateDeclarations
)
// EnvOption is a functional interface for configuring the environment.
@@ -103,6 +107,18 @@ func Declarations(decls ...*exprpb.Decl) EnvOption {
}
}
// EagerlyValidateDeclarations ensures that any collisions between configured declarations are caught
// at the time of the `NewEnv` call.
//
// Eagerly validating declarations is also useful for bootstrapping a base `cel.Env` value.
// Calls to base `Env.Extend()` will be significantly faster when declarations are eagerly validated
// as declarations will be collision-checked at most once and only incrementally by way of `Extend`
//
// Disabled by default as not all environments are used for type-checking.
func EagerlyValidateDeclarations(enabled bool) EnvOption {
return features(featureEagerlyValidateDeclarations, enabled)
}
// HomogeneousAggregateLiterals option ensures that list and map literal entry types must agree
// during type-checking.
//