Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guard against empty inputs for objs expressions. #11311

Merged
merged 3 commits into from Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,4 @@
changes:
- type: fix
scope: pkg
description: Fix a panic in codegen for an edge case involving object expressions without corresponding function arguments.
4 changes: 3 additions & 1 deletion pkg/codegen/pcl/invoke.go
Expand Up @@ -150,7 +150,9 @@ func (b *binder) bindInvokeSignature(args []model.Expression) (model.StaticFunct

// annotate the input args on the expression with the input type of the function
if argsObject, isObjectExpression := args[1].(*model.ObjectConsExpression); isObjectExpression {
annotateObjectProperties(argsObject.Type(), fn.Inputs)
if fn.Inputs != nil {
annotateObjectProperties(argsObject.Type(), fn.Inputs)
}
}

return sig, nil
Expand Down