pulumi/pkg/codegen/python
Pat Gavlin 0a45f8d3ab
[codegen/go] Rewrite cyclic types. (#8049)
When computing the type name for a field of an object type, we must
ensure that we do not generate invalid recursive struct types. A struct
type T contains invalid recursion if the closure of its fields and its
struct-typed fields' fields includes a field of type T. A few examples:

Directly invalid:

    type T struct { Invalid T }

Indirectly invalid:

    type T struct { Invalid S }

    type S struct { Invalid T }

In order to avoid generating invalid struct types, we replace all
references to types involved in a cyclical definition with *T. The
examples above therefore become:

(1) type T struct { Valid *T }

(2) type T struct { Valid *S }

    type S struct { Valid *T }

We do this using a rewriter that turns all fields involved in reference
cycles into optional fields.

These changes also include an enhancement to the SDK codegen test
driver in the interest of making iterating and debugging more convenient:  if the -sdk.no-checks flag is passed, the driver will not run post-generation checks.
2021-09-28 07:33:14 -07:00
..
.gitignore Simplify output-funcs codegen test (#8039) 2021-09-23 13:42:20 -04:00
doc.go [codegen/docs] Emit docs for methods (#7731) 2021-08-12 14:31:15 -07:00
gen.go Revert "Emit schema.Package.Version when possible (#7938)" (#8035) 2021-09-22 19:39:07 -07:00
gen_intrinsics.go Clean up the language-specific schema APIs. (#4454) 2020-04-20 16:36:05 -07:00
gen_program.go [codegen/python] Delete dead code around casing tables (#7647) 2021-07-27 08:37:49 -07:00
gen_program_expressions.go Implemented filebase64() support for Code Generator (#7863) 2021-09-10 23:09:28 +01:00
gen_program_lower.go [codegen/python] Delete dead code around casing tables (#7647) 2021-07-27 08:37:49 -07:00
gen_program_quotes.go [codegen/python] Delete dead code around casing tables (#7647) 2021-07-27 08:37:49 -07:00
gen_program_quotes_test.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
gen_program_test.go [codegen] Unify program codegen testing (#7657) 2021-07-27 18:00:39 -07:00
gen_resource_mappings.go Simplify output-funcs codegen test (#8039) 2021-09-23 13:42:20 -04:00
gen_resource_mappings_test.go Validate Name, Version and Enviroment (#7896) 2021-09-17 12:12:22 -07:00
gen_test.go [codegen/go] Rewrite cyclic types. (#8049) 2021-09-28 07:33:14 -07:00
importer.go Permit override of Python package naming (#6971) 2021-05-06 11:18:14 -07:00
python.go [codegen/python] Improve program gen perf. (#7547) 2021-07-16 15:45:00 -07:00
python_test.go [codegen/python] Fix unintended name changes from PyName and some whitespace cleanup (#5202) 2020-08-20 20:51:32 -07:00
requirements.txt Simplify output-funcs codegen test (#8039) 2021-09-23 13:42:20 -04:00
utilities.go Revert "Emit schema.Package.Version when possible (#7938)" (#8035) 2021-09-22 19:39:07 -07:00
utilities_test.go Revert "Emit schema.Package.Version when possible (#7938)" (#8035) 2021-09-22 19:39:07 -07:00