Skip to content

Commit 92b42ae

Browse files
committed
Merge remote-tracking branch 'origin/master' into move-test-proto-go-mod
2 parents ce9318c + 148d29d commit 92b42ae

File tree

5 files changed

+19
-55
lines changed

5 files changed

+19
-55
lines changed

WORKSPACE

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,9 @@ go_repository(
116116
version = "v4.13.0",
117117
)
118118

119-
# CEL Spec deps v0.15.0
120119
go_repository(
121120
name = "com_google_cel_spec",
122-
commit = "ae15d293dc49482180e967942612fb85e33bcde9",
121+
commit = "1bc3fb168317fa77d1227c52d0becbf2d358c023",
123122
importpath = "github.com/google/cel-spec",
124123
)
125124

cel/library.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ func optMap(meh MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *
403403
meh.NewList(),
404404
unusedIterVar,
405405
varName,
406-
meh.NewMemberCall(valueFunc, target),
406+
meh.NewMemberCall(valueFunc, meh.Copy(target)),
407407
meh.NewLiteral(types.False),
408408
meh.NewIdent(varName),
409409
mapExpr,
@@ -430,7 +430,7 @@ func optFlatMap(meh MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Exp
430430
meh.NewList(),
431431
unusedIterVar,
432432
varName,
433-
meh.NewMemberCall(valueFunc, target),
433+
meh.NewMemberCall(valueFunc, meh.Copy(target)),
434434
meh.NewLiteral(types.False),
435435
meh.NewIdent(varName),
436436
mapExpr,

conformance/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ ALL_TESTS = [
1111
"@com_google_cel_spec//tests/simple:testdata/logic.textproto",
1212
"@com_google_cel_spec//tests/simple:testdata/macros.textproto",
1313
"@com_google_cel_spec//tests/simple:testdata/namespace.textproto",
14+
"@com_google_cel_spec//tests/simple:testdata/optionals.textproto",
1415
"@com_google_cel_spec//tests/simple:testdata/parse.textproto",
1516
"@com_google_cel_spec//tests/simple:testdata/plumbing.textproto",
1617
"@com_google_cel_spec//tests/simple:testdata/proto2.textproto",

repl/appengine/web/package-lock.json

Lines changed: 11 additions & 50 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/server.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ func (s *ConformanceServer) Parse(ctx context.Context, in *confpb.ParseRequest)
4545
if in.DisableMacros {
4646
parseOptions = append(parseOptions, cel.ClearMacros())
4747
}
48+
parseOptions = append(parseOptions, cel.OptionalTypes())
4849
env, _ := cel.NewEnv(parseOptions...)
4950
past, iss := env.Parse(in.CelSource)
5051
resp := confpb.ParseResponse{}
@@ -75,6 +76,7 @@ func (s *ConformanceServer) Check(ctx context.Context, in *confpb.CheckRequest)
7576
checkOptions = append(checkOptions, cel.Declarations(in.TypeEnv...))
7677
checkOptions = append(checkOptions, cel.Types(&test2pb.TestAllTypes{}))
7778
checkOptions = append(checkOptions, cel.Types(&test3pb.TestAllTypes{}))
79+
checkOptions = append(checkOptions, cel.OptionalTypes())
7880
env, _ := cel.NewCustomEnv(checkOptions...)
7981

8082
// Check the expression.
@@ -254,5 +256,6 @@ var evalEnv *cel.Env
254256
func init() {
255257
evalEnv, _ = cel.NewEnv(
256258
cel.Types(&test2pb.TestAllTypes{}, &test3pb.TestAllTypes{}),
257-
cel.EagerlyValidateDeclarations(true))
259+
cel.EagerlyValidateDeclarations(true),
260+
cel.OptionalTypes())
258261
}

0 commit comments

Comments
 (0)