Skip to content

Commit 107ab5c

Browse files
authored
Fix loading field message when dependency is more than one step (#54)
Fixes the problem where you would get ``` compilation error: failed to compile expression api.source_context.file_name: ERROR: <input>:1:4: unexpected failed resolution of 'google.protobuf.SourceContext' | has(this.source_context.file_name) | ...^ ``` for the example added.
1 parent bfb9d45 commit 107ab5c

File tree

4 files changed

+252
-149
lines changed

4 files changed

+252
-149
lines changed

internal/evaluator/builder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ func (bldr *Builder) processFieldExpressions(
268268
var opts []cel.EnvOption
269269
if fieldDesc.Kind() == protoreflect.MessageKind {
270270
opts = []cel.EnvOption{
271-
cel.TypeDescs(fieldDesc.Message().ParentFile()),
271+
cel.Types(dynamicpb.NewMessage(fieldDesc.Message())),
272272
cel.Variable("this", cel.ObjectType(string(fieldDesc.Message().FullName()))),
273273
}
274274
} else {

0 commit comments

Comments
 (0)