diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 43410107c81..c97125386ac 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -1,4 +1,5 @@ ### Improvements -### Bug Fixes \ No newline at end of file +### Bug Fixes + - Fix emitting `PANIC` in generated programs when we don't have access to the schema of resource properties \ No newline at end of file diff --git a/pkg/codegen/java/gen_program.go b/pkg/codegen/java/gen_program.go index 271a0c77cf3..058b80df2bf 100644 --- a/pkg/codegen/java/gen_program.go +++ b/pkg/codegen/java/gen_program.go @@ -184,8 +184,9 @@ func GenerateProgram(program *pcl.Program) (map[string][]byte, hcl.Diagnostics, } g := &generator{ - program: program, - functionInvokes: map[string]*schema.Function{}, + program: program, + functionInvokes: map[string]*schema.Function{}, + currentResourcePropertyType: schema.AnyType, } g.Formatter = format.NewFormatter(g)