pulumi/pkg/codegen/hcl2/model
Will Jones cee6e49bf8
Clean up and test PCL object type annotations
In our model of PCL based on HCL syntax, we define a number of types
according to Pulumi's type system. Among these is `ObjectType`, the type
of objects of the form `{ k_1: t_1, ..., k_n: t_n }`, where each key
`k_i` maps to a nested type `t_i`. Object types crop up all over the
place -- as sets of resource input properties, resource outputs
themselves, and as arguments to function calls, for instance.

Because object types are so prevalent, it is often useful to be able to
link them to metadata about their intended use. For instance, in code
generation, we might like to know if an object type corresponds to a
"bare" object literal or an instance of some named class. To this end,
object types support _annotations_, and such annotations are used in
e.g. .Net and Python codegen as hinted above.

In preparation for making wider use of annotations (e.g. for adding
`call` to PCL, which requires us to know about expressions' linked
resource types), this change cleans up the interface for working with
annotations and adds a number of test cases. Additionally, code that is
likely currently brittle due to only checking the first of a set of
annotations (see the various uses of `[0]` in the diff) has been made
more robust, possibly fixing some rare bugs/edge cases.

Working towards closing pulumi/pulumi-java#262
2025-01-10 16:58:48 +00:00
..
format all: Assert => Assertf 2023-03-03 14:37:43 -08:00
pretty Enable perfsprint linter (#14813) 2023-12-12 12:19:42 +00:00
attribute.go Do not panic when PCL attribute type or PCL resource variable type isn't fully bound 2023-04-12 18:19:57 +02:00
binder_expression.go [go/conformance] Fix l2-resource-primitives test (#17332) 2024-09-26 05:15:38 +00:00
binder_expression_test.go ci: radical idea - what if slow tests & no stdout makes GH consider runner dead? 2022-03-06 14:52:13 -08:00
block.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
body.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
diagnostics.go Prepare golangci-lint upgrade (#17065) 2024-08-28 07:57:38 +00:00
expression.go Enable perfsprint linter (#14813) 2023-12-12 12:19:42 +00:00
functions.go Initial implementation of simplified invokes for dotnet and nodejs 2023-01-11 14:17:14 -08:00
print_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
printer.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
scope.go chore: fix some function names (#17128) 2024-09-03 08:57:30 +00:00
traversable.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
type.go Fix stack overflow panic when pretty printing recursive types 2023-05-11 16:28:16 +02:00
type_collection.go chore: fix some function names (#17128) 2024-09-03 08:57:30 +00:00
type_const.go Enable perfsprint linter (#14813) 2023-12-12 12:19:42 +00:00
type_enum.go Fix stack overflow panic when pretty printing recursive types 2023-05-11 16:28:16 +02:00
type_eventuals.go [program-gen] Fix stack overflow when binding invoke that resolves to promise (#15463) 2024-02-20 15:49:08 +00:00
type_list.go Fix stack overflow panic when pretty printing recursive types 2023-05-11 16:28:16 +02:00
type_map.go Fix stack overflow panic when pretty printing recursive types 2023-05-11 16:28:16 +02:00
type_none.go Fix stack overflow panic when pretty printing recursive types 2023-05-11 16:28:16 +02:00
type_object.go Clean up and test PCL object type annotations 2025-01-10 16:58:48 +00:00
type_opaque.go turn on the golangci-lint exhaustive linter (#15028) 2024-01-17 16:50:41 +00:00
type_opaque_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
type_output.go Fix stack overflow panic when pretty printing recursive types 2023-05-11 16:28:16 +02:00
type_promise.go Fix stack overflow panic when pretty printing recursive types 2023-05-11 16:28:16 +02:00
type_scope.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
type_set.go Fix stack overflow panic when pretty printing recursive types 2023-05-11 16:28:16 +02:00
type_test.go Clean up and test PCL object type annotations 2025-01-10 16:58:48 +00:00
type_tuple.go Update golangci-lint (#17972) 2024-12-10 11:50:38 +00:00
type_union.go Use slice.Prealloc instead of make([]T, 0, ...) 2023-06-29 11:27:50 +01:00
type_union_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
utilities.go Use slice.Prealloc instead of make([]T, 0, ...) 2023-06-29 11:27:50 +01:00
visitor.go Use slice.Prealloc instead of make([]T, 0, ...) 2023-06-29 11:27:50 +01:00