diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b3b6889ec4..219e0227d3 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -51,14 +51,6 @@ updates: ignore: - dependency-name: "setuptools" - - package-ecosystem: gomod - directory: '/packages/@jsii/go-runtime' - schedule: - interval: daily - labels: - - dependencies - - language/go - - package-ecosystem: gomod directory: '/packages/@jsii/go-runtime/jsii-runtime-go' schedule: diff --git a/packages/@jsii/go-runtime-test/build-tools/go-run.ts b/packages/@jsii/go-runtime-test/build-tools/go-run.ts deleted file mode 100644 index 0949c7958e..0000000000 --- a/packages/@jsii/go-runtime-test/build-tools/go-run.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { runCommand } from '@jsii/go-runtime/build-tools/_constants'; -import { spawnSync } from 'child_process'; -import { constants } from 'os'; -import { join } from 'path'; -import { argv, exit } from 'process'; - -if (argv.length < 3) { - console.error(`Not enough arguments: ${argv[0]} ${argv[1]} [args]`); - exit(1); -} - -const [, , cmd, ...args] = argv; - -const result = spawnSync('go', ['env', 'GOPATH'], { - stdio: ['inherit', 'pipe', 'inherit'], -}); - -if (result.error) { - console.error('"go env GOPATH" failed:', result.error); - exit(-1); -} - -if (result.status !== 0) { - console.error('"go env GOPATH" failed:', result.status ?? result.signal); - exit( - result.status ?? 128 + constants.signals[result.signal as NodeJS.Signals], - ); -} - -const gopath = result.stdout.toString('utf8').trim(); -runCommand(join(gopath, 'bin', cmd), args); diff --git a/packages/@jsii/go-runtime-test/package.json b/packages/@jsii/go-runtime-test/package.json index ed44d04811..0381792edb 100644 --- a/packages/@jsii/go-runtime-test/package.json +++ b/packages/@jsii/go-runtime-test/package.json @@ -5,12 +5,11 @@ "description": "", "scripts": { "build": "tsc --build && yarn gen:calc", - "fmt": "yarn --silent go:run goimports -w .", - "lint": "cd project && go vet ./... && yarn --silent go:run golint ./...", + "fmt": "cd project && go run golang.org/x/tools/cmd/goimports -w .", + "lint": "cd project && go vet ./... && go run golang.org/x/lint/golint ./...", "test": "cd project && go test ./...", "lint:fix": "yarn lint && yarn fmt", - "gen:calc": "node build-tools/gen-calc.js", - "go:run": "cd project && go mod download && node ../build-tools/go-run.js" + "gen:calc": "node build-tools/gen-calc.js" }, "keywords": [], "author": "", diff --git a/packages/@jsii/go-runtime-test/project/go.mod b/packages/@jsii/go-runtime-test/project/go.mod index d1fe57ce7c..1017179096 100644 --- a/packages/@jsii/go-runtime-test/project/go.mod +++ b/packages/@jsii/go-runtime-test/project/go.mod @@ -6,16 +6,16 @@ require ( github.com/aws/jsii-runtime-go v0.0.0 github.com/aws/jsii/jsii-calc/go/jcb v0.0.0 github.com/aws/jsii/jsii-calc/go/jsiicalc/v3 v3.20.120 - github.com/aws/jsii/jsii-calc/go/scopejsiicalclib v0.0.0 + github.com/aws/jsii/jsii-calc/go/scopejsiicalclib v0.0.0-devpreview github.com/stretchr/testify v1.8.0 golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 golang.org/x/tools v0.1.12 ) replace ( - github.com/aws/jsii-runtime-go => ../../go-runtime/jsii-runtime-go - github.com/aws/jsii/jsii-calc/go/jcb => ../jsii-calc/go/jcb - github.com/aws/jsii/jsii-calc/go/jsiicalc/v3 => ../jsii-calc/go/jsiicalc + github.com/aws/jsii-runtime-go v0.0.0 => ../../go-runtime/jsii-runtime-go + github.com/aws/jsii/jsii-calc/go/jcb v0.0.0 => ../jsii-calc/go/jcb + github.com/aws/jsii/jsii-calc/go/jsiicalc/v3 v3.20.120 => ../jsii-calc/go/jsiicalc github.com/aws/jsii/jsii-calc/go/scopejsiicalcbaseofbase/v2 => ../jsii-calc/go/scopejsiicalcbaseofbase - github.com/aws/jsii/jsii-calc/go/scopejsiicalclib => ../jsii-calc/go/scopejsiicalclib + github.com/aws/jsii/jsii-calc/go/scopejsiicalclib v0.0.0-devpreview => ../jsii-calc/go/scopejsiicalclib ) diff --git a/packages/@jsii/go-runtime-test/project/go.sum b/packages/@jsii/go-runtime-test/project/go.sum index 2b16f283b9..fff4429337 100644 --- a/packages/@jsii/go-runtime-test/project/go.sum +++ b/packages/@jsii/go-runtime-test/project/go.sum @@ -12,6 +12,7 @@ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSS github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -24,6 +25,7 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= diff --git a/packages/@jsii/go-runtime-test/project/runtime_type_checking_test.go b/packages/@jsii/go-runtime-test/project/runtime_type_checking_test.go new file mode 100644 index 0000000000..ea9a5c918f --- /dev/null +++ b/packages/@jsii/go-runtime-test/project/runtime_type_checking_test.go @@ -0,0 +1,91 @@ +package tests + +import ( + "fmt" + "testing" + + "github.com/aws/jsii-runtime-go" + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3" + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/anonymous" +) + +func TestConstructor(t *testing.T) { + defer expectPanic(t, "parameter unionProperty[0][\"bad\"] must be one of the allowed types: *StructA, *StructB; received \"Not a StructA or StructB\" (a string)") + jsiicalc.NewClassWithCollectionOfUnions(&[]*map[string]interface{}{ + { + "good": jsiicalc.StructA{ + RequiredString: jsii.String("present"), + }, + "bad": "Not a StructA or StructB", + }, + }) +} + +func TestSetter(t *testing.T) { + subject := jsiicalc.NewClassWithCollectionOfUnions(&[]*map[string]interface{}{}) + + defer expectPanic(t, "parameter val[0][\"bad\"] must be one of the allowed types: *StructA, *StructB; received \"Not a StructA or StructB\" (a string)") + subject.SetUnionProperty(&[]*map[string]interface{}{ + { + "good": jsiicalc.StructA{ + RequiredString: jsii.String("present"), + }, + "bad": "Not a StructA or StructB", + }, + }) +} + +func TestStaticMethod(t *testing.T) { + defer expectPanic(t, "parameter struct_ must be one of the allowed types: *StructA, *StructB; received \"Not a StructA\" (a string)") + jsiicalc.StructUnionConsumer_IsStructA("Not a StructA") +} + +func TestAnonymousObjectIsValid(t *testing.T) { + strct := jsiicalc.StructUnionConsumer_ProvideStruct(jsii.String("A")) + if !*jsiicalc.StructUnionConsumer_IsStructA(strct) { + t.Error("Expected strct to be a StructA") + } + + iface := anonymous.UseOptions_Provide(jsii.String("A")) + if *anonymous.UseOptions_Consume(iface) != "A" { + t.Error("Expected iface to produce A") + } +} + +func TestNestedUnion(t *testing.T) { + func() { + defer expectPanic(t, "parameter unionProperty[0] must be one of the allowed types: *map[string]interface{}, *[]interface{}; received 1337.42 (a float64)") + jsiicalc.NewClassWithNestedUnion(&[]interface{}{1337.42}) + }() + + func() { + defer expectPanic(t, "parameter unionProperty[0][1] must be one of the allowed types: *StructA, *StructB; received 1337.42 (a float64)") + jsiicalc.NewClassWithNestedUnion(&[]interface{}{ + []interface{}{ + jsiicalc.StructA{RequiredString: jsii.String("present")}, + 1337.42, + }, + }) + }() + + func() { + defer expectPanic(t, "parameter unionProperty[0][\"bad\"] must be one of the allowed types: *StructA, *StructB; received \"Not a StructA or StructB\" (a string)") + jsiicalc.NewClassWithNestedUnion(&[]interface{}{ + map[string]interface{}{ + "good": jsiicalc.StructA{RequiredString: jsii.String("present")}, + "bad": "Not a StructA or StructB", + }, + }) + }() +} + +func expectPanic(t *testing.T, expected string) { + if err := recover(); err != nil { + actual := fmt.Sprintf("%v", err) + if actual != expected { + t.Errorf("Failed with error:\n%#v\nexpected to receive:\n%#v", actual, expected) + } + } else { + t.Errorf("Expected test to fail with error:\n%#v", expected) + } +} diff --git a/packages/@jsii/go-runtime/build-tools/go-run.ts b/packages/@jsii/go-runtime/build-tools/go-run.ts deleted file mode 100644 index 8d8c79dd27..0000000000 --- a/packages/@jsii/go-runtime/build-tools/go-run.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { spawnSync } from 'child_process'; -import { constants } from 'os'; -import { join } from 'path'; -import { argv, exit } from 'process'; - -import { runCommand } from './_constants'; - -if (argv.length < 3) { - console.error(`Not enough arguments: ${argv[0]} ${argv[1]} [args]`); - exit(1); -} - -const [, , cmd, ...args] = argv; - -const result = spawnSync('go', ['env', 'GOPATH'], { - stdio: ['inherit', 'pipe', 'inherit'], -}); - -if (result.error) { - console.error('"go env GOPATH" failed:', result.error); - exit(-1); -} - -if (result.status !== 0) { - console.error('"go env GOPATH" failed:', result.status ?? result.signal); - exit( - result.status ?? 128 + constants.signals[result.signal as NodeJS.Signals], - ); -} - -const gopath = result.stdout.toString('utf8').trim(); -runCommand(join(gopath, 'bin', cmd), args); diff --git a/packages/@jsii/go-runtime/go.mod b/packages/@jsii/go-runtime/go.mod deleted file mode 100644 index 38eb54b493..0000000000 --- a/packages/@jsii/go-runtime/go.mod +++ /dev/null @@ -1,8 +0,0 @@ -module github.com/aws/jsii - -go 1.16 - -require ( - golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 - golang.org/x/tools v0.1.12 -) diff --git a/packages/@jsii/go-runtime/go.sum b/packages/@jsii/go-runtime/go.sum deleted file mode 100644 index c4bbae804b..0000000000 --- a/packages/@jsii/go-runtime/go.sum +++ /dev/null @@ -1,36 +0,0 @@ -github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/cast.go b/packages/@jsii/go-runtime/jsii-runtime-go/cast.go index 102e4bfba4..f53ea34640 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/cast.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/cast.go @@ -13,11 +13,11 @@ import ( func UnsafeCast(from interface{}, into interface{}) { rinto := reflect.ValueOf(into) if rinto.Kind() != reflect.Ptr { - panic(fmt.Errorf("Second argument to UnsafeCast must be a pointer to an interface. Received %s", rinto.Type().String())) + panic(fmt.Errorf("second argument to UnsafeCast must be a pointer to an interface; received %v", rinto.Type())) } rinto = rinto.Elem() if rinto.Kind() != reflect.Interface { - panic(fmt.Errorf("Second argument to UnsafeCast must be a pointer to an interface. Received pointer to %s", rinto.Type().String())) + panic(fmt.Errorf("second argument to UnsafeCast must be a pointer to an interface; received pointer to %v", rinto.Type())) } rfrom := reflect.ValueOf(from) @@ -30,7 +30,7 @@ func UnsafeCast(from interface{}, into interface{}) { } // Interfaces may present as a pointer to an implementing struct, and that's fine... if rfrom.Kind() != reflect.Interface && rfrom.Kind() != reflect.Ptr { - panic(fmt.Errorf("First argument to UnsafeCast must be an interface value. Received %s", rfrom.Type().String())) + panic(fmt.Errorf("first argument to UnsafeCast must be an interface value; received %v", rfrom.Type())) } // If rfrom can be directly converted to rinto, just do it. @@ -55,5 +55,5 @@ func UnsafeCast(from interface{}, into interface{}) { return } - panic(fmt.Errorf("First argument to UnsafeCast must be a jsii proxy value. Received %s", rfrom.String())) + panic(fmt.Errorf("first argument to UnsafeCast must be a jsii proxy value; received %v", rfrom)) } diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/deprecated.go b/packages/@jsii/go-runtime/jsii-runtime-go/deprecated.go index 06feadc1e3..cb31d3d699 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/deprecated.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/deprecated.go @@ -1,9 +1,10 @@ package jsii import ( + "reflect" + "github.com/aws/jsii-runtime-go/internal/api" "github.com/aws/jsii-runtime-go/runtime" - "reflect" ) // Deprecated: FQN represents a fully-qualified type name in the jsii type system. diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/go.mod b/packages/@jsii/go-runtime/jsii-runtime-go/go.mod index 76c9441e85..cfe77bad2e 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/go.mod +++ b/packages/@jsii/go-runtime/jsii-runtime-go/go.mod @@ -6,6 +6,8 @@ require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/mattn/go-isatty v0.0.16 github.com/stretchr/testify v1.8.0 + golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 + golang.org/x/tools v0.1.12 ) retract v1.27.0 diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/go.sum b/packages/@jsii/go-runtime/jsii-runtime-go/go.sum index 85436dbd3a..fff4429337 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/go.sum +++ b/packages/@jsii/go-runtime/jsii-runtime-go/go.sum @@ -12,8 +12,43 @@ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSS github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab h1:2QkjZIsXupsJbJIdSjjUOgWK3aEtzyuh2mPt3l/CkeU= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/api/api.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/api/api.go index 259a133d4a..fcdd1a1448 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/internal/api/api.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/api/api.go @@ -71,9 +71,9 @@ type ObjectRef struct { } func (o *ObjectRef) TypeFQN() FQN { - re := regexp.MustCompile("^(.+)@(\\d+)$") + re := regexp.MustCompile(`^(.+)@(\d+)$`) if parts := re.FindStringSubmatch(o.InstanceID); parts == nil { - panic(fmt.Errorf("invalid instance id: %s", o.InstanceID)) + panic(fmt.Errorf("invalid instance id: %#v", o.InstanceID)) } else { return FQN(parts[1]) } diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/client.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/client.go index 944e420644..bfd249eb24 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/client.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/client.go @@ -73,7 +73,7 @@ func CloseClient() { // newClient initializes a client, making it ready for business. func newClient() (*Client, error) { - if process, err := process.NewProcess(fmt.Sprintf("^%s", version)); err != nil { + if process, err := process.NewProcess(fmt.Sprintf("^%v", version)); err != nil { return nil, err } else { result := &Client{ diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/client_test.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/client_test.go index 19d17b01d5..7093222e4b 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/client_test.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/client_test.go @@ -10,7 +10,7 @@ import ( func TestClient(t *testing.T) { client, err := newClient() if err != nil { - t.Fatalf("client init failed: %s", err.Error()) + t.Fatalf("client init failed: %v", err.Error()) } defer client.close() @@ -31,7 +31,7 @@ func TestClient(t *testing.T) { t.Run("Type registry survives CloseClient()", func(t *testing.T) { client, err := newClient() if err != nil { - t.Fatalf("client init failed: %s", err.Error()) + t.Fatalf("client init failed: %v", err.Error()) } // Clean up after ourselves, so this test does not leave traces behind. @@ -47,7 +47,7 @@ func TestClient(t *testing.T) { map[string]interface{}{"FOO": enumTypeFOO}, ) if err != nil { - t.Fatalf("failed registering enum: %s", err.Error()) + t.Fatalf("failed registering enum: %v", err.Error()) } CloseClient() diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/load.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/load.go index 3089a9a365..56b4b384c1 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/load.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/load.go @@ -31,7 +31,7 @@ func (c *Client) Load(props LoadProps, tarball []byte) (response LoadResponse, e } tmpfile, err := ioutil.TempFile("", fmt.Sprintf( - "%s-%s.*.tgz", + "%v-%v.*.tgz", regexp.MustCompile("[^a-zA-Z0-9_-]").ReplaceAllString(props.Name, "-"), version, )) diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/handshake.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/handshake.go index 8173655ad8..ef4c3e05fc 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/handshake.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/handshake.go @@ -20,6 +20,6 @@ func (h *handshakeResponse) runtimeVersion() (*semver.Version, error) { case 3: return semver.NewVersion(parts[2]) default: - return nil, fmt.Errorf("invalid handshake payload: %s", h.Hello) + return nil, fmt.Errorf("invalid handshake payload: %v", h.Hello) } } diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/process.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/process.go index 3ccecddaf6..b8ab3d6bc7 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/process.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/process.go @@ -105,7 +105,7 @@ func NewProcess(compatibleVersions string) (*Process, error) { // particular, we are setting NODE_OPTIONS only if `os.Environ()` does not have another value... So the user can // control the environment... However, JSII_AGENT must always be controlled by this process. p.cmd.Env = append([]string{"NODE_OPTIONS=--max-old-space-size=4069"}, os.Environ()...) - p.cmd.Env = append(p.cmd.Env, fmt.Sprintf("JSII_AGENT=%s/%s/%s", runtime.Version(), runtime.GOOS, runtime.GOARCH)) + p.cmd.Env = append(p.cmd.Env, fmt.Sprintf("JSII_AGENT=%v/%v/%v", runtime.Version(), runtime.GOOS, runtime.GOARCH)) if stdin, err := p.cmd.StdinPipe(); err != nil { p.Close() @@ -163,13 +163,13 @@ func (p *Process) ensureStarted() error { causes[i] = fmt.Sprintf("- %v", err) } p.Close() - return fmt.Errorf("incompatible runtime version:\n%s", strings.Join(causes, "\n")) + return fmt.Errorf("incompatible runtime version:\n%v", strings.Join(causes, "\n")) } go func() { err := p.cmd.Wait() if err != nil { - fmt.Fprintf(os.Stderr, "Runtime process exited abnormally: %s", err.Error()) + fmt.Fprintf(os.Stderr, "Runtime process exited abnormally: %v", err.Error()) } p.Close() }() diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/process_test.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/process_test.go index b3a91c08b7..0a38bed296 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/process_test.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/process_test.go @@ -38,7 +38,7 @@ func TestVersionCheck(t *testing.T) { acceptedVersions := []string{"4.3.2", "4.3.1337", "4.1337.42"} for _, mockVersion := range acceptedVersions { - t.Run(fmt.Sprintf("accepts version %s", mockVersion), func(t *testing.T) { + t.Run(fmt.Sprintf("accepts version %v", mockVersion), func(t *testing.T) { oldJsiiRuntime := os.Getenv(JSII_RUNTIME) if runtime, err := makeCustomRuntime(mockVersion); err != nil { t.Fatal(err) @@ -53,7 +53,7 @@ func TestVersionCheck(t *testing.T) { return } defer process.Close() - t.Logf("Subprocess command: %s", strings.Join(process.cmd.Args, " ")) + t.Logf("Subprocess command: %v", strings.Join(process.cmd.Args, " ")) var ( request = EchoRequest{Message: "Oh, hi!"} @@ -63,7 +63,7 @@ func TestVersionCheck(t *testing.T) { t.Fatal(err) } if response.Message != request.Message { - t.Errorf("Expected %s, received %s", request.Message, response.Message) + t.Errorf("Expected %v, received %v", request.Message, response.Message) } }) } @@ -71,7 +71,7 @@ func TestVersionCheck(t *testing.T) { rejectedVersions := []string{"3.1337.42", "5.0.0-0", "4.3.2-pre.0", "4.3.3-pre.0"} for _, mockVersion := range rejectedVersions { - t.Run(fmt.Sprintf("rejects version %s", mockVersion), func(t *testing.T) { + t.Run(fmt.Sprintf("rejects version %v", mockVersion), func(t *testing.T) { oldJsiiRuntime := os.Getenv(JSII_RUNTIME) if runtime, err := makeCustomRuntime(mockVersion); err != nil { t.Fatal(err) @@ -80,13 +80,13 @@ func TestVersionCheck(t *testing.T) { } defer os.Setenv(JSII_RUNTIME, oldJsiiRuntime) - process, err := NewProcess(fmt.Sprintf("^4.3.2")) + process, err := NewProcess("^4.3.2") if err != nil { t.Fatal(err) return } defer process.Close() - t.Logf("Subprocess command: %s", strings.Join(process.cmd.Args, " ")) + t.Logf("Subprocess command: %v", strings.Join(process.cmd.Args, " ")) var ( request = EchoRequest{Message: "Oh, hi!"} @@ -95,7 +95,7 @@ func TestVersionCheck(t *testing.T) { if err := process.Request(request, &response); err == nil { t.Errorf("expected an error, but no error received") } else if !strings.Contains(err.Error(), "incompatible runtime version") { - t.Errorf("expected incompatible runtime version error, got %s", err.Error()) + t.Errorf("expected incompatible runtime version error, got %v", err.Error()) } }) } @@ -122,5 +122,5 @@ func makeCustomRuntime(mockVersion string) (string, error) { if err != nil { return "", err } - return fmt.Sprintf("%s %s %s", node, mockRuntime, mockVersion), nil + return fmt.Sprintf("%v %v %v", node, mockRuntime, mockVersion), nil } diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/objectstore/objectstore.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/objectstore/objectstore.go index 0fae5652a4..8339bad718 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/internal/objectstore/objectstore.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/objectstore/objectstore.go @@ -74,7 +74,7 @@ func (o *ObjectStore) Register(value reflect.Value, objectRef api.ObjectRef) err o.mergeInterfaces(objectRef) return nil } - return fmt.Errorf("attempting to register %s as %s, but it was already registered as %s", value, objectRef.InstanceID, existing) + return fmt.Errorf("attempting to register %v as %v, but it was already registered as %v", value, objectRef.InstanceID, existing) } aliases := findAliases(value) @@ -95,7 +95,7 @@ func (o *ObjectStore) Register(value reflect.Value, objectRef api.ObjectRef) err for _, alias := range aliases { ptr := alias.Pointer() if existing, found := o.objectToID[ptr]; found && existing != objectRef.InstanceID { - return fmt.Errorf("value %s is embedded in %s which has ID %s, but was already assigned %s", alias.String(), value.String(), objectRef.InstanceID, existing) + return fmt.Errorf("value %v is embedded in %v which has ID %v, but was already assigned %v", alias.String(), value.String(), objectRef.InstanceID, existing) } } @@ -216,7 +216,7 @@ func canonicalValue(value reflect.Value) (reflect.Value, error) { result := reflect.ValueOf(reflect.Indirect(value).Interface()) if result.Kind() != reflect.Ptr { - return reflect.Value{}, fmt.Errorf("illegal argument: %s is not a pointer", result.String()) + return reflect.Value{}, fmt.Errorf("illegal argument: %v is not a pointer", result.String()) } return result, nil diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/registration.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/registration.go index c1245762ca..8919397c5a 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/registration.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/registration.go @@ -23,8 +23,9 @@ type registeredType struct { } type registeredStruct struct { - FQN api.FQN - Fields []reflect.StructField + FQN api.FQN + Fields []reflect.StructField + Validator func(interface{}, func() string) error } // RegisterClass maps the given FQN to the provided class interface, list of @@ -36,7 +37,7 @@ func (t *TypeRegistry) RegisterClass(fqn api.FQN, class reflect.Type, overrides } if existing, exists := t.fqnToType[fqn]; exists && existing.Type != class { - return fmt.Errorf("another type was already registered with %s: %v", fqn, existing) + return fmt.Errorf("another type was already registered with %v: %v", fqn, existing) } t.fqnToType[fqn] = registeredType{class, classType} @@ -60,15 +61,15 @@ func (t *TypeRegistry) RegisterEnum(fqn api.FQN, enm reflect.Type, members map[s return fmt.Errorf("the provided enum is not a string derivative: %v", enm) } if existing, exists := t.fqnToType[fqn]; exists && existing.Type != enm { - return fmt.Errorf("another type was already registered with %s: %v", fqn, existing) + return fmt.Errorf("another type was already registered with %v: %v", fqn, existing) } if existing, exists := t.typeToEnumFQN[enm]; exists && existing != fqn { - return fmt.Errorf("attempted to re-register %v as %s, but it was registered as %s", enm, fqn, existing) + return fmt.Errorf("attempted to re-register %v as %v, but it was registered as %v", enm, fqn, existing) } for memberName, memberVal := range members { vt := reflect.ValueOf(memberVal).Type() if vt != enm { - return fmt.Errorf("the enum entry for key %s has incorrect type %v", memberName, vt) + return fmt.Errorf("the enum entry for key %v has incorrect type %v", memberName, vt) } // Not setting in t.fqnToEnumMember here so we don't cause any side-effects // if the pre-condition fails at any point. This is done in a second loop. @@ -77,7 +78,7 @@ func (t *TypeRegistry) RegisterEnum(fqn api.FQN, enm reflect.Type, members map[s t.fqnToType[fqn] = registeredType{enm, enumType} t.typeToEnumFQN[enm] = fqn for memberName, memberVal := range members { - memberFQN := fmt.Sprintf("%s/%s", fqn, memberName) + memberFQN := fmt.Sprintf("%v/%v", fqn, memberName) t.fqnToEnumMember[memberFQN] = memberVal } @@ -93,11 +94,11 @@ func (t *TypeRegistry) RegisterInterface(fqn api.FQN, iface reflect.Type, overri } if existing, exists := t.fqnToType[fqn]; exists && existing.Type != iface { - return fmt.Errorf("another type was already registered with %s: %v", fqn, existing) + return fmt.Errorf("another type was already registered with %v: %v", fqn, existing) } if existing, exists := t.typeToInterfaceFQN[iface]; exists && existing != fqn { - return fmt.Errorf("anoter FQN was already registered with %v: %s", iface, existing) + return fmt.Errorf("anoter FQN was already registered with %v: %v", iface, existing) } t.fqnToType[fqn] = registeredType{iface, interfaceType} @@ -122,11 +123,11 @@ func (t *TypeRegistry) RegisterStruct(fqn api.FQN, strct reflect.Type) error { } if existing, exists := t.fqnToType[fqn]; exists && existing.Type != strct { - return fmt.Errorf("another type was already registered with %s: %v", fqn, existing) + return fmt.Errorf("another type was already registered with %v: %v", fqn, existing) } if existing, exists := t.structInfo[strct]; exists && existing.FQN != fqn { - return fmt.Errorf("attempting to register type %s as %s, but it was already registered as: %s", strct.String(), fqn, existing.FQN) + return fmt.Errorf("attempting to register type %v as %v, but it was already registered as: %v", strct, fqn, existing.FQN) } numField := strct.NumField() @@ -134,13 +135,13 @@ func (t *TypeRegistry) RegisterStruct(fqn api.FQN, strct reflect.Type) error { for i := 0; i < numField; i++ { field := strct.Field(i) if field.Anonymous { - return fmt.Errorf("unexpected anonymous field %v in struct %s (%v)", field, fqn, strct) + return fmt.Errorf("unexpected anonymous field %v in struct %v (%v)", field, fqn, strct) } if field.PkgPath != "" { - return fmt.Errorf("unexpected un-exported field %v in struct %s (%v)", field, fqn, strct) + return fmt.Errorf("unexpected un-exported field %v in struct %v (%v)", field, fqn, strct) } if field.Tag.Get("json") == "" { - return fmt.Errorf("missing json tag on struct field %v of %s (%v)", field, fqn, strct) + return fmt.Errorf("missing json tag on struct field %v of %v (%v)", field, fqn, strct) } fields = append(fields, field) } @@ -150,3 +151,20 @@ func (t *TypeRegistry) RegisterStruct(fqn api.FQN, strct reflect.Type) error { return nil } + +// RegisterStructValidator adds a validator function to an already registered struct type. This is separate call largely +// to maintain backwards compatibility with existing code. +func (t *TypeRegistry) RegisterStructValidator(strct reflect.Type, validator func(interface{}, func() string) error) error { + if strct.Kind() != reflect.Struct { + return fmt.Errorf("the provided struct is not a struct: %v", strct) + } + + info, ok := t.structInfo[strct] + if !ok { + return fmt.Errorf("the provided struct %v is not registered (call RegisterStruct first)", strct) + } + info.Validator = validator + t.structInfo[strct] = info + + return nil +} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/typeregistry.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/typeregistry.go index 98af846ec3..e133f01417 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/typeregistry.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/typeregistry.go @@ -30,7 +30,7 @@ type TypeRegistry struct { // corresponding jsii interface FQN (e.g: "jsii-calc.SomeInterface") typeToInterfaceFQN map[reflect.Type]api.FQN - // structInfo maps registered struct types to all their fields. + // structInfo maps registered struct types to all their fields, and possibly a validator structInfo map[reflect.Type]registeredStruct // proxyMakers map registered interface types to a proxy maker function. @@ -41,6 +41,8 @@ type TypeRegistry struct { typeMembers map[api.FQN][]api.Override } +type anonymousProxy struct{ _ int } // Padded so it's not 0-sized + // New creates a new type registry. func New() *TypeRegistry { registry := TypeRegistry{ @@ -55,13 +57,22 @@ func New() *TypeRegistry { // Ensure we can initialize proxies for `interface{}` when a method returns `any`. registry.proxyMakers[reflect.TypeOf((*interface{})(nil)).Elem()] = func() interface{} { - type object struct{ _ int } // Padded so it's not 0-sized - return &object{} + return &anonymousProxy{} } return ®istry } +// IsAnonymousProxy tells whether the value v is an anonymous object proxy, or +// a pointer to one. +func (t *TypeRegistry) IsAnonymousProxy(v interface{}) bool { + _, ok := v.(*anonymousProxy) + if !ok { + _, ok = v.(anonymousProxy) + } + return ok +} + // StructFields returns the list of fields associated with a jsii struct type, // the jsii fully qualified type name, and a boolean telling whether the // provided type was a registered jsii struct type. @@ -111,7 +122,7 @@ func (t *TypeRegistry) InitJsiiProxy(val reflect.Value, valType reflect.Type) er continue } if !field.Anonymous { - return fmt.Errorf("refusing to initialize non-anonymous field %s of %v", field.Name, val) + return fmt.Errorf("refusing to initialize non-anonymous field %v of %v", field.Name, val) } if err := t.InitJsiiProxy(val.Field(i), field.Type); err != nil { return err @@ -132,7 +143,7 @@ func (t *TypeRegistry) EnumMemberForEnumRef(ref api.EnumRef) (interface{}, error if member, ok := t.fqnToEnumMember[ref.MemberFQN]; ok { return member, nil } - return nil, fmt.Errorf("no enum member registered for %s", ref.MemberFQN) + return nil, fmt.Errorf("no enum member registered for %v", ref.MemberFQN) } // TryRenderEnumRef returns an enumref if the provided value corresponds to a @@ -147,7 +158,7 @@ func (t *TypeRegistry) TryRenderEnumRef(value reflect.Value) (ref *api.EnumRef, if enumFQN, ok := t.typeToEnumFQN[value.Type()]; ok { isEnumRef = true if memberName := value.String(); memberName != "" { - ref = &api.EnumRef{MemberFQN: fmt.Sprintf("%s/%s", enumFQN, memberName)} + ref = &api.EnumRef{MemberFQN: fmt.Sprintf("%v/%v", enumFQN, memberName)} } else { ref = nil } diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/validate-struct.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/validate-struct.go new file mode 100644 index 0000000000..257954a8bd --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/validate-struct.go @@ -0,0 +1,27 @@ +package typeregistry + +import ( + "fmt" + "reflect" +) + +// ValidateStruct runs validations on the supplied struct to determine whether +// it is valid. In particular, it checks union-typed properties to ensure the +// provided value is of one of the allowed types. +// +// May panic if v is not a pointer to a struct value. +func (t *TypeRegistry) ValidateStruct(v interface{}, d func() string) error { + rt := reflect.TypeOf(v).Elem() + + info, ok := t.structInfo[rt] + if !ok { + return fmt.Errorf("%v: %v is not a know struct type", d(), rt) + } + + // There may not be a validator (type is simple enough, etc...). + if info.Validator != nil { + return info.Validator(v, d) + } + + return nil +} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/runtime/runtime.go b/packages/@jsii/go-runtime/jsii-runtime-go/runtime/runtime.go index 00878c4ccd..fecf492ff9 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/runtime/runtime.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/runtime/runtime.go @@ -97,6 +97,16 @@ func RegisterStruct(fqn FQN, strct reflect.Type) { } } +// RegisterStructValidator adds a validator function to an already registered +// struct type. This is separate call largely to maintain backwards compatibility +// with existing code. +func RegisterStructValidator(strct reflect.Type, validator func(interface{}, func() string) error) { + client := kernel.GetClient() + if err := client.Types().RegisterStructValidator(strct, validator); err != nil { + panic(err) + } +} + // InitJsiiProxy initializes a jsii proxy instance at the provided pointer. // Panics if the pointer cannot be initialized to a proxy instance (i.e: the // element of it is not a registered jsii interface or class type). @@ -107,6 +117,12 @@ func InitJsiiProxy(ptr interface{}) { } } +// IsAnonymousProxy tells whether the value v is an anonymous object proxy, or +// a pointer to one. +func IsAnonymousProxy(v interface{}) bool { + return kernel.GetClient().Types().IsAnonymousProxy(v) +} + // Create will construct a new JSII object within the kernel runtime. This is // called by jsii object constructors. func Create(fqn FQN, args []interface{}, inst interface{}) { @@ -147,7 +163,7 @@ func Create(fqn FQN, args []interface{}, inst interface{}) { // If overriding struct has no overriding methods, could happen if // overriding methods are not defined with pointer receiver. if len(mOverrides) == 0 && !strings.HasPrefix(instType.Name(), "jsiiProxy_") { - panic(fmt.Errorf("%s has no overriding methods. Overriding methods must be defined with a pointer receiver", instType.Name())) + panic(fmt.Errorf("%v has no overriding methods. Overriding methods must be defined with a pointer receiver", instType.Name())) } var overrides []api.Override registry := client.Types() @@ -375,7 +391,7 @@ func getMethodOverrides(ptr interface{}, basePrefix string) (methods []string) { mCache := make(map[string]bool) getMethodOverridesRec(ptr, basePrefix, mCache) // Return overriden methods names in embedding hierarchy - for m, _ := range mCache { + for m := range mCache { methods = append(methods, m) } return diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/runtime/type_checking.go b/packages/@jsii/go-runtime/jsii-runtime-go/runtime/type_checking.go new file mode 100644 index 0000000000..d0a8275347 --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/runtime/type_checking.go @@ -0,0 +1,11 @@ +package runtime + +import "github.com/aws/jsii-runtime-go/internal/kernel" + +// ValidateStruct runs validations on the supplied struct to determine whether +// it is valid. In particular, it checks union-typed properties to ensure the +// provided value is of one of the allowed types. +func ValidateStruct(v interface{}, d func() string) error { + client := kernel.GetClient() + return client.Types().ValidateStruct(v, d) +} diff --git a/packages/@jsii/go-runtime/tools.go b/packages/@jsii/go-runtime/jsii-runtime-go/tools.go similarity index 96% rename from packages/@jsii/go-runtime/tools.go rename to packages/@jsii/go-runtime/jsii-runtime-go/tools.go index 81c01faf65..7b49e3a9e0 100644 --- a/packages/@jsii/go-runtime/tools.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/tools.go @@ -1,3 +1,4 @@ +//go:build tools // +build tools // Package tools contains the necessary statements to ensure tool dependencies diff --git a/packages/@jsii/go-runtime/package.json b/packages/@jsii/go-runtime/package.json index 26d2b9fc3e..c483f1e095 100644 --- a/packages/@jsii/go-runtime/package.json +++ b/packages/@jsii/go-runtime/package.json @@ -8,13 +8,12 @@ "build": "tsc --build && npm run gen:rt", "gen:rt": "node build-tools/gen.js", "generate": "npm run gen:rt", - "go:run": "go mod download && node build-tools/go-run.js", "package": "build-tools/package.sh && package-private", - "doc": "(cd jsii-runtime-go && yarn --silent go:run godoc)", - "fmt": "yarn --silent go:run goimports -w jsii-runtime-go", - "lint": "(cd jsii-runtime-go && go vet ./... && yarn --silent go:run golint ./...)", + "doc": "cd jsii-runtime-go && go run golang.org/x/tools/cmd/godoc", + "fmt": "cd jsii-runtime-go && go run golang.org/x/tools/cmd/goimports -w .", + "lint": "cd jsii-runtime-go && go vet ./... && go run golang.org/x/lint/golint ./...", "lint:fix": "yarn lint && yarn fmt", - "test": "(cd jsii-runtime-go && go test ./...)" + "test": "cd jsii-runtime-go && go test ./..." }, "keywords": [], "author": "", diff --git a/packages/jsii-pacmak/lib/targets/dotnet/runtime-type-checking.ts b/packages/jsii-pacmak/lib/targets/dotnet/runtime-type-checking.ts index 7f4e8c332e..aeb9dacfb3 100644 --- a/packages/jsii-pacmak/lib/targets/dotnet/runtime-type-checking.ts +++ b/packages/jsii-pacmak/lib/targets/dotnet/runtime-type-checking.ts @@ -203,15 +203,21 @@ abstract class Validation { code.unindent(false); } code.indent('case null:'); + + const acceptedTypes = validTypes + .map((t) => + t.startsWith('"') + ? t.slice(1, t.length - 1) + : t.startsWith('$"') + ? t.slice(2, t.length - 1) + : `{${t}}`, + ) + .join(', '); if (allowNull) { code.line('break;'); } else { const message = JSON.stringify( - `Expected ${description} to be one of: ${validTypes - .map((t) => - t.startsWith('"') ? t.slice(1, t.length - 1) : `{${t}}`, - ) - .join(', ')}; received null`, + `Expected ${description} to be one of: ${acceptedTypes}; received null`, ); code.line( `throw new System.ArgumentException($${message}, ${argument});`, @@ -220,11 +226,7 @@ abstract class Validation { code.unindent(false); code.indent('default:'); const message = JSON.stringify( - `Expected ${description} to be one of: ${validTypes - .map((t) => - t.startsWith('"') ? t.slice(1, t.length - 1) : `{${t}}`, - ) - .join(', ')}; received {${expression}.GetType().FullName}`, + `Expected ${description} to be one of: ${acceptedTypes}; received {${expression}.GetType().FullName}`, ); code.line( `throw new System.ArgumentException($${message}, ${argument});`, diff --git a/packages/jsii-pacmak/lib/targets/go.ts b/packages/jsii-pacmak/lib/targets/go.ts index 9e43bdce44..c19c8edc6b 100644 --- a/packages/jsii-pacmak/lib/targets/go.ts +++ b/packages/jsii-pacmak/lib/targets/go.ts @@ -18,7 +18,7 @@ export class Golang extends Target { public constructor(options: TargetOptions) { super(options); - this.goGenerator = new GoGenerator(options.rosetta); + this.goGenerator = new GoGenerator(options); } public get generator() { @@ -146,8 +146,16 @@ class GoGenerator implements IGenerator { }); private readonly documenter: Documentation; - public constructor(private readonly rosetta: Rosetta) { + private readonly rosetta: Rosetta; + private readonly runtimeTypeChecking: boolean; + + public constructor(options: { + readonly rosetta: Rosetta; + readonly runtimeTypeChecking: boolean; + }) { + this.rosetta = options.rosetta; this.documenter = new Documentation(this.code, this.rosetta); + this.runtimeTypeChecking = options.runtimeTypeChecking; } public async load(_: string, assembly: Assembly): Promise { @@ -165,6 +173,7 @@ class GoGenerator implements IGenerator { return this.rootPackage.emit({ code: this.code, documenter: this.documenter, + runtimeTypeChecking: this.runtimeTypeChecking, }); } diff --git a/packages/jsii-pacmak/lib/targets/go/dependencies.ts b/packages/jsii-pacmak/lib/targets/go/dependencies.ts index a0996b43a9..2316baea74 100644 --- a/packages/jsii-pacmak/lib/targets/go/dependencies.ts +++ b/packages/jsii-pacmak/lib/targets/go/dependencies.ts @@ -1,8 +1,21 @@ +import * as assert from 'assert'; + +import { Package } from './package'; +import { + JSII_INIT_ALIAS, + JSII_INIT_PACKAGE, + JSII_RT_ALIAS, + JSII_RT_PACKAGE_NAME, +} from './runtime'; + /** * Information about a module's dependency on "special" packages (either part of * the go standard library, or generated as part of the current module). */ export interface SpecialDependencies { + /** Whether the go standard library for string formatting is needed */ + readonly fmt: boolean; + /** Whether the jsii runtime library for go is needed */ readonly runtime: boolean; @@ -15,3 +28,80 @@ export interface SpecialDependencies { /** Whether go's standard library "time" module is needed */ readonly time: boolean; } + +export function reduceSpecialDependencies( + ...specialDepsList: readonly SpecialDependencies[] +): SpecialDependencies { + const [first, ...rest] = specialDepsList; + if (!first) { + assert(rest.length === 0); + return { + fmt: false, + init: false, + internal: false, + runtime: false, + time: false, + }; + } + return rest.reduce( + (acc, elt) => ({ + fmt: acc.fmt || elt.fmt, + init: acc.init || elt.init, + internal: acc.internal || elt.internal, + runtime: acc.runtime || elt.runtime, + time: acc.time || elt.time, + }), + first, + ); +} + +export interface ImportedModule { + readonly alias?: string; + readonly module: string; +} + +export function toImportedModules( + specialDeps: SpecialDependencies, + context: Package, +): readonly ImportedModule[] { + const result = new Array(); + + if (specialDeps.fmt) { + result.push({ module: 'fmt' }); + } + + if (specialDeps.time) { + result.push({ module: 'time' }); + } + + if (specialDeps.runtime) { + result.push(JSII_RT_MODULE); + } + + if (specialDeps.init) { + result.push({ + alias: JSII_INIT_ALIAS, + module: `${context.root.goModuleName}/${JSII_INIT_PACKAGE}`, + }); + } + + if (specialDeps.internal) { + result.push({ + module: `${context.goModuleName}/${INTERNAL_PACKAGE_NAME}`, + }); + } + + return result; +} + +/** + * The name of a sub-package that includes internal type aliases it has to be + * "internal" so it not published. + */ +export const INTERNAL_PACKAGE_NAME = 'internal'; + +export const JSII_RT_MODULE: ImportedModule = { + alias: JSII_RT_ALIAS, + module: JSII_RT_PACKAGE_NAME, +}; +export const GO_REFLECT: ImportedModule = { module: 'reflect' }; diff --git a/packages/jsii-pacmak/lib/targets/go/emit-context.ts b/packages/jsii-pacmak/lib/targets/go/emit-context.ts index 50c6515145..c80234a794 100644 --- a/packages/jsii-pacmak/lib/targets/go/emit-context.ts +++ b/packages/jsii-pacmak/lib/targets/go/emit-context.ts @@ -11,4 +11,7 @@ export interface EmitContext { /** A Documentation generator. Includes Rosetta stone to translate code examples. */ readonly documenter: Documentation; + + /** Whether runtime type checking code should be emitted */ + readonly runtimeTypeChecking: boolean; } diff --git a/packages/jsii-pacmak/lib/targets/go/package.ts b/packages/jsii-pacmak/lib/targets/go/package.ts index 6b71b0d5d2..943607e9fa 100644 --- a/packages/jsii-pacmak/lib/targets/go/package.ts +++ b/packages/jsii-pacmak/lib/targets/go/package.ts @@ -9,12 +9,19 @@ import { join } from 'path'; import * as semver from 'semver'; import { VERSION } from '../../version'; +import { + GO_REFLECT, + ImportedModule, + INTERNAL_PACKAGE_NAME, + JSII_RT_MODULE, + reduceSpecialDependencies, + toImportedModules, +} from './dependencies'; import { EmitContext } from './emit-context'; import { ReadmeFile } from './readme-file'; import { JSII_RT_ALIAS, JSII_RT_MODULE_NAME, - JSII_RT_PACKAGE_NAME, JSII_INIT_PACKAGE, JSII_INIT_FUNC, JSII_INIT_ALIAS, @@ -31,10 +38,6 @@ import { VersionFile } from './version-file'; export const GOMOD_FILENAME = 'go.mod'; export const GO_VERSION = '1.16'; -// the name of a sub-package that includes internal type aliases it has to be -// "internal" so it not published. -const INTERNAL_PACKAGE_NAME = 'internal'; - /* * Package represents a single `.go` source file within a package. This can be the root package file or a submodule */ @@ -192,12 +195,14 @@ export abstract class Package { * responsible for correctly initializing the module, including registering * the declared types with the jsii runtime for go. */ - private emitGoInitFunction({ code }: EmitContext): void { + private emitGoInitFunction(context: EmitContext): void { // We don't emit anything if there are not types in this (sub)module. This // avoids registering an `init` function that does nothing, which is poor // form. It also saves us from "imported but unused" errors that would arise // as a consequence. if (this.types.length > 0) { + const { code } = context; + const initFile = join(this.directory, `${this.packageName}.go`); code.openFile(initFile); code.line(`package ${this.packageName}`); @@ -206,7 +211,7 @@ export abstract class Package { code.line(); code.openBlock('func init()'); for (const type of this.types) { - type.emitRegistration(code); + type.emitRegistration(context); } code.closeBlock(); code.closeFile(initFile); @@ -216,28 +221,7 @@ export abstract class Package { private emitImports(code: CodeMaker, type: GoType) { const toImport = new Array(); - const specialDeps = type.specialDependencies; - - if (specialDeps.time) { - toImport.push({ module: 'time' }); - } - - if (specialDeps.runtime) { - toImport.push(JSII_RT_MODULE); - } - - if (specialDeps.init) { - toImport.push({ - alias: JSII_INIT_ALIAS, - module: `${this.root.goModuleName}/${JSII_INIT_PACKAGE}`, - }); - } - - if (specialDeps.internal) { - toImport.push({ - module: `${this.goModuleName}/${INTERNAL_PACKAGE_NAME}`, - }); - } + toImport.push(...toImportedModules(type.specialDependencies, this)); for (const goModuleName of new Set( type.dependencies.map(({ goModuleName }) => goModuleName), @@ -265,6 +249,86 @@ export abstract class Package { type.emit(context); context.code.closeFile(filePath); + + this.emitValidators(context, type); + } + } + + private emitValidators( + { code, runtimeTypeChecking }: EmitContext, + type: GoType, + ): void { + if (!runtimeTypeChecking) { + return; + } + + if (type.parameterValidators.length === 0 && type.structValidator == null) { + return; + } + + emit.call( + this, + join( + this.directory, + `${this.packageName}_${type.name}__runtime_type_checks.go`, + ), + false, + ); + + emit.call( + this, + join( + this.directory, + `${this.packageName}_${type.name}__no_runtime_type_checking.go`, + ), + true, + ); + + function emit(this: Package, filePath: string, forNoOp: boolean) { + code.openFile(filePath); + // Conditional compilation tag... + code.line(`//go:build ${forNoOp ? '' : '!'}no_runtime_type_checking`); + // For go1.16 compatibility + code.line(`// +build ${forNoOp ? '' : '!'}no_runtime_type_checking`); + code.line(); + this.emitHeader(code); + + if (!forNoOp) { + const specialDependencies = reduceSpecialDependencies( + ...type.parameterValidators.map((v) => v.specialDependencies), + ...(type.structValidator + ? [type.structValidator.specialDependencies] + : []), + ); + + importGoModules(code, [ + ...toImportedModules(specialDependencies, this), + ...Array.from( + new Set( + [ + ...(type.structValidator?.dependencies ?? []), + ...type.parameterValidators.flatMap((v) => v.dependencies), + ].map((mod) => mod.goModuleName), + ), + ) + .filter((mod) => mod !== this.goModuleName) + .map((mod) => ({ module: mod })), + ]); + code.line(); + } else { + code.line( + '// Building without runtime type checking enabled, so all the below just return nil', + ); + code.line(); + } + + type.structValidator?.emitImplementation(code, this, forNoOp); + + for (const validator of type.parameterValidators) { + validator.emitImplementation(code, this, forNoOp); + } + + code.closeFile(filePath); } } @@ -533,17 +597,6 @@ function determineMajorVersionSuffix(version: string) { return `/v${sv.major}`; } -interface ImportedModule { - readonly alias?: string; - readonly module: string; -} - -const JSII_RT_MODULE: ImportedModule = { - alias: JSII_RT_ALIAS, - module: JSII_RT_PACKAGE_NAME, -}; -const GO_REFLECT: ImportedModule = { module: 'reflect' }; - function importGoModules(code: CodeMaker, modules: readonly ImportedModule[]) { if (modules.length === 0) { return; diff --git a/packages/jsii-pacmak/lib/targets/go/runtime/class-constructor.ts b/packages/jsii-pacmak/lib/targets/go/runtime/class-constructor.ts index f505c4b724..3e00bc93ec 100644 --- a/packages/jsii-pacmak/lib/targets/go/runtime/class-constructor.ts +++ b/packages/jsii-pacmak/lib/targets/go/runtime/class-constructor.ts @@ -1,5 +1,6 @@ import { CodeMaker } from 'codemaker'; +import { EmitContext } from '../emit-context'; import { GoClassConstructor } from '../types'; import { JSII_CREATE_FUNC } from './constants'; import { emitArguments } from './emit-arguments'; @@ -8,10 +9,14 @@ import { slugify, emitInitialization } from './util'; export class ClassConstructor { public constructor(public readonly parent: GoClassConstructor) {} - public emit(code: CodeMaker) { + public emit({ code, runtimeTypeChecking }: EmitContext) { emitInitialization(code); code.line(); + if (runtimeTypeChecking) { + this.parent.validator?.emitCall(code); + } + const resultVar = slugify( this.parent.parent.proxyName[0], this.parent.parameters.map((p) => p.name), diff --git a/packages/jsii-pacmak/lib/targets/go/runtime/method-call.ts b/packages/jsii-pacmak/lib/targets/go/runtime/method-call.ts index d8e4f0d018..b51b94d9a3 100644 --- a/packages/jsii-pacmak/lib/targets/go/runtime/method-call.ts +++ b/packages/jsii-pacmak/lib/targets/go/runtime/method-call.ts @@ -1,6 +1,6 @@ -import { CodeMaker } from 'codemaker'; import { Method } from 'jsii-reflect'; +import { EmitContext } from '../emit-context'; import { GoMethod } from '../types'; import { JSII_INVOKE_FUNC, @@ -18,15 +18,19 @@ export class MethodCall extends FunctionCall { super(parent); } - public emit(code: CodeMaker) { + public emit(context: EmitContext) { if (this.inStatic) { - this.emitStatic(code); + this.emitStatic(context); } else { - this.emitDynamic(code); + this.emitDynamic(context); } } - private emitDynamic(code: CodeMaker) { + private emitDynamic({ code, runtimeTypeChecking }: EmitContext) { + if (runtimeTypeChecking) { + this.parent.validator?.emitCall(code); + } + const args = emitArguments( code, this.parent.parameters, @@ -55,9 +59,14 @@ export class MethodCall extends FunctionCall { } } - private emitStatic(code: CodeMaker) { + private emitStatic({ code, runtimeTypeChecking }: EmitContext) { emitInitialization(code); code.line(); + + if (runtimeTypeChecking) { + this.parent.validator?.emitCall(code); + } + const args = emitArguments( code, this.parent.parameters, diff --git a/packages/jsii-pacmak/lib/targets/go/runtime/property-access.ts b/packages/jsii-pacmak/lib/targets/go/runtime/property-access.ts index f322008e7c..c04c3e5166 100644 --- a/packages/jsii-pacmak/lib/targets/go/runtime/property-access.ts +++ b/packages/jsii-pacmak/lib/targets/go/runtime/property-access.ts @@ -1,5 +1,6 @@ import { CodeMaker } from 'codemaker'; +import { EmitContext } from '../emit-context'; import { GoProperty } from '../types'; import { JSII_GET_FUNC, @@ -32,7 +33,9 @@ export class GetProperty extends FunctionCall { export class SetProperty { public constructor(public readonly parent: GoProperty) {} - public emit(code: CodeMaker) { + public emit({ code, runtimeTypeChecking }: EmitContext) { + if (runtimeTypeChecking) this.parent.validator?.emitCall(code); + code.open(`${JSII_SET_FUNC}(`); code.line(`${this.parent.instanceArg},`); code.line(`"${this.parent.property.name}",`); @@ -64,9 +67,13 @@ export class StaticGetProperty extends FunctionCall { export class StaticSetProperty { public constructor(public readonly parent: GoProperty) {} - public emit(code: CodeMaker) { + public emit({ code, runtimeTypeChecking }: EmitContext) { emitInitialization(code); + if (runtimeTypeChecking) { + this.parent.validator?.emitCall(code); + } + code.open(`${JSII_SSET_FUNC}(`); code.line(`"${this.parent.parent.fqn}",`); code.line(`"${this.parent.property.name}",`); diff --git a/packages/jsii-pacmak/lib/targets/go/runtime/runtime-type-checking.ts b/packages/jsii-pacmak/lib/targets/go/runtime/runtime-type-checking.ts new file mode 100644 index 0000000000..48e4cedb15 --- /dev/null +++ b/packages/jsii-pacmak/lib/targets/go/runtime/runtime-type-checking.ts @@ -0,0 +1,641 @@ +import { TypeReference } from '@jsii/spec'; +import { CodeMaker } from 'codemaker'; +import { createHash } from 'crypto'; +import { Method, Parameter } from 'jsii-reflect'; + +import { + reduceSpecialDependencies, + SpecialDependencies, +} from '../dependencies'; +import { Package } from '../package'; +import { + GoClass, + GoClassConstructor, + GoInterface, + GoMethod, + GoParameter, + GoProperty, + GoTypeRef, + Struct, +} from '../types'; +import { JSII_RT_ALIAS } from './constants'; + +export class ParameterValidator { + public static forConstructor( + ctor: GoClassConstructor, + ): ParameterValidator | undefined { + return ParameterValidator.fromParts( + `New${ctor.parent.name}`, + ctor.parameters, + ); + } + + public static forMethod(method: GoMethod): ParameterValidator | undefined { + return ParameterValidator.fromParts( + method.name, + method.parameters, + method.static + ? undefined + : { + name: method.instanceArg, + type: `*${method.parent.proxyName}`, + }, + ); + } + + public static forProperty( + property: GoProperty, + ): ParameterValidator | undefined { + if (property.immutable) { + return undefined; + } + return ParameterValidator.fromParts( + property.setterName, + [ + syntheticParameter( + property.parent as any, + 'val', + property.reference.reference.spec!, + property.property.optional, + ), + ], + property.static + ? undefined + : { + name: property.instanceArg, + type: `*${property.parent.proxyName}`, + }, + ); + } + + private static fromParts( + name: string, + parameters: readonly GoParameter[], + receiver?: Receiver, + ): ParameterValidator | undefined { + if (parameters.length === 0) { + return undefined; + } + const parameterValidations = new Map(); + + for (const param of parameters) { + const expr = param.name; + const descr = `parameter ${param.name}`; + + const validations = new Array(); + if (!param.isOptional) { + validations.push(Validation.nullCheck(expr, descr, param.reference)); + } + const validation = Validation.forTypeMap( + expr, + descr, + param.reference.typeMap, + ); + if (validation) { + validations.push(validation); + } + + if (validations.length !== 0) { + parameterValidations.set(param, validations); + } + } + + if (parameterValidations.size === 0) { + return undefined; + } + return new ParameterValidator(name, parameterValidations, receiver); + } + + private readonly receiver?: Receiver; + private readonly name: string; + private readonly parameters: readonly GoParameter[]; + private readonly validations: ReadonlyMap; + + private constructor( + baseName: string, + validations: ReadonlyMap, + receiver: Receiver | undefined, + ) { + this.receiver = receiver; + this.name = `validate${baseName}Parameters`; + this.validations = validations; + this.parameters = Array.from(validations.keys()); + } + + public get dependencies(): readonly Package[] { + return [ + ...this.parameters.flatMap( + (p) => p.reference.withTransparentUnions.dependencies, + ), + ...Array.from(this.validations.values()).flatMap((vs) => + vs.flatMap((v) => v.dependencies), + ), + ]; + } + + public get specialDependencies(): SpecialDependencies { + return reduceSpecialDependencies( + ...this.parameters.map((p) => p.reference.specialDependencies), + ...Array.from(this.validations.values()).flatMap((vs) => + vs.flatMap((v) => v.specialDependencies), + ), + ); + } + + public emitCall(code: CodeMaker): void { + const recv = this.receiver?.name ? `${this.receiver.name}.` : ''; + const params = this.parameters.map((p) => p.name).join(', '); + + code.openBlock(`if err := ${recv}${this.name}(${params}); err != nil`); + code.line(`panic(err)`); + code.closeBlock(); + } + + public emitImplementation( + code: CodeMaker, + scope: Package, + noOp = false, + ): void { + code.openBlock( + `func ${ + this.receiver ? `(${this.receiver.name} ${this.receiver.type}) ` : '' + }${this.name}(${this.parameters + .map((p) => + p.isVariadic + ? `${p.name} []${p.reference.scopedReference(scope)}` + : p.toString(), + ) + .join(', ')}) error`, + ); + if (noOp) { + code.line('return nil'); + } else { + for (const [_parameter, validations] of this.validations) { + for (const validation of validations) { + validation.emit(code, scope); + } + code.line(); + } + code.line('return nil'); + } + code.closeBlock(); + code.line(); + } +} + +interface Receiver { + readonly name: string; + readonly type: string; +} + +export class StructValidator { + public static for(struct: Struct): StructValidator | undefined { + const receiver = { + name: struct.name.slice(0, 1).toLowerCase(), + type: `*${struct.name}`, + }; + + const fieldValidations = new Map(); + for (const prop of struct.properties) { + const expr = `${receiver.name}.${prop.name}`; + const descr = `@{desc()}.${prop.name}`; + + const validations = new Array(); + if (!prop.property.optional) { + validations.push(Validation.nullCheck(expr, descr, prop.reference)); + } + const validation = Validation.forTypeMap( + expr, + descr, + prop.reference.typeMap, + ); + if (validation) { + validations.push(validation); + } + if (validations.length > 0) { + fieldValidations.set(prop, validations); + } + } + + if (fieldValidations.size === 0) { + return undefined; + } + + return new StructValidator(receiver, fieldValidations); + } + + private constructor( + private readonly receiver: Receiver, + private readonly validations: ReadonlyMap< + GoProperty, + readonly Validation[] + >, + ) {} + + public get dependencies() { + return Array.from(this.validations.values()).flatMap((vs) => + vs.flatMap((v) => v.dependencies), + ); + } + + public get specialDependencies(): SpecialDependencies { + return reduceSpecialDependencies( + { + fmt: true, + init: false, + internal: false, + runtime: false, + time: false, + }, + ...Array.from(this.validations.values()).flatMap((vs) => + vs.flatMap((v) => v.specialDependencies), + ), + ); + } + + public emitImplementation( + code: CodeMaker, + scope: Package, + noOp = false, + ): void { + code.openBlock( + `func (${this.receiver.name} ${this.receiver.type}) validate(desc func() string) error`, + ); + if (noOp) { + code.line('return nil'); + } else { + for (const [_prop, validations] of this.validations) { + for (const validation of validations) { + validation.emit(code, scope); + } + code.line(); + } + code.line('return nil'); + } + code.closeBlock(); + code.line(); + } +} + +abstract class Validation { + public static forTypeMap( + expression: string, + description: string, + typeMap: GoTypeRef['typeMap'], + ): Validation | undefined { + switch (typeMap.type) { + case 'union': + return Validation.unionCheck(expression, description, typeMap.value); + case 'interface': + return Validation.interfaceCheck( + expression, + description, + typeMap.value, + ); + case 'array': + case 'map': + return Validation.collectionCheck( + expression, + description, + typeMap.value, + ); + case 'primitive': + case 'void': + return undefined; + } + } + + public static collectionCheck( + expression: string, + description: string, + elementType: GoTypeRef, + ): Validation | undefined { + // We need to come up with a unique-enough ID here... so we use a hash. + const idx = `idx_${createHash('sha256') + .update(expression) + .digest('hex') + .slice(0, 6)}`; + + // This is actually unused + const elementValidator = Validation.forTypeMap( + 'v', + `${description}[@{${idx}:#v}]`, + elementType.typeMap, + ); + if (elementValidator == null) { + return undefined; + } + + class CollectionCheck extends Validation { + public get specialDependencies(): SpecialDependencies { + return elementValidator!.specialDependencies; + } + + public get dependencies() { + return elementValidator!.dependencies; + } + + public emit(code: CodeMaker, scope: Package): void { + // We need to de-reference the pointer here (range does not operate on pointers) + code.openBlock(`for ${idx}, v := range *${expression}`); + elementValidator!.emit(code, scope); + code.closeBlock(); + } + } + + return new CollectionCheck(); + } + + public static interfaceCheck( + expression: string, + description: string, + iface: GoTypeRef, + ): Validation | undefined { + if (!iface.datatype) { + return undefined; + } + + class InterfaceCheck extends Validation { + public get dependencies(): readonly Package[] { + return []; + } + + public get specialDependencies(): SpecialDependencies { + return { + fmt: INTERPOLATION.test(description), + init: false, + internal: false, + runtime: !!iface.datatype, + time: false, + }; + } + + public emit(code: CodeMaker, _scope: Package): void { + code.openBlock( + `if err := ${JSII_RT_ALIAS}.ValidateStruct(${expression}, func() string { return ${interpolated( + description, + )} }); err != nil`, + ); + code.line(`return err`); + code.closeBlock(); + } + } + return new InterfaceCheck(); + } + + public static nullCheck( + expression: string, + description: string, + typeRef: GoTypeRef, + ): Validation { + class NullCheck extends Validation { + public get dependencies(): readonly Package[] { + return []; + } + + public get specialDependencies(): SpecialDependencies { + return { + fmt: true, + init: false, + internal: false, + runtime: false, + time: false, + }; + } + + public emit(code: CodeMaker): void { + const nullValue = typeRef.type?.type?.isEnumType() + ? `""` // Enums are represented as string-valued constants + : 'nil'; + code.openBlock(`if ${expression} == ${nullValue}`); + code.line( + returnErrorf(`${description} is required, but nil was provided`), + ); + code.closeBlock(); + } + } + return new NullCheck(); + } + + public static unionCheck( + expression: string, + description: string, + types: readonly GoTypeRef[], + ): Validation { + const hasInterface = types.some((t) => t.typeMap.type === 'interface'); + + class UnionCheck extends Validation { + public get dependencies(): readonly Package[] { + return types.flatMap((t) => t.dependencies); + } + + public get specialDependencies(): SpecialDependencies { + return reduceSpecialDependencies( + { + fmt: true, + init: false, + internal: false, + runtime: hasInterface, + time: false, + }, + ...types.flatMap((t) => { + const validator = Validation.forTypeMap( + expression, + description, + t.typeMap, + ); + if (validator == null) return []; + return [validator.specialDependencies]; + }), + ); + } + + public emit(code: CodeMaker, scope: Package): void { + const validTypes = new Array(); + + code.line(`switch ${expression}.(type) {`); + for (const type of types) { + const typeName = type.scopedReference(scope); + validTypes.push(typeName); + // Maps a type to the conversion instructions to the ${typeName} type + const acceptableTypes = new Map< + string, + | ((code: CodeMaker, inVar: string, outVar: string) => void) + | undefined + >(); + acceptableTypes.set(typeName, undefined); + switch (typeName) { + case '*float64': + // For numbers, we accept everything that implictly converts to float64 (pointer & not) + acceptableTypes.set('float64', (code, inVar, outVar) => + code.line(`${outVar} := &${inVar}`), + ); + const ALTERNATE_TYPES = [ + 'int', + 'uint', + 'int8', + 'int16', + 'int32', + 'int64', + 'uint8', + 'uint16', + 'uint32', + 'uint64', + ]; + for (const otherType of ALTERNATE_TYPES) { + const varName = createHash('sha256') + .update(expression) + .digest('hex') + .slice(6); + acceptableTypes.set(`*${otherType}`, (code) => { + code.openBlock( + `${varName} := func (v *${otherType}) *float64`, + ); + code.openBlock('if v == nil {'); + code.line('return nil'); + code.closeBlock(); + code.line(`val := float64(*v)`); + code.line(`return &val`); + code.closeBlock('()'); + }); + acceptableTypes.set(otherType, (code) => { + code.openBlock( + `${varName} := func (v ${otherType}) *float64`, + ); + code.line(`val := float64(v)`); + code.line(`return &val`); + code.closeBlock('()'); + }); + } + break; + default: + // Accept pointer and non-pointer versions of everything + if (typeName.startsWith('*')) { + const nonPointerType = typeName.slice(1); + acceptableTypes.set(nonPointerType, (code, inVar, outVar) => + code.line(`${outVar} := &${inVar}`), + ); + } + } + for (const [acceptableType, conversion] of acceptableTypes) { + code.indent(`case ${acceptableType}:`); + const outVar = /^[a-z0-9_]+$/.test(expression) ? expression : `v`; + const validation = Validation.forTypeMap( + outVar, + description, + type.typeMap, + ); + if (validation) { + const inVar = conversion ? `${outVar}_` : outVar; + code.line(`${inVar} := ${expression}.(${acceptableType})`); + if (conversion) { + conversion(code, inVar, outVar); + } + validation.emit(code, scope); + } else { + code.line('// ok'); + } + code.unindent(false); + } + } + code.indent('default:'); + if (hasInterface) + code.openBlock( + `if !${JSII_RT_ALIAS}.IsAnonymousProxy(${expression})`, + ); + code.line( + returnErrorf( + `${description} must be one of the allowed types: ${validTypes.join( + ', ', + )}; received @{${expression}:#v} (a @{${expression}:T})`, + ), + ); + if (hasInterface) code.closeBlock(); + code.unindent('}'); + } + } + return new UnionCheck(); + } + + private constructor() {} + + public abstract get dependencies(): readonly Package[]; + + public abstract get specialDependencies(): SpecialDependencies; + + public abstract emit(code: CodeMaker, scope: Package): void; +} + +const INTERPOLATION = /@\{([^}:]+)(?::([^}]+))?\}/; + +function interpolated(message: string): string { + // Need to escape literal percent signes, as a precaution. + let escaped = message.replace(/%/gm, '%%'); + + const args = new Array(); + let match: ReturnType; + while ((match = INTERPOLATION.exec(escaped))) { + const before = escaped.slice(0, match.index); + const expr = match[1]; + const mod = match[2]; + const after = escaped.slice( + match.index + match[1].length + 3 + (mod ? mod.length + 1 : 0), + ); + escaped = `${before}%${mod || 'v'}${after}`; + args.push(expr); + } + + if (args.length === 0) { + return JSON.stringify(message); + } + + return `fmt.Sprintf(${JSON.stringify(escaped)}, ${args.join(', ')})`; +} + +function returnErrorf(message: string): string { + const args = new Array(); + + // Need to escape literal percent signes, as a precaution. + message = message.replace(/%/gm, '%%'); + + let match: ReturnType; + while ((match = INTERPOLATION.exec(message))) { + const before = message.slice(0, match.index); + const expr = match[1]; + const mod = match[2]; + const after = message.slice( + match.index + match[1].length + 3 + (mod ? mod.length + 1 : 0), + ); + message = `${before}%${mod || 'v'}${after}`; + args.push(expr); + } + + return `return fmt.Errorf(${[JSON.stringify(message), ...args].join(', ')})`; +} + +function syntheticParameter( + parent: GoClass | GoInterface, + name: string, + type: TypeReference, + optional: boolean, +) { + return new GoParameter( + parent, + new Parameter( + parent.type.system, + parent.type, + new Method( + parent.type.system, + parent.type.assembly, + parent.type, + parent.type, + { name: '__synthetic__' }, + ), + { + name, + optional, + type, + }, + ), + ); +} diff --git a/packages/jsii-pacmak/lib/targets/go/types/class.ts b/packages/jsii-pacmak/lib/targets/go/types/class.ts index e344d4a2d0..81c01fd8ef 100644 --- a/packages/jsii-pacmak/lib/targets/go/types/class.ts +++ b/packages/jsii-pacmak/lib/targets/go/types/class.ts @@ -1,4 +1,3 @@ -import { CodeMaker } from 'codemaker'; import { Method, ClassType, Initializer } from 'jsii-reflect'; import { jsiiToPascalCase } from '../../../naming-util'; @@ -11,9 +10,8 @@ import { JSII_RT_ALIAS, MethodCall, slugify, - StaticGetProperty, - StaticSetProperty, } from '../runtime'; +import { ParameterValidator } from '../runtime/runtime-type-checking'; import { getMemberDependencies, getParamDependencies } from '../util'; import { GoType } from './go-type'; import { GoTypeRef } from './go-type-reference'; @@ -33,6 +31,7 @@ export class GoClass extends GoType { private _implements?: readonly GoInterface[]; private readonly initializer?: GoClassConstructor; + #parameterValidators?: ParameterValidator[]; public constructor(pkg: Package, type: ClassType) { super(pkg, type); @@ -68,6 +67,21 @@ export class GoClass extends GoType { } } + public get parameterValidators(): readonly ParameterValidator[] { + if (this.#parameterValidators === undefined) { + this.#parameterValidators = [ + ...this.methods.map((m) => m.validator!).filter((v) => v != null), + ...this.staticMethods.map((m) => m.validator!).filter((v) => v != null), + ...this.properties.map((m) => m.validator!).filter((v) => v != null), + ...this.staticProperties + .map((m) => m.validator!) + .filter((v) => v != null), + ...(this.initializer?.validator ? [this.initializer.validator] : []), + ]; + } + return this.#parameterValidators; + } + public get extends(): GoClass | undefined { // Cannot compute in constructor, as dependencies may not have finished // resolving just yet. @@ -111,7 +125,8 @@ export class GoClass extends GoType { } for (const prop of this.staticProperties) { - this.emitStaticProperty(context, prop); + prop.emitGetterProxy(context); + prop.emitSetterProxy(context); } for (const method of this.methods) { @@ -119,7 +134,7 @@ export class GoClass extends GoType { } } - public emitRegistration(code: CodeMaker): void { + public emitRegistration({ code }: EmitContext): void { code.open(`${JSII_RT_ALIAS}.RegisterClass(`); code.line(`"${this.fqn}",`); code.line(`reflect.TypeOf((*${this.name})(nil)).Elem(),`); @@ -158,11 +173,12 @@ export class GoClass extends GoType { public get specialDependencies(): SpecialDependencies { return { - runtime: this.initializer != null || this.members.length > 0, + fmt: false, init: this.initializer != null || this.members.some((m) => m.specialDependencies.init), internal: this.baseTypes.some((base) => this.pkg.isExternalType(base)), + runtime: this.initializer != null || this.members.length > 0, time: !!this.initializer?.specialDependencies.time || this.members.some((m) => m.specialDependencies.time), @@ -228,29 +244,6 @@ export class GoClass extends GoType { code.line(); } - private emitStaticProperty({ code }: EmitContext, prop: GoProperty): void { - const getCaller = new StaticGetProperty(prop); - - const propertyName = jsiiToPascalCase(prop.name); - const name = `${this.name}_${propertyName}`; - - code.openBlock(`func ${name}() ${prop.returnType}`); - getCaller.emit(code); - - code.closeBlock(); - code.line(); - - if (!prop.immutable) { - const setCaller = new StaticSetProperty(prop); - const name = `${this.name}_Set${propertyName}`; - code.openBlock(`func ${name}(val ${prop.returnType})`); - setCaller.emit(code); - - code.closeBlock(); - code.line(); - } - } - // emits the implementation of the setters for the struct private emitSetters(context: EmitContext): void { for (const property of this.properties) { @@ -277,6 +270,7 @@ export class GoClass extends GoType { export class GoClassConstructor extends GoMethod { private readonly constructorRuntimeCall: ClassConstructor; + #validator: ParameterValidator | undefined | null = null; public constructor( public readonly parent: GoClass, @@ -286,11 +280,19 @@ export class GoClassConstructor extends GoMethod { this.constructorRuntimeCall = new ClassConstructor(this); } + public get validator() { + if (this.#validator === null) { + this.#validator = ParameterValidator.forConstructor(this); + } + return this.#validator; + } + public get specialDependencies(): SpecialDependencies { return { - runtime: true, + fmt: false, init: true, internal: false, + runtime: true, time: this.parameters.some((p) => p.reference.specialDependencies.time), }; } @@ -306,7 +308,9 @@ export class GoClassConstructor extends GoMethod { } } - private emitNew({ code, documenter }: EmitContext) { + private emitNew(context: EmitContext) { + const { code, documenter } = context; + const constr = `New${this.parent.name}`; const paramString = this.parameters.length === 0 @@ -315,7 +319,7 @@ export class GoClassConstructor extends GoMethod { documenter.emit(this.type.docs, this.apiLocation); code.openBlock(`func ${constr}(${paramString}) ${this.parent.name}`); - this.constructorRuntimeCall.emit(code); + this.constructorRuntimeCall.emit(context); code.closeBlock(); code.line(); @@ -348,9 +352,10 @@ export class ClassMethod extends GoMethod { } /* emit generates method implementation on the class */ - public emit({ code }: EmitContext) { + public emit(context: EmitContext) { const name = this.name; const returnTypeString = this.reference?.void ? '' : ` ${this.returnType}`; + const { code } = context; code.openBlock( `func (${this.instanceArg} *${ @@ -358,7 +363,7 @@ export class ClassMethod extends GoMethod { }) ${name}(${this.paramString()})${returnTypeString}`, ); - this.runtimeCall.emit(code); + this.runtimeCall.emit(context); code.closeBlock(); code.line(); @@ -375,11 +380,16 @@ export class ClassMethod extends GoMethod { return this.parent.name.substring(0, 1).toLowerCase(); } + public get static(): boolean { + return !!this.method.spec.static; + } + public get specialDependencies(): SpecialDependencies { return { - runtime: true, + fmt: false, init: this.method.static, internal: false, + runtime: true, time: !!this.parameters.some((p) => p.reference.specialDependencies.time) || !!this.reference?.specialDependencies.time, @@ -388,21 +398,27 @@ export class ClassMethod extends GoMethod { } export class StaticMethod extends ClassMethod { + public readonly name: string; + public constructor( public readonly parent: GoClass, public readonly method: Method, ) { super(parent, method); + + this.name = `${this.parent.name}_${jsiiToPascalCase(method.name)}`; } - public emit({ code, documenter }: EmitContext) { - const name = `${this.parent.name}_${this.name}`; + public emit(context: EmitContext) { const returnTypeString = this.reference?.void ? '' : ` ${this.returnType}`; + const { code, documenter } = context; documenter.emit(this.method.docs, this.apiLocation); - code.openBlock(`func ${name}(${this.paramString()})${returnTypeString}`); + code.openBlock( + `func ${this.name}(${this.paramString()})${returnTypeString}`, + ); - this.runtimeCall.emit(code); + this.runtimeCall.emit(context); code.closeBlock(); code.line(); diff --git a/packages/jsii-pacmak/lib/targets/go/types/enum.ts b/packages/jsii-pacmak/lib/targets/go/types/enum.ts index 6028b01501..528b59b149 100644 --- a/packages/jsii-pacmak/lib/targets/go/types/enum.ts +++ b/packages/jsii-pacmak/lib/targets/go/types/enum.ts @@ -1,4 +1,3 @@ -import { CodeMaker } from 'codemaker'; import { EnumType, EnumMember, Docs } from 'jsii-reflect'; import { ApiLocation } from 'jsii-rosetta'; @@ -17,6 +16,10 @@ export class Enum extends GoType { this.members = type.members.map((mem) => new GoEnumMember(this, mem)); } + public get parameterValidators() { + return []; + } + public emit(context: EmitContext) { this.emitDocs(context); @@ -36,7 +39,7 @@ export class Enum extends GoType { code.line(); } - public emitRegistration(code: CodeMaker): void { + public emitRegistration({ code }: EmitContext): void { code.open(`${JSII_RT_ALIAS}.RegisterEnum(`); code.line(`"${this.fqn}",`); code.line(`reflect.TypeOf((*${this.name})(nil)).Elem(),`); @@ -54,9 +57,10 @@ export class Enum extends GoType { public get specialDependencies(): SpecialDependencies { return { - runtime: false, + fmt: false, init: false, internal: false, + runtime: false, time: false, }; } diff --git a/packages/jsii-pacmak/lib/targets/go/types/go-type-reference.ts b/packages/jsii-pacmak/lib/targets/go/types/go-type-reference.ts index 21c88eceab..a4cf60ec3f 100644 --- a/packages/jsii-pacmak/lib/targets/go/types/go-type-reference.ts +++ b/packages/jsii-pacmak/lib/targets/go/types/go-type-reference.ts @@ -51,6 +51,9 @@ export class GoTypeRef { public constructor( public readonly root: Package, public readonly reference: TypeReference, + private readonly options: { readonly opaqueUnionTypes: boolean } = { + opaqueUnionTypes: true, + }, ) {} public get type(): GoType | undefined { @@ -63,28 +66,31 @@ export class GoTypeRef { public get specialDependencies(): SpecialDependencies { return { - runtime: false, + fmt: false, init: false, internal: false, - time: containsDate(this.reference), + runtime: false, + time: containsDate(this.reference, this.options.opaqueUnionTypes), }; - function containsDate(ref: TypeReference): boolean { + function containsDate( + ref: TypeReference, + opaqueUnionType: boolean, + ): boolean { if (ref.primitive === 'date') { return true; } if (ref.arrayOfType) { - return containsDate(ref.arrayOfType); + return containsDate(ref.arrayOfType, opaqueUnionType); } if (ref.mapOfType) { - return containsDate(ref.mapOfType); + return containsDate(ref.mapOfType, opaqueUnionType); + } + if (!opaqueUnionType && ref.unionOfTypes) { + return ref.unionOfTypes.some((item) => + containsDate(item, opaqueUnionType), + ); } - // NOTE: UNION gets represented as interface{} so we don't need to import - // individual types here... - // - // if (ref.unionOfTypes) { - // return ref.unionOfTypes.some(containsDate); - // } return false; } } @@ -140,13 +146,11 @@ export class GoTypeRef { break; case 'union': - // Unions ultimately result in `interface{}` being rendered, so no import is needed. We - // hence ignore them entirely here for now. In the future, we may want to inject specific - // runtime type checks around use of unions, which may result in imports being useful. - - // for (const t of this.typeMap.value) { - // ret.push(...t.dependencies); - // } + if (!this.options.opaqueUnionTypes) { + for (const t of this.typeMap.value) { + ret.push(...t.dependencies); + } + } break; case 'void': @@ -157,6 +161,24 @@ export class GoTypeRef { return ret; } + public get unionOfTypes(): readonly GoTypeRef[] | undefined { + const typeMap = this.typeMap; + if (typeMap.type !== 'union') { + return undefined; + } + return typeMap.value; + } + + public get withTransparentUnions(): GoTypeRef { + if (!this.options.opaqueUnionTypes) { + return this; + } + return new GoTypeRef(this.root, this.reference, { + ...this.options, + opaqueUnionTypes: false, + }); + } + /* * Return the name of a type for reference from the `Package` passed in */ @@ -174,18 +196,22 @@ export class GoTypeRef { } else if (ref.reference.arrayOfType) { return { type: 'array', - value: new GoTypeRef(this.root, ref.reference.arrayOfType), + value: new GoTypeRef( + this.root, + ref.reference.arrayOfType, + this.options, + ), }; } else if (ref.reference.mapOfType) { return { type: 'map', - value: new GoTypeRef(this.root, ref.reference.mapOfType), + value: new GoTypeRef(this.root, ref.reference.mapOfType, this.options), }; } else if (ref.reference.unionOfTypes) { return { type: 'union', value: ref.reference.unionOfTypes.map( - (typeRef) => new GoTypeRef(this.root, typeRef), + (typeRef) => new GoTypeRef(this.root, typeRef, this.options), ), }; } else if (ref.reference.void) { diff --git a/packages/jsii-pacmak/lib/targets/go/types/go-type.ts b/packages/jsii-pacmak/lib/targets/go/types/go-type.ts index 2ae0813df3..de7df979cd 100644 --- a/packages/jsii-pacmak/lib/targets/go/types/go-type.ts +++ b/packages/jsii-pacmak/lib/targets/go/types/go-type.ts @@ -6,6 +6,10 @@ import { SpecialDependencies } from '../dependencies'; import { EmitContext } from '../emit-context'; import { Package } from '../package'; import { JSII_RT_ALIAS } from '../runtime'; +import { + ParameterValidator, + StructValidator, +} from '../runtime/runtime-type-checking'; import { GoClass } from './class'; import { GoInterface } from './interface'; @@ -36,9 +40,15 @@ export abstract class GoType { this.apiLocation = { api: 'type', fqn: this.fqn }; } + public get structValidator(): StructValidator | undefined { + return undefined; + } + + public abstract get parameterValidators(): readonly ParameterValidator[]; + public abstract emit(context: EmitContext): void; - public abstract emitRegistration(code: CodeMaker): void; + public abstract emitRegistration(context: EmitContext): void; public abstract get dependencies(): Package[]; public abstract get specialDependencies(): SpecialDependencies; diff --git a/packages/jsii-pacmak/lib/targets/go/types/interface.ts b/packages/jsii-pacmak/lib/targets/go/types/interface.ts index aa38bb8671..443c144750 100644 --- a/packages/jsii-pacmak/lib/targets/go/types/interface.ts +++ b/packages/jsii-pacmak/lib/targets/go/types/interface.ts @@ -1,11 +1,14 @@ -import { CodeMaker } from 'codemaker'; import { InterfaceType, Method, Property } from 'jsii-reflect'; import * as comparators from '../comparators'; -import { SpecialDependencies } from '../dependencies'; +import { + reduceSpecialDependencies, + SpecialDependencies, +} from '../dependencies'; import { EmitContext } from '../emit-context'; import { Package } from '../package'; import { JSII_RT_ALIAS, MethodCall } from '../runtime'; +import { ParameterValidator } from '../runtime/runtime-type-checking'; import { getMemberDependencies, getParamDependencies } from '../util'; import { GoType } from './go-type'; import { GoTypeRef } from './go-type-reference'; @@ -17,6 +20,8 @@ export class GoInterface extends GoType { public readonly properties: InterfaceProperty[]; public readonly reimplementedProperties: readonly InterfaceProperty[]; + #parameterValidators?: readonly ParameterValidator[]; + public constructor(pkg: Package, type: InterfaceType) { super(pkg, type); @@ -56,6 +61,22 @@ export class GoInterface extends GoType { } } + public get parameterValidators(): readonly ParameterValidator[] { + if (this.#parameterValidators == null) { + this.#parameterValidators = [ + ...this.methods.map((m) => m.validator!).filter((v) => v != null), + ...this.reimplementedMethods + .map((m) => m.validator!) + .filter((v) => v != null), + ...this.properties.map((p) => p.validator!).filter((v) => v != null), + ...this.reimplementedProperties + .map((p) => p.validator!) + .filter((v) => v != null), + ]; + } + return this.#parameterValidators; + } + public emit(context: EmitContext) { this.emitDocs(context); @@ -118,7 +139,7 @@ export class GoInterface extends GoType { } } - public emitRegistration(code: CodeMaker): void { + public emitRegistration({ code }: EmitContext): void { code.open(`${JSII_RT_ALIAS}.RegisterInterface(`); code.line(`"${this.fqn}",`); code.line(`reflect.TypeOf((*${this.name})(nil)).Elem(),`); @@ -146,24 +167,18 @@ export class GoInterface extends GoType { } public get specialDependencies(): SpecialDependencies { - return [ - ...this.properties.map((p) => p.specialDependencies), - ...this.reimplementedProperties.map((p) => p.specialDependencies), - ...this.methods.map((m) => m.specialDependencies), - ...this.reimplementedMethods.map((m) => m.specialDependencies), - ].reduce( - (acc, elt) => ({ - runtime: acc.runtime || elt.runtime, - init: acc.init || elt.init, - internal: acc.internal, - time: acc.time || elt.time, - }), + return reduceSpecialDependencies( { - runtime: false, + fmt: false, init: false, internal: this.extends.some((base) => this.pkg.isExternalType(base)), + runtime: false, time: false, }, + ...this.properties.map((p) => p.specialDependencies), + ...this.reimplementedProperties.map((p) => p.specialDependencies), + ...this.methods.map((m) => m.specialDependencies), + ...this.reimplementedMethods.map((m) => m.specialDependencies), ); } @@ -242,15 +257,16 @@ class InterfaceMethod extends GoMethod { code.line(`${this.name}(${this.paramString()})${this.returnTypeString}`); } - public emit({ code }: EmitContext) { + public emit(context: EmitContext) { const name = this.name; + const { code } = context; code.openBlock( `func (${this.instanceArg} *${ this.parent.proxyName }) ${name}(${this.paramString()})${this.returnTypeString}`, ); - this.runtimeCall.emit(code); + this.runtimeCall.emit(context); code.closeBlock(); code.line(); @@ -258,9 +274,10 @@ class InterfaceMethod extends GoMethod { public get specialDependencies(): SpecialDependencies { return { - runtime: true, + fmt: false, init: false, internal: false, + runtime: true, time: this.parameters.some((p) => p.reference.specialDependencies.time) || !!this.reference?.specialDependencies.time, diff --git a/packages/jsii-pacmak/lib/targets/go/types/struct.ts b/packages/jsii-pacmak/lib/targets/go/types/struct.ts index f64c6567fb..df3359dc41 100644 --- a/packages/jsii-pacmak/lib/targets/go/types/struct.ts +++ b/packages/jsii-pacmak/lib/targets/go/types/struct.ts @@ -1,11 +1,14 @@ import * as assert from 'assert'; -import { CodeMaker } from 'codemaker'; import { InterfaceType } from 'jsii-reflect'; import { SpecialDependencies } from '../dependencies'; import { EmitContext } from '../emit-context'; import { Package } from '../package'; import { JSII_RT_ALIAS } from '../runtime'; +import { + ParameterValidator, + StructValidator, +} from '../runtime/runtime-type-checking'; import { getMemberDependencies } from '../util'; import { GoType } from './go-type'; import { GoProperty } from './type-member'; @@ -14,7 +17,9 @@ import { GoProperty } from './type-member'; * Struct wraps a JSII datatype interface aka, structs */ export class Struct extends GoType { - private readonly properties: readonly GoProperty[]; + public readonly properties: readonly GoProperty[]; + #structValidator: StructValidator | undefined; + #validators?: readonly ParameterValidator[]; public constructor(parent: Package, type: InterfaceType) { super(parent, type); @@ -29,15 +34,32 @@ export class Struct extends GoType { ); } + public get parameterValidators(): readonly ParameterValidator[] { + if (this.#validators == null) { + this.#validators = this.properties + .map((p) => p.validator!) + .filter((v) => v != null); + } + return this.#validators; + } + + public get structValidator(): StructValidator | undefined { + if (this.#structValidator === null) { + this.#structValidator = StructValidator.for(this); + } + return this.#structValidator; + } + public get dependencies(): Package[] { return getMemberDependencies(this.properties); } public get specialDependencies(): SpecialDependencies { return { - runtime: false, + fmt: false, init: false, internal: false, + runtime: false, time: this.properties.some((prop) => prop.specialDependencies.time), }; } @@ -53,10 +75,18 @@ export class Struct extends GoType { code.line(); } - public emitRegistration(code: CodeMaker): void { + public emitRegistration({ code, runtimeTypeChecking }: EmitContext): void { code.open(`${JSII_RT_ALIAS}.RegisterStruct(`); code.line(`"${this.fqn}",`); code.line(`reflect.TypeOf((*${this.name})(nil)).Elem(),`); code.close(')'); + if (runtimeTypeChecking && this.structValidator) { + code.open(`${JSII_RT_ALIAS}.RegisterStructValidator(`); + code.line(`reflect.TypeOf((*${this.name})(nil)).Elem(),`); + code.open('func (i interface{}, d func() string) error {'); + code.line(`return (i.(*${this.name})).validate(d)`); + code.close('},'); + code.close(')'); + } } } diff --git a/packages/jsii-pacmak/lib/targets/go/types/type-member.ts b/packages/jsii-pacmak/lib/targets/go/types/type-member.ts index e81b03fe8c..0683864096 100644 --- a/packages/jsii-pacmak/lib/targets/go/types/type-member.ts +++ b/packages/jsii-pacmak/lib/targets/go/types/type-member.ts @@ -12,7 +12,14 @@ import { jsiiToPascalCase } from '../../../naming-util'; import { SpecialDependencies } from '../dependencies'; import { EmitContext } from '../emit-context'; import { Package } from '../package'; -import { GetProperty, JSII_RT_ALIAS, SetProperty } from '../runtime'; +import { + GetProperty, + JSII_RT_ALIAS, + SetProperty, + StaticGetProperty, + StaticSetProperty, +} from '../runtime'; +import { ParameterValidator } from '../runtime/runtime-type-checking'; import { substituteReservedWords } from '../util'; import { GoClass, GoType, GoInterface, GoTypeRef } from './index'; @@ -35,14 +42,22 @@ export interface GoTypeMember { */ export class GoProperty implements GoTypeMember { public readonly name: string; + public readonly setterName: string; public readonly immutable: boolean; protected readonly apiLocation: ApiLocation; + #validator: ParameterValidator | undefined | null = null; public constructor( public parent: GoType, public readonly property: Property, ) { - this.name = jsiiToPascalCase(this.property.name); + const localName = jsiiToPascalCase(this.property.name); + this.name = property.spec.static + ? `${parent.name}_${localName}` + : localName; + this.setterName = property.spec.static + ? `${parent.name}_Set${localName}` + : `Set${this.name}`; this.immutable = property.immutable; this.apiLocation = { api: 'member', @@ -51,15 +66,23 @@ export class GoProperty implements GoTypeMember { }; } + public get validator(): ParameterValidator | undefined { + if (this.#validator === null) { + this.#validator = ParameterValidator.forProperty(this); + } + return this.#validator; + } + public get reference(): GoTypeRef { return new GoTypeRef(this.parent.pkg.root, this.property.type); } public get specialDependencies(): SpecialDependencies { return { - runtime: true, + fmt: false, init: this.static, internal: false, + runtime: true, time: !!this.reference?.specialDependencies.time, }; } @@ -104,39 +127,33 @@ export class GoProperty implements GoTypeMember { code.line(`${this.name}() ${this.returnType}`); } - public emitGetter({ code }: EmitContext): void { - const receiver = this.parent.name; - const instanceArg = receiver.substring(0, 1).toLowerCase(); - - code.openBlock( - `func (${instanceArg} *${receiver}) Get${this.name}() ${this.returnType}`, - ); - code.line(`return ${instanceArg}.${this.name}`); - code.closeBlock(); - } - public emitSetterDecl({ code, documenter }: EmitContext) { if (!this.immutable) { // For setters, only emit the stability. Copying the documentation from // the getter might result in confusing documentation. This is an "okay" // middle-ground. documenter.emitStability(this.property.docs); - code.line(`Set${this.name}(val ${this.returnType})`); + code.line(`${this.setterName}(val ${this.returnType})`); } } // Emits getter methods on the struct for each property public emitGetterProxy(context: EmitContext) { const { code } = context; - const receiver = this.parent.proxyName; - const instanceArg = receiver.substring(0, 1).toLowerCase(); - code.openBlock( - `func (${instanceArg} *${receiver}) ${this.name}() ${this.returnType}`, - ); + if (!this.static) { + const receiver = this.parent.proxyName; + const instanceArg = receiver.substring(0, 1).toLowerCase(); - new GetProperty(this).emit(code); + code.openBlock( + `func (${instanceArg} *${receiver}) ${this.name}() ${this.returnType}`, + ); + new GetProperty(this).emit(code); + } else { + code.openBlock(`func ${this.name}() ${this.returnType}`); + new StaticGetProperty(this).emit(code); + } code.closeBlock(); code.line(); } @@ -144,15 +161,20 @@ export class GoProperty implements GoTypeMember { public emitSetterProxy(context: EmitContext) { if (!this.immutable) { const { code } = context; - const receiver = this.parent.proxyName; - const instanceArg = receiver.substring(0, 1).toLowerCase(); - code.openBlock( - `func (${instanceArg} *${receiver}) Set${this.name}(val ${this.returnType})`, - ); + if (!this.static) { + const receiver = this.parent.proxyName; + const instanceArg = receiver.substring(0, 1).toLowerCase(); - new SetProperty(this).emit(code); + code.openBlock( + `func (${instanceArg} *${receiver})${this.setterName}(val ${this.returnType})`, + ); + new SetProperty(this).emit(context); + } else { + code.openBlock(`func ${this.setterName}(val ${this.returnType})`); + new StaticSetProperty(this).emit(context); + } code.closeBlock(); code.line(); } @@ -163,6 +185,7 @@ export abstract class GoMethod implements GoTypeMember { public readonly name: string; public readonly parameters: GoParameter[]; protected readonly apiLocation: ApiLocation; + #validator: ParameterValidator | undefined | null = null; public constructor( public readonly parent: GoClass | GoInterface, @@ -179,6 +202,13 @@ export abstract class GoMethod implements GoTypeMember { : { api: 'member', fqn: parent.fqn, memberName: method.name }; } + public get validator() { + if (this.#validator === null) { + this.#validator = ParameterValidator.forMethod(this); + } + return this.#validator; + } + public abstract emit(context: EmitContext): void; public abstract get specialDependencies(): SpecialDependencies; @@ -215,6 +245,10 @@ export abstract class GoMethod implements GoTypeMember { return `${JSII_RT_ALIAS}.MemberMethod{JsiiMethod: "${this.method.name}", GoMethod: "${this.name}"}`; } + public get static(): boolean { + return false; + } + public paramString(): string { return this.parameters.length === 0 ? '' @@ -224,12 +258,14 @@ export abstract class GoMethod implements GoTypeMember { export class GoParameter { public readonly name: string; + public readonly isOptional: boolean; public readonly isVariadic: boolean; private readonly type: TypeReference; private readonly pkg: Package; public constructor(parent: GoClass | GoInterface, parameter: Parameter) { this.name = substituteReservedWords(parameter.name); + this.isOptional = parameter.optional; this.isVariadic = parameter.variadic; this.type = parameter.type; this.pkg = parent.pkg; diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/examples.test.js.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/examples.test.js.snap index 7c1d15db12..bf23fbb5f0 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/examples.test.js.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/examples.test.js.snap @@ -25,6 +25,8 @@ exports[`diamond-struct-parameter.ts: / 1`] = ` ┃ ┣━ 📁 jsii ┃ ┃ ┗━ 📄 jsii.go ┃ ┣━ 📄 testpkg_Baz.go + ┃ ┣━ 📄 testpkg_Consumer__no_runtime_type_checking.go + ┃ ┣━ 📄 testpkg_Consumer__runtime_type_checks.go ┃ ┣━ 📄 testpkg_Consumer.go ┃ ┣━ 📄 testpkg_Foo.go ┃ ┣━ 📄 testpkg_FooBar.go @@ -482,6 +484,9 @@ type jsiiProxy_Consumer struct { func Consumer_ConsumeBaz(baz *Baz) { _init_.Initialize() + if err := validateConsumer_ConsumeBazParameters(baz); err != nil { + panic(err) + } _jsii_.StaticInvokeVoid( "testpkg.Consumer", "consumeBaz", @@ -490,6 +495,49 @@ func Consumer_ConsumeBaz(baz *Baz) { } +`; + +exports[`diamond-struct-parameter.ts: /go/testpkg/testpkg_Consumer__no_runtime_type_checking.go 1`] = ` +//go:build no_runtime_type_checking +// +build no_runtime_type_checking + +// testpkg +package testpkg + +// Building without runtime type checking enabled, so all the below just return nil + +func validateConsumer_ConsumeBazParameters(baz *Baz) error { + return nil +} + + +`; + +exports[`diamond-struct-parameter.ts: /go/testpkg/testpkg_Consumer__runtime_type_checks.go 1`] = ` +//go:build !no_runtime_type_checking +// +build !no_runtime_type_checking + +// testpkg +package testpkg + +import ( + "fmt" + + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +func validateConsumer_ConsumeBazParameters(baz *Baz) error { + if baz == nil { + return fmt.Errorf("parameter baz is required, but nil was provided") + } + if err := _jsii_.ValidateStruct(baz, func() string { return "parameter baz" }); err != nil { + return err + } + + return nil +} + + `; exports[`diamond-struct-parameter.ts: /go/testpkg/testpkg_Foo.go 1`] = ` diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-dotnet.test.js.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-dotnet.test.js.snap index b8d50dbd2c..9608202087 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-dotnet.test.js.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-dotnet.test.js.snap @@ -3705,43 +3705,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace get => GetInstanceProperty()!; set { - if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) - { - for (var __idx_cd4240 = 0 ; __idx_cd4240 < value.Length ; __idx_cd4240++) - { - switch (value[__idx_cd4240]) - { - case double cast_e9c63e: - break; - case byte cast_e9c63e: - break; - case decimal cast_e9c63e: - break; - case float cast_e9c63e: - break; - case int cast_e9c63e: - break; - case long cast_e9c63e: - break; - case sbyte cast_e9c63e: - break; - case short cast_e9c63e: - break; - case uint cast_e9c63e: - break; - case ulong cast_e9c63e: - break; - case ushort cast_e9c63e: - break; - case Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.NumericValue cast_e9c63e: - break; - case null: - throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}] to be one of: double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.NumericValue).FullName}; received null", nameof(value)); - default: - throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}] to be one of: double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.NumericValue).FullName}; received {value[__idx_cd4240].GetType().FullName}", nameof(value)); - } - } - } SetInstanceProperty(value); } } @@ -3752,45 +3715,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace get => GetInstanceProperty>()!; set { - if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) - { - foreach (var __item_cd4240 in value) - { - switch (__item_cd4240.Value) - { - case string cast_af5ffb: - break; - case double cast_af5ffb: - break; - case byte cast_af5ffb: - break; - case decimal cast_af5ffb: - break; - case float cast_af5ffb: - break; - case int cast_af5ffb: - break; - case long cast_af5ffb: - break; - case sbyte cast_af5ffb: - break; - case short cast_af5ffb: - break; - case uint cast_af5ffb: - break; - case ulong cast_af5ffb: - break; - case ushort cast_af5ffb: - break; - case Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Number cast_af5ffb: - break; - case null: - throw new System.ArgumentException($"Expected {nameof(value)}[\\"{__item_cd4240.Key}\\"] to be one of: string, double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Number).FullName}; received null", nameof(value)); - default: - throw new System.ArgumentException($"Expected {nameof(value)}[\\"{__item_cd4240.Key}\\"] to be one of: string, double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Number).FullName}; received {__item_cd4240.Value.GetType().FullName}", nameof(value)); - } - } - } SetInstanceProperty(value); } } @@ -3801,44 +3725,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace get => GetInstanceProperty()!; set { - if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) - { - switch (value) - { - case string cast_cd4240: - break; - case double cast_cd4240: - break; - case byte cast_cd4240: - break; - case decimal cast_cd4240: - break; - case float cast_cd4240: - break; - case int cast_cd4240: - break; - case long cast_cd4240: - break; - case sbyte cast_cd4240: - break; - case short cast_cd4240: - break; - case uint cast_cd4240: - break; - case ulong cast_cd4240: - break; - case ushort cast_cd4240: - break; - case Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Number cast_cd4240: - break; - case Amazon.JSII.Tests.CalculatorNamespace.Multiply cast_cd4240: - break; - case null: - throw new System.ArgumentException($"Expected {nameof(value)} to be one of: string, double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Number).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.Multiply).FullName}; received null", nameof(value)); - default: - throw new System.ArgumentException($"Expected {nameof(value)} to be one of: string, double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Number).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.Multiply).FullName}; received {value.GetType().FullName}", nameof(value)); - } - } SetInstanceProperty(value); } } @@ -4101,23 +3987,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Anonymous [JsiiMethod(name: "consume", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", parametersJson: "[{\\"name\\":\\"option\\",\\"type\\":{\\"union\\":{\\"types\\":[{\\"fqn\\":\\"jsii-calc.anonymous.IOptionA\\"},{\\"fqn\\":\\"jsii-calc.anonymous.IOptionB\\"}]}}}]")] public static string Consume(object option) { - if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) - { - switch (option) - { - case Amazon.JSII.Tests.CalculatorNamespace.Anonymous.IOptionA cast_a11a75: - break; - case Amazon.JSII.Tests.CalculatorNamespace.Anonymous.IOptionB cast_a11a75: - break; - case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_a11a75: - // Not enough information to type-check... - break; - case null: - throw new System.ArgumentException($"Expected argument {nameof(option)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.Anonymous.IOptionA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.Anonymous.IOptionB).FullName}; received null", nameof(option)); - default: - throw new System.ArgumentException($"Expected argument {nameof(option)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.Anonymous.IOptionA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.Anonymous.IOptionB).FullName}; received {option.GetType().FullName}", nameof(option)); - } - } return InvokeStaticMethod(typeof(Amazon.JSII.Tests.CalculatorNamespace.Anonymous.UseOptions), new System.Type[]{typeof(object)}, new object[]{option})!; } @@ -4765,22 +4634,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace get => GetInstanceProperty(); set { - if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) - { - switch (value) - { - case Amazon.JSII.Tests.CalculatorNamespace.Add cast_cd4240: - break; - case Amazon.JSII.Tests.CalculatorNamespace.Multiply cast_cd4240: - break; - case Amazon.JSII.Tests.CalculatorNamespace.Power cast_cd4240: - break; - case null: - break; - default: - throw new System.ArgumentException($"Expected {nameof(value)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.Add).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.Multiply).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.Power).FullName}; received {value.GetType().FullName}", nameof(value)); - } - } SetInstanceProperty(value); } } @@ -5130,29 +4983,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] private static DeputyProps _MakeDeputyProps(System.Collections.Generic.IDictionary[] unionProperty) { - if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) - { - for (var __idx_7e4c6f = 0 ; __idx_7e4c6f < unionProperty.Length ; __idx_7e4c6f++) - { - foreach (var __item_85d4f8 in unionProperty[__idx_7e4c6f]) - { - switch (__item_85d4f8.Value) - { - case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_7df241: - break; - case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_7df241: - break; - case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_7df241: - // Not enough information to type-check... - break; - case null: - throw new System.ArgumentException($"Expected argument {nameof(unionProperty)}[{__idx_7e4c6f}][\\"{__item_85d4f8.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(unionProperty)); - default: - throw new System.ArgumentException($"Expected argument {nameof(unionProperty)}[{__idx_7e4c6f}][\\"{__item_85d4f8.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {__item_85d4f8.Value.GetType().FullName}", nameof(unionProperty)); - } - } - } - } return new DeputyProps(new object?[]{unionProperty}); } @@ -5176,29 +5006,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace get => GetInstanceProperty[]>()!; set { - if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) - { - for (var __idx_cd4240 = 0 ; __idx_cd4240 < value.Length ; __idx_cd4240++) - { - foreach (var __item_e9c63e in value[__idx_cd4240]) - { - switch (__item_e9c63e.Value) - { - case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_b53a7c: - break; - case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_b53a7c: - break; - case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_b53a7c: - // Not enough information to type-check... - break; - case null: - throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}][\\"{__item_e9c63e.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(value)); - default: - throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}][\\"{__item_e9c63e.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {__item_e9c63e.Value.GetType().FullName}", nameof(value)); - } - } - } - } SetInstanceProperty(value); } } @@ -5511,57 +5318,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] private static DeputyProps _MakeDeputyProps(object[] unionProperty) { - if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) - { - for (var __idx_7e4c6f = 0 ; __idx_7e4c6f < unionProperty.Length ; __idx_7e4c6f++) - { - switch (unionProperty[__idx_7e4c6f]) - { - case System.Collections.Generic.IDictionary cast_85d4f8: - foreach (var __item_94dd05 in cast_85d4f8) - { - switch (__item_94dd05.Value) - { - case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_dd6247: - break; - case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_dd6247: - break; - case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_dd6247: - // Not enough information to type-check... - break; - case null: - throw new System.ArgumentException($"Expected argument {nameof(unionProperty)}[{__idx_7e4c6f}][\\"{__item_94dd05.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(unionProperty)); - default: - throw new System.ArgumentException($"Expected argument {nameof(unionProperty)}[{__idx_7e4c6f}][\\"{__item_94dd05.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {__item_94dd05.Value.GetType().FullName}", nameof(unionProperty)); - } - } - break; - case object[] cast_85d4f8: - for (var __idx_94dd05 = 0 ; __idx_94dd05 < cast_85d4f8.Length ; __idx_94dd05++) - { - switch (cast_85d4f8[__idx_94dd05]) - { - case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_8facca: - break; - case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_8facca: - break; - case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_8facca: - // Not enough information to type-check... - break; - case null: - throw new System.ArgumentException($"Expected argument {nameof(unionProperty)}[{__idx_7e4c6f}][{__idx_94dd05}] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(unionProperty)); - default: - throw new System.ArgumentException($"Expected argument {nameof(unionProperty)}[{__idx_7e4c6f}][{__idx_94dd05}] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {cast_85d4f8[__idx_94dd05].GetType().FullName}", nameof(unionProperty)); - } - } - break; - case null: - throw new System.ArgumentException($"Expected argument {nameof(unionProperty)}[{__idx_7e4c6f}] to be one of: System.Collections.Generic.IDictionary, object[]; received null", nameof(unionProperty)); - default: - throw new System.ArgumentException($"Expected argument {nameof(unionProperty)}[{__idx_7e4c6f}] to be one of: System.Collections.Generic.IDictionary, object[]; received {unionProperty[__idx_7e4c6f].GetType().FullName}", nameof(unionProperty)); - } - } - } return new DeputyProps(new object?[]{unionProperty}); } @@ -5585,57 +5341,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace get => GetInstanceProperty()!; set { - if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) - { - for (var __idx_cd4240 = 0 ; __idx_cd4240 < value.Length ; __idx_cd4240++) - { - switch (value[__idx_cd4240]) - { - case System.Collections.Generic.IDictionary cast_e9c63e: - foreach (var __item_cce3ad in cast_e9c63e) - { - switch (__item_cce3ad.Value) - { - case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_40706a: - break; - case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_40706a: - break; - case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_40706a: - // Not enough information to type-check... - break; - case null: - throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}][\\"{__item_cce3ad.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(value)); - default: - throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}][\\"{__item_cce3ad.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {__item_cce3ad.Value.GetType().FullName}", nameof(value)); - } - } - break; - case object[] cast_e9c63e: - for (var __idx_cce3ad = 0 ; __idx_cce3ad < cast_e9c63e.Length ; __idx_cce3ad++) - { - switch (cast_e9c63e[__idx_cce3ad]) - { - case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_e1169c: - break; - case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_e1169c: - break; - case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_e1169c: - // Not enough information to type-check... - break; - case null: - throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}][{__idx_cce3ad}] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(value)); - default: - throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}][{__idx_cce3ad}] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {cast_e9c63e[__idx_cce3ad].GetType().FullName}", nameof(value)); - } - } - break; - case null: - throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}] to be one of: System.Collections.Generic.IDictionary, object[]; received null", nameof(value)); - default: - throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}] to be one of: System.Collections.Generic.IDictionary, object[]; received {value[__idx_cd4240].GetType().FullName}", nameof(value)); - } - } - } SetInstanceProperty(value); } } @@ -5857,40 +5562,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace get => GetInstanceProperty(); set { - if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) - { - switch (value) - { - case Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly cast_cd4240: - break; - case object[] cast_cd4240: - for (var __idx_f64a5c = 0 ; __idx_f64a5c < cast_cd4240.Length ; __idx_f64a5c++) - { - switch (cast_cd4240[__idx_f64a5c]) - { - case Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly cast_201718: - break; - case Amazon.JSII.Tests.CalculatorNamespace.AbstractClass cast_201718: - break; - case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_201718: - // Not enough information to type-check... - break; - case null: - throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_f64a5c}] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.AbstractClass).FullName}; received null", nameof(value)); - default: - throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_f64a5c}] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.AbstractClass).FullName}; received {cast_cd4240[__idx_f64a5c].GetType().FullName}", nameof(value)); - } - } - break; - case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_cd4240: - // Not enough information to type-check... - break; - case null: - break; - default: - throw new System.ArgumentException($"Expected {nameof(value)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly).FullName}, object[]; received {value.GetType().FullName}", nameof(value)); - } - } SetInstanceProperty(value); } } @@ -5918,40 +5589,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace get => _unionProperty; set { - if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) - { - switch (value) - { - case Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly cast_cd4240: - break; - case object[] cast_cd4240: - for (var __idx_f64a5c = 0 ; __idx_f64a5c < cast_cd4240.Length ; __idx_f64a5c++) - { - switch (cast_cd4240[__idx_f64a5c]) - { - case Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly cast_201718: - break; - case Amazon.JSII.Tests.CalculatorNamespace.AbstractClass cast_201718: - break; - case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_201718: - // Not enough information to type-check... - break; - case null: - throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_f64a5c}] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.AbstractClass).FullName}; received null", nameof(value)); - default: - throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_f64a5c}] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.AbstractClass).FullName}; received {cast_cd4240[__idx_f64a5c].GetType().FullName}", nameof(value)); - } - } - break; - case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_cd4240: - // Not enough information to type-check... - break; - case null: - break; - default: - throw new System.ArgumentException($"Expected {nameof(value)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly).FullName}, object[]; received {value.GetType().FullName}", nameof(value)); - } - } _unionProperty = value; } } @@ -18486,46 +18123,12 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiMethod(name: "isStructA", returnsJson: "{\\"type\\":{\\"primitive\\":\\"boolean\\"}}", parametersJson: "[{\\"name\\":\\"struct\\",\\"type\\":{\\"union\\":{\\"types\\":[{\\"fqn\\":\\"jsii-calc.StructA\\"},{\\"fqn\\":\\"jsii-calc.StructB\\"}]}}}]")] public static bool IsStructA(object @struct) { - if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) - { - switch (@struct) - { - case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_309153: - break; - case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_309153: - break; - case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_309153: - // Not enough information to type-check... - break; - case null: - throw new System.ArgumentException($"Expected argument {nameof(@struct)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(@struct)); - default: - throw new System.ArgumentException($"Expected argument {nameof(@struct)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {@struct.GetType().FullName}", nameof(@struct)); - } - } return InvokeStaticMethod(typeof(Amazon.JSII.Tests.CalculatorNamespace.StructUnionConsumer), new System.Type[]{typeof(object)}, new object[]{@struct})!; } [JsiiMethod(name: "isStructB", returnsJson: "{\\"type\\":{\\"primitive\\":\\"boolean\\"}}", parametersJson: "[{\\"name\\":\\"struct\\",\\"type\\":{\\"union\\":{\\"types\\":[{\\"fqn\\":\\"jsii-calc.StructA\\"},{\\"fqn\\":\\"jsii-calc.StructB\\"}]}}}]")] public static bool IsStructB(object @struct) { - if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) - { - switch (@struct) - { - case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_309153: - break; - case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_309153: - break; - case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_309153: - // Not enough information to type-check... - break; - case null: - throw new System.ArgumentException($"Expected argument {nameof(@struct)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(@struct)); - default: - throw new System.ArgumentException($"Expected argument {nameof(@struct)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {@struct.GetType().FullName}", nameof(@struct)); - } - } return InvokeStaticMethod(typeof(Amazon.JSII.Tests.CalculatorNamespace.StructUnionConsumer), new System.Type[]{typeof(object)}, new object[]{@struct})!; } @@ -18559,29 +18162,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace get => _unionProperty; set { - if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) - { - for (var __idx_cd4240 = 0 ; __idx_cd4240 < value.Length ; __idx_cd4240++) - { - foreach (var __item_e9c63e in value[__idx_cd4240]) - { - switch (__item_e9c63e.Value) - { - case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_b53a7c: - break; - case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_b53a7c: - break; - case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_b53a7c: - // Not enough information to type-check... - break; - case null: - throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}][\\"{__item_e9c63e.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(value)); - default: - throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}][\\"{__item_e9c63e.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {__item_e9c63e.Value.GetType().FullName}", nameof(value)); - } - } - } - } _unionProperty = value; } } @@ -19965,43 +19545,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace get => _secondLevel; set { - if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) - { - switch (value) - { - case double cast_cd4240: - break; - case byte cast_cd4240: - break; - case decimal cast_cd4240: - break; - case float cast_cd4240: - break; - case int cast_cd4240: - break; - case long cast_cd4240: - break; - case sbyte cast_cd4240: - break; - case short cast_cd4240: - break; - case uint cast_cd4240: - break; - case ulong cast_cd4240: - break; - case ushort cast_cd4240: - break; - case Amazon.JSII.Tests.CalculatorNamespace.ISecondLevelStruct cast_cd4240: - break; - case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_cd4240: - // Not enough information to type-check... - break; - case null: - throw new System.ArgumentException($"Expected {nameof(value)} to be one of: double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.ISecondLevelStruct).FullName}; received null", nameof(value)); - default: - throw new System.ArgumentException($"Expected {nameof(value)} to be one of: double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.ISecondLevelStruct).FullName}; received {value.GetType().FullName}", nameof(value)); - } - } _secondLevel = value; } } @@ -20238,42 +19781,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace get => _bar; set { - if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) - { - switch (value) - { - case string cast_cd4240: - break; - case double cast_cd4240: - break; - case byte cast_cd4240: - break; - case decimal cast_cd4240: - break; - case float cast_cd4240: - break; - case int cast_cd4240: - break; - case long cast_cd4240: - break; - case sbyte cast_cd4240: - break; - case short cast_cd4240: - break; - case uint cast_cd4240: - break; - case ulong cast_cd4240: - break; - case ushort cast_cd4240: - break; - case Amazon.JSII.Tests.CalculatorNamespace.AllTypes cast_cd4240: - break; - case null: - throw new System.ArgumentException($"Expected {nameof(value)} to be one of: string, double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.AllTypes).FullName}; received null", nameof(value)); - default: - throw new System.ArgumentException($"Expected {nameof(value)} to be one of: string, double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.AllTypes).FullName}; received {value.GetType().FullName}", nameof(value)); - } - } _bar = value; } } @@ -20287,40 +19794,6 @@ namespace Amazon.JSII.Tests.CalculatorNamespace get => _foo; set { - if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) - { - switch (value) - { - case string cast_cd4240: - break; - case double cast_cd4240: - break; - case byte cast_cd4240: - break; - case decimal cast_cd4240: - break; - case float cast_cd4240: - break; - case int cast_cd4240: - break; - case long cast_cd4240: - break; - case sbyte cast_cd4240: - break; - case short cast_cd4240: - break; - case uint cast_cd4240: - break; - case ulong cast_cd4240: - break; - case ushort cast_cd4240: - break; - case null: - break; - default: - throw new System.ArgumentException($"Expected {nameof(value)} to be one of: string, double; received {value.GetType().FullName}", nameof(value)); - } - } _foo = value; } } @@ -21065,51 +20538,51 @@ exports[`Generated code for "jsii-calc": / 1`] = ` `; exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypes.cs.diff 1`] = ` ---- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypes.cs --runtime-type-checking -+++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypes.cs --no-runtime-type-checking -@@ -141,144 +141,30 @@ +--- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypes.cs --no-runtime-type-checking ++++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypes.cs --runtime-type-checking +@@ -141,30 +141,144 @@ public virtual object[] UnionArrayProperty { get => GetInstanceProperty()!; set { -- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) -- { -- for (var __idx_cd4240 = 0 ; __idx_cd4240 < value.Length ; __idx_cd4240++) -- { -- switch (value[__idx_cd4240]) -- { -- case double cast_e9c63e: -- break; -- case byte cast_e9c63e: -- break; -- case decimal cast_e9c63e: -- break; -- case float cast_e9c63e: -- break; -- case int cast_e9c63e: -- break; -- case long cast_e9c63e: -- break; -- case sbyte cast_e9c63e: -- break; -- case short cast_e9c63e: -- break; -- case uint cast_e9c63e: -- break; -- case ulong cast_e9c63e: -- break; -- case ushort cast_e9c63e: -- break; -- case Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.NumericValue cast_e9c63e: -- break; -- case null: -- throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}] to be one of: double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.NumericValue).FullName}; received null", nameof(value)); -- default: -- throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}] to be one of: double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.NumericValue).FullName}; received {value[__idx_cd4240].GetType().FullName}", nameof(value)); -- } -- } -- } ++ if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) ++ { ++ for (var __idx_cd4240 = 0 ; __idx_cd4240 < value.Length ; __idx_cd4240++) ++ { ++ switch (value[__idx_cd4240]) ++ { ++ case double cast_e9c63e: ++ break; ++ case byte cast_e9c63e: ++ break; ++ case decimal cast_e9c63e: ++ break; ++ case float cast_e9c63e: ++ break; ++ case int cast_e9c63e: ++ break; ++ case long cast_e9c63e: ++ break; ++ case sbyte cast_e9c63e: ++ break; ++ case short cast_e9c63e: ++ break; ++ case uint cast_e9c63e: ++ break; ++ case ulong cast_e9c63e: ++ break; ++ case ushort cast_e9c63e: ++ break; ++ case Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.NumericValue cast_e9c63e: ++ break; ++ case null: ++ throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}] to be one of: double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.NumericValue).FullName}; received null", nameof(value)); ++ default: ++ throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}] to be one of: double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.NumericValue).FullName}; received {value[__idx_cd4240].GetType().FullName}", nameof(value)); ++ } ++ } ++ } SetInstanceProperty(value); } } @@ -21120,45 +20593,45 @@ exports[`Generated code for "jsii-calc": /dotnet/Amazon get => GetInstanceProperty>()!; set { -- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) -- { -- foreach (var __item_cd4240 in value) -- { -- switch (__item_cd4240.Value) -- { -- case string cast_af5ffb: -- break; -- case double cast_af5ffb: -- break; -- case byte cast_af5ffb: -- break; -- case decimal cast_af5ffb: -- break; -- case float cast_af5ffb: -- break; -- case int cast_af5ffb: -- break; -- case long cast_af5ffb: -- break; -- case sbyte cast_af5ffb: -- break; -- case short cast_af5ffb: -- break; -- case uint cast_af5ffb: -- break; -- case ulong cast_af5ffb: -- break; -- case ushort cast_af5ffb: -- break; -- case Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Number cast_af5ffb: -- break; -- case null: -- throw new System.ArgumentException($"Expected {nameof(value)}[\\"{__item_cd4240.Key}\\"] to be one of: string, double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Number).FullName}; received null", nameof(value)); -- default: -- throw new System.ArgumentException($"Expected {nameof(value)}[\\"{__item_cd4240.Key}\\"] to be one of: string, double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Number).FullName}; received {__item_cd4240.Value.GetType().FullName}", nameof(value)); -- } -- } -- } ++ if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) ++ { ++ foreach (var __item_cd4240 in value) ++ { ++ switch (__item_cd4240.Value) ++ { ++ case string cast_af5ffb: ++ break; ++ case double cast_af5ffb: ++ break; ++ case byte cast_af5ffb: ++ break; ++ case decimal cast_af5ffb: ++ break; ++ case float cast_af5ffb: ++ break; ++ case int cast_af5ffb: ++ break; ++ case long cast_af5ffb: ++ break; ++ case sbyte cast_af5ffb: ++ break; ++ case short cast_af5ffb: ++ break; ++ case uint cast_af5ffb: ++ break; ++ case ulong cast_af5ffb: ++ break; ++ case ushort cast_af5ffb: ++ break; ++ case Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Number cast_af5ffb: ++ break; ++ case null: ++ throw new System.ArgumentException($"Expected {nameof(value)}[\\"{__item_cd4240.Key}\\"] to be one of: string, double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Number).FullName}; received null", nameof(value)); ++ default: ++ throw new System.ArgumentException($"Expected {nameof(value)}[\\"{__item_cd4240.Key}\\"] to be one of: string, double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Number).FullName}; received {__item_cd4240.Value.GetType().FullName}", nameof(value)); ++ } ++ } ++ } SetInstanceProperty(value); } } @@ -21169,44 +20642,44 @@ exports[`Generated code for "jsii-calc": /dotnet/Amazon get => GetInstanceProperty()!; set { -- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) -- { -- switch (value) -- { -- case string cast_cd4240: -- break; -- case double cast_cd4240: -- break; -- case byte cast_cd4240: -- break; -- case decimal cast_cd4240: -- break; -- case float cast_cd4240: -- break; -- case int cast_cd4240: -- break; -- case long cast_cd4240: -- break; -- case sbyte cast_cd4240: -- break; -- case short cast_cd4240: -- break; -- case uint cast_cd4240: -- break; -- case ulong cast_cd4240: -- break; -- case ushort cast_cd4240: -- break; -- case Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Number cast_cd4240: -- break; -- case Amazon.JSII.Tests.CalculatorNamespace.Multiply cast_cd4240: -- break; -- case null: -- throw new System.ArgumentException($"Expected {nameof(value)} to be one of: string, double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Number).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.Multiply).FullName}; received null", nameof(value)); -- default: -- throw new System.ArgumentException($"Expected {nameof(value)} to be one of: string, double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Number).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.Multiply).FullName}; received {value.GetType().FullName}", nameof(value)); -- } -- } ++ if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) ++ { ++ switch (value) ++ { ++ case string cast_cd4240: ++ break; ++ case double cast_cd4240: ++ break; ++ case byte cast_cd4240: ++ break; ++ case decimal cast_cd4240: ++ break; ++ case float cast_cd4240: ++ break; ++ case int cast_cd4240: ++ break; ++ case long cast_cd4240: ++ break; ++ case sbyte cast_cd4240: ++ break; ++ case short cast_cd4240: ++ break; ++ case uint cast_cd4240: ++ break; ++ case ulong cast_cd4240: ++ break; ++ case ushort cast_cd4240: ++ break; ++ case Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Number cast_cd4240: ++ break; ++ case Amazon.JSII.Tests.CalculatorNamespace.Multiply cast_cd4240: ++ break; ++ case null: ++ throw new System.ArgumentException($"Expected {nameof(value)} to be one of: string, double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Number).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.Multiply).FullName}; received null", nameof(value)); ++ default: ++ throw new System.ArgumentException($"Expected {nameof(value)} to be one of: string, double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Number).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.Multiply).FullName}; received {value.GetType().FullName}", nameof(value)); ++ } ++ } SetInstanceProperty(value); } } @@ -21215,31 +20688,31 @@ exports[`Generated code for "jsii-calc": /dotnet/Amazon `; exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Anonymous/UseOptions.cs.diff 1`] = ` ---- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Anonymous/UseOptions.cs --runtime-type-checking -+++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Anonymous/UseOptions.cs --no-runtime-type-checking -@@ -22,27 +22,10 @@ +--- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Anonymous/UseOptions.cs --no-runtime-type-checking ++++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Anonymous/UseOptions.cs --runtime-type-checking +@@ -22,10 +22,27 @@ } [JsiiMethod(name: "consume", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", parametersJson: "[{\\"name\\":\\"option\\",\\"type\\":{\\"union\\":{\\"types\\":[{\\"fqn\\":\\"jsii-calc.anonymous.IOptionA\\"},{\\"fqn\\":\\"jsii-calc.anonymous.IOptionB\\"}]}}}]")] public static string Consume(object option) { -- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) -- { -- switch (option) -- { -- case Amazon.JSII.Tests.CalculatorNamespace.Anonymous.IOptionA cast_a11a75: -- break; -- case Amazon.JSII.Tests.CalculatorNamespace.Anonymous.IOptionB cast_a11a75: -- break; -- case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_a11a75: -- // Not enough information to type-check... -- break; -- case null: -- throw new System.ArgumentException($"Expected argument {nameof(option)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.Anonymous.IOptionA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.Anonymous.IOptionB).FullName}; received null", nameof(option)); -- default: -- throw new System.ArgumentException($"Expected argument {nameof(option)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.Anonymous.IOptionA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.Anonymous.IOptionB).FullName}; received {option.GetType().FullName}", nameof(option)); -- } -- } ++ if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) ++ { ++ switch (option) ++ { ++ case Amazon.JSII.Tests.CalculatorNamespace.Anonymous.IOptionA cast_a11a75: ++ break; ++ case Amazon.JSII.Tests.CalculatorNamespace.Anonymous.IOptionB cast_a11a75: ++ break; ++ case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_a11a75: ++ // Not enough information to type-check... ++ break; ++ case null: ++ throw new System.ArgumentException($"Expected argument {nameof(option)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.Anonymous.IOptionA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.Anonymous.IOptionB).FullName}; received null", nameof(option)); ++ default: ++ throw new System.ArgumentException($"Expected argument {nameof(option)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.Anonymous.IOptionA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.Anonymous.IOptionB).FullName}; received {option.GetType().FullName}", nameof(option)); ++ } ++ } return InvokeStaticMethod(typeof(Amazon.JSII.Tests.CalculatorNamespace.Anonymous.UseOptions), new System.Type[]{typeof(object)}, new object[]{option})!; } @@ -21248,30 +20721,30 @@ exports[`Generated code for "jsii-calc": /dotnet/Amazon `; exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Calculator.cs.diff 1`] = ` ---- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Calculator.cs --runtime-type-checking -+++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Calculator.cs --no-runtime-type-checking -@@ -131,26 +131,10 @@ +--- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Calculator.cs --no-runtime-type-checking ++++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Calculator.cs --runtime-type-checking +@@ -131,10 +131,26 @@ public virtual object? UnionProperty { get => GetInstanceProperty(); set { -- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) -- { -- switch (value) -- { -- case Amazon.JSII.Tests.CalculatorNamespace.Add cast_cd4240: -- break; -- case Amazon.JSII.Tests.CalculatorNamespace.Multiply cast_cd4240: -- break; -- case Amazon.JSII.Tests.CalculatorNamespace.Power cast_cd4240: -- break; -- case null: -- break; -- default: -- throw new System.ArgumentException($"Expected {nameof(value)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.Add).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.Multiply).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.Power).FullName}; received {value.GetType().FullName}", nameof(value)); -- } -- } ++ if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) ++ { ++ switch (value) ++ { ++ case Amazon.JSII.Tests.CalculatorNamespace.Add cast_cd4240: ++ break; ++ case Amazon.JSII.Tests.CalculatorNamespace.Multiply cast_cd4240: ++ break; ++ case Amazon.JSII.Tests.CalculatorNamespace.Power cast_cd4240: ++ break; ++ case null: ++ break; ++ default: ++ throw new System.ArgumentException($"Expected {nameof(value)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.Add).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.Multiply).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.Power).FullName}; received {value.GetType().FullName}", nameof(value)); ++ } ++ } SetInstanceProperty(value); } } @@ -21280,71 +20753,71 @@ exports[`Generated code for "jsii-calc": /dotnet/Amazon `; exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithCollectionOfUnions.cs.diff 1`] = ` ---- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithCollectionOfUnions.cs --runtime-type-checking -+++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithCollectionOfUnions.cs --no-runtime-type-checking -@@ -12,33 +12,10 @@ +--- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithCollectionOfUnions.cs --no-runtime-type-checking ++++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithCollectionOfUnions.cs --runtime-type-checking +@@ -12,10 +12,33 @@ } [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] private static DeputyProps _MakeDeputyProps(System.Collections.Generic.IDictionary[] unionProperty) { -- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) -- { -- for (var __idx_7e4c6f = 0 ; __idx_7e4c6f < unionProperty.Length ; __idx_7e4c6f++) -- { -- foreach (var __item_85d4f8 in unionProperty[__idx_7e4c6f]) -- { -- switch (__item_85d4f8.Value) -- { -- case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_7df241: -- break; -- case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_7df241: -- break; -- case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_7df241: -- // Not enough information to type-check... -- break; -- case null: -- throw new System.ArgumentException($"Expected argument {nameof(unionProperty)}[{__idx_7e4c6f}][\\"{__item_85d4f8.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(unionProperty)); -- default: -- throw new System.ArgumentException($"Expected argument {nameof(unionProperty)}[{__idx_7e4c6f}][\\"{__item_85d4f8.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {__item_85d4f8.Value.GetType().FullName}", nameof(unionProperty)); -- } -- } -- } -- } ++ if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) ++ { ++ for (var __idx_7e4c6f = 0 ; __idx_7e4c6f < unionProperty.Length ; __idx_7e4c6f++) ++ { ++ foreach (var __item_85d4f8 in unionProperty[__idx_7e4c6f]) ++ { ++ switch (__item_85d4f8.Value) ++ { ++ case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_7df241: ++ break; ++ case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_7df241: ++ break; ++ case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_7df241: ++ // Not enough information to type-check... ++ break; ++ case null: ++ throw new System.ArgumentException($"Expected argument {nameof(unionProperty)}[{__idx_7e4c6f}][\\"{__item_85d4f8.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(unionProperty)); ++ default: ++ throw new System.ArgumentException($"Expected argument {nameof(unionProperty)}[{__idx_7e4c6f}][\\"{__item_85d4f8.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {__item_85d4f8.Value.GetType().FullName}", nameof(unionProperty)); ++ } ++ } ++ } ++ } return new DeputyProps(new object?[]{unionProperty}); } /// Used by jsii to construct an instance of this class from a Javascript-owned object reference /// The Javascript-owned object reference -@@ -58,33 +35,10 @@ +@@ -35,10 +58,33 @@ public virtual System.Collections.Generic.IDictionary[] UnionProperty { get => GetInstanceProperty[]>()!; set { -- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) -- { -- for (var __idx_cd4240 = 0 ; __idx_cd4240 < value.Length ; __idx_cd4240++) -- { -- foreach (var __item_e9c63e in value[__idx_cd4240]) -- { -- switch (__item_e9c63e.Value) -- { -- case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_b53a7c: -- break; -- case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_b53a7c: -- break; -- case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_b53a7c: -- // Not enough information to type-check... -- break; -- case null: -- throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}][\\"{__item_e9c63e.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(value)); -- default: -- throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}][\\"{__item_e9c63e.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {__item_e9c63e.Value.GetType().FullName}", nameof(value)); -- } -- } -- } -- } ++ if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) ++ { ++ for (var __idx_cd4240 = 0 ; __idx_cd4240 < value.Length ; __idx_cd4240++) ++ { ++ foreach (var __item_e9c63e in value[__idx_cd4240]) ++ { ++ switch (__item_e9c63e.Value) ++ { ++ case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_b53a7c: ++ break; ++ case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_b53a7c: ++ break; ++ case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_b53a7c: ++ // Not enough information to type-check... ++ break; ++ case null: ++ throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}][\\"{__item_e9c63e.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(value)); ++ default: ++ throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}][\\"{__item_e9c63e.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {__item_e9c63e.Value.GetType().FullName}", nameof(value)); ++ } ++ } ++ } ++ } SetInstanceProperty(value); } } @@ -21353,127 +20826,127 @@ exports[`Generated code for "jsii-calc": /dotnet/Amazon `; exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithNestedUnion.cs.diff 1`] = ` ---- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithNestedUnion.cs --runtime-type-checking -+++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithNestedUnion.cs --no-runtime-type-checking -@@ -12,61 +12,10 @@ +--- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithNestedUnion.cs --no-runtime-type-checking ++++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithNestedUnion.cs --runtime-type-checking +@@ -12,10 +12,61 @@ } [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] private static DeputyProps _MakeDeputyProps(object[] unionProperty) { -- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) -- { -- for (var __idx_7e4c6f = 0 ; __idx_7e4c6f < unionProperty.Length ; __idx_7e4c6f++) -- { -- switch (unionProperty[__idx_7e4c6f]) -- { -- case System.Collections.Generic.IDictionary cast_85d4f8: -- foreach (var __item_94dd05 in cast_85d4f8) -- { -- switch (__item_94dd05.Value) -- { -- case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_dd6247: -- break; -- case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_dd6247: -- break; -- case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_dd6247: -- // Not enough information to type-check... -- break; -- case null: -- throw new System.ArgumentException($"Expected argument {nameof(unionProperty)}[{__idx_7e4c6f}][\\"{__item_94dd05.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(unionProperty)); -- default: -- throw new System.ArgumentException($"Expected argument {nameof(unionProperty)}[{__idx_7e4c6f}][\\"{__item_94dd05.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {__item_94dd05.Value.GetType().FullName}", nameof(unionProperty)); -- } -- } -- break; -- case object[] cast_85d4f8: -- for (var __idx_94dd05 = 0 ; __idx_94dd05 < cast_85d4f8.Length ; __idx_94dd05++) -- { -- switch (cast_85d4f8[__idx_94dd05]) -- { -- case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_8facca: -- break; -- case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_8facca: -- break; -- case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_8facca: -- // Not enough information to type-check... -- break; -- case null: -- throw new System.ArgumentException($"Expected argument {nameof(unionProperty)}[{__idx_7e4c6f}][{__idx_94dd05}] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(unionProperty)); -- default: -- throw new System.ArgumentException($"Expected argument {nameof(unionProperty)}[{__idx_7e4c6f}][{__idx_94dd05}] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {cast_85d4f8[__idx_94dd05].GetType().FullName}", nameof(unionProperty)); -- } -- } -- break; -- case null: -- throw new System.ArgumentException($"Expected argument {nameof(unionProperty)}[{__idx_7e4c6f}] to be one of: System.Collections.Generic.IDictionary, object[]; received null", nameof(unionProperty)); -- default: -- throw new System.ArgumentException($"Expected argument {nameof(unionProperty)}[{__idx_7e4c6f}] to be one of: System.Collections.Generic.IDictionary, object[]; received {unionProperty[__idx_7e4c6f].GetType().FullName}", nameof(unionProperty)); -- } -- } -- } ++ if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) ++ { ++ for (var __idx_7e4c6f = 0 ; __idx_7e4c6f < unionProperty.Length ; __idx_7e4c6f++) ++ { ++ switch (unionProperty[__idx_7e4c6f]) ++ { ++ case System.Collections.Generic.IDictionary cast_85d4f8: ++ foreach (var __item_94dd05 in cast_85d4f8) ++ { ++ switch (__item_94dd05.Value) ++ { ++ case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_dd6247: ++ break; ++ case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_dd6247: ++ break; ++ case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_dd6247: ++ // Not enough information to type-check... ++ break; ++ case null: ++ throw new System.ArgumentException($"Expected argument {nameof(unionProperty)}[{__idx_7e4c6f}][\\"{__item_94dd05.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(unionProperty)); ++ default: ++ throw new System.ArgumentException($"Expected argument {nameof(unionProperty)}[{__idx_7e4c6f}][\\"{__item_94dd05.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {__item_94dd05.Value.GetType().FullName}", nameof(unionProperty)); ++ } ++ } ++ break; ++ case object[] cast_85d4f8: ++ for (var __idx_94dd05 = 0 ; __idx_94dd05 < cast_85d4f8.Length ; __idx_94dd05++) ++ { ++ switch (cast_85d4f8[__idx_94dd05]) ++ { ++ case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_8facca: ++ break; ++ case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_8facca: ++ break; ++ case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_8facca: ++ // Not enough information to type-check... ++ break; ++ case null: ++ throw new System.ArgumentException($"Expected argument {nameof(unionProperty)}[{__idx_7e4c6f}][{__idx_94dd05}] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(unionProperty)); ++ default: ++ throw new System.ArgumentException($"Expected argument {nameof(unionProperty)}[{__idx_7e4c6f}][{__idx_94dd05}] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {cast_85d4f8[__idx_94dd05].GetType().FullName}", nameof(unionProperty)); ++ } ++ } ++ break; ++ case null: ++ throw new System.ArgumentException($"Expected argument {nameof(unionProperty)}[{__idx_7e4c6f}] to be one of: System.Collections.Generic.IDictionary, object[]; received null", nameof(unionProperty)); ++ default: ++ throw new System.ArgumentException($"Expected argument {nameof(unionProperty)}[{__idx_7e4c6f}] to be one of: System.Collections.Generic.IDictionary, object[]; received {unionProperty[__idx_7e4c6f].GetType().FullName}", nameof(unionProperty)); ++ } ++ } ++ } return new DeputyProps(new object?[]{unionProperty}); } /// Used by jsii to construct an instance of this class from a Javascript-owned object reference /// The Javascript-owned object reference -@@ -86,61 +35,10 @@ +@@ -35,10 +86,61 @@ public virtual object[] UnionProperty { get => GetInstanceProperty()!; set { -- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) -- { -- for (var __idx_cd4240 = 0 ; __idx_cd4240 < value.Length ; __idx_cd4240++) -- { -- switch (value[__idx_cd4240]) -- { -- case System.Collections.Generic.IDictionary cast_e9c63e: -- foreach (var __item_cce3ad in cast_e9c63e) -- { -- switch (__item_cce3ad.Value) -- { -- case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_40706a: -- break; -- case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_40706a: -- break; -- case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_40706a: -- // Not enough information to type-check... -- break; -- case null: -- throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}][\\"{__item_cce3ad.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(value)); -- default: -- throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}][\\"{__item_cce3ad.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {__item_cce3ad.Value.GetType().FullName}", nameof(value)); -- } -- } -- break; -- case object[] cast_e9c63e: -- for (var __idx_cce3ad = 0 ; __idx_cce3ad < cast_e9c63e.Length ; __idx_cce3ad++) -- { -- switch (cast_e9c63e[__idx_cce3ad]) -- { -- case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_e1169c: -- break; -- case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_e1169c: -- break; -- case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_e1169c: -- // Not enough information to type-check... -- break; -- case null: -- throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}][{__idx_cce3ad}] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(value)); -- default: -- throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}][{__idx_cce3ad}] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {cast_e9c63e[__idx_cce3ad].GetType().FullName}", nameof(value)); -- } -- } -- break; -- case null: -- throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}] to be one of: System.Collections.Generic.IDictionary, object[]; received null", nameof(value)); -- default: -- throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}] to be one of: System.Collections.Generic.IDictionary, object[]; received {value[__idx_cd4240].GetType().FullName}", nameof(value)); -- } -- } -- } ++ if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) ++ { ++ for (var __idx_cd4240 = 0 ; __idx_cd4240 < value.Length ; __idx_cd4240++) ++ { ++ switch (value[__idx_cd4240]) ++ { ++ case System.Collections.Generic.IDictionary cast_e9c63e: ++ foreach (var __item_cce3ad in cast_e9c63e) ++ { ++ switch (__item_cce3ad.Value) ++ { ++ case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_40706a: ++ break; ++ case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_40706a: ++ break; ++ case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_40706a: ++ // Not enough information to type-check... ++ break; ++ case null: ++ throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}][\\"{__item_cce3ad.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(value)); ++ default: ++ throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}][\\"{__item_cce3ad.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {__item_cce3ad.Value.GetType().FullName}", nameof(value)); ++ } ++ } ++ break; ++ case object[] cast_e9c63e: ++ for (var __idx_cce3ad = 0 ; __idx_cce3ad < cast_e9c63e.Length ; __idx_cce3ad++) ++ { ++ switch (cast_e9c63e[__idx_cce3ad]) ++ { ++ case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_e1169c: ++ break; ++ case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_e1169c: ++ break; ++ case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_e1169c: ++ // Not enough information to type-check... ++ break; ++ case null: ++ throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}][{__idx_cce3ad}] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(value)); ++ default: ++ throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}][{__idx_cce3ad}] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {cast_e9c63e[__idx_cce3ad].GetType().FullName}", nameof(value)); ++ } ++ } ++ break; ++ case null: ++ throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}] to be one of: System.Collections.Generic.IDictionary, object[]; received null", nameof(value)); ++ default: ++ throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}] to be one of: System.Collections.Generic.IDictionary, object[]; received {value[__idx_cd4240].GetType().FullName}", nameof(value)); ++ } ++ } ++ } SetInstanceProperty(value); } } @@ -21482,48 +20955,48 @@ exports[`Generated code for "jsii-calc": /dotnet/Amazon `; exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ConfusingToJackson.cs.diff 1`] = ` ---- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ConfusingToJackson.cs --runtime-type-checking -+++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ConfusingToJackson.cs --no-runtime-type-checking -@@ -42,44 +42,10 @@ +--- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ConfusingToJackson.cs --no-runtime-type-checking ++++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ConfusingToJackson.cs --runtime-type-checking +@@ -42,10 +42,44 @@ public virtual object? UnionProperty { get => GetInstanceProperty(); set { -- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) -- { -- switch (value) -- { -- case Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly cast_cd4240: -- break; -- case object[] cast_cd4240: -- for (var __idx_f64a5c = 0 ; __idx_f64a5c < cast_cd4240.Length ; __idx_f64a5c++) -- { -- switch (cast_cd4240[__idx_f64a5c]) -- { -- case Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly cast_201718: -- break; -- case Amazon.JSII.Tests.CalculatorNamespace.AbstractClass cast_201718: -- break; -- case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_201718: -- // Not enough information to type-check... -- break; -- case null: -- throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_f64a5c}] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.AbstractClass).FullName}; received null", nameof(value)); -- default: -- throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_f64a5c}] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.AbstractClass).FullName}; received {cast_cd4240[__idx_f64a5c].GetType().FullName}", nameof(value)); -- } -- } -- break; -- case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_cd4240: -- // Not enough information to type-check... -- break; -- case null: -- break; -- default: -- throw new System.ArgumentException($"Expected {nameof(value)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly).FullName}, object[]; received {value.GetType().FullName}", nameof(value)); -- } -- } ++ if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) ++ { ++ switch (value) ++ { ++ case Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly cast_cd4240: ++ break; ++ case object[] cast_cd4240: ++ for (var __idx_f64a5c = 0 ; __idx_f64a5c < cast_cd4240.Length ; __idx_f64a5c++) ++ { ++ switch (cast_cd4240[__idx_f64a5c]) ++ { ++ case Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly cast_201718: ++ break; ++ case Amazon.JSII.Tests.CalculatorNamespace.AbstractClass cast_201718: ++ break; ++ case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_201718: ++ // Not enough information to type-check... ++ break; ++ case null: ++ throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_f64a5c}] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.AbstractClass).FullName}; received null", nameof(value)); ++ default: ++ throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_f64a5c}] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.AbstractClass).FullName}; received {cast_cd4240[__idx_f64a5c].GetType().FullName}", nameof(value)); ++ } ++ } ++ break; ++ case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_cd4240: ++ // Not enough information to type-check... ++ break; ++ case null: ++ break; ++ default: ++ throw new System.ArgumentException($"Expected {nameof(value)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly).FullName}, object[]; received {value.GetType().FullName}", nameof(value)); ++ } ++ } SetInstanceProperty(value); } } @@ -21532,48 +21005,48 @@ exports[`Generated code for "jsii-calc": /dotnet/Amazon `; exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ConfusingToJacksonStruct.cs.diff 1`] = ` ---- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ConfusingToJacksonStruct.cs --runtime-type-checking -+++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ConfusingToJacksonStruct.cs --no-runtime-type-checking -@@ -14,44 +14,10 @@ +--- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ConfusingToJacksonStruct.cs --no-runtime-type-checking ++++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ConfusingToJacksonStruct.cs --runtime-type-checking +@@ -14,10 +14,44 @@ public object? UnionProperty { get => _unionProperty; set { -- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) -- { -- switch (value) -- { -- case Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly cast_cd4240: -- break; -- case object[] cast_cd4240: -- for (var __idx_f64a5c = 0 ; __idx_f64a5c < cast_cd4240.Length ; __idx_f64a5c++) -- { -- switch (cast_cd4240[__idx_f64a5c]) -- { -- case Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly cast_201718: -- break; -- case Amazon.JSII.Tests.CalculatorNamespace.AbstractClass cast_201718: -- break; -- case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_201718: -- // Not enough information to type-check... -- break; -- case null: -- throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_f64a5c}] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.AbstractClass).FullName}; received null", nameof(value)); -- default: -- throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_f64a5c}] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.AbstractClass).FullName}; received {cast_cd4240[__idx_f64a5c].GetType().FullName}", nameof(value)); -- } -- } -- break; -- case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_cd4240: -- // Not enough information to type-check... -- break; -- case null: -- break; -- default: -- throw new System.ArgumentException($"Expected {nameof(value)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly).FullName}, object[]; received {value.GetType().FullName}", nameof(value)); -- } -- } ++ if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) ++ { ++ switch (value) ++ { ++ case Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly cast_cd4240: ++ break; ++ case object[] cast_cd4240: ++ for (var __idx_f64a5c = 0 ; __idx_f64a5c < cast_cd4240.Length ; __idx_f64a5c++) ++ { ++ switch (cast_cd4240[__idx_f64a5c]) ++ { ++ case Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly cast_201718: ++ break; ++ case Amazon.JSII.Tests.CalculatorNamespace.AbstractClass cast_201718: ++ break; ++ case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_201718: ++ // Not enough information to type-check... ++ break; ++ case null: ++ throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_f64a5c}] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.AbstractClass).FullName}; received null", nameof(value)); ++ default: ++ throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_f64a5c}] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.AbstractClass).FullName}; received {cast_cd4240[__idx_f64a5c].GetType().FullName}", nameof(value)); ++ } ++ } ++ break; ++ case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_cd4240: ++ // Not enough information to type-check... ++ break; ++ case null: ++ break; ++ default: ++ throw new System.ArgumentException($"Expected {nameof(value)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly).FullName}, object[]; received {value.GetType().FullName}", nameof(value)); ++ } ++ } _unionProperty = value; } } @@ -21582,54 +21055,54 @@ exports[`Generated code for "jsii-calc": /dotnet/Amazon `; exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructUnionConsumer.cs.diff 1`] = ` ---- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructUnionConsumer.cs --runtime-type-checking -+++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructUnionConsumer.cs --no-runtime-type-checking -@@ -22,50 +22,16 @@ +--- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructUnionConsumer.cs --no-runtime-type-checking ++++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructUnionConsumer.cs --runtime-type-checking +@@ -22,16 +22,50 @@ } [JsiiMethod(name: "isStructA", returnsJson: "{\\"type\\":{\\"primitive\\":\\"boolean\\"}}", parametersJson: "[{\\"name\\":\\"struct\\",\\"type\\":{\\"union\\":{\\"types\\":[{\\"fqn\\":\\"jsii-calc.StructA\\"},{\\"fqn\\":\\"jsii-calc.StructB\\"}]}}}]")] public static bool IsStructA(object @struct) { -- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) -- { -- switch (@struct) -- { -- case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_309153: -- break; -- case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_309153: -- break; -- case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_309153: -- // Not enough information to type-check... -- break; -- case null: -- throw new System.ArgumentException($"Expected argument {nameof(@struct)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(@struct)); -- default: -- throw new System.ArgumentException($"Expected argument {nameof(@struct)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {@struct.GetType().FullName}", nameof(@struct)); -- } -- } ++ if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) ++ { ++ switch (@struct) ++ { ++ case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_309153: ++ break; ++ case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_309153: ++ break; ++ case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_309153: ++ // Not enough information to type-check... ++ break; ++ case null: ++ throw new System.ArgumentException($"Expected argument {nameof(@struct)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(@struct)); ++ default: ++ throw new System.ArgumentException($"Expected argument {nameof(@struct)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {@struct.GetType().FullName}", nameof(@struct)); ++ } ++ } return InvokeStaticMethod(typeof(Amazon.JSII.Tests.CalculatorNamespace.StructUnionConsumer), new System.Type[]{typeof(object)}, new object[]{@struct})!; } [JsiiMethod(name: "isStructB", returnsJson: "{\\"type\\":{\\"primitive\\":\\"boolean\\"}}", parametersJson: "[{\\"name\\":\\"struct\\",\\"type\\":{\\"union\\":{\\"types\\":[{\\"fqn\\":\\"jsii-calc.StructA\\"},{\\"fqn\\":\\"jsii-calc.StructB\\"}]}}}]")] public static bool IsStructB(object @struct) { -- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) -- { -- switch (@struct) -- { -- case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_309153: -- break; -- case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_309153: -- break; -- case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_309153: -- // Not enough information to type-check... -- break; -- case null: -- throw new System.ArgumentException($"Expected argument {nameof(@struct)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(@struct)); -- default: -- throw new System.ArgumentException($"Expected argument {nameof(@struct)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {@struct.GetType().FullName}", nameof(@struct)); -- } -- } ++ if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) ++ { ++ switch (@struct) ++ { ++ case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_309153: ++ break; ++ case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_309153: ++ break; ++ case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_309153: ++ // Not enough information to type-check... ++ break; ++ case null: ++ throw new System.ArgumentException($"Expected argument {nameof(@struct)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(@struct)); ++ default: ++ throw new System.ArgumentException($"Expected argument {nameof(@struct)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {@struct.GetType().FullName}", nameof(@struct)); ++ } ++ } return InvokeStaticMethod(typeof(Amazon.JSII.Tests.CalculatorNamespace.StructUnionConsumer), new System.Type[]{typeof(object)}, new object[]{@struct})!; } @@ -21638,37 +21111,37 @@ exports[`Generated code for "jsii-calc": /dotnet/Amazon `; exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructWithCollectionOfUnionts.cs.diff 1`] = ` ---- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructWithCollectionOfUnionts.cs --runtime-type-checking -+++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructWithCollectionOfUnionts.cs --no-runtime-type-checking -@@ -15,33 +15,10 @@ +--- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructWithCollectionOfUnionts.cs --no-runtime-type-checking ++++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructWithCollectionOfUnionts.cs --runtime-type-checking +@@ -15,10 +15,33 @@ public System.Collections.Generic.IDictionary[] UnionProperty { get => _unionProperty; set { -- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) -- { -- for (var __idx_cd4240 = 0 ; __idx_cd4240 < value.Length ; __idx_cd4240++) -- { -- foreach (var __item_e9c63e in value[__idx_cd4240]) -- { -- switch (__item_e9c63e.Value) -- { -- case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_b53a7c: -- break; -- case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_b53a7c: -- break; -- case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_b53a7c: -- // Not enough information to type-check... -- break; -- case null: -- throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}][\\"{__item_e9c63e.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(value)); -- default: -- throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}][\\"{__item_e9c63e.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {__item_e9c63e.Value.GetType().FullName}", nameof(value)); -- } -- } -- } -- } ++ if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) ++ { ++ for (var __idx_cd4240 = 0 ; __idx_cd4240 < value.Length ; __idx_cd4240++) ++ { ++ foreach (var __item_e9c63e in value[__idx_cd4240]) ++ { ++ switch (__item_e9c63e.Value) ++ { ++ case Amazon.JSII.Tests.CalculatorNamespace.IStructA cast_b53a7c: ++ break; ++ case Amazon.JSII.Tests.CalculatorNamespace.IStructB cast_b53a7c: ++ break; ++ case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_b53a7c: ++ // Not enough information to type-check... ++ break; ++ case null: ++ throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}][\\"{__item_e9c63e.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received null", nameof(value)); ++ default: ++ throw new System.ArgumentException($"Expected {nameof(value)}[{__idx_cd4240}][\\"{__item_e9c63e.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {__item_e9c63e.Value.GetType().FullName}", nameof(value)); ++ } ++ } ++ } ++ } _unionProperty = value; } } @@ -21677,51 +21150,51 @@ exports[`Generated code for "jsii-calc": /dotnet/Amazon `; exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/TopLevelStruct.cs.diff 1`] = ` ---- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/TopLevelStruct.cs --runtime-type-checking -+++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/TopLevelStruct.cs --no-runtime-type-checking -@@ -24,47 +24,10 @@ +--- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/TopLevelStruct.cs --no-runtime-type-checking ++++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/TopLevelStruct.cs --runtime-type-checking +@@ -24,10 +24,47 @@ public object SecondLevel { get => _secondLevel; set { -- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) -- { -- switch (value) -- { -- case double cast_cd4240: -- break; -- case byte cast_cd4240: -- break; -- case decimal cast_cd4240: -- break; -- case float cast_cd4240: -- break; -- case int cast_cd4240: -- break; -- case long cast_cd4240: -- break; -- case sbyte cast_cd4240: -- break; -- case short cast_cd4240: -- break; -- case uint cast_cd4240: -- break; -- case ulong cast_cd4240: -- break; -- case ushort cast_cd4240: -- break; -- case Amazon.JSII.Tests.CalculatorNamespace.ISecondLevelStruct cast_cd4240: -- break; -- case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_cd4240: -- // Not enough information to type-check... -- break; -- case null: -- throw new System.ArgumentException($"Expected {nameof(value)} to be one of: double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.ISecondLevelStruct).FullName}; received null", nameof(value)); -- default: -- throw new System.ArgumentException($"Expected {nameof(value)} to be one of: double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.ISecondLevelStruct).FullName}; received {value.GetType().FullName}", nameof(value)); -- } -- } ++ if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) ++ { ++ switch (value) ++ { ++ case double cast_cd4240: ++ break; ++ case byte cast_cd4240: ++ break; ++ case decimal cast_cd4240: ++ break; ++ case float cast_cd4240: ++ break; ++ case int cast_cd4240: ++ break; ++ case long cast_cd4240: ++ break; ++ case sbyte cast_cd4240: ++ break; ++ case short cast_cd4240: ++ break; ++ case uint cast_cd4240: ++ break; ++ case ulong cast_cd4240: ++ break; ++ case ushort cast_cd4240: ++ break; ++ case Amazon.JSII.Tests.CalculatorNamespace.ISecondLevelStruct cast_cd4240: ++ break; ++ case Amazon.JSII.Runtime.Deputy.AnonymousObject cast_cd4240: ++ // Not enough information to type-check... ++ break; ++ case null: ++ throw new System.ArgumentException($"Expected {nameof(value)} to be one of: double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.ISecondLevelStruct).FullName}; received null", nameof(value)); ++ default: ++ throw new System.ArgumentException($"Expected {nameof(value)} to be one of: double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.ISecondLevelStruct).FullName}; received {value.GetType().FullName}", nameof(value)); ++ } ++ } _secondLevel = value; } } @@ -21730,95 +21203,95 @@ exports[`Generated code for "jsii-calc": /dotnet/Amazon `; exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionProperties.cs.diff 1`] = ` ---- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionProperties.cs --runtime-type-checking -+++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionProperties.cs --no-runtime-type-checking -@@ -15,46 +15,10 @@ +--- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionProperties.cs --no-runtime-type-checking ++++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionProperties.cs --runtime-type-checking +@@ -15,10 +15,46 @@ public object Bar { get => _bar; set { -- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) -- { -- switch (value) -- { -- case string cast_cd4240: -- break; -- case double cast_cd4240: -- break; -- case byte cast_cd4240: -- break; -- case decimal cast_cd4240: -- break; -- case float cast_cd4240: -- break; -- case int cast_cd4240: -- break; -- case long cast_cd4240: -- break; -- case sbyte cast_cd4240: -- break; -- case short cast_cd4240: -- break; -- case uint cast_cd4240: -- break; -- case ulong cast_cd4240: -- break; -- case ushort cast_cd4240: -- break; -- case Amazon.JSII.Tests.CalculatorNamespace.AllTypes cast_cd4240: -- break; -- case null: -- throw new System.ArgumentException($"Expected {nameof(value)} to be one of: string, double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.AllTypes).FullName}; received null", nameof(value)); -- default: -- throw new System.ArgumentException($"Expected {nameof(value)} to be one of: string, double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.AllTypes).FullName}; received {value.GetType().FullName}", nameof(value)); -- } -- } ++ if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) ++ { ++ switch (value) ++ { ++ case string cast_cd4240: ++ break; ++ case double cast_cd4240: ++ break; ++ case byte cast_cd4240: ++ break; ++ case decimal cast_cd4240: ++ break; ++ case float cast_cd4240: ++ break; ++ case int cast_cd4240: ++ break; ++ case long cast_cd4240: ++ break; ++ case sbyte cast_cd4240: ++ break; ++ case short cast_cd4240: ++ break; ++ case uint cast_cd4240: ++ break; ++ case ulong cast_cd4240: ++ break; ++ case ushort cast_cd4240: ++ break; ++ case Amazon.JSII.Tests.CalculatorNamespace.AllTypes cast_cd4240: ++ break; ++ case null: ++ throw new System.ArgumentException($"Expected {nameof(value)} to be one of: string, double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.AllTypes).FullName}; received null", nameof(value)); ++ default: ++ throw new System.ArgumentException($"Expected {nameof(value)} to be one of: string, double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.AllTypes).FullName}; received {value.GetType().FullName}", nameof(value)); ++ } ++ } _bar = value; } } private object? _foo; -@@ -64,44 +28,10 @@ +@@ -28,10 +64,44 @@ public object? Foo { get => _foo; set { -- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) -- { -- switch (value) -- { -- case string cast_cd4240: -- break; -- case double cast_cd4240: -- break; -- case byte cast_cd4240: -- break; -- case decimal cast_cd4240: -- break; -- case float cast_cd4240: -- break; -- case int cast_cd4240: -- break; -- case long cast_cd4240: -- break; -- case sbyte cast_cd4240: -- break; -- case short cast_cd4240: -- break; -- case uint cast_cd4240: -- break; -- case ulong cast_cd4240: -- break; -- case ushort cast_cd4240: -- break; -- case null: -- break; -- default: -- throw new System.ArgumentException($"Expected {nameof(value)} to be one of: string, double; received {value.GetType().FullName}", nameof(value)); -- } -- } ++ if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) ++ { ++ switch (value) ++ { ++ case string cast_cd4240: ++ break; ++ case double cast_cd4240: ++ break; ++ case byte cast_cd4240: ++ break; ++ case decimal cast_cd4240: ++ break; ++ case float cast_cd4240: ++ break; ++ case int cast_cd4240: ++ break; ++ case long cast_cd4240: ++ break; ++ case sbyte cast_cd4240: ++ break; ++ case short cast_cd4240: ++ break; ++ case uint cast_cd4240: ++ break; ++ case ulong cast_cd4240: ++ break; ++ case ushort cast_cd4240: ++ break; ++ case null: ++ break; ++ default: ++ throw new System.ArgumentException($"Expected {nameof(value)} to be one of: string, double; received {value.GetType().FullName}", nameof(value)); ++ } ++ } _foo = value; } } diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.js.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.js.snap index 77050e964f..766e5a6f43 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.js.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.js.snap @@ -494,7 +494,71 @@ exports[`Generated code for "@scope/jsii-calc-base": /go/jcb/version 1`] exports[`Generated code for "@scope/jsii-calc-base": / 1`] = ` -┗━ 🕳 There is nothing here + ┗━ 📁 go + ┗━ 📁 jcb + ┣━ 🆕 jcb_StaticConsumer__no_runtime_type_checking.go + ┣━ 🆕 jcb_StaticConsumer__runtime_type_checks.go + ┗━ 📄 jcb_StaticConsumer.go.diff +`; + +exports[`Generated code for "@scope/jsii-calc-base": /go/jcb/jcb_StaticConsumer.go.diff 1`] = ` +--- go/jcb/jcb_StaticConsumer.go --no-runtime-type-checking ++++ go/jcb/jcb_StaticConsumer.go --runtime-type-checking +@@ -40,10 +40,13 @@ + } + + func StaticConsumer_Consume(args ...interface{}) { + _init_.Initialize() + ++ if err := validateStaticConsumer_ConsumeParameters(args); err != nil { ++ panic(err) ++ } + args_ := []interface{}{} + for _, a := range args { + args_ = append(args_, a) + } +`; + +exports[`Generated code for "@scope/jsii-calc-base": /go/jcb/jcb_StaticConsumer__no_runtime_type_checking.go.diff 1`] = ` +--- go/jcb/jcb_StaticConsumer__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jcb/jcb_StaticConsumer__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// An example direct dependency for jsii-calc. ++package jcb ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateStaticConsumer_ConsumeParameters(args []interface{}) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "@scope/jsii-calc-base": /go/jcb/jcb_StaticConsumer__runtime_type_checks.go.diff 1`] = ` +--- go/jcb/jcb_StaticConsumer__runtime_type_checks.go --no-runtime-type-checking ++++ go/jcb/jcb_StaticConsumer__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// An example direct dependency for jsii-calc. ++package jcb ++ ++import ( ++ "fmt" ++) ++ ++func validateStaticConsumer_ConsumeParameters(args []interface{}) error { ++ if args == nil { ++ return fmt.Errorf("parameter args is required, but nil was provided") ++ } ++ ++ return nil ++} ++ `; exports[`Generated code for "@scope/jsii-calc-base-of-base": / 1`] = ` @@ -955,7 +1019,71 @@ exports[`Generated code for "@scope/jsii-calc-base-of-base": /go/scopejs exports[`Generated code for "@scope/jsii-calc-base-of-base": / 1`] = ` -┗━ 🕳 There is nothing here + ┗━ 📁 go + ┗━ 📁 scopejsiicalcbaseofbase + ┣━ 🆕 scopejsiicalcbaseofbase_StaticConsumer__no_runtime_type_checking.go + ┣━ 🆕 scopejsiicalcbaseofbase_StaticConsumer__runtime_type_checks.go + ┗━ 📄 scopejsiicalcbaseofbase_StaticConsumer.go.diff +`; + +exports[`Generated code for "@scope/jsii-calc-base-of-base": /go/scopejsiicalcbaseofbase/scopejsiicalcbaseofbase_StaticConsumer.go.diff 1`] = ` +--- go/scopejsiicalcbaseofbase/scopejsiicalcbaseofbase_StaticConsumer.go --no-runtime-type-checking ++++ go/scopejsiicalcbaseofbase/scopejsiicalcbaseofbase_StaticConsumer.go --runtime-type-checking +@@ -15,10 +15,13 @@ + } + + func StaticConsumer_Consume(_args ...interface{}) { + _init_.Initialize() + ++ if err := validateStaticConsumer_ConsumeParameters(_args); err != nil { ++ panic(err) ++ } + args := []interface{}{} + for _, a := range _args { + args = append(args, a) + } +`; + +exports[`Generated code for "@scope/jsii-calc-base-of-base": /go/scopejsiicalcbaseofbase/scopejsiicalcbaseofbase_StaticConsumer__no_runtime_type_checking.go.diff 1`] = ` +--- go/scopejsiicalcbaseofbase/scopejsiicalcbaseofbase_StaticConsumer__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/scopejsiicalcbaseofbase/scopejsiicalcbaseofbase_StaticConsumer__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// An example transitive dependency for jsii-calc. ++package scopejsiicalcbaseofbase ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateStaticConsumer_ConsumeParameters(_args []interface{}) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "@scope/jsii-calc-base-of-base": /go/scopejsiicalcbaseofbase/scopejsiicalcbaseofbase_StaticConsumer__runtime_type_checks.go.diff 1`] = ` +--- go/scopejsiicalcbaseofbase/scopejsiicalcbaseofbase_StaticConsumer__runtime_type_checks.go --no-runtime-type-checking ++++ go/scopejsiicalcbaseofbase/scopejsiicalcbaseofbase_StaticConsumer__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// An example transitive dependency for jsii-calc. ++package scopejsiicalcbaseofbase ++ ++import ( ++ "fmt" ++) ++ ++func validateStaticConsumer_ConsumeParameters(_args []interface{}) error { ++ if _args == nil { ++ return fmt.Errorf("parameter _args is required, but nil was provided") ++ } ++ ++ return nil ++} ++ `; exports[`Generated code for "@scope/jsii-calc-lib": / 1`] = ` @@ -2210,7 +2338,228 @@ exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib exports[`Generated code for "@scope/jsii-calc-lib": / 1`] = ` -┗━ 🕳 There is nothing here + ┗━ 📁 go + ┗━ 📁 scopejsiicalclib + ┣━ 📁 customsubmodulename + ┃ ┣━ 🆕 customsubmodulename_Reflector__no_runtime_type_checking.go + ┃ ┣━ 🆕 customsubmodulename_Reflector__runtime_type_checks.go + ┃ ┗━ 📄 customsubmodulename_Reflector.go.diff + ┣━ 🆕 scopejsiicalclib_BaseFor2647__no_runtime_type_checking.go + ┣━ 🆕 scopejsiicalclib_BaseFor2647__runtime_type_checks.go + ┣━ 📄 scopejsiicalclib_BaseFor2647.go.diff + ┣━ 🆕 scopejsiicalclib_Number__no_runtime_type_checking.go + ┣━ 🆕 scopejsiicalclib_Number__runtime_type_checks.go + ┗━ 📄 scopejsiicalclib_Number.go.diff +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/customsubmodulename/customsubmodulename_Reflector.go.diff 1`] = ` +--- go/scopejsiicalclib/customsubmodulename/customsubmodulename_Reflector.go --no-runtime-type-checking ++++ go/scopejsiicalclib/customsubmodulename/customsubmodulename_Reflector.go --runtime-type-checking +@@ -41,10 +41,13 @@ + r, + ) + } + + func (r *jsiiProxy_Reflector) AsMap(reflectable IReflectable) *map[string]interface{} { ++ if err := r.validateAsMapParameters(reflectable); err != nil { ++ panic(err) ++ } + var returns *map[string]interface{} + + _jsii_.Invoke( + r, + "asMap", +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/customsubmodulename/customsubmodulename_Reflector__no_runtime_type_checking.go.diff 1`] = ` +--- go/scopejsiicalclib/customsubmodulename/customsubmodulename_Reflector__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/scopejsiicalclib/customsubmodulename/customsubmodulename_Reflector__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++package customsubmodulename ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (r *jsiiProxy_Reflector) validateAsMapParameters(reflectable IReflectable) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/customsubmodulename/customsubmodulename_Reflector__runtime_type_checks.go.diff 1`] = ` +--- go/scopejsiicalclib/customsubmodulename/customsubmodulename_Reflector__runtime_type_checks.go --no-runtime-type-checking ++++ go/scopejsiicalclib/customsubmodulename/customsubmodulename_Reflector__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++package customsubmodulename ++ ++import ( ++ "fmt" ++) ++ ++func (r *jsiiProxy_Reflector) validateAsMapParameters(reflectable IReflectable) error { ++ if reflectable == nil { ++ return fmt.Errorf("parameter reflectable is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/scopejsiicalclib_BaseFor2647.go.diff 1`] = ` +--- go/scopejsiicalclib/scopejsiicalclib_BaseFor2647.go --no-runtime-type-checking ++++ go/scopejsiicalclib/scopejsiicalclib_BaseFor2647.go --runtime-type-checking +@@ -29,10 +29,13 @@ + + // Deprecated. + func NewBaseFor2647(very scopejsiicalcbaseofbase.Very) BaseFor2647 { + _init_.Initialize() + ++ if err := validateNewBaseFor2647Parameters(very); err != nil { ++ panic(err) ++ } + j := jsiiProxy_BaseFor2647{} + + _jsii_.Create( + "@scope/jsii-calc-lib.BaseFor2647", + []interface{}{very}, +@@ -52,10 +55,13 @@ + b, + ) + } + + func (b *jsiiProxy_BaseFor2647) Foo(obj jcb.IBaseInterface) { ++ if err := b.validateFooParameters(obj); err != nil { ++ panic(err) ++ } + _jsii_.InvokeVoid( + b, + "foo", + []interface{}{obj}, + ) +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/scopejsiicalclib_BaseFor2647__no_runtime_type_checking.go.diff 1`] = ` +--- go/scopejsiicalclib/scopejsiicalclib_BaseFor2647__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/scopejsiicalclib/scopejsiicalclib_BaseFor2647__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,16 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator library built on JSII. ++package scopejsiicalclib ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (b *jsiiProxy_BaseFor2647) validateFooParameters(obj jcb.IBaseInterface) error { ++ return nil ++} ++ ++func validateNewBaseFor2647Parameters(very scopejsiicalcbaseofbase.Very) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/scopejsiicalclib_BaseFor2647__runtime_type_checks.go.diff 1`] = ` +--- go/scopejsiicalclib/scopejsiicalclib_BaseFor2647__runtime_type_checks.go --no-runtime-type-checking ++++ go/scopejsiicalclib/scopejsiicalclib_BaseFor2647__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,29 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator library built on JSII. ++package scopejsiicalclib ++ ++import ( ++ "fmt" ++ ++ "github.com/aws/jsii/jsii-calc/go/jcb" ++ "github.com/aws/jsii/jsii-calc/go/scopejsiicalcbaseofbase/v2" ++) ++ ++func (b *jsiiProxy_BaseFor2647) validateFooParameters(obj jcb.IBaseInterface) error { ++ if obj == nil { ++ return fmt.Errorf("parameter obj is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func validateNewBaseFor2647Parameters(very scopejsiicalcbaseofbase.Very) error { ++ if very == nil { ++ return fmt.Errorf("parameter very is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/scopejsiicalclib_Number.go.diff 1`] = ` +--- go/scopejsiicalclib/scopejsiicalclib_Number.go --no-runtime-type-checking ++++ go/scopejsiicalclib/scopejsiicalclib_Number.go --runtime-type-checking +@@ -55,10 +55,13 @@ + // Creates a Number object. + // Deprecated. + func NewNumber(value *float64) Number { + _init_.Initialize() + ++ if err := validateNewNumberParameters(value); err != nil { ++ panic(err) ++ } + j := jsiiProxy_Number{} + + _jsii_.Create( + "@scope/jsii-calc-lib.Number", + []interface{}{value}, +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/scopejsiicalclib_Number__no_runtime_type_checking.go.diff 1`] = ` +--- go/scopejsiicalclib/scopejsiicalclib_Number__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/scopejsiicalclib/scopejsiicalclib_Number__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator library built on JSII. ++package scopejsiicalclib ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateNewNumberParameters(value *float64) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/scopejsiicalclib_Number__runtime_type_checks.go.diff 1`] = ` +--- go/scopejsiicalclib/scopejsiicalclib_Number__runtime_type_checks.go --no-runtime-type-checking ++++ go/scopejsiicalclib/scopejsiicalclib_Number__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator library built on JSII. ++package scopejsiicalclib ++ ++import ( ++ "fmt" ++) ++ ++func validateNewNumberParameters(value *float64) error { ++ if value == nil { ++ return fmt.Errorf("parameter value is required, but nil was provided") ++ } ++ ++ return nil ++} ++ `; exports[`Generated code for "jsii-calc": / 1`] = ` @@ -3326,7 +3675,7 @@ func NewCompositeOperation_Override(c CompositeOperation) { ) } -func (j *jsiiProxy_CompositeOperation) SetDecorationPostfixes(val *[]*string) { +func (j *jsiiProxy_CompositeOperation)SetDecorationPostfixes(val *[]*string) { _jsii_.Set( j, "decorationPostfixes", @@ -3334,7 +3683,7 @@ func (j *jsiiProxy_CompositeOperation) SetDecorationPostfixes(val *[]*string) { ) } -func (j *jsiiProxy_CompositeOperation) SetDecorationPrefixes(val *[]*string) { +func (j *jsiiProxy_CompositeOperation)SetDecorationPrefixes(val *[]*string) { _jsii_.Set( j, "decorationPrefixes", @@ -3342,7 +3691,7 @@ func (j *jsiiProxy_CompositeOperation) SetDecorationPrefixes(val *[]*string) { ) } -func (j *jsiiProxy_CompositeOperation) SetStringStyle(val CompositeOperation_CompositionStringStyle) { +func (j *jsiiProxy_CompositeOperation)SetStringStyle(val CompositeOperation_CompositionStringStyle) { _jsii_.Set( j, "stringStyle", @@ -3494,7 +3843,7 @@ func NewBase_Override(b Base) { ) } -func (j *jsiiProxy_Base) SetProp(val *string) { +func (j *jsiiProxy_Base)SetProp(val *string) { _jsii_.Set( j, "prop", @@ -3559,7 +3908,7 @@ func NewDerived_Override(d Derived) { ) } -func (j *jsiiProxy_Derived) SetProp(val *string) { +func (j *jsiiProxy_Derived)SetProp(val *string) { _jsii_.Set( j, "prop", @@ -3665,7 +4014,7 @@ func NewFoo_Override(f Foo) { ) } -func (j *jsiiProxy_Foo) SetBar(val *string) { +func (j *jsiiProxy_Foo)SetBar(val *string) { _jsii_.Set( j, "bar", @@ -6445,7 +6794,7 @@ func NewAbstractSuite_Override(a AbstractSuite) { ) } -func (j *jsiiProxy_AbstractSuite) SetProperty(val *string) { +func (j *jsiiProxy_AbstractSuite)SetProperty(val *string) { _jsii_.Set( j, "property", @@ -6894,7 +7243,7 @@ func NewAllTypes_Override(a AllTypes) { ) } -func (j *jsiiProxy_AllTypes) SetAnyArrayProperty(val *[]interface{}) { +func (j *jsiiProxy_AllTypes)SetAnyArrayProperty(val *[]interface{}) { _jsii_.Set( j, "anyArrayProperty", @@ -6902,7 +7251,7 @@ func (j *jsiiProxy_AllTypes) SetAnyArrayProperty(val *[]interface{}) { ) } -func (j *jsiiProxy_AllTypes) SetAnyMapProperty(val *map[string]interface{}) { +func (j *jsiiProxy_AllTypes)SetAnyMapProperty(val *map[string]interface{}) { _jsii_.Set( j, "anyMapProperty", @@ -6910,7 +7259,7 @@ func (j *jsiiProxy_AllTypes) SetAnyMapProperty(val *map[string]interface{}) { ) } -func (j *jsiiProxy_AllTypes) SetAnyProperty(val interface{}) { +func (j *jsiiProxy_AllTypes)SetAnyProperty(val interface{}) { _jsii_.Set( j, "anyProperty", @@ -6918,7 +7267,7 @@ func (j *jsiiProxy_AllTypes) SetAnyProperty(val interface{}) { ) } -func (j *jsiiProxy_AllTypes) SetArrayProperty(val *[]*string) { +func (j *jsiiProxy_AllTypes)SetArrayProperty(val *[]*string) { _jsii_.Set( j, "arrayProperty", @@ -6926,7 +7275,7 @@ func (j *jsiiProxy_AllTypes) SetArrayProperty(val *[]*string) { ) } -func (j *jsiiProxy_AllTypes) SetBooleanProperty(val *bool) { +func (j *jsiiProxy_AllTypes)SetBooleanProperty(val *bool) { _jsii_.Set( j, "booleanProperty", @@ -6934,7 +7283,7 @@ func (j *jsiiProxy_AllTypes) SetBooleanProperty(val *bool) { ) } -func (j *jsiiProxy_AllTypes) SetDateProperty(val *time.Time) { +func (j *jsiiProxy_AllTypes)SetDateProperty(val *time.Time) { _jsii_.Set( j, "dateProperty", @@ -6942,7 +7291,7 @@ func (j *jsiiProxy_AllTypes) SetDateProperty(val *time.Time) { ) } -func (j *jsiiProxy_AllTypes) SetEnumProperty(val AllTypesEnum) { +func (j *jsiiProxy_AllTypes)SetEnumProperty(val AllTypesEnum) { _jsii_.Set( j, "enumProperty", @@ -6950,7 +7299,7 @@ func (j *jsiiProxy_AllTypes) SetEnumProperty(val AllTypesEnum) { ) } -func (j *jsiiProxy_AllTypes) SetJsonProperty(val *map[string]interface{}) { +func (j *jsiiProxy_AllTypes)SetJsonProperty(val *map[string]interface{}) { _jsii_.Set( j, "jsonProperty", @@ -6958,7 +7307,7 @@ func (j *jsiiProxy_AllTypes) SetJsonProperty(val *map[string]interface{}) { ) } -func (j *jsiiProxy_AllTypes) SetMapProperty(val *map[string]scopejsiicalclib.Number) { +func (j *jsiiProxy_AllTypes)SetMapProperty(val *map[string]scopejsiicalclib.Number) { _jsii_.Set( j, "mapProperty", @@ -6966,7 +7315,7 @@ func (j *jsiiProxy_AllTypes) SetMapProperty(val *map[string]scopejsiicalclib.Num ) } -func (j *jsiiProxy_AllTypes) SetNumberProperty(val *float64) { +func (j *jsiiProxy_AllTypes)SetNumberProperty(val *float64) { _jsii_.Set( j, "numberProperty", @@ -6974,7 +7323,7 @@ func (j *jsiiProxy_AllTypes) SetNumberProperty(val *float64) { ) } -func (j *jsiiProxy_AllTypes) SetOptionalEnumValue(val StringEnum) { +func (j *jsiiProxy_AllTypes)SetOptionalEnumValue(val StringEnum) { _jsii_.Set( j, "optionalEnumValue", @@ -6982,7 +7331,7 @@ func (j *jsiiProxy_AllTypes) SetOptionalEnumValue(val StringEnum) { ) } -func (j *jsiiProxy_AllTypes) SetStringProperty(val *string) { +func (j *jsiiProxy_AllTypes)SetStringProperty(val *string) { _jsii_.Set( j, "stringProperty", @@ -6990,7 +7339,7 @@ func (j *jsiiProxy_AllTypes) SetStringProperty(val *string) { ) } -func (j *jsiiProxy_AllTypes) SetUnionArrayProperty(val *[]interface{}) { +func (j *jsiiProxy_AllTypes)SetUnionArrayProperty(val *[]interface{}) { _jsii_.Set( j, "unionArrayProperty", @@ -6998,7 +7347,7 @@ func (j *jsiiProxy_AllTypes) SetUnionArrayProperty(val *[]interface{}) { ) } -func (j *jsiiProxy_AllTypes) SetUnionMapProperty(val *map[string]interface{}) { +func (j *jsiiProxy_AllTypes)SetUnionMapProperty(val *map[string]interface{}) { _jsii_.Set( j, "unionMapProperty", @@ -7006,7 +7355,7 @@ func (j *jsiiProxy_AllTypes) SetUnionMapProperty(val *map[string]interface{}) { ) } -func (j *jsiiProxy_AllTypes) SetUnionProperty(val interface{}) { +func (j *jsiiProxy_AllTypes)SetUnionProperty(val interface{}) { _jsii_.Set( j, "unionProperty", @@ -7014,7 +7363,7 @@ func (j *jsiiProxy_AllTypes) SetUnionProperty(val interface{}) { ) } -func (j *jsiiProxy_AllTypes) SetUnknownArrayProperty(val *[]interface{}) { +func (j *jsiiProxy_AllTypes)SetUnknownArrayProperty(val *[]interface{}) { _jsii_.Set( j, "unknownArrayProperty", @@ -7022,7 +7371,7 @@ func (j *jsiiProxy_AllTypes) SetUnknownArrayProperty(val *[]interface{}) { ) } -func (j *jsiiProxy_AllTypes) SetUnknownMapProperty(val *map[string]interface{}) { +func (j *jsiiProxy_AllTypes)SetUnknownMapProperty(val *map[string]interface{}) { _jsii_.Set( j, "unknownMapProperty", @@ -7030,7 +7379,7 @@ func (j *jsiiProxy_AllTypes) SetUnknownMapProperty(val *map[string]interface{}) ) } -func (j *jsiiProxy_AllTypes) SetUnknownProperty(val interface{}) { +func (j *jsiiProxy_AllTypes)SetUnknownProperty(val interface{}) { _jsii_.Set( j, "unknownProperty", @@ -7670,7 +8019,7 @@ func NewBell_Override(b Bell) { ) } -func (j *jsiiProxy_Bell) SetRung(val *bool) { +func (j *jsiiProxy_Bell)SetRung(val *bool) { _jsii_.Set( j, "rung", @@ -8081,7 +8430,7 @@ func NewCalculator_Override(c Calculator, props *CalculatorProps) { ) } -func (j *jsiiProxy_Calculator) SetCurr(val scopejsiicalclib.NumericValue) { +func (j *jsiiProxy_Calculator)SetCurr(val scopejsiicalclib.NumericValue) { _jsii_.Set( j, "curr", @@ -8089,7 +8438,7 @@ func (j *jsiiProxy_Calculator) SetCurr(val scopejsiicalclib.NumericValue) { ) } -func (j *jsiiProxy_Calculator) SetDecorationPostfixes(val *[]*string) { +func (j *jsiiProxy_Calculator)SetDecorationPostfixes(val *[]*string) { _jsii_.Set( j, "decorationPostfixes", @@ -8097,7 +8446,7 @@ func (j *jsiiProxy_Calculator) SetDecorationPostfixes(val *[]*string) { ) } -func (j *jsiiProxy_Calculator) SetDecorationPrefixes(val *[]*string) { +func (j *jsiiProxy_Calculator)SetDecorationPrefixes(val *[]*string) { _jsii_.Set( j, "decorationPrefixes", @@ -8105,7 +8454,7 @@ func (j *jsiiProxy_Calculator) SetDecorationPrefixes(val *[]*string) { ) } -func (j *jsiiProxy_Calculator) SetMaxValue(val *float64) { +func (j *jsiiProxy_Calculator)SetMaxValue(val *float64) { _jsii_.Set( j, "maxValue", @@ -8113,7 +8462,7 @@ func (j *jsiiProxy_Calculator) SetMaxValue(val *float64) { ) } -func (j *jsiiProxy_Calculator) SetStringStyle(val composition.CompositeOperation_CompositionStringStyle) { +func (j *jsiiProxy_Calculator)SetStringStyle(val composition.CompositeOperation_CompositionStringStyle) { _jsii_.Set( j, "stringStyle", @@ -8121,7 +8470,7 @@ func (j *jsiiProxy_Calculator) SetStringStyle(val composition.CompositeOperation ) } -func (j *jsiiProxy_Calculator) SetUnionProperty(val interface{}) { +func (j *jsiiProxy_Calculator)SetUnionProperty(val interface{}) { _jsii_.Set( j, "unionProperty", @@ -8325,7 +8674,7 @@ func NewClassThatImplementsTheInternalInterface_Override(c ClassThatImplementsTh ) } -func (j *jsiiProxy_ClassThatImplementsTheInternalInterface) SetA(val *string) { +func (j *jsiiProxy_ClassThatImplementsTheInternalInterface)SetA(val *string) { _jsii_.Set( j, "a", @@ -8333,7 +8682,7 @@ func (j *jsiiProxy_ClassThatImplementsTheInternalInterface) SetA(val *string) { ) } -func (j *jsiiProxy_ClassThatImplementsTheInternalInterface) SetB(val *string) { +func (j *jsiiProxy_ClassThatImplementsTheInternalInterface)SetB(val *string) { _jsii_.Set( j, "b", @@ -8341,7 +8690,7 @@ func (j *jsiiProxy_ClassThatImplementsTheInternalInterface) SetB(val *string) { ) } -func (j *jsiiProxy_ClassThatImplementsTheInternalInterface) SetC(val *string) { +func (j *jsiiProxy_ClassThatImplementsTheInternalInterface)SetC(val *string) { _jsii_.Set( j, "c", @@ -8349,7 +8698,7 @@ func (j *jsiiProxy_ClassThatImplementsTheInternalInterface) SetC(val *string) { ) } -func (j *jsiiProxy_ClassThatImplementsTheInternalInterface) SetD(val *string) { +func (j *jsiiProxy_ClassThatImplementsTheInternalInterface)SetD(val *string) { _jsii_.Set( j, "d", @@ -8451,7 +8800,7 @@ func NewClassThatImplementsThePrivateInterface_Override(c ClassThatImplementsThe ) } -func (j *jsiiProxy_ClassThatImplementsThePrivateInterface) SetA(val *string) { +func (j *jsiiProxy_ClassThatImplementsThePrivateInterface)SetA(val *string) { _jsii_.Set( j, "a", @@ -8459,7 +8808,7 @@ func (j *jsiiProxy_ClassThatImplementsThePrivateInterface) SetA(val *string) { ) } -func (j *jsiiProxy_ClassThatImplementsThePrivateInterface) SetB(val *string) { +func (j *jsiiProxy_ClassThatImplementsThePrivateInterface)SetB(val *string) { _jsii_.Set( j, "b", @@ -8467,7 +8816,7 @@ func (j *jsiiProxy_ClassThatImplementsThePrivateInterface) SetB(val *string) { ) } -func (j *jsiiProxy_ClassThatImplementsThePrivateInterface) SetC(val *string) { +func (j *jsiiProxy_ClassThatImplementsThePrivateInterface)SetC(val *string) { _jsii_.Set( j, "c", @@ -8475,7 +8824,7 @@ func (j *jsiiProxy_ClassThatImplementsThePrivateInterface) SetC(val *string) { ) } -func (j *jsiiProxy_ClassThatImplementsThePrivateInterface) SetE(val *string) { +func (j *jsiiProxy_ClassThatImplementsThePrivateInterface)SetE(val *string) { _jsii_.Set( j, "e", @@ -8540,7 +8889,7 @@ func NewClassWithCollectionOfUnions_Override(c ClassWithCollectionOfUnions, unio ) } -func (j *jsiiProxy_ClassWithCollectionOfUnions) SetUnionProperty(val *[]*map[string]interface{}) { +func (j *jsiiProxy_ClassWithCollectionOfUnions)SetUnionProperty(val *[]*map[string]interface{}) { _jsii_.Set( j, "unionProperty", @@ -8617,7 +8966,7 @@ func NewClassWithCollections_Override(c ClassWithCollections, map_ *map[string]* ) } -func (j *jsiiProxy_ClassWithCollections) SetArray(val *[]*string) { +func (j *jsiiProxy_ClassWithCollections)SetArray(val *[]*string) { _jsii_.Set( j, "array", @@ -8625,7 +8974,7 @@ func (j *jsiiProxy_ClassWithCollections) SetArray(val *[]*string) { ) } -func (j *jsiiProxy_ClassWithCollections) SetMap(val *map[string]*string) { +func (j *jsiiProxy_ClassWithCollections)SetMap(val *map[string]*string) { _jsii_.Set( j, "map", @@ -8973,7 +9322,7 @@ func NewClassWithMutableObjectLiteralProperty_Override(c ClassWithMutableObjectL ) } -func (j *jsiiProxy_ClassWithMutableObjectLiteralProperty) SetMutableObject(val IMutableObjectLiteral) { +func (j *jsiiProxy_ClassWithMutableObjectLiteralProperty)SetMutableObject(val IMutableObjectLiteral) { _jsii_.Set( j, "mutableObject", @@ -9038,7 +9387,7 @@ func NewClassWithNestedUnion_Override(c ClassWithNestedUnion, unionProperty *[]i ) } -func (j *jsiiProxy_ClassWithNestedUnion) SetUnionProperty(val *[]interface{}) { +func (j *jsiiProxy_ClassWithNestedUnion)SetUnionProperty(val *[]interface{}) { _jsii_.Set( j, "unionProperty", @@ -9092,7 +9441,7 @@ func (j *jsiiProxy_ClassWithPrivateConstructorAndAutomaticProperties) ReadWriteS } -func (j *jsiiProxy_ClassWithPrivateConstructorAndAutomaticProperties) SetReadWriteString(val *string) { +func (j *jsiiProxy_ClassWithPrivateConstructorAndAutomaticProperties)SetReadWriteString(val *string) { _jsii_.Set( j, "readWriteString", @@ -9151,7 +9500,7 @@ func (j *jsiiProxy_ConfusingToJackson) UnionProperty() interface{} { } -func (j *jsiiProxy_ConfusingToJackson) SetUnionProperty(val interface{}) { +func (j *jsiiProxy_ConfusingToJackson)SetUnionProperty(val interface{}) { _jsii_.Set( j, "unionProperty", @@ -10107,7 +10456,7 @@ func NewDeprecatedClass_Override(d DeprecatedClass, readonlyString *string, muta ) } -func (j *jsiiProxy_DeprecatedClass) SetMutableProperty(val *float64) { +func (j *jsiiProxy_DeprecatedClass)SetMutableProperty(val *float64) { _jsii_.Set( j, "mutableProperty", @@ -10750,7 +11099,7 @@ func NewDynamicPropertyBearer_Override(d DynamicPropertyBearer, valueStore *stri ) } -func (j *jsiiProxy_DynamicPropertyBearer) SetDynamicProperty(val *string) { +func (j *jsiiProxy_DynamicPropertyBearer)SetDynamicProperty(val *string) { _jsii_.Set( j, "dynamicProperty", @@ -10758,7 +11107,7 @@ func (j *jsiiProxy_DynamicPropertyBearer) SetDynamicProperty(val *string) { ) } -func (j *jsiiProxy_DynamicPropertyBearer) SetValueStore(val *string) { +func (j *jsiiProxy_DynamicPropertyBearer)SetValueStore(val *string) { _jsii_.Set( j, "valueStore", @@ -10851,7 +11200,7 @@ func NewDynamicPropertyBearerChild_Override(d DynamicPropertyBearerChild, origin ) } -func (j *jsiiProxy_DynamicPropertyBearerChild) SetDynamicProperty(val *string) { +func (j *jsiiProxy_DynamicPropertyBearerChild)SetDynamicProperty(val *string) { _jsii_.Set( j, "dynamicProperty", @@ -10859,7 +11208,7 @@ func (j *jsiiProxy_DynamicPropertyBearerChild) SetDynamicProperty(val *string) { ) } -func (j *jsiiProxy_DynamicPropertyBearerChild) SetValueStore(val *string) { +func (j *jsiiProxy_DynamicPropertyBearerChild)SetValueStore(val *string) { _jsii_.Set( j, "valueStore", @@ -11180,7 +11529,7 @@ func NewExperimentalClass_Override(e ExperimentalClass, readonlyString *string, ) } -func (j *jsiiProxy_ExperimentalClass) SetMutableProperty(val *float64) { +func (j *jsiiProxy_ExperimentalClass)SetMutableProperty(val *float64) { _jsii_.Set( j, "mutableProperty", @@ -11366,7 +11715,7 @@ func NewExternalClass_Override(e ExternalClass, readonlyString *string, mutableN ) } -func (j *jsiiProxy_ExternalClass) SetMutableProperty(val *float64) { +func (j *jsiiProxy_ExternalClass)SetMutableProperty(val *float64) { _jsii_.Set( j, "mutableProperty", @@ -11757,7 +12106,7 @@ func (j *jsiiProxy_IAnotherPublicInterface) A() *string { return returns } -func (j *jsiiProxy_IAnotherPublicInterface) SetA(val *string) { +func (j *jsiiProxy_IAnotherPublicInterface)SetA(val *string) { _jsii_.Set( j, "a", @@ -11895,7 +12244,7 @@ func (j *jsiiProxy_IDeprecatedInterface) MutableProperty() *float64 { return returns } -func (j *jsiiProxy_IDeprecatedInterface) SetMutableProperty(val *float64) { +func (j *jsiiProxy_IDeprecatedInterface)SetMutableProperty(val *float64) { _jsii_.Set( j, "mutableProperty", @@ -11947,7 +12296,7 @@ func (j *jsiiProxy_IExperimentalInterface) MutableProperty() *float64 { return returns } -func (j *jsiiProxy_IExperimentalInterface) SetMutableProperty(val *float64) { +func (j *jsiiProxy_IExperimentalInterface)SetMutableProperty(val *float64) { _jsii_.Set( j, "mutableProperty", @@ -11997,7 +12346,7 @@ func (j *jsiiProxy_IExtendsPrivateInterface) Private() *string { return returns } -func (j *jsiiProxy_IExtendsPrivateInterface) SetPrivate(val *string) { +func (j *jsiiProxy_IExtendsPrivateInterface)SetPrivate(val *string) { _jsii_.Set( j, "private", @@ -12045,7 +12394,7 @@ func (j *jsiiProxy_IExternalInterface) MutableProperty() *float64 { return returns } -func (j *jsiiProxy_IExternalInterface) SetMutableProperty(val *float64) { +func (j *jsiiProxy_IExternalInterface)SetMutableProperty(val *float64) { _jsii_.Set( j, "mutableProperty", @@ -12405,7 +12754,7 @@ func (j *jsiiProxy_IInterfaceWithProperties) ReadWriteString() *string { return returns } -func (j *jsiiProxy_IInterfaceWithProperties) SetReadWriteString(val *string) { +func (j *jsiiProxy_IInterfaceWithProperties)SetReadWriteString(val *string) { _jsii_.Set( j, "readWriteString", @@ -12445,7 +12794,7 @@ func (j *jsiiProxy_IInterfaceWithPropertiesExtension) Foo() *float64 { return returns } -func (j *jsiiProxy_IInterfaceWithPropertiesExtension) SetFoo(val *float64) { +func (j *jsiiProxy_IInterfaceWithPropertiesExtension)SetFoo(val *float64) { _jsii_.Set( j, "foo", @@ -13109,7 +13458,7 @@ func (j *jsiiProxy_IMutableObjectLiteral) Value() *string { return returns } -func (j *jsiiProxy_IMutableObjectLiteral) SetValue(val *string) { +func (j *jsiiProxy_IMutableObjectLiteral)SetValue(val *string) { _jsii_.Set( j, "value", @@ -13151,7 +13500,7 @@ func (j *jsiiProxy_INonInternalInterface) B() *string { return returns } -func (j *jsiiProxy_INonInternalInterface) SetB(val *string) { +func (j *jsiiProxy_INonInternalInterface)SetB(val *string) { _jsii_.Set( j, "b", @@ -13169,7 +13518,7 @@ func (j *jsiiProxy_INonInternalInterface) C() *string { return returns } -func (j *jsiiProxy_INonInternalInterface) SetC(val *string) { +func (j *jsiiProxy_INonInternalInterface)SetC(val *string) { _jsii_.Set( j, "c", @@ -13223,7 +13572,7 @@ func (j *jsiiProxy_IObjectWithProperty) Property() *string { return returns } -func (j *jsiiProxy_IObjectWithProperty) SetProperty(val *string) { +func (j *jsiiProxy_IObjectWithProperty)SetProperty(val *string) { _jsii_.Set( j, "property", @@ -13515,7 +13864,7 @@ func (j *jsiiProxy_IStableInterface) MutableProperty() *float64 { return returns } -func (j *jsiiProxy_IStableInterface) SetMutableProperty(val *float64) { +func (j *jsiiProxy_IStableInterface)SetMutableProperty(val *float64) { _jsii_.Set( j, "mutableProperty", @@ -13649,7 +13998,7 @@ func NewImplementInternalInterface_Override(i ImplementInternalInterface) { ) } -func (j *jsiiProxy_ImplementInternalInterface) SetProp(val *string) { +func (j *jsiiProxy_ImplementInternalInterface)SetProp(val *string) { _jsii_.Set( j, "prop", @@ -13878,7 +14227,7 @@ func NewImplementsPrivateInterface_Override(i ImplementsPrivateInterface) { ) } -func (j *jsiiProxy_ImplementsPrivateInterface) SetPrivate(val *string) { +func (j *jsiiProxy_ImplementsPrivateInterface)SetPrivate(val *string) { _jsii_.Set( j, "private", @@ -14632,7 +14981,7 @@ func NewJSObjectLiteralToNativeClass_Override(j JSObjectLiteralToNativeClass) { ) } -func (j *jsiiProxy_JSObjectLiteralToNativeClass) SetPropA(val *string) { +func (j *jsiiProxy_JSObjectLiteralToNativeClass)SetPropA(val *string) { _jsii_.Set( j, "propA", @@ -14640,7 +14989,7 @@ func (j *jsiiProxy_JSObjectLiteralToNativeClass) SetPropA(val *string) { ) } -func (j *jsiiProxy_JSObjectLiteralToNativeClass) SetPropB(val *float64) { +func (j *jsiiProxy_JSObjectLiteralToNativeClass)SetPropB(val *float64) { _jsii_.Set( j, "propB", @@ -14757,7 +15106,7 @@ func NewJavaReservedWords_Override(j JavaReservedWords) { ) } -func (j *jsiiProxy_JavaReservedWords) SetWhile(val *string) { +func (j *jsiiProxy_JavaReservedWords)SetWhile(val *string) { _jsii_.Set( j, "while", @@ -16323,7 +16672,7 @@ func NewNullShouldBeTreatedAsUndefined_Override(n NullShouldBeTreatedAsUndefined ) } -func (j *jsiiProxy_NullShouldBeTreatedAsUndefined) SetChangeMeToUndefined(val *string) { +func (j *jsiiProxy_NullShouldBeTreatedAsUndefined)SetChangeMeToUndefined(val *string) { _jsii_.Set( j, "changeMeToUndefined", @@ -16428,7 +16777,7 @@ func NewNumberGenerator_Override(n NumberGenerator, generator IRandomNumberGener ) } -func (j *jsiiProxy_NumberGenerator) SetGenerator(val IRandomNumberGenerator) { +func (j *jsiiProxy_NumberGenerator)SetGenerator(val IRandomNumberGenerator) { _jsii_.Set( j, "generator", @@ -16931,7 +17280,7 @@ func NewOverridableProtectedMember_Override(o OverridableProtectedMember) { ) } -func (j *jsiiProxy_OverridableProtectedMember) SetOverrideReadWrite(val *string) { +func (j *jsiiProxy_OverridableProtectedMember)SetOverrideReadWrite(val *string) { _jsii_.Set( j, "overrideReadWrite", @@ -17296,7 +17645,7 @@ func NewPower_Override(p Power, base scopejsiicalclib.NumericValue, pow scopejsi ) } -func (j *jsiiProxy_Power) SetDecorationPostfixes(val *[]*string) { +func (j *jsiiProxy_Power)SetDecorationPostfixes(val *[]*string) { _jsii_.Set( j, "decorationPostfixes", @@ -17304,7 +17653,7 @@ func (j *jsiiProxy_Power) SetDecorationPostfixes(val *[]*string) { ) } -func (j *jsiiProxy_Power) SetDecorationPrefixes(val *[]*string) { +func (j *jsiiProxy_Power)SetDecorationPrefixes(val *[]*string) { _jsii_.Set( j, "decorationPrefixes", @@ -17312,7 +17661,7 @@ func (j *jsiiProxy_Power) SetDecorationPrefixes(val *[]*string) { ) } -func (j *jsiiProxy_Power) SetStringStyle(val composition.CompositeOperation_CompositionStringStyle) { +func (j *jsiiProxy_Power)SetStringStyle(val composition.CompositeOperation_CompositionStringStyle) { _jsii_.Set( j, "stringStyle", @@ -17861,7 +18210,7 @@ func NewReferenceEnumFromScopedPackage_Override(r ReferenceEnumFromScopedPackage ) } -func (j *jsiiProxy_ReferenceEnumFromScopedPackage) SetFoo(val scopejsiicalclib.EnumFromScopedModule) { +func (j *jsiiProxy_ReferenceEnumFromScopedPackage)SetFoo(val scopejsiicalclib.EnumFromScopedModule) { _jsii_.Set( j, "foo", @@ -18425,7 +18774,7 @@ func NewStableClass_Override(s StableClass, readonlyString *string, mutableNumbe ) } -func (j *jsiiProxy_StableClass) SetMutableProperty(val *float64) { +func (j *jsiiProxy_StableClass)SetMutableProperty(val *float64) { _jsii_.Set( j, "mutableProperty", @@ -18881,7 +19230,7 @@ func NewStripInternal_Override(s StripInternal) { ) } -func (j *jsiiProxy_StripInternal) SetYouSeeMe(val *string) { +func (j *jsiiProxy_StripInternal)SetYouSeeMe(val *string) { _jsii_.Set( j, "youSeeMe", @@ -19255,7 +19604,7 @@ func NewSum_Override(s Sum) { ) } -func (j *jsiiProxy_Sum) SetDecorationPostfixes(val *[]*string) { +func (j *jsiiProxy_Sum)SetDecorationPostfixes(val *[]*string) { _jsii_.Set( j, "decorationPostfixes", @@ -19263,7 +19612,7 @@ func (j *jsiiProxy_Sum) SetDecorationPostfixes(val *[]*string) { ) } -func (j *jsiiProxy_Sum) SetDecorationPrefixes(val *[]*string) { +func (j *jsiiProxy_Sum)SetDecorationPrefixes(val *[]*string) { _jsii_.Set( j, "decorationPrefixes", @@ -19271,7 +19620,7 @@ func (j *jsiiProxy_Sum) SetDecorationPrefixes(val *[]*string) { ) } -func (j *jsiiProxy_Sum) SetParts(val *[]scopejsiicalclib.NumericValue) { +func (j *jsiiProxy_Sum)SetParts(val *[]scopejsiicalclib.NumericValue) { _jsii_.Set( j, "parts", @@ -19279,7 +19628,7 @@ func (j *jsiiProxy_Sum) SetParts(val *[]scopejsiicalclib.NumericValue) { ) } -func (j *jsiiProxy_Sum) SetStringStyle(val composition.CompositeOperation_CompositionStringStyle) { +func (j *jsiiProxy_Sum)SetStringStyle(val composition.CompositeOperation_CompositionStringStyle) { _jsii_.Set( j, "stringStyle", @@ -19637,7 +19986,7 @@ func NewSyncVirtualMethods_Override(s SyncVirtualMethods) { ) } -func (j *jsiiProxy_SyncVirtualMethods) SetA(val *float64) { +func (j *jsiiProxy_SyncVirtualMethods)SetA(val *float64) { _jsii_.Set( j, "a", @@ -19645,7 +19994,7 @@ func (j *jsiiProxy_SyncVirtualMethods) SetA(val *float64) { ) } -func (j *jsiiProxy_SyncVirtualMethods) SetCallerIsProperty(val *float64) { +func (j *jsiiProxy_SyncVirtualMethods)SetCallerIsProperty(val *float64) { _jsii_.Set( j, "callerIsProperty", @@ -19653,7 +20002,7 @@ func (j *jsiiProxy_SyncVirtualMethods) SetCallerIsProperty(val *float64) { ) } -func (j *jsiiProxy_SyncVirtualMethods) SetOtherProperty(val *string) { +func (j *jsiiProxy_SyncVirtualMethods)SetOtherProperty(val *string) { _jsii_.Set( j, "otherProperty", @@ -19661,7 +20010,7 @@ func (j *jsiiProxy_SyncVirtualMethods) SetOtherProperty(val *string) { ) } -func (j *jsiiProxy_SyncVirtualMethods) SetTheProperty(val *string) { +func (j *jsiiProxy_SyncVirtualMethods)SetTheProperty(val *string) { _jsii_.Set( j, "theProperty", @@ -19669,7 +20018,7 @@ func (j *jsiiProxy_SyncVirtualMethods) SetTheProperty(val *string) { ) } -func (j *jsiiProxy_SyncVirtualMethods) SetValueOfOtherProperty(val *string) { +func (j *jsiiProxy_SyncVirtualMethods)SetValueOfOtherProperty(val *string) { _jsii_.Set( j, "valueOfOtherProperty", @@ -23828,7 +24177,7 @@ func NewMyClass_Override(m MyClass, props *child.SomeStruct) { ) } -func (j *jsiiProxy_MyClass) SetAllTypes(val jsiicalc.AllTypes) { +func (j *jsiiProxy_MyClass)SetAllTypes(val jsiicalc.AllTypes) { _jsii_.Set( j, "allTypes", @@ -23859,5 +24208,10344 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/version 1`] = ` exports[`Generated code for "jsii-calc": / 1`] = ` -┗━ 🕳 There is nothing here + ┗━ 📁 go + ┗━ 📁 jsiicalc + ┣━ 📁 anonymous + ┃ ┣━ 🆕 anonymous_UseOptions__no_runtime_type_checking.go + ┃ ┣━ 🆕 anonymous_UseOptions__runtime_type_checks.go + ┃ ┗━ 📄 anonymous_UseOptions.go.diff + ┣━ 📁 cdk16625 + ┃ ┣━ 🆕 cdk16625_Cdk16625__no_runtime_type_checking.go + ┃ ┣━ 🆕 cdk16625_Cdk16625__runtime_type_checks.go + ┃ ┣━ 📄 cdk16625_Cdk16625.go.diff + ┃ ┗━ 📁 donotimport + ┃ ┣━ 🆕 donotimport_UnimportedSubmoduleType__no_runtime_type_checking.go + ┃ ┣━ 🆕 donotimport_UnimportedSubmoduleType__runtime_type_checks.go + ┃ ┗━ 📄 donotimport_UnimportedSubmoduleType.go.diff + ┣━ 📁 composition + ┃ ┣━ 🆕 composition_CompositeOperation__no_runtime_type_checking.go + ┃ ┣━ 🆕 composition_CompositeOperation__runtime_type_checks.go + ┃ ┗━ 📄 composition_CompositeOperation.go.diff + ┣━ 📁 derivedclasshasnoproperties + ┃ ┣━ 🆕 derivedclasshasnoproperties_Base__no_runtime_type_checking.go + ┃ ┣━ 🆕 derivedclasshasnoproperties_Base__runtime_type_checks.go + ┃ ┣━ 📄 derivedclasshasnoproperties_Base.go.diff + ┃ ┣━ 🆕 derivedclasshasnoproperties_Derived__no_runtime_type_checking.go + ┃ ┣━ 🆕 derivedclasshasnoproperties_Derived__runtime_type_checks.go + ┃ ┗━ 📄 derivedclasshasnoproperties_Derived.go.diff + ┣━ 📁 jsii3656 + ┃ ┣━ 🆕 jsii3656_OverrideMe__no_runtime_type_checking.go + ┃ ┣━ 🆕 jsii3656_OverrideMe__runtime_type_checks.go + ┃ ┗━ 📄 jsii3656_OverrideMe.go.diff + ┣━ 🆕 jsiicalc_AbstractClass__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_AbstractClass__runtime_type_checks.go + ┣━ 📄 jsiicalc_AbstractClass.go.diff + ┣━ 🆕 jsiicalc_AbstractSuite__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_AbstractSuite__runtime_type_checks.go + ┣━ 📄 jsiicalc_AbstractSuite.go.diff + ┣━ 🆕 jsiicalc_Add__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_Add__runtime_type_checks.go + ┣━ 📄 jsiicalc_Add.go.diff + ┣━ 🆕 jsiicalc_AllowedMethodNames__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_AllowedMethodNames__runtime_type_checks.go + ┣━ 📄 jsiicalc_AllowedMethodNames.go.diff + ┣━ 🆕 jsiicalc_AllTypes__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_AllTypes__runtime_type_checks.go + ┣━ 📄 jsiicalc_AllTypes.go.diff + ┣━ 🆕 jsiicalc_AmbiguousParameters__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_AmbiguousParameters__runtime_type_checks.go + ┣━ 📄 jsiicalc_AmbiguousParameters.go.diff + ┣━ 🆕 jsiicalc_AsyncVirtualMethods__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_AsyncVirtualMethods__runtime_type_checks.go + ┣━ 📄 jsiicalc_AsyncVirtualMethods.go.diff + ┣━ 🆕 jsiicalc_Bell__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_Bell__runtime_type_checks.go + ┣━ 📄 jsiicalc_Bell.go.diff + ┣━ 🆕 jsiicalc_BinaryOperation__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_BinaryOperation__runtime_type_checks.go + ┣━ 🆕 jsiicalc_BurriedAnonymousObject__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_BurriedAnonymousObject__runtime_type_checks.go + ┣━ 📄 jsiicalc_BurriedAnonymousObject.go.diff + ┣━ 🆕 jsiicalc_Calculator__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_Calculator__runtime_type_checks.go + ┣━ 📄 jsiicalc_Calculator.go.diff + ┣━ 🆕 jsiicalc_ClassThatImplementsTheInternalInterface__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_ClassThatImplementsTheInternalInterface__runtime_type_checks.go + ┣━ 📄 jsiicalc_ClassThatImplementsTheInternalInterface.go.diff + ┣━ 🆕 jsiicalc_ClassThatImplementsThePrivateInterface__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_ClassThatImplementsThePrivateInterface__runtime_type_checks.go + ┣━ 📄 jsiicalc_ClassThatImplementsThePrivateInterface.go.diff + ┣━ 🆕 jsiicalc_ClassWithCollectionOfUnions__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_ClassWithCollectionOfUnions__runtime_type_checks.go + ┣━ 📄 jsiicalc_ClassWithCollectionOfUnions.go.diff + ┣━ 🆕 jsiicalc_ClassWithCollections__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_ClassWithCollections__runtime_type_checks.go + ┣━ 📄 jsiicalc_ClassWithCollections.go.diff + ┣━ 🆕 jsiicalc_ClassWithContainerTypes__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_ClassWithContainerTypes__runtime_type_checks.go + ┣━ 📄 jsiicalc_ClassWithContainerTypes.go.diff + ┣━ 🆕 jsiicalc_ClassWithJavaReservedWords__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_ClassWithJavaReservedWords__runtime_type_checks.go + ┣━ 📄 jsiicalc_ClassWithJavaReservedWords.go.diff + ┣━ 🆕 jsiicalc_ClassWithMutableObjectLiteralProperty__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_ClassWithMutableObjectLiteralProperty__runtime_type_checks.go + ┣━ 📄 jsiicalc_ClassWithMutableObjectLiteralProperty.go.diff + ┣━ 🆕 jsiicalc_ClassWithNestedUnion__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_ClassWithNestedUnion__runtime_type_checks.go + ┣━ 📄 jsiicalc_ClassWithNestedUnion.go.diff + ┣━ 🆕 jsiicalc_ClassWithPrivateConstructorAndAutomaticProperties__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_ClassWithPrivateConstructorAndAutomaticProperties__runtime_type_checks.go + ┣━ 📄 jsiicalc_ClassWithPrivateConstructorAndAutomaticProperties.go.diff + ┣━ 🆕 jsiicalc_ConfusingToJackson__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_ConfusingToJackson__runtime_type_checks.go + ┣━ 📄 jsiicalc_ConfusingToJackson.go.diff + ┣━ 🆕 jsiicalc_ConstructorPassesThisOut__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_ConstructorPassesThisOut__runtime_type_checks.go + ┣━ 📄 jsiicalc_ConstructorPassesThisOut.go.diff + ┣━ 🆕 jsiicalc_ConsumePureInterface__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_ConsumePureInterface__runtime_type_checks.go + ┣━ 📄 jsiicalc_ConsumePureInterface.go.diff + ┣━ 🆕 jsiicalc_ConsumerCanRingBell__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_ConsumerCanRingBell__runtime_type_checks.go + ┣━ 📄 jsiicalc_ConsumerCanRingBell.go.diff + ┣━ 🆕 jsiicalc_ConsumersOfThisCrazyTypeSystem__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_ConsumersOfThisCrazyTypeSystem__runtime_type_checks.go + ┣━ 📄 jsiicalc_ConsumersOfThisCrazyTypeSystem.go.diff + ┣━ 🆕 jsiicalc_DataRenderer__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_DataRenderer__runtime_type_checks.go + ┣━ 📄 jsiicalc_DataRenderer.go.diff + ┣━ 🆕 jsiicalc_DeprecatedClass__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_DeprecatedClass__runtime_type_checks.go + ┣━ 📄 jsiicalc_DeprecatedClass.go.diff + ┣━ 🆕 jsiicalc_DocumentedClass__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_DocumentedClass__runtime_type_checks.go + ┣━ 📄 jsiicalc_DocumentedClass.go.diff + ┣━ 🆕 jsiicalc_DoNotOverridePrivates__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_DoNotOverridePrivates__runtime_type_checks.go + ┣━ 📄 jsiicalc_DoNotOverridePrivates.go.diff + ┣━ 🆕 jsiicalc_DoNotRecognizeAnyAsOptional__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_DoNotRecognizeAnyAsOptional__runtime_type_checks.go + ┣━ 📄 jsiicalc_DoNotRecognizeAnyAsOptional.go.diff + ┣━ 🆕 jsiicalc_DontComplainAboutVariadicAfterOptional__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_DontComplainAboutVariadicAfterOptional__runtime_type_checks.go + ┣━ 📄 jsiicalc_DontComplainAboutVariadicAfterOptional.go.diff + ┣━ 🆕 jsiicalc_DynamicPropertyBearer__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_DynamicPropertyBearer__runtime_type_checks.go + ┣━ 📄 jsiicalc_DynamicPropertyBearer.go.diff + ┣━ 🆕 jsiicalc_DynamicPropertyBearerChild__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_DynamicPropertyBearerChild__runtime_type_checks.go + ┣━ 📄 jsiicalc_DynamicPropertyBearerChild.go.diff + ┣━ 🆕 jsiicalc_Entropy__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_Entropy__runtime_type_checks.go + ┣━ 📄 jsiicalc_Entropy.go.diff + ┣━ 🆕 jsiicalc_EraseUndefinedHashValues__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_EraseUndefinedHashValues__runtime_type_checks.go + ┣━ 📄 jsiicalc_EraseUndefinedHashValues.go.diff + ┣━ 🆕 jsiicalc_ExperimentalClass__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_ExperimentalClass__runtime_type_checks.go + ┣━ 📄 jsiicalc_ExperimentalClass.go.diff + ┣━ 🆕 jsiicalc_ExportedBaseClass__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_ExportedBaseClass__runtime_type_checks.go + ┣━ 📄 jsiicalc_ExportedBaseClass.go.diff + ┣━ 🆕 jsiicalc_ExternalClass__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_ExternalClass__runtime_type_checks.go + ┣━ 📄 jsiicalc_ExternalClass.go.diff + ┣━ 🆕 jsiicalc_GiveMeStructs__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_GiveMeStructs__runtime_type_checks.go + ┣━ 📄 jsiicalc_GiveMeStructs.go.diff + ┣━ 🆕 jsiicalc_GreetingAugmenter__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_GreetingAugmenter__runtime_type_checks.go + ┣━ 📄 jsiicalc_GreetingAugmenter.go.diff + ┣━ 🆕 jsiicalc_IAnotherPublicInterface__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_IAnotherPublicInterface__runtime_type_checks.go + ┣━ 📄 jsiicalc_IAnotherPublicInterface.go.diff + ┣━ 🆕 jsiicalc_IBellRinger__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_IBellRinger__runtime_type_checks.go + ┣━ 📄 jsiicalc_IBellRinger.go.diff + ┣━ 🆕 jsiicalc_IConcreteBellRinger__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_IConcreteBellRinger__runtime_type_checks.go + ┣━ 📄 jsiicalc_IConcreteBellRinger.go.diff + ┣━ 🆕 jsiicalc_IExtendsPrivateInterface__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_IExtendsPrivateInterface__runtime_type_checks.go + ┣━ 📄 jsiicalc_IExtendsPrivateInterface.go.diff + ┣━ 🆕 jsiicalc_IInterfaceWithOptionalMethodArguments__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_IInterfaceWithOptionalMethodArguments__runtime_type_checks.go + ┣━ 📄 jsiicalc_IInterfaceWithOptionalMethodArguments.go.diff + ┣━ 🆕 jsiicalc_IInterfaceWithProperties__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_IInterfaceWithProperties__runtime_type_checks.go + ┣━ 📄 jsiicalc_IInterfaceWithProperties.go.diff + ┣━ 🆕 jsiicalc_IInterfaceWithPropertiesExtension__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_IInterfaceWithPropertiesExtension__runtime_type_checks.go + ┣━ 📄 jsiicalc_IInterfaceWithPropertiesExtension.go.diff + ┣━ 🆕 jsiicalc_ImplementInternalInterface__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_ImplementInternalInterface__runtime_type_checks.go + ┣━ 📄 jsiicalc_ImplementInternalInterface.go.diff + ┣━ 🆕 jsiicalc_ImplementsPrivateInterface__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_ImplementsPrivateInterface__runtime_type_checks.go + ┣━ 📄 jsiicalc_ImplementsPrivateInterface.go.diff + ┣━ 🆕 jsiicalc_IMutableObjectLiteral__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_IMutableObjectLiteral__runtime_type_checks.go + ┣━ 📄 jsiicalc_IMutableObjectLiteral.go.diff + ┣━ 🆕 jsiicalc_INonInternalInterface__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_INonInternalInterface__runtime_type_checks.go + ┣━ 📄 jsiicalc_INonInternalInterface.go.diff + ┣━ 🆕 jsiicalc_InterfacesMaker__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_InterfacesMaker__runtime_type_checks.go + ┣━ 📄 jsiicalc_InterfacesMaker.go.diff + ┣━ 🆕 jsiicalc_IObjectWithProperty__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_IObjectWithProperty__runtime_type_checks.go + ┣━ 📄 jsiicalc_IObjectWithProperty.go.diff + ┣━ 🆕 jsiicalc_JavaReservedWords__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_JavaReservedWords__runtime_type_checks.go + ┣━ 📄 jsiicalc_JavaReservedWords.go.diff + ┣━ 🆕 jsiicalc_JSII417Derived__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_JSII417Derived__runtime_type_checks.go + ┣━ 📄 jsiicalc_JSII417Derived.go.diff + ┣━ 🆕 jsiicalc_JSObjectLiteralToNativeClass__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_JSObjectLiteralToNativeClass__runtime_type_checks.go + ┣━ 📄 jsiicalc_JSObjectLiteralToNativeClass.go.diff + ┣━ 🆕 jsiicalc_LevelOne__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_LevelOne__runtime_type_checks.go + ┣━ 📄 jsiicalc_LevelOne.go.diff + ┣━ 🆕 jsiicalc_Multiply__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_Multiply__runtime_type_checks.go + ┣━ 📄 jsiicalc_Multiply.go.diff + ┣━ 🆕 jsiicalc_Negate__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_Negate__runtime_type_checks.go + ┣━ 📄 jsiicalc_Negate.go.diff + ┣━ 🆕 jsiicalc_NullShouldBeTreatedAsUndefined__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_NullShouldBeTreatedAsUndefined__runtime_type_checks.go + ┣━ 📄 jsiicalc_NullShouldBeTreatedAsUndefined.go.diff + ┣━ 🆕 jsiicalc_NumberGenerator__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_NumberGenerator__runtime_type_checks.go + ┣━ 📄 jsiicalc_NumberGenerator.go.diff + ┣━ 🆕 jsiicalc_ObjectRefsInCollections__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_ObjectRefsInCollections__runtime_type_checks.go + ┣━ 📄 jsiicalc_ObjectRefsInCollections.go.diff + ┣━ 🆕 jsiicalc_OptionalArgumentInvoker__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_OptionalArgumentInvoker__runtime_type_checks.go + ┣━ 📄 jsiicalc_OptionalArgumentInvoker.go.diff + ┣━ 🆕 jsiicalc_OptionalConstructorArgument__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_OptionalConstructorArgument__runtime_type_checks.go + ┣━ 📄 jsiicalc_OptionalConstructorArgument.go.diff + ┣━ 🆕 jsiicalc_OptionalStructConsumer__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_OptionalStructConsumer__runtime_type_checks.go + ┣━ 📄 jsiicalc_OptionalStructConsumer.go.diff + ┣━ 🆕 jsiicalc_OverridableProtectedMember__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_OverridableProtectedMember__runtime_type_checks.go + ┣━ 📄 jsiicalc_OverridableProtectedMember.go.diff + ┣━ 🆕 jsiicalc_OverrideReturnsObject__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_OverrideReturnsObject__runtime_type_checks.go + ┣━ 📄 jsiicalc_OverrideReturnsObject.go.diff + ┣━ 🆕 jsiicalc_PartiallyInitializedThisConsumer__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_PartiallyInitializedThisConsumer__runtime_type_checks.go + ┣━ 📄 jsiicalc_PartiallyInitializedThisConsumer.go.diff + ┣━ 🆕 jsiicalc_Polymorphism__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_Polymorphism__runtime_type_checks.go + ┣━ 📄 jsiicalc_Polymorphism.go.diff + ┣━ 🆕 jsiicalc_Power__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_Power__runtime_type_checks.go + ┣━ 📄 jsiicalc_Power.go.diff + ┣━ 🆕 jsiicalc_ReferenceEnumFromScopedPackage__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_ReferenceEnumFromScopedPackage__runtime_type_checks.go + ┣━ 📄 jsiicalc_ReferenceEnumFromScopedPackage.go.diff + ┣━ 🆕 jsiicalc_RootStructValidator__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_RootStructValidator__runtime_type_checks.go + ┣━ 📄 jsiicalc_RootStructValidator.go.diff + ┣━ 🆕 jsiicalc_RuntimeTypeChecking__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_RuntimeTypeChecking__runtime_type_checks.go + ┣━ 📄 jsiicalc_RuntimeTypeChecking.go.diff + ┣━ 🆕 jsiicalc_SingletonInt__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_SingletonInt__runtime_type_checks.go + ┣━ 📄 jsiicalc_SingletonInt.go.diff + ┣━ 🆕 jsiicalc_SingletonString__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_SingletonString__runtime_type_checks.go + ┣━ 📄 jsiicalc_SingletonString.go.diff + ┣━ 🆕 jsiicalc_StableClass__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_StableClass__runtime_type_checks.go + ┣━ 📄 jsiicalc_StableClass.go.diff + ┣━ 🆕 jsiicalc_StaticContext__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_StaticContext__runtime_type_checks.go + ┣━ 📄 jsiicalc_StaticContext.go.diff + ┣━ 🆕 jsiicalc_Statics__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_Statics__runtime_type_checks.go + ┣━ 📄 jsiicalc_Statics.go.diff + ┣━ 🆕 jsiicalc_StripInternal__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_StripInternal__runtime_type_checks.go + ┣━ 📄 jsiicalc_StripInternal.go.diff + ┣━ 🆕 jsiicalc_StructPassing__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_StructPassing__runtime_type_checks.go + ┣━ 📄 jsiicalc_StructPassing.go.diff + ┣━ 🆕 jsiicalc_StructUnionConsumer__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_StructUnionConsumer__runtime_type_checks.go + ┣━ 📄 jsiicalc_StructUnionConsumer.go.diff + ┣━ 🆕 jsiicalc_Sum__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_Sum__runtime_type_checks.go + ┣━ 📄 jsiicalc_Sum.go.diff + ┣━ 🆕 jsiicalc_SupportsNiceJavaBuilder__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_SupportsNiceJavaBuilder__runtime_type_checks.go + ┣━ 📄 jsiicalc_SupportsNiceJavaBuilder.go.diff + ┣━ 🆕 jsiicalc_SupportsNiceJavaBuilderWithRequiredProps__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_SupportsNiceJavaBuilderWithRequiredProps__runtime_type_checks.go + ┣━ 📄 jsiicalc_SupportsNiceJavaBuilderWithRequiredProps.go.diff + ┣━ 🆕 jsiicalc_SyncVirtualMethods__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_SyncVirtualMethods__runtime_type_checks.go + ┣━ 📄 jsiicalc_SyncVirtualMethods.go.diff + ┣━ 🆕 jsiicalc_TestStructWithEnum__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_TestStructWithEnum__runtime_type_checks.go + ┣━ 📄 jsiicalc_TestStructWithEnum.go.diff + ┣━ 🆕 jsiicalc_UnaryOperation__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_UnaryOperation__runtime_type_checks.go + ┣━ 🆕 jsiicalc_UpcasingReflectable__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_UpcasingReflectable__runtime_type_checks.go + ┣━ 📄 jsiicalc_UpcasingReflectable.go.diff + ┣━ 🆕 jsiicalc_UsesInterfaceWithProperties__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_UsesInterfaceWithProperties__runtime_type_checks.go + ┣━ 📄 jsiicalc_UsesInterfaceWithProperties.go.diff + ┣━ 🆕 jsiicalc_VariadicInvoker__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_VariadicInvoker__runtime_type_checks.go + ┣━ 📄 jsiicalc_VariadicInvoker.go.diff + ┣━ 🆕 jsiicalc_VariadicMethod__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_VariadicMethod__runtime_type_checks.go + ┣━ 📄 jsiicalc_VariadicMethod.go.diff + ┣━ 🆕 jsiicalc_VirtualMethodPlayground__no_runtime_type_checking.go + ┣━ 🆕 jsiicalc_VirtualMethodPlayground__runtime_type_checks.go + ┣━ 📄 jsiicalc_VirtualMethodPlayground.go.diff + ┣━ 📁 module2530 + ┃ ┣━ 🆕 module2530_MyClass__no_runtime_type_checking.go + ┃ ┣━ 🆕 module2530_MyClass__runtime_type_checks.go + ┃ ┗━ 📄 module2530_MyClass.go.diff + ┣━ 📁 module2647 + ┃ ┣━ 🆕 module2647_ExtendAndImplement__no_runtime_type_checking.go + ┃ ┣━ 🆕 module2647_ExtendAndImplement__runtime_type_checks.go + ┃ ┗━ 📄 module2647_ExtendAndImplement.go.diff + ┣━ 📁 module2689 + ┃ ┗━ 📁 methods + ┃ ┣━ 🆕 methods_MyClass__no_runtime_type_checking.go + ┃ ┣━ 🆕 methods_MyClass__runtime_type_checks.go + ┃ ┗━ 📄 methods_MyClass.go.diff + ┣━ 📁 pythonself + ┃ ┣━ 🆕 pythonself_ClassWithSelf__no_runtime_type_checking.go + ┃ ┣━ 🆕 pythonself_ClassWithSelf__runtime_type_checks.go + ┃ ┣━ 📄 pythonself_ClassWithSelf.go.diff + ┃ ┣━ 🆕 pythonself_ClassWithSelfKwarg__no_runtime_type_checking.go + ┃ ┣━ 🆕 pythonself_ClassWithSelfKwarg__runtime_type_checks.go + ┃ ┣━ 📄 pythonself_ClassWithSelfKwarg.go.diff + ┃ ┣━ 🆕 pythonself_IInterfaceWithSelf__no_runtime_type_checking.go + ┃ ┣━ 🆕 pythonself_IInterfaceWithSelf__runtime_type_checks.go + ┃ ┗━ 📄 pythonself_IInterfaceWithSelf.go.diff + ┗━ 📁 submodule + ┣━ 📁 isolated + ┃ ┣━ 🆕 isolated_Kwargs__no_runtime_type_checking.go + ┃ ┣━ 🆕 isolated_Kwargs__runtime_type_checks.go + ┃ ┗━ 📄 isolated_Kwargs.go.diff + ┣━ 🆕 submodule_MyClass__no_runtime_type_checking.go + ┣━ 🆕 submodule_MyClass__runtime_type_checks.go + ┗━ 📄 submodule_MyClass.go.diff +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/anonymous/anonymous_UseOptions.go.diff 1`] = ` +--- go/jsiicalc/anonymous/anonymous_UseOptions.go --no-runtime-type-checking ++++ go/jsiicalc/anonymous/anonymous_UseOptions.go --runtime-type-checking +@@ -14,10 +14,13 @@ + } + + func UseOptions_Consume(option interface{}) *string { + _init_.Initialize() + ++ if err := validateUseOptions_ConsumeParameters(option); err != nil { ++ panic(err) ++ } + var returns *string + + _jsii_.StaticInvoke( + "jsii-calc.anonymous.UseOptions", + "consume", +@@ -29,10 +32,13 @@ + } + + func UseOptions_PrivideAsAny(which *string) interface{} { + _init_.Initialize() + ++ if err := validateUseOptions_PrivideAsAnyParameters(which); err != nil { ++ panic(err) ++ } + var returns interface{} + + _jsii_.StaticInvoke( + "jsii-calc.anonymous.UseOptions", + "privideAsAny", +@@ -44,10 +50,13 @@ + } + + func UseOptions_Provide(which *string) interface{} { + _init_.Initialize() + ++ if err := validateUseOptions_ProvideParameters(which); err != nil { ++ panic(err) ++ } + var returns interface{} + + _jsii_.StaticInvoke( + "jsii-calc.anonymous.UseOptions", + "provide", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/anonymous/anonymous_UseOptions__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/anonymous/anonymous_UseOptions__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/anonymous/anonymous_UseOptions__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,19 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++package anonymous ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateUseOptions_ConsumeParameters(option interface{}) error { ++ return nil ++} ++ ++func validateUseOptions_PrivideAsAnyParameters(which *string) error { ++ return nil ++} ++ ++func validateUseOptions_ProvideParameters(which *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/anonymous/anonymous_UseOptions__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/anonymous/anonymous_UseOptions__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/anonymous/anonymous_UseOptions__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,45 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++package anonymous ++ ++import ( ++ "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++) ++ ++func validateUseOptions_ConsumeParameters(option interface{}) error { ++ if option == nil { ++ return fmt.Errorf("parameter option is required, but nil was provided") ++ } ++ switch option.(type) { ++ case IOptionA: ++ // ok ++ case IOptionB: ++ // ok ++ default: ++ if !_jsii_.IsAnonymousProxy(option) { ++ return fmt.Errorf("parameter option must be one of the allowed types: IOptionA, IOptionB; received %#v (a %T)", option, option) ++ } ++ } ++ ++ return nil ++} ++ ++func validateUseOptions_PrivideAsAnyParameters(which *string) error { ++ if which == nil { ++ return fmt.Errorf("parameter which is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func validateUseOptions_ProvideParameters(which *string) error { ++ if which == nil { ++ return fmt.Errorf("parameter which is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk16625/cdk16625_Cdk16625.go.diff 1`] = ` +--- go/jsiicalc/cdk16625/cdk16625_Cdk16625.go --no-runtime-type-checking ++++ go/jsiicalc/cdk16625/cdk16625_Cdk16625.go --runtime-type-checking +@@ -36,10 +36,13 @@ + nil, // no parameters + ) + } + + func (c *jsiiProxy_Cdk16625) Unwrap(gen jsiicalc.IRandomNumberGenerator) *float64 { ++ if err := c.validateUnwrapParameters(gen); err != nil { ++ panic(err) ++ } + var returns *float64 + + _jsii_.Invoke( + c, + "unwrap", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk16625/cdk16625_Cdk16625__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/cdk16625/cdk16625_Cdk16625__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/cdk16625/cdk16625_Cdk16625__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++package cdk16625 ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (c *jsiiProxy_Cdk16625) validateUnwrapParameters(gen jsiicalc.IRandomNumberGenerator) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk16625/cdk16625_Cdk16625__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/cdk16625/cdk16625_Cdk16625__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/cdk16625/cdk16625_Cdk16625__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,19 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++package cdk16625 ++ ++import ( ++ "fmt" ++ ++ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3" ++) ++ ++func (c *jsiiProxy_Cdk16625) validateUnwrapParameters(gen jsiicalc.IRandomNumberGenerator) error { ++ if gen == nil { ++ return fmt.Errorf("parameter gen is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk16625/donotimport/donotimport_UnimportedSubmoduleType.go.diff 1`] = ` +--- go/jsiicalc/cdk16625/donotimport/donotimport_UnimportedSubmoduleType.go --no-runtime-type-checking ++++ go/jsiicalc/cdk16625/donotimport/donotimport_UnimportedSubmoduleType.go --runtime-type-checking +@@ -29,10 +29,13 @@ + } + + func NewUnimportedSubmoduleType(value *float64) UnimportedSubmoduleType { + _init_.Initialize() + ++ if err := validateNewUnimportedSubmoduleTypeParameters(value); err != nil { ++ panic(err) ++ } + j := jsiiProxy_UnimportedSubmoduleType{} + + _jsii_.Create( + "jsii-calc.cdk16625.donotimport.UnimportedSubmoduleType", + []interface{}{value}, +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk16625/donotimport/donotimport_UnimportedSubmoduleType__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/cdk16625/donotimport/donotimport_UnimportedSubmoduleType__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/cdk16625/donotimport/donotimport_UnimportedSubmoduleType__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++package donotimport ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateNewUnimportedSubmoduleTypeParameters(value *float64) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk16625/donotimport/donotimport_UnimportedSubmoduleType__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/cdk16625/donotimport/donotimport_UnimportedSubmoduleType__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/cdk16625/donotimport/donotimport_UnimportedSubmoduleType__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++package donotimport ++ ++import ( ++ "fmt" ++) ++ ++func validateNewUnimportedSubmoduleTypeParameters(value *float64) error { ++ if value == nil { ++ return fmt.Errorf("parameter value is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/composition/composition_CompositeOperation.go.diff 1`] = ` +--- go/jsiicalc/composition/composition_CompositeOperation.go --no-runtime-type-checking ++++ go/jsiicalc/composition/composition_CompositeOperation.go --runtime-type-checking +@@ -97,26 +97,35 @@ + c, + ) + } + + func (j *jsiiProxy_CompositeOperation)SetDecorationPostfixes(val *[]*string) { ++ if err := j.validateSetDecorationPostfixesParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "decorationPostfixes", + val, + ) + } + + func (j *jsiiProxy_CompositeOperation)SetDecorationPrefixes(val *[]*string) { ++ if err := j.validateSetDecorationPrefixesParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "decorationPrefixes", + val, + ) + } + + func (j *jsiiProxy_CompositeOperation)SetStringStyle(val CompositeOperation_CompositionStringStyle) { ++ if err := j.validateSetStringStyleParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "stringStyle", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/composition/composition_CompositeOperation__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/composition/composition_CompositeOperation__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/composition/composition_CompositeOperation__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,19 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++package composition ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_CompositeOperation) validateSetDecorationPostfixesParameters(val *[]*string) error { ++ return nil ++} ++ ++func (j *jsiiProxy_CompositeOperation) validateSetDecorationPrefixesParameters(val *[]*string) error { ++ return nil ++} ++ ++func (j *jsiiProxy_CompositeOperation) validateSetStringStyleParameters(val CompositeOperation_CompositionStringStyle) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/composition/composition_CompositeOperation__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/composition/composition_CompositeOperation__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/composition/composition_CompositeOperation__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,33 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++package composition ++ ++import ( ++ "fmt" ++) ++ ++func (j *jsiiProxy_CompositeOperation) validateSetDecorationPostfixesParameters(val *[]*string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_CompositeOperation) validateSetDecorationPrefixesParameters(val *[]*string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_CompositeOperation) validateSetStringStyleParameters(val CompositeOperation_CompositionStringStyle) error { ++ if val == "" { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/derivedclasshasnoproperties/derivedclasshasnoproperties_Base.go.diff 1`] = ` +--- go/jsiicalc/derivedclasshasnoproperties/derivedclasshasnoproperties_Base.go --no-runtime-type-checking ++++ go/jsiicalc/derivedclasshasnoproperties/derivedclasshasnoproperties_Base.go --runtime-type-checking +@@ -49,10 +49,13 @@ + b, + ) + } + + func (j *jsiiProxy_Base)SetProp(val *string) { ++ if err := j.validateSetPropParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "prop", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/derivedclasshasnoproperties/derivedclasshasnoproperties_Base__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/derivedclasshasnoproperties/derivedclasshasnoproperties_Base__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/derivedclasshasnoproperties/derivedclasshasnoproperties_Base__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++package derivedclasshasnoproperties ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_Base) validateSetPropParameters(val *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/derivedclasshasnoproperties/derivedclasshasnoproperties_Base__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/derivedclasshasnoproperties/derivedclasshasnoproperties_Base__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/derivedclasshasnoproperties/derivedclasshasnoproperties_Base__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++package derivedclasshasnoproperties ++ ++import ( ++ "fmt" ++) ++ ++func (j *jsiiProxy_Base) validateSetPropParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/derivedclasshasnoproperties/derivedclasshasnoproperties_Derived.go.diff 1`] = ` +--- go/jsiicalc/derivedclasshasnoproperties/derivedclasshasnoproperties_Derived.go --no-runtime-type-checking ++++ go/jsiicalc/derivedclasshasnoproperties/derivedclasshasnoproperties_Derived.go --runtime-type-checking +@@ -50,10 +50,13 @@ + d, + ) + } + + func (j *jsiiProxy_Derived)SetProp(val *string) { ++ if err := j.validateSetPropParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "prop", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/derivedclasshasnoproperties/derivedclasshasnoproperties_Derived__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/derivedclasshasnoproperties/derivedclasshasnoproperties_Derived__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/derivedclasshasnoproperties/derivedclasshasnoproperties_Derived__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++package derivedclasshasnoproperties ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_Derived) validateSetPropParameters(val *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/derivedclasshasnoproperties/derivedclasshasnoproperties_Derived__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/derivedclasshasnoproperties/derivedclasshasnoproperties_Derived__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/derivedclasshasnoproperties/derivedclasshasnoproperties_Derived__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++package derivedclasshasnoproperties ++ ++import ( ++ "fmt" ++) ++ ++func (j *jsiiProxy_Derived) validateSetPropParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsii3656/jsii3656_OverrideMe.go.diff 1`] = ` +--- go/jsiicalc/jsii3656/jsii3656_OverrideMe.go --no-runtime-type-checking ++++ go/jsiicalc/jsii3656/jsii3656_OverrideMe.go --runtime-type-checking +@@ -25,10 +25,13 @@ + } + + func OverrideMe_CallAbstract(receiver OverrideMe) *bool { + _init_.Initialize() + ++ if err := validateOverrideMe_CallAbstractParameters(receiver); err != nil { ++ panic(err) ++ } + var returns *bool + + _jsii_.StaticInvoke( + "jsii-calc.jsii3656.OverrideMe", + "callAbstract", +@@ -38,10 +41,13 @@ + + return returns + } + + func (o *jsiiProxy_OverrideMe) ImplementMe(opts *ImplementMeOpts) *bool { ++ if err := o.validateImplementMeParameters(opts); err != nil { ++ panic(err) ++ } + var returns *bool + + _jsii_.Invoke( + o, + "implementMe", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsii3656/jsii3656_OverrideMe__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsii3656/jsii3656_OverrideMe__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsii3656/jsii3656_OverrideMe__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,15 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++package jsii3656 ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (o *jsiiProxy_OverrideMe) validateImplementMeParameters(opts *ImplementMeOpts) error { ++ return nil ++} ++ ++func validateOverrideMe_CallAbstractParameters(receiver OverrideMe) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsii3656/jsii3656_OverrideMe__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsii3656/jsii3656_OverrideMe__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsii3656/jsii3656_OverrideMe__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,30 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++package jsii3656 ++ ++import ( ++ "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++) ++ ++func (o *jsiiProxy_OverrideMe) validateImplementMeParameters(opts *ImplementMeOpts) error { ++ if opts == nil { ++ return fmt.Errorf("parameter opts is required, but nil was provided") ++ } ++ if err := _jsii_.ValidateStruct(opts, func() string { return "parameter opts" }); err != nil { ++ return err ++ } ++ ++ return nil ++} ++ ++func validateOverrideMe_CallAbstractParameters(receiver OverrideMe) error { ++ if receiver == nil { ++ return fmt.Errorf("parameter receiver is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AbstractClass.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_AbstractClass.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_AbstractClass.go --runtime-type-checking +@@ -51,10 +51,13 @@ + a, + ) + } + + func (a *jsiiProxy_AbstractClass) AbstractMethod(name *string) *string { ++ if err := a.validateAbstractMethodParameters(name); err != nil { ++ panic(err) ++ } + var returns *string + + _jsii_.Invoke( + a, + "abstractMethod", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AbstractClass__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_AbstractClass__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_AbstractClass__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (a *jsiiProxy_AbstractClass) validateAbstractMethodParameters(name *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AbstractClass__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_AbstractClass__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_AbstractClass__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (a *jsiiProxy_AbstractClass) validateAbstractMethodParameters(name *string) error { ++ if name == nil { ++ return fmt.Errorf("parameter name is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AbstractSuite.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_AbstractSuite.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_AbstractSuite.go --runtime-type-checking +@@ -40,18 +40,24 @@ + a, + ) + } + + func (j *jsiiProxy_AbstractSuite)SetProperty(val *string) { ++ if err := j.validateSetPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "property", + val, + ) + } + + func (a *jsiiProxy_AbstractSuite) SomeMethod(str *string) *string { ++ if err := a.validateSomeMethodParameters(str); err != nil { ++ panic(err) ++ } + var returns *string + + _jsii_.Invoke( + a, + "someMethod", +@@ -61,10 +67,13 @@ + + return returns + } + + func (a *jsiiProxy_AbstractSuite) WorkItAll(seed *string) *string { ++ if err := a.validateWorkItAllParameters(seed); err != nil { ++ panic(err) ++ } + var returns *string + + _jsii_.Invoke( + a, + "workItAll", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AbstractSuite__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_AbstractSuite__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_AbstractSuite__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,20 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (a *jsiiProxy_AbstractSuite) validateSomeMethodParameters(str *string) error { ++ return nil ++} ++ ++func (a *jsiiProxy_AbstractSuite) validateWorkItAllParameters(seed *string) error { ++ return nil ++} ++ ++func (j *jsiiProxy_AbstractSuite) validateSetPropertyParameters(val *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AbstractSuite__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_AbstractSuite__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_AbstractSuite__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,34 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (a *jsiiProxy_AbstractSuite) validateSomeMethodParameters(str *string) error { ++ if str == nil { ++ return fmt.Errorf("parameter str is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (a *jsiiProxy_AbstractSuite) validateWorkItAllParameters(seed *string) error { ++ if seed == nil { ++ return fmt.Errorf("parameter seed is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_AbstractSuite) validateSetPropertyParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Add.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Add.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Add.go --runtime-type-checking +@@ -63,10 +63,13 @@ + + // Creates a BinaryOperation. + func NewAdd(lhs scopejsiicalclib.NumericValue, rhs scopejsiicalclib.NumericValue) Add { + _init_.Initialize() + ++ if err := validateNewAddParameters(lhs, rhs); err != nil { ++ panic(err) ++ } + j := jsiiProxy_Add{} + + _jsii_.Create( + "jsii-calc.Add", + []interface{}{lhs, rhs}, +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Add__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Add__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Add__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateNewAddParameters(lhs scopejsiicalclib.NumericValue, rhs scopejsiicalclib.NumericValue) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Add__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Add__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Add__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,24 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ++) ++ ++func validateNewAddParameters(lhs scopejsiicalclib.NumericValue, rhs scopejsiicalclib.NumericValue) error { ++ if lhs == nil { ++ return fmt.Errorf("parameter lhs is required, but nil was provided") ++ } ++ ++ if rhs == nil { ++ return fmt.Errorf("parameter rhs is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AllTypes.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_AllTypes.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_AllTypes.go --runtime-type-checking +@@ -276,82 +276,112 @@ + a, + ) + } + + func (j *jsiiProxy_AllTypes)SetAnyArrayProperty(val *[]interface{}) { ++ if err := j.validateSetAnyArrayPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "anyArrayProperty", + val, + ) + } + + func (j *jsiiProxy_AllTypes)SetAnyMapProperty(val *map[string]interface{}) { ++ if err := j.validateSetAnyMapPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "anyMapProperty", + val, + ) + } + + func (j *jsiiProxy_AllTypes)SetAnyProperty(val interface{}) { ++ if err := j.validateSetAnyPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "anyProperty", + val, + ) + } + + func (j *jsiiProxy_AllTypes)SetArrayProperty(val *[]*string) { ++ if err := j.validateSetArrayPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "arrayProperty", + val, + ) + } + + func (j *jsiiProxy_AllTypes)SetBooleanProperty(val *bool) { ++ if err := j.validateSetBooleanPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "booleanProperty", + val, + ) + } + + func (j *jsiiProxy_AllTypes)SetDateProperty(val *time.Time) { ++ if err := j.validateSetDatePropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "dateProperty", + val, + ) + } + + func (j *jsiiProxy_AllTypes)SetEnumProperty(val AllTypesEnum) { ++ if err := j.validateSetEnumPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "enumProperty", + val, + ) + } + + func (j *jsiiProxy_AllTypes)SetJsonProperty(val *map[string]interface{}) { ++ if err := j.validateSetJsonPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "jsonProperty", + val, + ) + } + + func (j *jsiiProxy_AllTypes)SetMapProperty(val *map[string]scopejsiicalclib.Number) { ++ if err := j.validateSetMapPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "mapProperty", + val, + ) + } + + func (j *jsiiProxy_AllTypes)SetNumberProperty(val *float64) { ++ if err := j.validateSetNumberPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "numberProperty", + val, + ) +@@ -364,66 +394,90 @@ + val, + ) + } + + func (j *jsiiProxy_AllTypes)SetStringProperty(val *string) { ++ if err := j.validateSetStringPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "stringProperty", + val, + ) + } + + func (j *jsiiProxy_AllTypes)SetUnionArrayProperty(val *[]interface{}) { ++ if err := j.validateSetUnionArrayPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "unionArrayProperty", + val, + ) + } + + func (j *jsiiProxy_AllTypes)SetUnionMapProperty(val *map[string]interface{}) { ++ if err := j.validateSetUnionMapPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "unionMapProperty", + val, + ) + } + + func (j *jsiiProxy_AllTypes)SetUnionProperty(val interface{}) { ++ if err := j.validateSetUnionPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "unionProperty", + val, + ) + } + + func (j *jsiiProxy_AllTypes)SetUnknownArrayProperty(val *[]interface{}) { ++ if err := j.validateSetUnknownArrayPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "unknownArrayProperty", + val, + ) + } + + func (j *jsiiProxy_AllTypes)SetUnknownMapProperty(val *map[string]interface{}) { ++ if err := j.validateSetUnknownMapPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "unknownMapProperty", + val, + ) + } + + func (j *jsiiProxy_AllTypes)SetUnknownProperty(val interface{}) { ++ if err := j.validateSetUnknownPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "unknownProperty", + val, + ) + } + + func (a *jsiiProxy_AllTypes) AnyIn(inp interface{}) { ++ if err := a.validateAnyInParameters(inp); err != nil { ++ panic(err) ++ } + _jsii_.InvokeVoid( + a, + "anyIn", + []interface{}{inp}, + ) +@@ -441,10 +495,13 @@ + + return returns + } + + func (a *jsiiProxy_AllTypes) EnumMethod(value StringEnum) StringEnum { ++ if err := a.validateEnumMethodParameters(value); err != nil { ++ panic(err) ++ } + var returns StringEnum + + _jsii_.Invoke( + a, + "enumMethod", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AllTypes__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_AllTypes__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_AllTypes__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,84 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (a *jsiiProxy_AllTypes) validateAnyInParameters(inp interface{}) error { ++ return nil ++} ++ ++func (a *jsiiProxy_AllTypes) validateEnumMethodParameters(value StringEnum) error { ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetAnyArrayPropertyParameters(val *[]interface{}) error { ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetAnyMapPropertyParameters(val *map[string]interface{}) error { ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetAnyPropertyParameters(val interface{}) error { ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetArrayPropertyParameters(val *[]*string) error { ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetBooleanPropertyParameters(val *bool) error { ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetDatePropertyParameters(val *time.Time) error { ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetEnumPropertyParameters(val AllTypesEnum) error { ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetJsonPropertyParameters(val *map[string]interface{}) error { ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetMapPropertyParameters(val *map[string]scopejsiicalclib.Number) error { ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetNumberPropertyParameters(val *float64) error { ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetStringPropertyParameters(val *string) error { ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetUnionArrayPropertyParameters(val *[]interface{}) error { ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetUnionMapPropertyParameters(val *map[string]interface{}) error { ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetUnionPropertyParameters(val interface{}) error { ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetUnknownArrayPropertyParameters(val *[]interface{}) error { ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetUnknownMapPropertyParameters(val *map[string]interface{}) error { ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetUnknownPropertyParameters(val interface{}) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AllTypes__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_AllTypes__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_AllTypes__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,337 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ "time" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++ ++ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ++) ++ ++func (a *jsiiProxy_AllTypes) validateAnyInParameters(inp interface{}) error { ++ if inp == nil { ++ return fmt.Errorf("parameter inp is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (a *jsiiProxy_AllTypes) validateEnumMethodParameters(value StringEnum) error { ++ if value == "" { ++ return fmt.Errorf("parameter value is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetAnyArrayPropertyParameters(val *[]interface{}) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetAnyMapPropertyParameters(val *map[string]interface{}) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetAnyPropertyParameters(val interface{}) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetArrayPropertyParameters(val *[]*string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetBooleanPropertyParameters(val *bool) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetDatePropertyParameters(val *time.Time) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetEnumPropertyParameters(val AllTypesEnum) error { ++ if val == "" { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetJsonPropertyParameters(val *map[string]interface{}) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetMapPropertyParameters(val *map[string]scopejsiicalclib.Number) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetNumberPropertyParameters(val *float64) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetStringPropertyParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetUnionArrayPropertyParameters(val *[]interface{}) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ for idx_97dfc6, v := range *val { ++ switch v.(type) { ++ case *float64: ++ // ok ++ case float64: ++ // ok ++ case *int: ++ // ok ++ case int: ++ // ok ++ case *uint: ++ // ok ++ case uint: ++ // ok ++ case *int8: ++ // ok ++ case int8: ++ // ok ++ case *int16: ++ // ok ++ case int16: ++ // ok ++ case *int32: ++ // ok ++ case int32: ++ // ok ++ case *int64: ++ // ok ++ case int64: ++ // ok ++ case *uint8: ++ // ok ++ case uint8: ++ // ok ++ case *uint16: ++ // ok ++ case uint16: ++ // ok ++ case *uint32: ++ // ok ++ case uint32: ++ // ok ++ case *uint64: ++ // ok ++ case uint64: ++ // ok ++ case scopejsiicalclib.NumericValue: ++ // ok ++ default: ++ if !_jsii_.IsAnonymousProxy(v) { ++ return fmt.Errorf("parameter val[%#v] must be one of the allowed types: *float64, scopejsiicalclib.NumericValue; received %#v (a %T)", idx_97dfc6, v, v) ++ } ++ } ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetUnionMapPropertyParameters(val *map[string]interface{}) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ for idx_97dfc6, v := range *val { ++ switch v.(type) { ++ case *string: ++ // ok ++ case string: ++ // ok ++ case *float64: ++ // ok ++ case float64: ++ // ok ++ case *int: ++ // ok ++ case int: ++ // ok ++ case *uint: ++ // ok ++ case uint: ++ // ok ++ case *int8: ++ // ok ++ case int8: ++ // ok ++ case *int16: ++ // ok ++ case int16: ++ // ok ++ case *int32: ++ // ok ++ case int32: ++ // ok ++ case *int64: ++ // ok ++ case int64: ++ // ok ++ case *uint8: ++ // ok ++ case uint8: ++ // ok ++ case *uint16: ++ // ok ++ case uint16: ++ // ok ++ case *uint32: ++ // ok ++ case uint32: ++ // ok ++ case *uint64: ++ // ok ++ case uint64: ++ // ok ++ case scopejsiicalclib.Number: ++ // ok ++ default: ++ if !_jsii_.IsAnonymousProxy(v) { ++ return fmt.Errorf("parameter val[%#v] must be one of the allowed types: *string, *float64, scopejsiicalclib.Number; received %#v (a %T)", idx_97dfc6, v, v) ++ } ++ } ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetUnionPropertyParameters(val interface{}) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ switch val.(type) { ++ case *string: ++ // ok ++ case string: ++ // ok ++ case *float64: ++ // ok ++ case float64: ++ // ok ++ case *int: ++ // ok ++ case int: ++ // ok ++ case *uint: ++ // ok ++ case uint: ++ // ok ++ case *int8: ++ // ok ++ case int8: ++ // ok ++ case *int16: ++ // ok ++ case int16: ++ // ok ++ case *int32: ++ // ok ++ case int32: ++ // ok ++ case *int64: ++ // ok ++ case int64: ++ // ok ++ case *uint8: ++ // ok ++ case uint8: ++ // ok ++ case *uint16: ++ // ok ++ case uint16: ++ // ok ++ case *uint32: ++ // ok ++ case uint32: ++ // ok ++ case *uint64: ++ // ok ++ case uint64: ++ // ok ++ case scopejsiicalclib.Number: ++ // ok ++ case Multiply: ++ // ok ++ default: ++ if !_jsii_.IsAnonymousProxy(val) { ++ return fmt.Errorf("parameter val must be one of the allowed types: *string, *float64, scopejsiicalclib.Number, Multiply; received %#v (a %T)", val, val) ++ } ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetUnknownArrayPropertyParameters(val *[]interface{}) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetUnknownMapPropertyParameters(val *map[string]interface{}) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_AllTypes) validateSetUnknownPropertyParameters(val interface{}) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AllowedMethodNames.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_AllowedMethodNames.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_AllowedMethodNames.go --runtime-type-checking +@@ -43,18 +43,24 @@ + a, + ) + } + + func (a *jsiiProxy_AllowedMethodNames) GetBar(_p1 *string, _p2 *float64) { ++ if err := a.validateGetBarParameters(_p1, _p2); err != nil { ++ panic(err) ++ } + _jsii_.InvokeVoid( + a, + "getBar", + []interface{}{_p1, _p2}, + ) + } + + func (a *jsiiProxy_AllowedMethodNames) GetFoo(withParam *string) *string { ++ if err := a.validateGetFooParameters(withParam); err != nil { ++ panic(err) ++ } + var returns *string + + _jsii_.Invoke( + a, + "getFoo", +@@ -64,18 +70,24 @@ + + return returns + } + + func (a *jsiiProxy_AllowedMethodNames) SetBar(_x *string, _y *float64, _z *bool) { ++ if err := a.validateSetBarParameters(_x, _y, _z); err != nil { ++ panic(err) ++ } + _jsii_.InvokeVoid( + a, + "setBar", + []interface{}{_x, _y, _z}, + ) + } + + func (a *jsiiProxy_AllowedMethodNames) SetFoo(_x *string, _y *float64) { ++ if err := a.validateSetFooParameters(_x, _y); err != nil { ++ panic(err) ++ } + _jsii_.InvokeVoid( + a, + "setFoo", + []interface{}{_x, _y}, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AllowedMethodNames__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_AllowedMethodNames__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_AllowedMethodNames__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,24 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (a *jsiiProxy_AllowedMethodNames) validateGetBarParameters(_p1 *string, _p2 *float64) error { ++ return nil ++} ++ ++func (a *jsiiProxy_AllowedMethodNames) validateGetFooParameters(withParam *string) error { ++ return nil ++} ++ ++func (a *jsiiProxy_AllowedMethodNames) validateSetBarParameters(_x *string, _y *float64, _z *bool) error { ++ return nil ++} ++ ++func (a *jsiiProxy_AllowedMethodNames) validateSetFooParameters(_x *string, _y *float64) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AllowedMethodNames__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_AllowedMethodNames__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_AllowedMethodNames__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,58 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (a *jsiiProxy_AllowedMethodNames) validateGetBarParameters(_p1 *string, _p2 *float64) error { ++ if _p1 == nil { ++ return fmt.Errorf("parameter _p1 is required, but nil was provided") ++ } ++ ++ if _p2 == nil { ++ return fmt.Errorf("parameter _p2 is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (a *jsiiProxy_AllowedMethodNames) validateGetFooParameters(withParam *string) error { ++ if withParam == nil { ++ return fmt.Errorf("parameter withParam is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (a *jsiiProxy_AllowedMethodNames) validateSetBarParameters(_x *string, _y *float64, _z *bool) error { ++ if _x == nil { ++ return fmt.Errorf("parameter _x is required, but nil was provided") ++ } ++ ++ if _y == nil { ++ return fmt.Errorf("parameter _y is required, but nil was provided") ++ } ++ ++ if _z == nil { ++ return fmt.Errorf("parameter _z is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (a *jsiiProxy_AllowedMethodNames) validateSetFooParameters(_x *string, _y *float64) error { ++ if _x == nil { ++ return fmt.Errorf("parameter _x is required, but nil was provided") ++ } ++ ++ if _y == nil { ++ return fmt.Errorf("parameter _y is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AmbiguousParameters.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_AmbiguousParameters.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_AmbiguousParameters.go --runtime-type-checking +@@ -38,10 +38,13 @@ + + + func NewAmbiguousParameters(scope Bell, props *StructParameterType) AmbiguousParameters { + _init_.Initialize() + ++ if err := validateNewAmbiguousParametersParameters(scope, props); err != nil { ++ panic(err) ++ } + j := jsiiProxy_AmbiguousParameters{} + + _jsii_.Create( + "jsii-calc.AmbiguousParameters", + []interface{}{scope, props}, +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AmbiguousParameters__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_AmbiguousParameters__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_AmbiguousParameters__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateNewAmbiguousParametersParameters(scope Bell, props *StructParameterType) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AmbiguousParameters__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_AmbiguousParameters__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_AmbiguousParameters__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,27 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++) ++ ++func validateNewAmbiguousParametersParameters(scope Bell, props *StructParameterType) error { ++ if scope == nil { ++ return fmt.Errorf("parameter scope is required, but nil was provided") ++ } ++ ++ if props == nil { ++ return fmt.Errorf("parameter props is required, but nil was provided") ++ } ++ if err := _jsii_.ValidateStruct(props, func() string { return "parameter props" }); err != nil { ++ return err ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AsyncVirtualMethods.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_AsyncVirtualMethods.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_AsyncVirtualMethods.go --runtime-type-checking +@@ -101,10 +101,13 @@ + + return returns + } + + func (a *jsiiProxy_AsyncVirtualMethods) OverrideMe(mult *float64) *float64 { ++ if err := a.validateOverrideMeParameters(mult); err != nil { ++ panic(err) ++ } + var returns *float64 + + _jsii_.Invoke( + a, + "overrideMe", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AsyncVirtualMethods__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_AsyncVirtualMethods__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_AsyncVirtualMethods__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (a *jsiiProxy_AsyncVirtualMethods) validateOverrideMeParameters(mult *float64) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AsyncVirtualMethods__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_AsyncVirtualMethods__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_AsyncVirtualMethods__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (a *jsiiProxy_AsyncVirtualMethods) validateOverrideMeParameters(mult *float64) error { ++ if mult == nil { ++ return fmt.Errorf("parameter mult is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Bell.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Bell.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Bell.go --runtime-type-checking +@@ -52,10 +52,13 @@ + b, + ) + } + + func (j *jsiiProxy_Bell)SetRung(val *bool) { ++ if err := j.validateSetRungParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "rung", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Bell__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Bell__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Bell__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_Bell) validateSetRungParameters(val *bool) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Bell__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Bell__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Bell__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (j *jsiiProxy_Bell) validateSetRungParameters(val *bool) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_BinaryOperation__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_BinaryOperation__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_BinaryOperation__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateNewBinaryOperationParameters(lhs scopejsiicalclib.NumericValue, rhs scopejsiicalclib.NumericValue) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_BinaryOperation__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_BinaryOperation__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_BinaryOperation__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,24 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ++) ++ ++func validateNewBinaryOperationParameters(lhs scopejsiicalclib.NumericValue, rhs scopejsiicalclib.NumericValue) error { ++ if lhs == nil { ++ return fmt.Errorf("parameter lhs is required, but nil was provided") ++ } ++ ++ if rhs == nil { ++ return fmt.Errorf("parameter rhs is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_BurriedAnonymousObject.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_BurriedAnonymousObject.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_BurriedAnonymousObject.go --runtime-type-checking +@@ -42,10 +42,13 @@ + + return returns + } + + func (b *jsiiProxy_BurriedAnonymousObject) GiveItBack(value interface{}) interface{} { ++ if err := b.validateGiveItBackParameters(value); err != nil { ++ panic(err) ++ } + var returns interface{} + + _jsii_.Invoke( + b, + "giveItBack", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_BurriedAnonymousObject__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_BurriedAnonymousObject__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_BurriedAnonymousObject__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (b *jsiiProxy_BurriedAnonymousObject) validateGiveItBackParameters(value interface{}) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_BurriedAnonymousObject__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_BurriedAnonymousObject__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_BurriedAnonymousObject__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (b *jsiiProxy_BurriedAnonymousObject) validateGiveItBackParameters(value interface{}) error { ++ if value == nil { ++ return fmt.Errorf("parameter value is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Calculator.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Calculator.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Calculator.go --runtime-type-checking +@@ -181,10 +181,13 @@ + + // Creates a Calculator object. + func NewCalculator(props *CalculatorProps) Calculator { + _init_.Initialize() + ++ if err := validateNewCalculatorParameters(props); err != nil { ++ panic(err) ++ } + j := jsiiProxy_Calculator{} + + _jsii_.Create( + "jsii-calc.Calculator", + []interface{}{props}, +@@ -204,26 +207,35 @@ + c, + ) + } + + func (j *jsiiProxy_Calculator)SetCurr(val scopejsiicalclib.NumericValue) { ++ if err := j.validateSetCurrParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "curr", + val, + ) + } + + func (j *jsiiProxy_Calculator)SetDecorationPostfixes(val *[]*string) { ++ if err := j.validateSetDecorationPostfixesParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "decorationPostfixes", + val, + ) + } + + func (j *jsiiProxy_Calculator)SetDecorationPrefixes(val *[]*string) { ++ if err := j.validateSetDecorationPrefixesParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "decorationPrefixes", + val, + ) +@@ -236,34 +248,46 @@ + val, + ) + } + + func (j *jsiiProxy_Calculator)SetStringStyle(val composition.CompositeOperation_CompositionStringStyle) { ++ if err := j.validateSetStringStyleParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "stringStyle", + val, + ) + } + + func (j *jsiiProxy_Calculator)SetUnionProperty(val interface{}) { ++ if err := j.validateSetUnionPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "unionProperty", + val, + ) + } + + func (c *jsiiProxy_Calculator) Add(value *float64) { ++ if err := c.validateAddParameters(value); err != nil { ++ panic(err) ++ } + _jsii_.InvokeVoid( + c, + "add", + []interface{}{value}, + ) + } + + func (c *jsiiProxy_Calculator) Mul(value *float64) { ++ if err := c.validateMulParameters(value); err != nil { ++ panic(err) ++ } + _jsii_.InvokeVoid( + c, + "mul", + []interface{}{value}, + ) +@@ -276,10 +300,13 @@ + nil, // no parameters + ) + } + + func (c *jsiiProxy_Calculator) Pow(value *float64) { ++ if err := c.validatePowParameters(value); err != nil { ++ panic(err) ++ } + _jsii_.InvokeVoid( + c, + "pow", + []interface{}{value}, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Calculator__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Calculator__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Calculator__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,44 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (c *jsiiProxy_Calculator) validateAddParameters(value *float64) error { ++ return nil ++} ++ ++func (c *jsiiProxy_Calculator) validateMulParameters(value *float64) error { ++ return nil ++} ++ ++func (c *jsiiProxy_Calculator) validatePowParameters(value *float64) error { ++ return nil ++} ++ ++func (j *jsiiProxy_Calculator) validateSetCurrParameters(val scopejsiicalclib.NumericValue) error { ++ return nil ++} ++ ++func (j *jsiiProxy_Calculator) validateSetDecorationPostfixesParameters(val *[]*string) error { ++ return nil ++} ++ ++func (j *jsiiProxy_Calculator) validateSetDecorationPrefixesParameters(val *[]*string) error { ++ return nil ++} ++ ++func (j *jsiiProxy_Calculator) validateSetStringStyleParameters(val composition.CompositeOperation_CompositionStringStyle) error { ++ return nil ++} ++ ++func (j *jsiiProxy_Calculator) validateSetUnionPropertyParameters(val interface{}) error { ++ return nil ++} ++ ++func validateNewCalculatorParameters(props *CalculatorProps) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Calculator__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Calculator__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Calculator__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,96 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++ ++ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/composition" ++ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ++) ++ ++func (c *jsiiProxy_Calculator) validateAddParameters(value *float64) error { ++ if value == nil { ++ return fmt.Errorf("parameter value is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (c *jsiiProxy_Calculator) validateMulParameters(value *float64) error { ++ if value == nil { ++ return fmt.Errorf("parameter value is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (c *jsiiProxy_Calculator) validatePowParameters(value *float64) error { ++ if value == nil { ++ return fmt.Errorf("parameter value is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_Calculator) validateSetCurrParameters(val scopejsiicalclib.NumericValue) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_Calculator) validateSetDecorationPostfixesParameters(val *[]*string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_Calculator) validateSetDecorationPrefixesParameters(val *[]*string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_Calculator) validateSetStringStyleParameters(val composition.CompositeOperation_CompositionStringStyle) error { ++ if val == "" { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_Calculator) validateSetUnionPropertyParameters(val interface{}) error { ++ switch val.(type) { ++ case Add: ++ // ok ++ case Multiply: ++ // ok ++ case Power: ++ // ok ++ default: ++ if !_jsii_.IsAnonymousProxy(val) { ++ return fmt.Errorf("parameter val must be one of the allowed types: Add, Multiply, Power; received %#v (a %T)", val, val) ++ } ++ } ++ ++ return nil ++} ++ ++func validateNewCalculatorParameters(props *CalculatorProps) error { ++ if err := _jsii_.ValidateStruct(props, func() string { return "parameter props" }); err != nil { ++ return err ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassThatImplementsTheInternalInterface.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassThatImplementsTheInternalInterface.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassThatImplementsTheInternalInterface.go --runtime-type-checking +@@ -87,34 +87,46 @@ + c, + ) + } + + func (j *jsiiProxy_ClassThatImplementsTheInternalInterface)SetA(val *string) { ++ if err := j.validateSetAParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "a", + val, + ) + } + + func (j *jsiiProxy_ClassThatImplementsTheInternalInterface)SetB(val *string) { ++ if err := j.validateSetBParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "b", + val, + ) + } + + func (j *jsiiProxy_ClassThatImplementsTheInternalInterface)SetC(val *string) { ++ if err := j.validateSetCParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "c", + val, + ) + } + + func (j *jsiiProxy_ClassThatImplementsTheInternalInterface)SetD(val *string) { ++ if err := j.validateSetDParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "d", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassThatImplementsTheInternalInterface__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassThatImplementsTheInternalInterface__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassThatImplementsTheInternalInterface__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,24 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_ClassThatImplementsTheInternalInterface) validateSetAParameters(val *string) error { ++ return nil ++} ++ ++func (j *jsiiProxy_ClassThatImplementsTheInternalInterface) validateSetBParameters(val *string) error { ++ return nil ++} ++ ++func (j *jsiiProxy_ClassThatImplementsTheInternalInterface) validateSetCParameters(val *string) error { ++ return nil ++} ++ ++func (j *jsiiProxy_ClassThatImplementsTheInternalInterface) validateSetDParameters(val *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassThatImplementsTheInternalInterface__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassThatImplementsTheInternalInterface__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassThatImplementsTheInternalInterface__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,42 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (j *jsiiProxy_ClassThatImplementsTheInternalInterface) validateSetAParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_ClassThatImplementsTheInternalInterface) validateSetBParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_ClassThatImplementsTheInternalInterface) validateSetCParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_ClassThatImplementsTheInternalInterface) validateSetDParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassThatImplementsThePrivateInterface.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassThatImplementsThePrivateInterface.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassThatImplementsThePrivateInterface.go --runtime-type-checking +@@ -87,34 +87,46 @@ + c, + ) + } + + func (j *jsiiProxy_ClassThatImplementsThePrivateInterface)SetA(val *string) { ++ if err := j.validateSetAParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "a", + val, + ) + } + + func (j *jsiiProxy_ClassThatImplementsThePrivateInterface)SetB(val *string) { ++ if err := j.validateSetBParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "b", + val, + ) + } + + func (j *jsiiProxy_ClassThatImplementsThePrivateInterface)SetC(val *string) { ++ if err := j.validateSetCParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "c", + val, + ) + } + + func (j *jsiiProxy_ClassThatImplementsThePrivateInterface)SetE(val *string) { ++ if err := j.validateSetEParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "e", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassThatImplementsThePrivateInterface__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassThatImplementsThePrivateInterface__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassThatImplementsThePrivateInterface__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,24 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_ClassThatImplementsThePrivateInterface) validateSetAParameters(val *string) error { ++ return nil ++} ++ ++func (j *jsiiProxy_ClassThatImplementsThePrivateInterface) validateSetBParameters(val *string) error { ++ return nil ++} ++ ++func (j *jsiiProxy_ClassThatImplementsThePrivateInterface) validateSetCParameters(val *string) error { ++ return nil ++} ++ ++func (j *jsiiProxy_ClassThatImplementsThePrivateInterface) validateSetEParameters(val *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassThatImplementsThePrivateInterface__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassThatImplementsThePrivateInterface__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassThatImplementsThePrivateInterface__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,42 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (j *jsiiProxy_ClassThatImplementsThePrivateInterface) validateSetAParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_ClassThatImplementsThePrivateInterface) validateSetBParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_ClassThatImplementsThePrivateInterface) validateSetCParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_ClassThatImplementsThePrivateInterface) validateSetEParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithCollectionOfUnions.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassWithCollectionOfUnions.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassWithCollectionOfUnions.go --runtime-type-checking +@@ -28,10 +28,13 @@ + + + func NewClassWithCollectionOfUnions(unionProperty *[]*map[string]interface{}) ClassWithCollectionOfUnions { + _init_.Initialize() + ++ if err := validateNewClassWithCollectionOfUnionsParameters(unionProperty); err != nil { ++ panic(err) ++ } + j := jsiiProxy_ClassWithCollectionOfUnions{} + + _jsii_.Create( + "jsii-calc.ClassWithCollectionOfUnions", + []interface{}{unionProperty}, +@@ -50,10 +53,13 @@ + c, + ) + } + + func (j *jsiiProxy_ClassWithCollectionOfUnions)SetUnionProperty(val *[]*map[string]interface{}) { ++ if err := j.validateSetUnionPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "unionProperty", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithCollectionOfUnions__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassWithCollectionOfUnions__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassWithCollectionOfUnions__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,16 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_ClassWithCollectionOfUnions) validateSetUnionPropertyParameters(val *[]*map[string]interface{}) error { ++ return nil ++} ++ ++func validateNewClassWithCollectionOfUnionsParameters(unionProperty *[]*map[string]interface{}) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithCollectionOfUnions__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassWithCollectionOfUnions__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassWithCollectionOfUnions__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,92 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++) ++ ++func (j *jsiiProxy_ClassWithCollectionOfUnions) validateSetUnionPropertyParameters(val *[]*map[string]interface{}) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ for idx_97dfc6, v := range *val { ++ for idx_4c9448, v := range *v { ++ switch v.(type) { ++ case *StructA: ++ v := v.(*StructA) ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v][%#v]", idx_97dfc6, idx_4c9448) }); err != nil { ++ return err ++ } ++ case StructA: ++ v_ := v.(StructA) ++ v := &v_ ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v][%#v]", idx_97dfc6, idx_4c9448) }); err != nil { ++ return err ++ } ++ case *StructB: ++ v := v.(*StructB) ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v][%#v]", idx_97dfc6, idx_4c9448) }); err != nil { ++ return err ++ } ++ case StructB: ++ v_ := v.(StructB) ++ v := &v_ ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v][%#v]", idx_97dfc6, idx_4c9448) }); err != nil { ++ return err ++ } ++ default: ++ if !_jsii_.IsAnonymousProxy(v) { ++ return fmt.Errorf("parameter val[%#v][%#v] must be one of the allowed types: *StructA, *StructB; received %#v (a %T)", idx_97dfc6, idx_4c9448, v, v) ++ } ++ } ++ } ++ } ++ ++ return nil ++} ++ ++func validateNewClassWithCollectionOfUnionsParameters(unionProperty *[]*map[string]interface{}) error { ++ if unionProperty == nil { ++ return fmt.Errorf("parameter unionProperty is required, but nil was provided") ++ } ++ for idx_7e4c6f, v := range *unionProperty { ++ for idx_4c9448, v := range *v { ++ switch v.(type) { ++ case *StructA: ++ v := v.(*StructA) ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter unionProperty[%#v][%#v]", idx_7e4c6f, idx_4c9448) }); err != nil { ++ return err ++ } ++ case StructA: ++ v_ := v.(StructA) ++ v := &v_ ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter unionProperty[%#v][%#v]", idx_7e4c6f, idx_4c9448) }); err != nil { ++ return err ++ } ++ case *StructB: ++ v := v.(*StructB) ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter unionProperty[%#v][%#v]", idx_7e4c6f, idx_4c9448) }); err != nil { ++ return err ++ } ++ case StructB: ++ v_ := v.(StructB) ++ v := &v_ ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter unionProperty[%#v][%#v]", idx_7e4c6f, idx_4c9448) }); err != nil { ++ return err ++ } ++ default: ++ if !_jsii_.IsAnonymousProxy(v) { ++ return fmt.Errorf("parameter unionProperty[%#v][%#v] must be one of the allowed types: *StructA, *StructB; received %#v (a %T)", idx_7e4c6f, idx_4c9448, v, v) ++ } ++ } ++ } ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithCollections.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassWithCollections.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassWithCollections.go --runtime-type-checking +@@ -40,10 +40,13 @@ + + + func NewClassWithCollections(map_ *map[string]*string, array *[]*string) ClassWithCollections { + _init_.Initialize() + ++ if err := validateNewClassWithCollectionsParameters(map_, array); err != nil { ++ panic(err) ++ } + j := jsiiProxy_ClassWithCollections{} + + _jsii_.Create( + "jsii-calc.ClassWithCollections", + []interface{}{map_, array}, +@@ -62,18 +65,24 @@ + c, + ) + } + + func (j *jsiiProxy_ClassWithCollections)SetArray(val *[]*string) { ++ if err := j.validateSetArrayParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "array", + val, + ) + } + + func (j *jsiiProxy_ClassWithCollections)SetMap(val *map[string]*string) { ++ if err := j.validateSetMapParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "map", + val, + ) +@@ -120,10 +129,13 @@ + return returns + } + + func ClassWithCollections_SetStaticArray(val *[]*string) { + _init_.Initialize() ++ if err := validateClassWithCollections_SetStaticArrayParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.StaticSet( + "jsii-calc.ClassWithCollections", + "staticArray", + val, + ) +@@ -140,10 +152,13 @@ + return returns + } + + func ClassWithCollections_SetStaticMap(val *map[string]*string) { + _init_.Initialize() ++ if err := validateClassWithCollections_SetStaticMapParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.StaticSet( + "jsii-calc.ClassWithCollections", + "staticMap", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithCollections__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassWithCollections__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassWithCollections__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,28 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_ClassWithCollections) validateSetArrayParameters(val *[]*string) error { ++ return nil ++} ++ ++func (j *jsiiProxy_ClassWithCollections) validateSetMapParameters(val *map[string]*string) error { ++ return nil ++} ++ ++func validateClassWithCollections_SetStaticArrayParameters(val *[]*string) error { ++ return nil ++} ++ ++func validateClassWithCollections_SetStaticMapParameters(val *map[string]*string) error { ++ return nil ++} ++ ++func validateNewClassWithCollectionsParameters(map_ *map[string]*string, array *[]*string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithCollections__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassWithCollections__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassWithCollections__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,54 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (j *jsiiProxy_ClassWithCollections) validateSetArrayParameters(val *[]*string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_ClassWithCollections) validateSetMapParameters(val *map[string]*string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func validateClassWithCollections_SetStaticArrayParameters(val *[]*string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func validateClassWithCollections_SetStaticMapParameters(val *map[string]*string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func validateNewClassWithCollectionsParameters(map_ *map[string]*string, array *[]*string) error { ++ if map_ == nil { ++ return fmt.Errorf("parameter map_ is required, but nil was provided") ++ } ++ ++ if array == nil { ++ return fmt.Errorf("parameter array is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithContainerTypes.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassWithContainerTypes.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassWithContainerTypes.go --runtime-type-checking +@@ -60,10 +60,13 @@ + + + func NewClassWithContainerTypes(array *[]*DummyObj, record *map[string]*DummyObj, obj *map[string]*DummyObj, props *ContainerProps) ClassWithContainerTypes { + _init_.Initialize() + ++ if err := validateNewClassWithContainerTypesParameters(array, record, obj, props); err != nil { ++ panic(err) ++ } + j := jsiiProxy_ClassWithContainerTypes{} + + _jsii_.Create( + "jsii-calc.ClassWithContainerTypes", + []interface{}{array, record, obj, props}, +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithContainerTypes__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassWithContainerTypes__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassWithContainerTypes__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateNewClassWithContainerTypesParameters(array *[]*DummyObj, record *map[string]*DummyObj, obj *map[string]*DummyObj, props *ContainerProps) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithContainerTypes__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassWithContainerTypes__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassWithContainerTypes__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,47 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++) ++ ++func validateNewClassWithContainerTypesParameters(array *[]*DummyObj, record *map[string]*DummyObj, obj *map[string]*DummyObj, props *ContainerProps) error { ++ if array == nil { ++ return fmt.Errorf("parameter array is required, but nil was provided") ++ } ++ for idx_dbe42c, v := range *array { ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter array[%#v]", idx_dbe42c) }); err != nil { ++ return err ++ } ++ } ++ ++ if record == nil { ++ return fmt.Errorf("parameter record is required, but nil was provided") ++ } ++ for idx_70ce87, v := range *record { ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter record[%#v]", idx_70ce87) }); err != nil { ++ return err ++ } ++ } ++ ++ if obj == nil { ++ return fmt.Errorf("parameter obj is required, but nil was provided") ++ } ++ for idx_772a5f, v := range *obj { ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter obj[%#v]", idx_772a5f) }); err != nil { ++ return err ++ } ++ } ++ ++ if err := _jsii_.ValidateStruct(props, func() string { return "parameter props" }); err != nil { ++ return err ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithJavaReservedWords.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassWithJavaReservedWords.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassWithJavaReservedWords.go --runtime-type-checking +@@ -28,10 +28,13 @@ + + + func NewClassWithJavaReservedWords(int *string) ClassWithJavaReservedWords { + _init_.Initialize() + ++ if err := validateNewClassWithJavaReservedWordsParameters(int); err != nil { ++ panic(err) ++ } + j := jsiiProxy_ClassWithJavaReservedWords{} + + _jsii_.Create( + "jsii-calc.ClassWithJavaReservedWords", + []interface{}{int}, +@@ -50,10 +53,13 @@ + c, + ) + } + + func (c *jsiiProxy_ClassWithJavaReservedWords) Import(assert *string) *string { ++ if err := c.validateImportParameters(assert); err != nil { ++ panic(err) ++ } + var returns *string + + _jsii_.Invoke( + c, + "import", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithJavaReservedWords__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassWithJavaReservedWords__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassWithJavaReservedWords__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,16 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (c *jsiiProxy_ClassWithJavaReservedWords) validateImportParameters(assert *string) error { ++ return nil ++} ++ ++func validateNewClassWithJavaReservedWordsParameters(int *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithJavaReservedWords__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassWithJavaReservedWords__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassWithJavaReservedWords__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,26 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (c *jsiiProxy_ClassWithJavaReservedWords) validateImportParameters(assert *string) error { ++ if assert == nil { ++ return fmt.Errorf("parameter assert is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func validateNewClassWithJavaReservedWordsParameters(int *string) error { ++ if int == nil { ++ return fmt.Errorf("parameter int is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithMutableObjectLiteralProperty.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassWithMutableObjectLiteralProperty.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassWithMutableObjectLiteralProperty.go --runtime-type-checking +@@ -50,10 +50,13 @@ + c, + ) + } + + func (j *jsiiProxy_ClassWithMutableObjectLiteralProperty)SetMutableObject(val IMutableObjectLiteral) { ++ if err := j.validateSetMutableObjectParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "mutableObject", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithMutableObjectLiteralProperty__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassWithMutableObjectLiteralProperty__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassWithMutableObjectLiteralProperty__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_ClassWithMutableObjectLiteralProperty) validateSetMutableObjectParameters(val IMutableObjectLiteral) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithMutableObjectLiteralProperty__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassWithMutableObjectLiteralProperty__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassWithMutableObjectLiteralProperty__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (j *jsiiProxy_ClassWithMutableObjectLiteralProperty) validateSetMutableObjectParameters(val IMutableObjectLiteral) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithNestedUnion.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassWithNestedUnion.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassWithNestedUnion.go --runtime-type-checking +@@ -28,10 +28,13 @@ + + + func NewClassWithNestedUnion(unionProperty *[]interface{}) ClassWithNestedUnion { + _init_.Initialize() + ++ if err := validateNewClassWithNestedUnionParameters(unionProperty); err != nil { ++ panic(err) ++ } + j := jsiiProxy_ClassWithNestedUnion{} + + _jsii_.Create( + "jsii-calc.ClassWithNestedUnion", + []interface{}{unionProperty}, +@@ -50,10 +53,13 @@ + c, + ) + } + + func (j *jsiiProxy_ClassWithNestedUnion)SetUnionProperty(val *[]interface{}) { ++ if err := j.validateSetUnionPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "unionProperty", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithNestedUnion__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassWithNestedUnion__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassWithNestedUnion__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,16 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_ClassWithNestedUnion) validateSetUnionPropertyParameters(val *[]interface{}) error { ++ return nil ++} ++ ++func validateNewClassWithNestedUnionParameters(unionProperty *[]interface{}) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithNestedUnion__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassWithNestedUnion__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassWithNestedUnion__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,300 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++) ++ ++func (j *jsiiProxy_ClassWithNestedUnion) validateSetUnionPropertyParameters(val *[]interface{}) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ for idx_97dfc6, v := range *val { ++ switch v.(type) { ++ case *map[string]interface{}: ++ v := v.(*map[string]interface{}) ++ for idx_4c9448, v := range *v { ++ switch v.(type) { ++ case *StructA: ++ v := v.(*StructA) ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v][%#v]", idx_97dfc6, idx_4c9448) }); err != nil { ++ return err ++ } ++ case StructA: ++ v_ := v.(StructA) ++ v := &v_ ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v][%#v]", idx_97dfc6, idx_4c9448) }); err != nil { ++ return err ++ } ++ case *StructB: ++ v := v.(*StructB) ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v][%#v]", idx_97dfc6, idx_4c9448) }); err != nil { ++ return err ++ } ++ case StructB: ++ v_ := v.(StructB) ++ v := &v_ ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v][%#v]", idx_97dfc6, idx_4c9448) }); err != nil { ++ return err ++ } ++ default: ++ if !_jsii_.IsAnonymousProxy(v) { ++ return fmt.Errorf("parameter val[%#v][%#v] must be one of the allowed types: *StructA, *StructB; received %#v (a %T)", idx_97dfc6, idx_4c9448, v, v) ++ } ++ } ++ } ++ case map[string]interface{}: ++ v_ := v.(map[string]interface{}) ++ v := &v_ ++ for idx_4c9448, v := range *v { ++ switch v.(type) { ++ case *StructA: ++ v := v.(*StructA) ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v][%#v]", idx_97dfc6, idx_4c9448) }); err != nil { ++ return err ++ } ++ case StructA: ++ v_ := v.(StructA) ++ v := &v_ ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v][%#v]", idx_97dfc6, idx_4c9448) }); err != nil { ++ return err ++ } ++ case *StructB: ++ v := v.(*StructB) ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v][%#v]", idx_97dfc6, idx_4c9448) }); err != nil { ++ return err ++ } ++ case StructB: ++ v_ := v.(StructB) ++ v := &v_ ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v][%#v]", idx_97dfc6, idx_4c9448) }); err != nil { ++ return err ++ } ++ default: ++ if !_jsii_.IsAnonymousProxy(v) { ++ return fmt.Errorf("parameter val[%#v][%#v] must be one of the allowed types: *StructA, *StructB; received %#v (a %T)", idx_97dfc6, idx_4c9448, v, v) ++ } ++ } ++ } ++ case *[]interface{}: ++ v := v.(*[]interface{}) ++ for idx_4c9448, v := range *v { ++ switch v.(type) { ++ case *StructA: ++ v := v.(*StructA) ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v][%#v]", idx_97dfc6, idx_4c9448) }); err != nil { ++ return err ++ } ++ case StructA: ++ v_ := v.(StructA) ++ v := &v_ ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v][%#v]", idx_97dfc6, idx_4c9448) }); err != nil { ++ return err ++ } ++ case *StructB: ++ v := v.(*StructB) ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v][%#v]", idx_97dfc6, idx_4c9448) }); err != nil { ++ return err ++ } ++ case StructB: ++ v_ := v.(StructB) ++ v := &v_ ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v][%#v]", idx_97dfc6, idx_4c9448) }); err != nil { ++ return err ++ } ++ default: ++ if !_jsii_.IsAnonymousProxy(v) { ++ return fmt.Errorf("parameter val[%#v][%#v] must be one of the allowed types: *StructA, *StructB; received %#v (a %T)", idx_97dfc6, idx_4c9448, v, v) ++ } ++ } ++ } ++ case []interface{}: ++ v_ := v.([]interface{}) ++ v := &v_ ++ for idx_4c9448, v := range *v { ++ switch v.(type) { ++ case *StructA: ++ v := v.(*StructA) ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v][%#v]", idx_97dfc6, idx_4c9448) }); err != nil { ++ return err ++ } ++ case StructA: ++ v_ := v.(StructA) ++ v := &v_ ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v][%#v]", idx_97dfc6, idx_4c9448) }); err != nil { ++ return err ++ } ++ case *StructB: ++ v := v.(*StructB) ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v][%#v]", idx_97dfc6, idx_4c9448) }); err != nil { ++ return err ++ } ++ case StructB: ++ v_ := v.(StructB) ++ v := &v_ ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v][%#v]", idx_97dfc6, idx_4c9448) }); err != nil { ++ return err ++ } ++ default: ++ if !_jsii_.IsAnonymousProxy(v) { ++ return fmt.Errorf("parameter val[%#v][%#v] must be one of the allowed types: *StructA, *StructB; received %#v (a %T)", idx_97dfc6, idx_4c9448, v, v) ++ } ++ } ++ } ++ default: ++ return fmt.Errorf("parameter val[%#v] must be one of the allowed types: *map[string]interface{}, *[]interface{}; received %#v (a %T)", idx_97dfc6, v, v) ++ } ++ } ++ ++ return nil ++} ++ ++func validateNewClassWithNestedUnionParameters(unionProperty *[]interface{}) error { ++ if unionProperty == nil { ++ return fmt.Errorf("parameter unionProperty is required, but nil was provided") ++ } ++ for idx_7e4c6f, v := range *unionProperty { ++ switch v.(type) { ++ case *map[string]interface{}: ++ v := v.(*map[string]interface{}) ++ for idx_4c9448, v := range *v { ++ switch v.(type) { ++ case *StructA: ++ v := v.(*StructA) ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter unionProperty[%#v][%#v]", idx_7e4c6f, idx_4c9448) }); err != nil { ++ return err ++ } ++ case StructA: ++ v_ := v.(StructA) ++ v := &v_ ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter unionProperty[%#v][%#v]", idx_7e4c6f, idx_4c9448) }); err != nil { ++ return err ++ } ++ case *StructB: ++ v := v.(*StructB) ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter unionProperty[%#v][%#v]", idx_7e4c6f, idx_4c9448) }); err != nil { ++ return err ++ } ++ case StructB: ++ v_ := v.(StructB) ++ v := &v_ ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter unionProperty[%#v][%#v]", idx_7e4c6f, idx_4c9448) }); err != nil { ++ return err ++ } ++ default: ++ if !_jsii_.IsAnonymousProxy(v) { ++ return fmt.Errorf("parameter unionProperty[%#v][%#v] must be one of the allowed types: *StructA, *StructB; received %#v (a %T)", idx_7e4c6f, idx_4c9448, v, v) ++ } ++ } ++ } ++ case map[string]interface{}: ++ v_ := v.(map[string]interface{}) ++ v := &v_ ++ for idx_4c9448, v := range *v { ++ switch v.(type) { ++ case *StructA: ++ v := v.(*StructA) ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter unionProperty[%#v][%#v]", idx_7e4c6f, idx_4c9448) }); err != nil { ++ return err ++ } ++ case StructA: ++ v_ := v.(StructA) ++ v := &v_ ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter unionProperty[%#v][%#v]", idx_7e4c6f, idx_4c9448) }); err != nil { ++ return err ++ } ++ case *StructB: ++ v := v.(*StructB) ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter unionProperty[%#v][%#v]", idx_7e4c6f, idx_4c9448) }); err != nil { ++ return err ++ } ++ case StructB: ++ v_ := v.(StructB) ++ v := &v_ ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter unionProperty[%#v][%#v]", idx_7e4c6f, idx_4c9448) }); err != nil { ++ return err ++ } ++ default: ++ if !_jsii_.IsAnonymousProxy(v) { ++ return fmt.Errorf("parameter unionProperty[%#v][%#v] must be one of the allowed types: *StructA, *StructB; received %#v (a %T)", idx_7e4c6f, idx_4c9448, v, v) ++ } ++ } ++ } ++ case *[]interface{}: ++ v := v.(*[]interface{}) ++ for idx_4c9448, v := range *v { ++ switch v.(type) { ++ case *StructA: ++ v := v.(*StructA) ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter unionProperty[%#v][%#v]", idx_7e4c6f, idx_4c9448) }); err != nil { ++ return err ++ } ++ case StructA: ++ v_ := v.(StructA) ++ v := &v_ ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter unionProperty[%#v][%#v]", idx_7e4c6f, idx_4c9448) }); err != nil { ++ return err ++ } ++ case *StructB: ++ v := v.(*StructB) ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter unionProperty[%#v][%#v]", idx_7e4c6f, idx_4c9448) }); err != nil { ++ return err ++ } ++ case StructB: ++ v_ := v.(StructB) ++ v := &v_ ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter unionProperty[%#v][%#v]", idx_7e4c6f, idx_4c9448) }); err != nil { ++ return err ++ } ++ default: ++ if !_jsii_.IsAnonymousProxy(v) { ++ return fmt.Errorf("parameter unionProperty[%#v][%#v] must be one of the allowed types: *StructA, *StructB; received %#v (a %T)", idx_7e4c6f, idx_4c9448, v, v) ++ } ++ } ++ } ++ case []interface{}: ++ v_ := v.([]interface{}) ++ v := &v_ ++ for idx_4c9448, v := range *v { ++ switch v.(type) { ++ case *StructA: ++ v := v.(*StructA) ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter unionProperty[%#v][%#v]", idx_7e4c6f, idx_4c9448) }); err != nil { ++ return err ++ } ++ case StructA: ++ v_ := v.(StructA) ++ v := &v_ ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter unionProperty[%#v][%#v]", idx_7e4c6f, idx_4c9448) }); err != nil { ++ return err ++ } ++ case *StructB: ++ v := v.(*StructB) ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter unionProperty[%#v][%#v]", idx_7e4c6f, idx_4c9448) }); err != nil { ++ return err ++ } ++ case StructB: ++ v_ := v.(StructB) ++ v := &v_ ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter unionProperty[%#v][%#v]", idx_7e4c6f, idx_4c9448) }); err != nil { ++ return err ++ } ++ default: ++ if !_jsii_.IsAnonymousProxy(v) { ++ return fmt.Errorf("parameter unionProperty[%#v][%#v] must be one of the allowed types: *StructA, *StructB; received %#v (a %T)", idx_7e4c6f, idx_4c9448, v, v) ++ } ++ } ++ } ++ default: ++ return fmt.Errorf("parameter unionProperty[%#v] must be one of the allowed types: *map[string]interface{}, *[]interface{}; received %#v (a %T)", idx_7e4c6f, v, v) ++ } ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithPrivateConstructorAndAutomaticProperties.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassWithPrivateConstructorAndAutomaticProperties.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassWithPrivateConstructorAndAutomaticProperties.go --runtime-type-checking +@@ -39,20 +39,26 @@ + return returns + } + + + func (j *jsiiProxy_ClassWithPrivateConstructorAndAutomaticProperties)SetReadWriteString(val *string) { ++ if err := j.validateSetReadWriteStringParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "readWriteString", + val, + ) + } + + func ClassWithPrivateConstructorAndAutomaticProperties_Create(readOnlyString *string, readWriteString *string) ClassWithPrivateConstructorAndAutomaticProperties { + _init_.Initialize() + ++ if err := validateClassWithPrivateConstructorAndAutomaticProperties_CreateParameters(readOnlyString, readWriteString); err != nil { ++ panic(err) ++ } + var returns ClassWithPrivateConstructorAndAutomaticProperties + + _jsii_.StaticInvoke( + "jsii-calc.ClassWithPrivateConstructorAndAutomaticProperties", + "create", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithPrivateConstructorAndAutomaticProperties__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassWithPrivateConstructorAndAutomaticProperties__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassWithPrivateConstructorAndAutomaticProperties__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,16 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateClassWithPrivateConstructorAndAutomaticProperties_CreateParameters(readOnlyString *string, readWriteString *string) error { ++ return nil ++} ++ ++func (j *jsiiProxy_ClassWithPrivateConstructorAndAutomaticProperties) validateSetReadWriteStringParameters(val *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithPrivateConstructorAndAutomaticProperties__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ClassWithPrivateConstructorAndAutomaticProperties__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ClassWithPrivateConstructorAndAutomaticProperties__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,30 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func validateClassWithPrivateConstructorAndAutomaticProperties_CreateParameters(readOnlyString *string, readWriteString *string) error { ++ if readOnlyString == nil { ++ return fmt.Errorf("parameter readOnlyString is required, but nil was provided") ++ } ++ ++ if readWriteString == nil { ++ return fmt.Errorf("parameter readWriteString is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_ClassWithPrivateConstructorAndAutomaticProperties) validateSetReadWriteStringParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ConfusingToJackson.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ConfusingToJackson.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ConfusingToJackson.go --runtime-type-checking +@@ -29,10 +29,13 @@ + return returns + } + + + func (j *jsiiProxy_ConfusingToJackson)SetUnionProperty(val interface{}) { ++ if err := j.validateSetUnionPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "unionProperty", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ConfusingToJackson__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ConfusingToJackson__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ConfusingToJackson__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_ConfusingToJackson) validateSetUnionPropertyParameters(val interface{}) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ConfusingToJackson__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ConfusingToJackson__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ConfusingToJackson__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,56 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++ ++ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ++) ++ ++func (j *jsiiProxy_ConfusingToJackson) validateSetUnionPropertyParameters(val interface{}) error { ++ switch val.(type) { ++ case scopejsiicalclib.IFriendly: ++ // ok ++ case *[]interface{}: ++ val := val.(*[]interface{}) ++ for idx_97dfc6, v := range *val { ++ switch v.(type) { ++ case scopejsiicalclib.IFriendly: ++ // ok ++ case AbstractClass: ++ // ok ++ default: ++ if !_jsii_.IsAnonymousProxy(v) { ++ return fmt.Errorf("parameter val[%#v] must be one of the allowed types: scopejsiicalclib.IFriendly, AbstractClass; received %#v (a %T)", idx_97dfc6, v, v) ++ } ++ } ++ } ++ case []interface{}: ++ val_ := val.([]interface{}) ++ val := &val_ ++ for idx_97dfc6, v := range *val { ++ switch v.(type) { ++ case scopejsiicalclib.IFriendly: ++ // ok ++ case AbstractClass: ++ // ok ++ default: ++ if !_jsii_.IsAnonymousProxy(v) { ++ return fmt.Errorf("parameter val[%#v] must be one of the allowed types: scopejsiicalclib.IFriendly, AbstractClass; received %#v (a %T)", idx_97dfc6, v, v) ++ } ++ } ++ } ++ default: ++ if !_jsii_.IsAnonymousProxy(val) { ++ return fmt.Errorf("parameter val must be one of the allowed types: scopejsiicalclib.IFriendly, *[]interface{}; received %#v (a %T)", val, val) ++ } ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ConstructorPassesThisOut.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ConstructorPassesThisOut.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ConstructorPassesThisOut.go --runtime-type-checking +@@ -15,10 +15,13 @@ + } + + func NewConstructorPassesThisOut(consumer PartiallyInitializedThisConsumer) ConstructorPassesThisOut { + _init_.Initialize() + ++ if err := validateNewConstructorPassesThisOutParameters(consumer); err != nil { ++ panic(err) ++ } + j := jsiiProxy_ConstructorPassesThisOut{} + + _jsii_.Create( + "jsii-calc.ConstructorPassesThisOut", + []interface{}{consumer}, +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ConstructorPassesThisOut__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ConstructorPassesThisOut__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ConstructorPassesThisOut__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateNewConstructorPassesThisOutParameters(consumer PartiallyInitializedThisConsumer) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ConstructorPassesThisOut__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ConstructorPassesThisOut__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ConstructorPassesThisOut__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func validateNewConstructorPassesThisOutParameters(consumer PartiallyInitializedThisConsumer) error { ++ if consumer == nil { ++ return fmt.Errorf("parameter consumer is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ConsumePureInterface.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ConsumePureInterface.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ConsumePureInterface.go --runtime-type-checking +@@ -16,10 +16,13 @@ + } + + func NewConsumePureInterface(delegate IStructReturningDelegate) ConsumePureInterface { + _init_.Initialize() + ++ if err := validateNewConsumePureInterfaceParameters(delegate); err != nil { ++ panic(err) ++ } + j := jsiiProxy_ConsumePureInterface{} + + _jsii_.Create( + "jsii-calc.ConsumePureInterface", + []interface{}{delegate}, +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ConsumePureInterface__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ConsumePureInterface__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ConsumePureInterface__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateNewConsumePureInterfaceParameters(delegate IStructReturningDelegate) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ConsumePureInterface__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ConsumePureInterface__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ConsumePureInterface__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func validateNewConsumePureInterfaceParameters(delegate IStructReturningDelegate) error { ++ if delegate == nil { ++ return fmt.Errorf("parameter delegate is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ConsumerCanRingBell.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ConsumerCanRingBell.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ConsumerCanRingBell.go --runtime-type-checking +@@ -62,10 +62,13 @@ + // + // Returns whether the bell was rung. + func ConsumerCanRingBell_StaticImplementedByObjectLiteral(ringer IBellRinger) *bool { + _init_.Initialize() + ++ if err := validateConsumerCanRingBell_StaticImplementedByObjectLiteralParameters(ringer); err != nil { ++ panic(err) ++ } + var returns *bool + + _jsii_.StaticInvoke( + "jsii-calc.ConsumerCanRingBell", + "staticImplementedByObjectLiteral", +@@ -80,10 +83,13 @@ + // + // Return whether the bell was rung. + func ConsumerCanRingBell_StaticImplementedByPrivateClass(ringer IBellRinger) *bool { + _init_.Initialize() + ++ if err := validateConsumerCanRingBell_StaticImplementedByPrivateClassParameters(ringer); err != nil { ++ panic(err) ++ } + var returns *bool + + _jsii_.StaticInvoke( + "jsii-calc.ConsumerCanRingBell", + "staticImplementedByPrivateClass", +@@ -98,10 +104,13 @@ + // + // Return whether the bell was rung. + func ConsumerCanRingBell_StaticImplementedByPublicClass(ringer IBellRinger) *bool { + _init_.Initialize() + ++ if err := validateConsumerCanRingBell_StaticImplementedByPublicClassParameters(ringer); err != nil { ++ panic(err) ++ } + var returns *bool + + _jsii_.StaticInvoke( + "jsii-calc.ConsumerCanRingBell", + "staticImplementedByPublicClass", +@@ -116,10 +125,13 @@ + // + // Return whether the bell was rung. + func ConsumerCanRingBell_StaticWhenTypedAsClass(ringer IConcreteBellRinger) *bool { + _init_.Initialize() + ++ if err := validateConsumerCanRingBell_StaticWhenTypedAsClassParameters(ringer); err != nil { ++ panic(err) ++ } + var returns *bool + + _jsii_.StaticInvoke( + "jsii-calc.ConsumerCanRingBell", + "staticWhenTypedAsClass", +@@ -129,10 +141,13 @@ + + return returns + } + + func (c *jsiiProxy_ConsumerCanRingBell) ImplementedByObjectLiteral(ringer IBellRinger) *bool { ++ if err := c.validateImplementedByObjectLiteralParameters(ringer); err != nil { ++ panic(err) ++ } + var returns *bool + + _jsii_.Invoke( + c, + "implementedByObjectLiteral", +@@ -142,10 +157,13 @@ + + return returns + } + + func (c *jsiiProxy_ConsumerCanRingBell) ImplementedByPrivateClass(ringer IBellRinger) *bool { ++ if err := c.validateImplementedByPrivateClassParameters(ringer); err != nil { ++ panic(err) ++ } + var returns *bool + + _jsii_.Invoke( + c, + "implementedByPrivateClass", +@@ -155,10 +173,13 @@ + + return returns + } + + func (c *jsiiProxy_ConsumerCanRingBell) ImplementedByPublicClass(ringer IBellRinger) *bool { ++ if err := c.validateImplementedByPublicClassParameters(ringer); err != nil { ++ panic(err) ++ } + var returns *bool + + _jsii_.Invoke( + c, + "implementedByPublicClass", +@@ -168,10 +189,13 @@ + + return returns + } + + func (c *jsiiProxy_ConsumerCanRingBell) WhenTypedAsClass(ringer IConcreteBellRinger) *bool { ++ if err := c.validateWhenTypedAsClassParameters(ringer); err != nil { ++ panic(err) ++ } + var returns *bool + + _jsii_.Invoke( + c, + "whenTypedAsClass", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ConsumerCanRingBell__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ConsumerCanRingBell__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ConsumerCanRingBell__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,40 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (c *jsiiProxy_ConsumerCanRingBell) validateImplementedByObjectLiteralParameters(ringer IBellRinger) error { ++ return nil ++} ++ ++func (c *jsiiProxy_ConsumerCanRingBell) validateImplementedByPrivateClassParameters(ringer IBellRinger) error { ++ return nil ++} ++ ++func (c *jsiiProxy_ConsumerCanRingBell) validateImplementedByPublicClassParameters(ringer IBellRinger) error { ++ return nil ++} ++ ++func (c *jsiiProxy_ConsumerCanRingBell) validateWhenTypedAsClassParameters(ringer IConcreteBellRinger) error { ++ return nil ++} ++ ++func validateConsumerCanRingBell_StaticImplementedByObjectLiteralParameters(ringer IBellRinger) error { ++ return nil ++} ++ ++func validateConsumerCanRingBell_StaticImplementedByPrivateClassParameters(ringer IBellRinger) error { ++ return nil ++} ++ ++func validateConsumerCanRingBell_StaticImplementedByPublicClassParameters(ringer IBellRinger) error { ++ return nil ++} ++ ++func validateConsumerCanRingBell_StaticWhenTypedAsClassParameters(ringer IConcreteBellRinger) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ConsumerCanRingBell__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ConsumerCanRingBell__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ConsumerCanRingBell__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,74 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (c *jsiiProxy_ConsumerCanRingBell) validateImplementedByObjectLiteralParameters(ringer IBellRinger) error { ++ if ringer == nil { ++ return fmt.Errorf("parameter ringer is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (c *jsiiProxy_ConsumerCanRingBell) validateImplementedByPrivateClassParameters(ringer IBellRinger) error { ++ if ringer == nil { ++ return fmt.Errorf("parameter ringer is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (c *jsiiProxy_ConsumerCanRingBell) validateImplementedByPublicClassParameters(ringer IBellRinger) error { ++ if ringer == nil { ++ return fmt.Errorf("parameter ringer is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (c *jsiiProxy_ConsumerCanRingBell) validateWhenTypedAsClassParameters(ringer IConcreteBellRinger) error { ++ if ringer == nil { ++ return fmt.Errorf("parameter ringer is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func validateConsumerCanRingBell_StaticImplementedByObjectLiteralParameters(ringer IBellRinger) error { ++ if ringer == nil { ++ return fmt.Errorf("parameter ringer is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func validateConsumerCanRingBell_StaticImplementedByPrivateClassParameters(ringer IBellRinger) error { ++ if ringer == nil { ++ return fmt.Errorf("parameter ringer is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func validateConsumerCanRingBell_StaticImplementedByPublicClassParameters(ringer IBellRinger) error { ++ if ringer == nil { ++ return fmt.Errorf("parameter ringer is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func validateConsumerCanRingBell_StaticWhenTypedAsClassParameters(ringer IConcreteBellRinger) error { ++ if ringer == nil { ++ return fmt.Errorf("parameter ringer is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ConsumersOfThisCrazyTypeSystem.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ConsumersOfThisCrazyTypeSystem.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ConsumersOfThisCrazyTypeSystem.go --runtime-type-checking +@@ -39,10 +39,13 @@ + c, + ) + } + + func (c *jsiiProxy_ConsumersOfThisCrazyTypeSystem) ConsumeAnotherPublicInterface(obj IAnotherPublicInterface) *string { ++ if err := c.validateConsumeAnotherPublicInterfaceParameters(obj); err != nil { ++ panic(err) ++ } + var returns *string + + _jsii_.Invoke( + c, + "consumeAnotherPublicInterface", +@@ -52,10 +55,13 @@ + + return returns + } + + func (c *jsiiProxy_ConsumersOfThisCrazyTypeSystem) ConsumeNonInternalInterface(obj INonInternalInterface) interface{} { ++ if err := c.validateConsumeNonInternalInterfaceParameters(obj); err != nil { ++ panic(err) ++ } + var returns interface{} + + _jsii_.Invoke( + c, + "consumeNonInternalInterface", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ConsumersOfThisCrazyTypeSystem__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ConsumersOfThisCrazyTypeSystem__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ConsumersOfThisCrazyTypeSystem__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,16 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (c *jsiiProxy_ConsumersOfThisCrazyTypeSystem) validateConsumeAnotherPublicInterfaceParameters(obj IAnotherPublicInterface) error { ++ return nil ++} ++ ++func (c *jsiiProxy_ConsumersOfThisCrazyTypeSystem) validateConsumeNonInternalInterfaceParameters(obj INonInternalInterface) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ConsumersOfThisCrazyTypeSystem__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ConsumersOfThisCrazyTypeSystem__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ConsumersOfThisCrazyTypeSystem__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,26 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (c *jsiiProxy_ConsumersOfThisCrazyTypeSystem) validateConsumeAnotherPublicInterfaceParameters(obj IAnotherPublicInterface) error { ++ if obj == nil { ++ return fmt.Errorf("parameter obj is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (c *jsiiProxy_ConsumersOfThisCrazyTypeSystem) validateConsumeNonInternalInterfaceParameters(obj INonInternalInterface) error { ++ if obj == nil { ++ return fmt.Errorf("parameter obj is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DataRenderer.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_DataRenderer.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_DataRenderer.go --runtime-type-checking +@@ -43,10 +43,13 @@ + d, + ) + } + + func (d *jsiiProxy_DataRenderer) Render(data *scopejsiicalclib.MyFirstStruct) *string { ++ if err := d.validateRenderParameters(data); err != nil { ++ panic(err) ++ } + var returns *string + + _jsii_.Invoke( + d, + "render", +@@ -56,10 +59,13 @@ + + return returns + } + + func (d *jsiiProxy_DataRenderer) RenderArbitrary(data *map[string]interface{}) *string { ++ if err := d.validateRenderArbitraryParameters(data); err != nil { ++ panic(err) ++ } + var returns *string + + _jsii_.Invoke( + d, + "renderArbitrary", +@@ -69,10 +75,13 @@ + + return returns + } + + func (d *jsiiProxy_DataRenderer) RenderMap(map_ *map[string]interface{}) *string { ++ if err := d.validateRenderMapParameters(map_); err != nil { ++ panic(err) ++ } + var returns *string + + _jsii_.Invoke( + d, + "renderMap", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DataRenderer__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_DataRenderer__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_DataRenderer__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,20 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (d *jsiiProxy_DataRenderer) validateRenderParameters(data *scopejsiicalclib.MyFirstStruct) error { ++ return nil ++} ++ ++func (d *jsiiProxy_DataRenderer) validateRenderArbitraryParameters(data *map[string]interface{}) error { ++ return nil ++} ++ ++func (d *jsiiProxy_DataRenderer) validateRenderMapParameters(map_ *map[string]interface{}) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DataRenderer__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_DataRenderer__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_DataRenderer__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,38 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++ ++ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ++) ++ ++func (d *jsiiProxy_DataRenderer) validateRenderParameters(data *scopejsiicalclib.MyFirstStruct) error { ++ if err := _jsii_.ValidateStruct(data, func() string { return "parameter data" }); err != nil { ++ return err ++ } ++ ++ return nil ++} ++ ++func (d *jsiiProxy_DataRenderer) validateRenderArbitraryParameters(data *map[string]interface{}) error { ++ if data == nil { ++ return fmt.Errorf("parameter data is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (d *jsiiProxy_DataRenderer) validateRenderMapParameters(map_ *map[string]interface{}) error { ++ if map_ == nil { ++ return fmt.Errorf("parameter map_ is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DeprecatedClass.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_DeprecatedClass.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_DeprecatedClass.go --runtime-type-checking +@@ -46,10 +46,13 @@ + + // Deprecated: this constructor is "just" okay. + func NewDeprecatedClass(readonlyString *string, mutableNumber *float64) DeprecatedClass { + _init_.Initialize() + ++ if err := validateNewDeprecatedClassParameters(readonlyString); err != nil { ++ panic(err) ++ } + j := jsiiProxy_DeprecatedClass{} + + _jsii_.Create( + "jsii-calc.DeprecatedClass", + []interface{}{readonlyString, mutableNumber}, +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DeprecatedClass__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_DeprecatedClass__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_DeprecatedClass__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateNewDeprecatedClassParameters(readonlyString *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DeprecatedClass__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_DeprecatedClass__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_DeprecatedClass__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func validateNewDeprecatedClassParameters(readonlyString *string) error { ++ if readonlyString == nil { ++ return fmt.Errorf("parameter readonlyString is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DoNotOverridePrivates.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_DoNotOverridePrivates.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_DoNotOverridePrivates.go --runtime-type-checking +@@ -40,10 +40,13 @@ + d, + ) + } + + func (d *jsiiProxy_DoNotOverridePrivates) ChangePrivatePropertyValue(newValue *string) { ++ if err := d.validateChangePrivatePropertyValueParameters(newValue); err != nil { ++ panic(err) ++ } + _jsii_.InvokeVoid( + d, + "changePrivatePropertyValue", + []interface{}{newValue}, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DoNotOverridePrivates__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_DoNotOverridePrivates__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_DoNotOverridePrivates__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (d *jsiiProxy_DoNotOverridePrivates) validateChangePrivatePropertyValueParameters(newValue *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DoNotOverridePrivates__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_DoNotOverridePrivates__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_DoNotOverridePrivates__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (d *jsiiProxy_DoNotOverridePrivates) validateChangePrivatePropertyValueParameters(newValue *string) error { ++ if newValue == nil { ++ return fmt.Errorf("parameter newValue is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DoNotRecognizeAnyAsOptional.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_DoNotRecognizeAnyAsOptional.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_DoNotRecognizeAnyAsOptional.go --runtime-type-checking +@@ -39,10 +39,13 @@ + d, + ) + } + + func (d *jsiiProxy_DoNotRecognizeAnyAsOptional) Method(_requiredAny interface{}, _optionalAny interface{}, _optionalString *string) { ++ if err := d.validateMethodParameters(_requiredAny); err != nil { ++ panic(err) ++ } + _jsii_.InvokeVoid( + d, + "method", + []interface{}{_requiredAny, _optionalAny, _optionalString}, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DoNotRecognizeAnyAsOptional__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_DoNotRecognizeAnyAsOptional__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_DoNotRecognizeAnyAsOptional__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (d *jsiiProxy_DoNotRecognizeAnyAsOptional) validateMethodParameters(_requiredAny interface{}) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DoNotRecognizeAnyAsOptional__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_DoNotRecognizeAnyAsOptional__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_DoNotRecognizeAnyAsOptional__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (d *jsiiProxy_DoNotRecognizeAnyAsOptional) validateMethodParameters(_requiredAny interface{}) error { ++ if _requiredAny == nil { ++ return fmt.Errorf("parameter _requiredAny is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DocumentedClass.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_DocumentedClass.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_DocumentedClass.go --runtime-type-checking +@@ -60,10 +60,13 @@ + d, + ) + } + + func (d *jsiiProxy_DocumentedClass) Greet(greetee *Greetee) *float64 { ++ if err := d.validateGreetParameters(greetee); err != nil { ++ panic(err) ++ } + var returns *float64 + + _jsii_.Invoke( + d, + "greet", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DocumentedClass__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_DocumentedClass__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_DocumentedClass__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (d *jsiiProxy_DocumentedClass) validateGreetParameters(greetee *Greetee) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DocumentedClass__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_DocumentedClass__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_DocumentedClass__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++) ++ ++func (d *jsiiProxy_DocumentedClass) validateGreetParameters(greetee *Greetee) error { ++ if err := _jsii_.ValidateStruct(greetee, func() string { return "parameter greetee" }); err != nil { ++ return err ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DontComplainAboutVariadicAfterOptional.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_DontComplainAboutVariadicAfterOptional.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_DontComplainAboutVariadicAfterOptional.go --runtime-type-checking +@@ -38,10 +38,13 @@ + d, + ) + } + + func (d *jsiiProxy_DontComplainAboutVariadicAfterOptional) OptionalAndVariadic(optional *string, things ...*string) *string { ++ if err := d.validateOptionalAndVariadicParameters(things); err != nil { ++ panic(err) ++ } + args := []interface{}{optional} + for _, a := range things { + args = append(args, a) + } +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DontComplainAboutVariadicAfterOptional__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_DontComplainAboutVariadicAfterOptional__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_DontComplainAboutVariadicAfterOptional__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (d *jsiiProxy_DontComplainAboutVariadicAfterOptional) validateOptionalAndVariadicParameters(things []*string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DontComplainAboutVariadicAfterOptional__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_DontComplainAboutVariadicAfterOptional__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_DontComplainAboutVariadicAfterOptional__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (d *jsiiProxy_DontComplainAboutVariadicAfterOptional) validateOptionalAndVariadicParameters(things []*string) error { ++ if things == nil { ++ return fmt.Errorf("parameter things is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DynamicPropertyBearer.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_DynamicPropertyBearer.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_DynamicPropertyBearer.go --runtime-type-checking +@@ -41,10 +41,13 @@ + + + func NewDynamicPropertyBearer(valueStore *string) DynamicPropertyBearer { + _init_.Initialize() + ++ if err := validateNewDynamicPropertyBearerParameters(valueStore); err != nil { ++ panic(err) ++ } + j := jsiiProxy_DynamicPropertyBearer{} + + _jsii_.Create( + "jsii-calc.DynamicPropertyBearer", + []interface{}{valueStore}, +@@ -63,18 +66,24 @@ + d, + ) + } + + func (j *jsiiProxy_DynamicPropertyBearer)SetDynamicProperty(val *string) { ++ if err := j.validateSetDynamicPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "dynamicProperty", + val, + ) + } + + func (j *jsiiProxy_DynamicPropertyBearer)SetValueStore(val *string) { ++ if err := j.validateSetValueStoreParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "valueStore", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DynamicPropertyBearer__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_DynamicPropertyBearer__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_DynamicPropertyBearer__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,20 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_DynamicPropertyBearer) validateSetDynamicPropertyParameters(val *string) error { ++ return nil ++} ++ ++func (j *jsiiProxy_DynamicPropertyBearer) validateSetValueStoreParameters(val *string) error { ++ return nil ++} ++ ++func validateNewDynamicPropertyBearerParameters(valueStore *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DynamicPropertyBearer__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_DynamicPropertyBearer__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_DynamicPropertyBearer__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,34 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (j *jsiiProxy_DynamicPropertyBearer) validateSetDynamicPropertyParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_DynamicPropertyBearer) validateSetValueStoreParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func validateNewDynamicPropertyBearerParameters(valueStore *string) error { ++ if valueStore == nil { ++ return fmt.Errorf("parameter valueStore is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DynamicPropertyBearerChild.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_DynamicPropertyBearerChild.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_DynamicPropertyBearerChild.go --runtime-type-checking +@@ -56,10 +56,13 @@ + + + func NewDynamicPropertyBearerChild(originalValue *string) DynamicPropertyBearerChild { + _init_.Initialize() + ++ if err := validateNewDynamicPropertyBearerChildParameters(originalValue); err != nil { ++ panic(err) ++ } + j := jsiiProxy_DynamicPropertyBearerChild{} + + _jsii_.Create( + "jsii-calc.DynamicPropertyBearerChild", + []interface{}{originalValue}, +@@ -78,26 +81,35 @@ + d, + ) + } + + func (j *jsiiProxy_DynamicPropertyBearerChild)SetDynamicProperty(val *string) { ++ if err := j.validateSetDynamicPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "dynamicProperty", + val, + ) + } + + func (j *jsiiProxy_DynamicPropertyBearerChild)SetValueStore(val *string) { ++ if err := j.validateSetValueStoreParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "valueStore", + val, + ) + } + + func (d *jsiiProxy_DynamicPropertyBearerChild) OverrideValue(newValue *string) *string { ++ if err := d.validateOverrideValueParameters(newValue); err != nil { ++ panic(err) ++ } + var returns *string + + _jsii_.Invoke( + d, + "overrideValue", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DynamicPropertyBearerChild__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_DynamicPropertyBearerChild__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_DynamicPropertyBearerChild__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,24 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (d *jsiiProxy_DynamicPropertyBearerChild) validateOverrideValueParameters(newValue *string) error { ++ return nil ++} ++ ++func (j *jsiiProxy_DynamicPropertyBearerChild) validateSetDynamicPropertyParameters(val *string) error { ++ return nil ++} ++ ++func (j *jsiiProxy_DynamicPropertyBearerChild) validateSetValueStoreParameters(val *string) error { ++ return nil ++} ++ ++func validateNewDynamicPropertyBearerChildParameters(originalValue *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DynamicPropertyBearerChild__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_DynamicPropertyBearerChild__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_DynamicPropertyBearerChild__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,42 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (d *jsiiProxy_DynamicPropertyBearerChild) validateOverrideValueParameters(newValue *string) error { ++ if newValue == nil { ++ return fmt.Errorf("parameter newValue is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_DynamicPropertyBearerChild) validateSetDynamicPropertyParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_DynamicPropertyBearerChild) validateSetValueStoreParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func validateNewDynamicPropertyBearerChildParameters(originalValue *string) error { ++ if originalValue == nil { ++ return fmt.Errorf("parameter originalValue is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Entropy.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Entropy.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Entropy.go --runtime-type-checking +@@ -46,10 +46,13 @@ + + return returns + } + + func (e *jsiiProxy_Entropy) Repeat(word *string) *string { ++ if err := e.validateRepeatParameters(word); err != nil { ++ panic(err) ++ } + var returns *string + + _jsii_.Invoke( + e, + "repeat", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Entropy__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Entropy__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Entropy__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,16 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (e *jsiiProxy_Entropy) validateRepeatParameters(word *string) error { ++ return nil ++} ++ ++func validateNewEntropyParameters(clock IWallClock) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Entropy__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Entropy__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Entropy__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,26 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (e *jsiiProxy_Entropy) validateRepeatParameters(word *string) error { ++ if word == nil { ++ return fmt.Errorf("parameter word is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func validateNewEntropyParameters(clock IWallClock) error { ++ if clock == nil { ++ return fmt.Errorf("parameter clock is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_EraseUndefinedHashValues.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_EraseUndefinedHashValues.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_EraseUndefinedHashValues.go --runtime-type-checking +@@ -43,10 +43,13 @@ + // Used to check that undefined/null hash values + // are being erased when sending values from native code to JS. + func EraseUndefinedHashValues_DoesKeyExist(opts *EraseUndefinedHashValuesOptions, key *string) *bool { + _init_.Initialize() + ++ if err := validateEraseUndefinedHashValues_DoesKeyExistParameters(opts, key); err != nil { ++ panic(err) ++ } + var returns *bool + + _jsii_.StaticInvoke( + "jsii-calc.EraseUndefinedHashValues", + "doesKeyExist", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_EraseUndefinedHashValues__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_EraseUndefinedHashValues__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_EraseUndefinedHashValues__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateEraseUndefinedHashValues_DoesKeyExistParameters(opts *EraseUndefinedHashValuesOptions, key *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_EraseUndefinedHashValues__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_EraseUndefinedHashValues__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_EraseUndefinedHashValues__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,27 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++) ++ ++func validateEraseUndefinedHashValues_DoesKeyExistParameters(opts *EraseUndefinedHashValuesOptions, key *string) error { ++ if opts == nil { ++ return fmt.Errorf("parameter opts is required, but nil was provided") ++ } ++ if err := _jsii_.ValidateStruct(opts, func() string { return "parameter opts" }); err != nil { ++ return err ++ } ++ ++ if key == nil { ++ return fmt.Errorf("parameter key is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ExperimentalClass.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ExperimentalClass.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ExperimentalClass.go --runtime-type-checking +@@ -46,10 +46,13 @@ + + // Experimental. + func NewExperimentalClass(readonlyString *string, mutableNumber *float64) ExperimentalClass { + _init_.Initialize() + ++ if err := validateNewExperimentalClassParameters(readonlyString); err != nil { ++ panic(err) ++ } + j := jsiiProxy_ExperimentalClass{} + + _jsii_.Create( + "jsii-calc.ExperimentalClass", + []interface{}{readonlyString, mutableNumber}, +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ExperimentalClass__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ExperimentalClass__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ExperimentalClass__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateNewExperimentalClassParameters(readonlyString *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ExperimentalClass__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ExperimentalClass__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ExperimentalClass__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func validateNewExperimentalClassParameters(readonlyString *string) error { ++ if readonlyString == nil { ++ return fmt.Errorf("parameter readonlyString is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ExportedBaseClass.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ExportedBaseClass.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ExportedBaseClass.go --runtime-type-checking +@@ -27,10 +27,13 @@ + + + func NewExportedBaseClass(success *bool) ExportedBaseClass { + _init_.Initialize() + ++ if err := validateNewExportedBaseClassParameters(success); err != nil { ++ panic(err) ++ } + j := jsiiProxy_ExportedBaseClass{} + + _jsii_.Create( + "jsii-calc.ExportedBaseClass", + []interface{}{success}, +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ExportedBaseClass__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ExportedBaseClass__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ExportedBaseClass__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateNewExportedBaseClassParameters(success *bool) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ExportedBaseClass__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ExportedBaseClass__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ExportedBaseClass__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func validateNewExportedBaseClassParameters(success *bool) error { ++ if success == nil { ++ return fmt.Errorf("parameter success is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ExternalClass.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ExternalClass.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ExternalClass.go --runtime-type-checking +@@ -40,10 +40,13 @@ + + + func NewExternalClass(readonlyString *string, mutableNumber *float64) ExternalClass { + _init_.Initialize() + ++ if err := validateNewExternalClassParameters(readonlyString); err != nil { ++ panic(err) ++ } + j := jsiiProxy_ExternalClass{} + + _jsii_.Create( + "jsii-calc.ExternalClass", + []interface{}{readonlyString, mutableNumber}, +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ExternalClass__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ExternalClass__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ExternalClass__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateNewExternalClassParameters(readonlyString *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ExternalClass__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ExternalClass__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ExternalClass__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func validateNewExternalClassParameters(readonlyString *string) error { ++ if readonlyString == nil { ++ return fmt.Errorf("parameter readonlyString is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_GiveMeStructs.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_GiveMeStructs.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_GiveMeStructs.go --runtime-type-checking +@@ -57,10 +57,13 @@ + g, + ) + } + + func (g *jsiiProxy_GiveMeStructs) DerivedToFirst(derived *DerivedStruct) *scopejsiicalclib.MyFirstStruct { ++ if err := g.validateDerivedToFirstParameters(derived); err != nil { ++ panic(err) ++ } + var returns *scopejsiicalclib.MyFirstStruct + + _jsii_.Invoke( + g, + "derivedToFirst", +@@ -70,10 +73,13 @@ + + return returns + } + + func (g *jsiiProxy_GiveMeStructs) ReadDerivedNonPrimitive(derived *DerivedStruct) DoubleTrouble { ++ if err := g.validateReadDerivedNonPrimitiveParameters(derived); err != nil { ++ panic(err) ++ } + var returns DoubleTrouble + + _jsii_.Invoke( + g, + "readDerivedNonPrimitive", +@@ -83,10 +89,13 @@ + + return returns + } + + func (g *jsiiProxy_GiveMeStructs) ReadFirstNumber(first *scopejsiicalclib.MyFirstStruct) *float64 { ++ if err := g.validateReadFirstNumberParameters(first); err != nil { ++ panic(err) ++ } + var returns *float64 + + _jsii_.Invoke( + g, + "readFirstNumber", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_GiveMeStructs__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_GiveMeStructs__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_GiveMeStructs__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,20 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (g *jsiiProxy_GiveMeStructs) validateDerivedToFirstParameters(derived *DerivedStruct) error { ++ return nil ++} ++ ++func (g *jsiiProxy_GiveMeStructs) validateReadDerivedNonPrimitiveParameters(derived *DerivedStruct) error { ++ return nil ++} ++ ++func (g *jsiiProxy_GiveMeStructs) validateReadFirstNumberParameters(first *scopejsiicalclib.MyFirstStruct) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_GiveMeStructs__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_GiveMeStructs__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_GiveMeStructs__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,47 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++ ++ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ++) ++ ++func (g *jsiiProxy_GiveMeStructs) validateDerivedToFirstParameters(derived *DerivedStruct) error { ++ if derived == nil { ++ return fmt.Errorf("parameter derived is required, but nil was provided") ++ } ++ if err := _jsii_.ValidateStruct(derived, func() string { return "parameter derived" }); err != nil { ++ return err ++ } ++ ++ return nil ++} ++ ++func (g *jsiiProxy_GiveMeStructs) validateReadDerivedNonPrimitiveParameters(derived *DerivedStruct) error { ++ if derived == nil { ++ return fmt.Errorf("parameter derived is required, but nil was provided") ++ } ++ if err := _jsii_.ValidateStruct(derived, func() string { return "parameter derived" }); err != nil { ++ return err ++ } ++ ++ return nil ++} ++ ++func (g *jsiiProxy_GiveMeStructs) validateReadFirstNumberParameters(first *scopejsiicalclib.MyFirstStruct) error { ++ if first == nil { ++ return fmt.Errorf("parameter first is required, but nil was provided") ++ } ++ if err := _jsii_.ValidateStruct(first, func() string { return "parameter first" }); err != nil { ++ return err ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_GreetingAugmenter.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_GreetingAugmenter.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_GreetingAugmenter.go --runtime-type-checking +@@ -40,10 +40,13 @@ + g, + ) + } + + func (g *jsiiProxy_GreetingAugmenter) BetterGreeting(friendly scopejsiicalclib.IFriendly) *string { ++ if err := g.validateBetterGreetingParameters(friendly); err != nil { ++ panic(err) ++ } + var returns *string + + _jsii_.Invoke( + g, + "betterGreeting", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_GreetingAugmenter__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_GreetingAugmenter__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_GreetingAugmenter__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (g *jsiiProxy_GreetingAugmenter) validateBetterGreetingParameters(friendly scopejsiicalclib.IFriendly) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_GreetingAugmenter__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_GreetingAugmenter__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_GreetingAugmenter__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,20 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ++) ++ ++func (g *jsiiProxy_GreetingAugmenter) validateBetterGreetingParameters(friendly scopejsiicalclib.IFriendly) error { ++ if friendly == nil { ++ return fmt.Errorf("parameter friendly is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IAnotherPublicInterface.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IAnotherPublicInterface.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IAnotherPublicInterface.go --runtime-type-checking +@@ -24,10 +24,13 @@ + ) + return returns + } + + func (j *jsiiProxy_IAnotherPublicInterface)SetA(val *string) { ++ if err := j.validateSetAParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "a", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IAnotherPublicInterface__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IAnotherPublicInterface__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IAnotherPublicInterface__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_IAnotherPublicInterface) validateSetAParameters(val *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IAnotherPublicInterface__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IAnotherPublicInterface__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IAnotherPublicInterface__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (j *jsiiProxy_IAnotherPublicInterface) validateSetAParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IBellRinger.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IBellRinger.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IBellRinger.go --runtime-type-checking +@@ -14,10 +14,13 @@ + type jsiiProxy_IBellRinger struct { + _ byte // padding + } + + func (i *jsiiProxy_IBellRinger) YourTurn(bell IBell) { ++ if err := i.validateYourTurnParameters(bell); err != nil { ++ panic(err) ++ } + _jsii_.InvokeVoid( + i, + "yourTurn", + []interface{}{bell}, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IBellRinger__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IBellRinger__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IBellRinger__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (i *jsiiProxy_IBellRinger) validateYourTurnParameters(bell IBell) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IBellRinger__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IBellRinger__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IBellRinger__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (i *jsiiProxy_IBellRinger) validateYourTurnParameters(bell IBell) error { ++ if bell == nil { ++ return fmt.Errorf("parameter bell is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IConcreteBellRinger.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IConcreteBellRinger.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IConcreteBellRinger.go --runtime-type-checking +@@ -14,10 +14,13 @@ + type jsiiProxy_IConcreteBellRinger struct { + _ byte // padding + } + + func (i *jsiiProxy_IConcreteBellRinger) YourTurn(bell Bell) { ++ if err := i.validateYourTurnParameters(bell); err != nil { ++ panic(err) ++ } + _jsii_.InvokeVoid( + i, + "yourTurn", + []interface{}{bell}, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IConcreteBellRinger__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IConcreteBellRinger__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IConcreteBellRinger__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (i *jsiiProxy_IConcreteBellRinger) validateYourTurnParameters(bell Bell) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IConcreteBellRinger__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IConcreteBellRinger__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IConcreteBellRinger__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (i *jsiiProxy_IConcreteBellRinger) validateYourTurnParameters(bell Bell) error { ++ if bell == nil { ++ return fmt.Errorf("parameter bell is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IExtendsPrivateInterface.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IExtendsPrivateInterface.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IExtendsPrivateInterface.go --runtime-type-checking +@@ -35,10 +35,13 @@ + ) + return returns + } + + func (j *jsiiProxy_IExtendsPrivateInterface)SetPrivate(val *string) { ++ if err := j.validateSetPrivateParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "private", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IExtendsPrivateInterface__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IExtendsPrivateInterface__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IExtendsPrivateInterface__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_IExtendsPrivateInterface) validateSetPrivateParameters(val *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IExtendsPrivateInterface__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IExtendsPrivateInterface__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IExtendsPrivateInterface__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (j *jsiiProxy_IExtendsPrivateInterface) validateSetPrivateParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IInterfaceWithOptionalMethodArguments.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IInterfaceWithOptionalMethodArguments.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IInterfaceWithOptionalMethodArguments.go --runtime-type-checking +@@ -14,10 +14,13 @@ + type jsiiProxy_IInterfaceWithOptionalMethodArguments struct { + _ byte // padding + } + + func (i *jsiiProxy_IInterfaceWithOptionalMethodArguments) Hello(arg1 *string, arg2 *float64) { ++ if err := i.validateHelloParameters(arg1); err != nil { ++ panic(err) ++ } + _jsii_.InvokeVoid( + i, + "hello", + []interface{}{arg1, arg2}, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IInterfaceWithOptionalMethodArguments__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IInterfaceWithOptionalMethodArguments__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IInterfaceWithOptionalMethodArguments__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (i *jsiiProxy_IInterfaceWithOptionalMethodArguments) validateHelloParameters(arg1 *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IInterfaceWithOptionalMethodArguments__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IInterfaceWithOptionalMethodArguments__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IInterfaceWithOptionalMethodArguments__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (i *jsiiProxy_IInterfaceWithOptionalMethodArguments) validateHelloParameters(arg1 *string) error { ++ if arg1 == nil { ++ return fmt.Errorf("parameter arg1 is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IInterfaceWithProperties.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IInterfaceWithProperties.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IInterfaceWithProperties.go --runtime-type-checking +@@ -35,10 +35,13 @@ + ) + return returns + } + + func (j *jsiiProxy_IInterfaceWithProperties)SetReadWriteString(val *string) { ++ if err := j.validateSetReadWriteStringParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "readWriteString", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IInterfaceWithProperties__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IInterfaceWithProperties__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IInterfaceWithProperties__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_IInterfaceWithProperties) validateSetReadWriteStringParameters(val *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IInterfaceWithProperties__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IInterfaceWithProperties__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IInterfaceWithProperties__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (j *jsiiProxy_IInterfaceWithProperties) validateSetReadWriteStringParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IInterfaceWithPropertiesExtension.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IInterfaceWithPropertiesExtension.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IInterfaceWithPropertiesExtension.go --runtime-type-checking +@@ -25,10 +25,13 @@ + ) + return returns + } + + func (j *jsiiProxy_IInterfaceWithPropertiesExtension)SetFoo(val *float64) { ++ if err := j.validateSetFooParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "foo", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IInterfaceWithPropertiesExtension__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IInterfaceWithPropertiesExtension__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IInterfaceWithPropertiesExtension__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_IInterfaceWithPropertiesExtension) validateSetFooParameters(val *float64) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IInterfaceWithPropertiesExtension__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IInterfaceWithPropertiesExtension__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IInterfaceWithPropertiesExtension__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (j *jsiiProxy_IInterfaceWithPropertiesExtension) validateSetFooParameters(val *float64) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IMutableObjectLiteral.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IMutableObjectLiteral.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IMutableObjectLiteral.go --runtime-type-checking +@@ -24,10 +24,13 @@ + ) + return returns + } + + func (j *jsiiProxy_IMutableObjectLiteral)SetValue(val *string) { ++ if err := j.validateSetValueParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "value", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IMutableObjectLiteral__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IMutableObjectLiteral__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IMutableObjectLiteral__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_IMutableObjectLiteral) validateSetValueParameters(val *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IMutableObjectLiteral__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IMutableObjectLiteral__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IMutableObjectLiteral__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (j *jsiiProxy_IMutableObjectLiteral) validateSetValueParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_INonInternalInterface.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_INonInternalInterface.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_INonInternalInterface.go --runtime-type-checking +@@ -27,10 +27,13 @@ + ) + return returns + } + + func (j *jsiiProxy_INonInternalInterface)SetB(val *string) { ++ if err := j.validateSetBParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "b", + val, + ) +@@ -45,10 +48,13 @@ + ) + return returns + } + + func (j *jsiiProxy_INonInternalInterface)SetC(val *string) { ++ if err := j.validateSetCParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "c", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_INonInternalInterface__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_INonInternalInterface__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_INonInternalInterface__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,16 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_INonInternalInterface) validateSetBParameters(val *string) error { ++ return nil ++} ++ ++func (j *jsiiProxy_INonInternalInterface) validateSetCParameters(val *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_INonInternalInterface__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_INonInternalInterface__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_INonInternalInterface__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,26 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (j *jsiiProxy_INonInternalInterface) validateSetBParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_INonInternalInterface) validateSetCParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IObjectWithProperty.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IObjectWithProperty.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IObjectWithProperty.go --runtime-type-checking +@@ -39,10 +39,13 @@ + ) + return returns + } + + func (j *jsiiProxy_IObjectWithProperty)SetProperty(val *string) { ++ if err := j.validateSetPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "property", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IObjectWithProperty__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IObjectWithProperty__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IObjectWithProperty__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_IObjectWithProperty) validateSetPropertyParameters(val *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IObjectWithProperty__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_IObjectWithProperty__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_IObjectWithProperty__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (j *jsiiProxy_IObjectWithProperty) validateSetPropertyParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ImplementInternalInterface.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ImplementInternalInterface.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ImplementInternalInterface.go --runtime-type-checking +@@ -50,10 +50,13 @@ + i, + ) + } + + func (j *jsiiProxy_ImplementInternalInterface)SetProp(val *string) { ++ if err := j.validateSetPropParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "prop", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ImplementInternalInterface__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ImplementInternalInterface__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ImplementInternalInterface__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_ImplementInternalInterface) validateSetPropParameters(val *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ImplementInternalInterface__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ImplementInternalInterface__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ImplementInternalInterface__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (j *jsiiProxy_ImplementInternalInterface) validateSetPropParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ImplementsPrivateInterface.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ImplementsPrivateInterface.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ImplementsPrivateInterface.go --runtime-type-checking +@@ -50,10 +50,13 @@ + i, + ) + } + + func (j *jsiiProxy_ImplementsPrivateInterface)SetPrivate(val *string) { ++ if err := j.validateSetPrivateParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "private", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ImplementsPrivateInterface__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ImplementsPrivateInterface__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ImplementsPrivateInterface__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_ImplementsPrivateInterface) validateSetPrivateParameters(val *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ImplementsPrivateInterface__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ImplementsPrivateInterface__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ImplementsPrivateInterface__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (j *jsiiProxy_ImplementsPrivateInterface) validateSetPrivateParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_InterfacesMaker.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_InterfacesMaker.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_InterfacesMaker.go --runtime-type-checking +@@ -18,10 +18,13 @@ + } + + func InterfacesMaker_MakeInterfaces(count *float64) *[]scopejsiicalclib.IDoublable { + _init_.Initialize() + ++ if err := validateInterfacesMaker_MakeInterfacesParameters(count); err != nil { ++ panic(err) ++ } + var returns *[]scopejsiicalclib.IDoublable + + _jsii_.StaticInvoke( + "jsii-calc.InterfacesMaker", + "makeInterfaces", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_InterfacesMaker__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_InterfacesMaker__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_InterfacesMaker__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateInterfacesMaker_MakeInterfacesParameters(count *float64) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_InterfacesMaker__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_InterfacesMaker__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_InterfacesMaker__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func validateInterfacesMaker_MakeInterfacesParameters(count *float64) error { ++ if count == nil { ++ return fmt.Errorf("parameter count is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_JSII417Derived.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_JSII417Derived.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_JSII417Derived.go --runtime-type-checking +@@ -42,10 +42,13 @@ + + + func NewJSII417Derived(property *string) JSII417Derived { + _init_.Initialize() + ++ if err := validateNewJSII417DerivedParameters(property); err != nil { ++ panic(err) ++ } + j := jsiiProxy_JSII417Derived{} + + _jsii_.Create( + "jsii-calc.JSII417Derived", + []interface{}{property}, +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_JSII417Derived__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_JSII417Derived__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_JSII417Derived__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateNewJSII417DerivedParameters(property *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_JSII417Derived__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_JSII417Derived__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_JSII417Derived__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func validateNewJSII417DerivedParameters(property *string) error { ++ if property == nil { ++ return fmt.Errorf("parameter property is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_JSObjectLiteralToNativeClass.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_JSObjectLiteralToNativeClass.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_JSObjectLiteralToNativeClass.go --runtime-type-checking +@@ -62,18 +62,24 @@ + j, + ) + } + + func (j *jsiiProxy_JSObjectLiteralToNativeClass)SetPropA(val *string) { ++ if err := j.validateSetPropAParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "propA", + val, + ) + } + + func (j *jsiiProxy_JSObjectLiteralToNativeClass)SetPropB(val *float64) { ++ if err := j.validateSetPropBParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "propB", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_JSObjectLiteralToNativeClass__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_JSObjectLiteralToNativeClass__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_JSObjectLiteralToNativeClass__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,16 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_JSObjectLiteralToNativeClass) validateSetPropAParameters(val *string) error { ++ return nil ++} ++ ++func (j *jsiiProxy_JSObjectLiteralToNativeClass) validateSetPropBParameters(val *float64) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_JSObjectLiteralToNativeClass__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_JSObjectLiteralToNativeClass__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_JSObjectLiteralToNativeClass__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,26 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (j *jsiiProxy_JSObjectLiteralToNativeClass) validateSetPropAParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_JSObjectLiteralToNativeClass) validateSetPropBParameters(val *float64) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_JavaReservedWords.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_JavaReservedWords.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_JavaReservedWords.go --runtime-type-checking +@@ -102,10 +102,13 @@ + j, + ) + } + + func (j *jsiiProxy_JavaReservedWords)SetWhile(val *string) { ++ if err := j.validateSetWhileParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "while", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_JavaReservedWords__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_JavaReservedWords__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_JavaReservedWords__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_JavaReservedWords) validateSetWhileParameters(val *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_JavaReservedWords__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_JavaReservedWords__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_JavaReservedWords__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (j *jsiiProxy_JavaReservedWords) validateSetWhileParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_LevelOne.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_LevelOne.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_LevelOne.go --runtime-type-checking +@@ -28,10 +28,13 @@ + + + func NewLevelOne(props *LevelOneProps) LevelOne { + _init_.Initialize() + ++ if err := validateNewLevelOneParameters(props); err != nil { ++ panic(err) ++ } + j := jsiiProxy_LevelOne{} + + _jsii_.Create( + "jsii-calc.LevelOne", + []interface{}{props}, +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_LevelOne__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_LevelOne__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_LevelOne__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateNewLevelOneParameters(props *LevelOneProps) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_LevelOne__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_LevelOne__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_LevelOne__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,23 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++) ++ ++func validateNewLevelOneParameters(props *LevelOneProps) error { ++ if props == nil { ++ return fmt.Errorf("parameter props is required, but nil was provided") ++ } ++ if err := _jsii_.ValidateStruct(props, func() string { return "parameter props" }); err != nil { ++ return err ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Multiply.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Multiply.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Multiply.go --runtime-type-checking +@@ -73,10 +73,13 @@ + + // Creates a BinaryOperation. + func NewMultiply(lhs scopejsiicalclib.NumericValue, rhs scopejsiicalclib.NumericValue) Multiply { + _init_.Initialize() + ++ if err := validateNewMultiplyParameters(lhs, rhs); err != nil { ++ panic(err) ++ } + j := jsiiProxy_Multiply{} + + _jsii_.Create( + "jsii-calc.Multiply", + []interface{}{lhs, rhs}, +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Multiply__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Multiply__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Multiply__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateNewMultiplyParameters(lhs scopejsiicalclib.NumericValue, rhs scopejsiicalclib.NumericValue) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Multiply__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Multiply__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Multiply__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,24 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ++) ++ ++func validateNewMultiplyParameters(lhs scopejsiicalclib.NumericValue, rhs scopejsiicalclib.NumericValue) error { ++ if lhs == nil { ++ return fmt.Errorf("parameter lhs is required, but nil was provided") ++ } ++ ++ if rhs == nil { ++ return fmt.Errorf("parameter rhs is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Negate.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Negate.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Negate.go --runtime-type-checking +@@ -55,10 +55,13 @@ + + + func NewNegate(operand scopejsiicalclib.NumericValue) Negate { + _init_.Initialize() + ++ if err := validateNewNegateParameters(operand); err != nil { ++ panic(err) ++ } + j := jsiiProxy_Negate{} + + _jsii_.Create( + "jsii-calc.Negate", + []interface{}{operand}, +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Negate__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Negate__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Negate__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateNewNegateParameters(operand scopejsiicalclib.NumericValue) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Negate__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Negate__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Negate__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,20 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ++) ++ ++func validateNewNegateParameters(operand scopejsiicalclib.NumericValue) error { ++ if operand == nil { ++ return fmt.Errorf("parameter operand is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_NullShouldBeTreatedAsUndefined.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_NullShouldBeTreatedAsUndefined.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_NullShouldBeTreatedAsUndefined.go --runtime-type-checking +@@ -32,10 +32,13 @@ + + + func NewNullShouldBeTreatedAsUndefined(_param1 *string, optional interface{}) NullShouldBeTreatedAsUndefined { + _init_.Initialize() + ++ if err := validateNewNullShouldBeTreatedAsUndefinedParameters(_param1); err != nil { ++ panic(err) ++ } + j := jsiiProxy_NullShouldBeTreatedAsUndefined{} + + _jsii_.Create( + "jsii-calc.NullShouldBeTreatedAsUndefined", + []interface{}{_param1, optional}, +@@ -70,10 +73,13 @@ + []interface{}{value}, + ) + } + + func (n *jsiiProxy_NullShouldBeTreatedAsUndefined) GiveMeUndefinedInsideAnObject(input *NullShouldBeTreatedAsUndefinedData) { ++ if err := n.validateGiveMeUndefinedInsideAnObjectParameters(input); err != nil { ++ panic(err) ++ } + _jsii_.InvokeVoid( + n, + "giveMeUndefinedInsideAnObject", + []interface{}{input}, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_NullShouldBeTreatedAsUndefined__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_NullShouldBeTreatedAsUndefined__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_NullShouldBeTreatedAsUndefined__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,16 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (n *jsiiProxy_NullShouldBeTreatedAsUndefined) validateGiveMeUndefinedInsideAnObjectParameters(input *NullShouldBeTreatedAsUndefinedData) error { ++ return nil ++} ++ ++func validateNewNullShouldBeTreatedAsUndefinedParameters(_param1 *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_NullShouldBeTreatedAsUndefined__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_NullShouldBeTreatedAsUndefined__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_NullShouldBeTreatedAsUndefined__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,31 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++) ++ ++func (n *jsiiProxy_NullShouldBeTreatedAsUndefined) validateGiveMeUndefinedInsideAnObjectParameters(input *NullShouldBeTreatedAsUndefinedData) error { ++ if input == nil { ++ return fmt.Errorf("parameter input is required, but nil was provided") ++ } ++ if err := _jsii_.ValidateStruct(input, func() string { return "parameter input" }); err != nil { ++ return err ++ } ++ ++ return nil ++} ++ ++func validateNewNullShouldBeTreatedAsUndefinedParameters(_param1 *string) error { ++ if _param1 == nil { ++ return fmt.Errorf("parameter _param1 is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_NumberGenerator.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_NumberGenerator.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_NumberGenerator.go --runtime-type-checking +@@ -31,10 +31,13 @@ + + + func NewNumberGenerator(generator IRandomNumberGenerator) NumberGenerator { + _init_.Initialize() + ++ if err := validateNewNumberGeneratorParameters(generator); err != nil { ++ panic(err) ++ } + j := jsiiProxy_NumberGenerator{} + + _jsii_.Create( + "jsii-calc.NumberGenerator", + []interface{}{generator}, +@@ -53,18 +56,24 @@ + n, + ) + } + + func (j *jsiiProxy_NumberGenerator)SetGenerator(val IRandomNumberGenerator) { ++ if err := j.validateSetGeneratorParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "generator", + val, + ) + } + + func (n *jsiiProxy_NumberGenerator) IsSameGenerator(gen IRandomNumberGenerator) *bool { ++ if err := n.validateIsSameGeneratorParameters(gen); err != nil { ++ panic(err) ++ } + var returns *bool + + _jsii_.Invoke( + n, + "isSameGenerator", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_NumberGenerator__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_NumberGenerator__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_NumberGenerator__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,20 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (n *jsiiProxy_NumberGenerator) validateIsSameGeneratorParameters(gen IRandomNumberGenerator) error { ++ return nil ++} ++ ++func (j *jsiiProxy_NumberGenerator) validateSetGeneratorParameters(val IRandomNumberGenerator) error { ++ return nil ++} ++ ++func validateNewNumberGeneratorParameters(generator IRandomNumberGenerator) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_NumberGenerator__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_NumberGenerator__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_NumberGenerator__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,34 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (n *jsiiProxy_NumberGenerator) validateIsSameGeneratorParameters(gen IRandomNumberGenerator) error { ++ if gen == nil { ++ return fmt.Errorf("parameter gen is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_NumberGenerator) validateSetGeneratorParameters(val IRandomNumberGenerator) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func validateNewNumberGeneratorParameters(generator IRandomNumberGenerator) error { ++ if generator == nil { ++ return fmt.Errorf("parameter generator is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ObjectRefsInCollections.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ObjectRefsInCollections.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ObjectRefsInCollections.go --runtime-type-checking +@@ -44,10 +44,13 @@ + o, + ) + } + + func (o *jsiiProxy_ObjectRefsInCollections) SumFromArray(values *[]scopejsiicalclib.NumericValue) *float64 { ++ if err := o.validateSumFromArrayParameters(values); err != nil { ++ panic(err) ++ } + var returns *float64 + + _jsii_.Invoke( + o, + "sumFromArray", +@@ -57,10 +60,13 @@ + + return returns + } + + func (o *jsiiProxy_ObjectRefsInCollections) SumFromMap(values *map[string]scopejsiicalclib.NumericValue) *float64 { ++ if err := o.validateSumFromMapParameters(values); err != nil { ++ panic(err) ++ } + var returns *float64 + + _jsii_.Invoke( + o, + "sumFromMap", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ObjectRefsInCollections__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ObjectRefsInCollections__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ObjectRefsInCollections__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,16 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (o *jsiiProxy_ObjectRefsInCollections) validateSumFromArrayParameters(values *[]scopejsiicalclib.NumericValue) error { ++ return nil ++} ++ ++func (o *jsiiProxy_ObjectRefsInCollections) validateSumFromMapParameters(values *map[string]scopejsiicalclib.NumericValue) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ObjectRefsInCollections__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ObjectRefsInCollections__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ObjectRefsInCollections__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,28 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ++) ++ ++func (o *jsiiProxy_ObjectRefsInCollections) validateSumFromArrayParameters(values *[]scopejsiicalclib.NumericValue) error { ++ if values == nil { ++ return fmt.Errorf("parameter values is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (o *jsiiProxy_ObjectRefsInCollections) validateSumFromMapParameters(values *map[string]scopejsiicalclib.NumericValue) error { ++ if values == nil { ++ return fmt.Errorf("parameter values is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_OptionalArgumentInvoker.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_OptionalArgumentInvoker.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_OptionalArgumentInvoker.go --runtime-type-checking +@@ -17,10 +17,13 @@ + } + + func NewOptionalArgumentInvoker(delegate IInterfaceWithOptionalMethodArguments) OptionalArgumentInvoker { + _init_.Initialize() + ++ if err := validateNewOptionalArgumentInvokerParameters(delegate); err != nil { ++ panic(err) ++ } + j := jsiiProxy_OptionalArgumentInvoker{} + + _jsii_.Create( + "jsii-calc.OptionalArgumentInvoker", + []interface{}{delegate}, +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_OptionalArgumentInvoker__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_OptionalArgumentInvoker__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_OptionalArgumentInvoker__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateNewOptionalArgumentInvokerParameters(delegate IInterfaceWithOptionalMethodArguments) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_OptionalArgumentInvoker__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_OptionalArgumentInvoker__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_OptionalArgumentInvoker__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func validateNewOptionalArgumentInvokerParameters(delegate IInterfaceWithOptionalMethodArguments) error { ++ if delegate == nil { ++ return fmt.Errorf("parameter delegate is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_OptionalConstructorArgument.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_OptionalConstructorArgument.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_OptionalConstructorArgument.go --runtime-type-checking +@@ -51,10 +51,13 @@ + + + func NewOptionalConstructorArgument(arg1 *float64, arg2 *string, arg3 *time.Time) OptionalConstructorArgument { + _init_.Initialize() + ++ if err := validateNewOptionalConstructorArgumentParameters(arg1, arg2); err != nil { ++ panic(err) ++ } + j := jsiiProxy_OptionalConstructorArgument{} + + _jsii_.Create( + "jsii-calc.OptionalConstructorArgument", + []interface{}{arg1, arg2, arg3}, +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_OptionalConstructorArgument__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_OptionalConstructorArgument__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_OptionalConstructorArgument__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateNewOptionalConstructorArgumentParameters(arg1 *float64, arg2 *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_OptionalConstructorArgument__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_OptionalConstructorArgument__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_OptionalConstructorArgument__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,22 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func validateNewOptionalConstructorArgumentParameters(arg1 *float64, arg2 *string) error { ++ if arg1 == nil { ++ return fmt.Errorf("parameter arg1 is required, but nil was provided") ++ } ++ ++ if arg2 == nil { ++ return fmt.Errorf("parameter arg2 is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_OptionalStructConsumer.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_OptionalStructConsumer.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_OptionalStructConsumer.go --runtime-type-checking +@@ -38,10 +38,13 @@ + + + func NewOptionalStructConsumer(optionalStruct *OptionalStruct) OptionalStructConsumer { + _init_.Initialize() + ++ if err := validateNewOptionalStructConsumerParameters(optionalStruct); err != nil { ++ panic(err) ++ } + j := jsiiProxy_OptionalStructConsumer{} + + _jsii_.Create( + "jsii-calc.OptionalStructConsumer", + []interface{}{optionalStruct}, +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_OptionalStructConsumer__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_OptionalStructConsumer__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_OptionalStructConsumer__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateNewOptionalStructConsumerParameters(optionalStruct *OptionalStruct) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_OptionalStructConsumer__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_OptionalStructConsumer__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_OptionalStructConsumer__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++) ++ ++func validateNewOptionalStructConsumerParameters(optionalStruct *OptionalStruct) error { ++ if err := _jsii_.ValidateStruct(optionalStruct, func() string { return "parameter optionalStruct" }); err != nil { ++ return err ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_OverridableProtectedMember.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_OverridableProtectedMember.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_OverridableProtectedMember.go --runtime-type-checking +@@ -66,10 +66,13 @@ + o, + ) + } + + func (j *jsiiProxy_OverridableProtectedMember)SetOverrideReadWrite(val *string) { ++ if err := j.validateSetOverrideReadWriteParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "overrideReadWrite", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_OverridableProtectedMember__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_OverridableProtectedMember__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_OverridableProtectedMember__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_OverridableProtectedMember) validateSetOverrideReadWriteParameters(val *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_OverridableProtectedMember__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_OverridableProtectedMember__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_OverridableProtectedMember__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (j *jsiiProxy_OverridableProtectedMember) validateSetOverrideReadWriteParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_OverrideReturnsObject.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_OverrideReturnsObject.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_OverrideReturnsObject.go --runtime-type-checking +@@ -38,10 +38,13 @@ + o, + ) + } + + func (o *jsiiProxy_OverrideReturnsObject) Test(obj IReturnsNumber) *float64 { ++ if err := o.validateTestParameters(obj); err != nil { ++ panic(err) ++ } + var returns *float64 + + _jsii_.Invoke( + o, + "test", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_OverrideReturnsObject__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_OverrideReturnsObject__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_OverrideReturnsObject__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (o *jsiiProxy_OverrideReturnsObject) validateTestParameters(obj IReturnsNumber) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_OverrideReturnsObject__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_OverrideReturnsObject__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_OverrideReturnsObject__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (o *jsiiProxy_OverrideReturnsObject) validateTestParameters(obj IReturnsNumber) error { ++ if obj == nil { ++ return fmt.Errorf("parameter obj is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_PartiallyInitializedThisConsumer.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_PartiallyInitializedThisConsumer.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_PartiallyInitializedThisConsumer.go --runtime-type-checking +@@ -26,10 +26,13 @@ + p, + ) + } + + func (p *jsiiProxy_PartiallyInitializedThisConsumer) ConsumePartiallyInitializedThis(obj ConstructorPassesThisOut, dt *time.Time, ev AllTypesEnum) *string { ++ if err := p.validateConsumePartiallyInitializedThisParameters(obj, dt, ev); err != nil { ++ panic(err) ++ } + var returns *string + + _jsii_.Invoke( + p, + "consumePartiallyInitializedThis", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_PartiallyInitializedThisConsumer__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_PartiallyInitializedThisConsumer__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_PartiallyInitializedThisConsumer__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (p *jsiiProxy_PartiallyInitializedThisConsumer) validateConsumePartiallyInitializedThisParameters(obj ConstructorPassesThisOut, dt *time.Time, ev AllTypesEnum) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_PartiallyInitializedThisConsumer__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_PartiallyInitializedThisConsumer__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_PartiallyInitializedThisConsumer__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,27 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ "time" ++) ++ ++func (p *jsiiProxy_PartiallyInitializedThisConsumer) validateConsumePartiallyInitializedThisParameters(obj ConstructorPassesThisOut, dt *time.Time, ev AllTypesEnum) error { ++ if obj == nil { ++ return fmt.Errorf("parameter obj is required, but nil was provided") ++ } ++ ++ if dt == nil { ++ return fmt.Errorf("parameter dt is required, but nil was provided") ++ } ++ ++ if ev == "" { ++ return fmt.Errorf("parameter ev is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Polymorphism.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Polymorphism.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Polymorphism.go --runtime-type-checking +@@ -40,10 +40,13 @@ + p, + ) + } + + func (p *jsiiProxy_Polymorphism) SayHello(friendly scopejsiicalclib.IFriendly) *string { ++ if err := p.validateSayHelloParameters(friendly); err != nil { ++ panic(err) ++ } + var returns *string + + _jsii_.Invoke( + p, + "sayHello", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Polymorphism__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Polymorphism__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Polymorphism__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (p *jsiiProxy_Polymorphism) validateSayHelloParameters(friendly scopejsiicalclib.IFriendly) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Polymorphism__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Polymorphism__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Polymorphism__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,20 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ++) ++ ++func (p *jsiiProxy_Polymorphism) validateSayHelloParameters(friendly scopejsiicalclib.IFriendly) error { ++ if friendly == nil { ++ return fmt.Errorf("parameter friendly is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Power.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Power.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Power.go --runtime-type-checking +@@ -116,10 +116,13 @@ + + // Creates a Power operation. + func NewPower(base scopejsiicalclib.NumericValue, pow scopejsiicalclib.NumericValue) Power { + _init_.Initialize() + ++ if err := validateNewPowerParameters(base, pow); err != nil { ++ panic(err) ++ } + j := jsiiProxy_Power{} + + _jsii_.Create( + "jsii-calc.Power", + []interface{}{base, pow}, +@@ -139,26 +142,35 @@ + p, + ) + } + + func (j *jsiiProxy_Power)SetDecorationPostfixes(val *[]*string) { ++ if err := j.validateSetDecorationPostfixesParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "decorationPostfixes", + val, + ) + } + + func (j *jsiiProxy_Power)SetDecorationPrefixes(val *[]*string) { ++ if err := j.validateSetDecorationPrefixesParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "decorationPrefixes", + val, + ) + } + + func (j *jsiiProxy_Power)SetStringStyle(val composition.CompositeOperation_CompositionStringStyle) { ++ if err := j.validateSetStringStyleParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "stringStyle", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Power__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Power__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Power__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,24 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_Power) validateSetDecorationPostfixesParameters(val *[]*string) error { ++ return nil ++} ++ ++func (j *jsiiProxy_Power) validateSetDecorationPrefixesParameters(val *[]*string) error { ++ return nil ++} ++ ++func (j *jsiiProxy_Power) validateSetStringStyleParameters(val composition.CompositeOperation_CompositionStringStyle) error { ++ return nil ++} ++ ++func validateNewPowerParameters(base scopejsiicalclib.NumericValue, pow scopejsiicalclib.NumericValue) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Power__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Power__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Power__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,49 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/composition" ++ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ++) ++ ++func (j *jsiiProxy_Power) validateSetDecorationPostfixesParameters(val *[]*string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_Power) validateSetDecorationPrefixesParameters(val *[]*string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_Power) validateSetStringStyleParameters(val composition.CompositeOperation_CompositionStringStyle) error { ++ if val == "" { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func validateNewPowerParameters(base scopejsiicalclib.NumericValue, pow scopejsiicalclib.NumericValue) error { ++ if base == nil { ++ return fmt.Errorf("parameter base is required, but nil was provided") ++ } ++ ++ if pow == nil { ++ return fmt.Errorf("parameter pow is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ReferenceEnumFromScopedPackage.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ReferenceEnumFromScopedPackage.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ReferenceEnumFromScopedPackage.go --runtime-type-checking +@@ -76,10 +76,13 @@ + + return returns + } + + func (r *jsiiProxy_ReferenceEnumFromScopedPackage) SaveFoo(value scopejsiicalclib.EnumFromScopedModule) { ++ if err := r.validateSaveFooParameters(value); err != nil { ++ panic(err) ++ } + _jsii_.InvokeVoid( + r, + "saveFoo", + []interface{}{value}, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ReferenceEnumFromScopedPackage__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ReferenceEnumFromScopedPackage__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ReferenceEnumFromScopedPackage__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (r *jsiiProxy_ReferenceEnumFromScopedPackage) validateSaveFooParameters(value scopejsiicalclib.EnumFromScopedModule) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ReferenceEnumFromScopedPackage__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_ReferenceEnumFromScopedPackage__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_ReferenceEnumFromScopedPackage__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,20 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ++) ++ ++func (r *jsiiProxy_ReferenceEnumFromScopedPackage) validateSaveFooParameters(value scopejsiicalclib.EnumFromScopedModule) error { ++ if value == "" { ++ return fmt.Errorf("parameter value is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_RootStructValidator.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_RootStructValidator.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_RootStructValidator.go --runtime-type-checking +@@ -15,10 +15,13 @@ + } + + func RootStructValidator_Validate(struct_ *RootStruct) { + _init_.Initialize() + ++ if err := validateRootStructValidator_ValidateParameters(struct_); err != nil { ++ panic(err) ++ } + _jsii_.StaticInvokeVoid( + "jsii-calc.RootStructValidator", + "validate", + []interface{}{struct_}, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_RootStructValidator__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_RootStructValidator__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_RootStructValidator__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateRootStructValidator_ValidateParameters(struct_ *RootStruct) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_RootStructValidator__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_RootStructValidator__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_RootStructValidator__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,23 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++) ++ ++func validateRootStructValidator_ValidateParameters(struct_ *RootStruct) error { ++ if struct_ == nil { ++ return fmt.Errorf("parameter struct_ is required, but nil was provided") ++ } ++ if err := _jsii_.ValidateStruct(struct_, func() string { return "parameter struct_" }); err != nil { ++ return err ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_RuntimeTypeChecking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_RuntimeTypeChecking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_RuntimeTypeChecking.go --runtime-type-checking +@@ -59,10 +59,13 @@ + []interface{}{arg}, + ) + } + + func (r *jsiiProxy_RuntimeTypeChecking) MethodWithOptionalArguments(arg1 *float64, arg2 *string, arg3 *time.Time) { ++ if err := r.validateMethodWithOptionalArgumentsParameters(arg1, arg2); err != nil { ++ panic(err) ++ } + _jsii_.InvokeVoid( + r, + "methodWithOptionalArguments", + []interface{}{arg1, arg2, arg3}, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_RuntimeTypeChecking__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_RuntimeTypeChecking__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_RuntimeTypeChecking__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (r *jsiiProxy_RuntimeTypeChecking) validateMethodWithOptionalArgumentsParameters(arg1 *float64, arg2 *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_RuntimeTypeChecking__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_RuntimeTypeChecking__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_RuntimeTypeChecking__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,22 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (r *jsiiProxy_RuntimeTypeChecking) validateMethodWithOptionalArgumentsParameters(arg1 *float64, arg2 *string) error { ++ if arg1 == nil { ++ return fmt.Errorf("parameter arg1 is required, but nil was provided") ++ } ++ ++ if arg2 == nil { ++ return fmt.Errorf("parameter arg2 is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SingletonInt.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_SingletonInt.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_SingletonInt.go --runtime-type-checking +@@ -16,10 +16,13 @@ + type jsiiProxy_SingletonInt struct { + _ byte // padding + } + + func (s *jsiiProxy_SingletonInt) IsSingletonInt(value *float64) *bool { ++ if err := s.validateIsSingletonIntParameters(value); err != nil { ++ panic(err) ++ } + var returns *bool + + _jsii_.Invoke( + s, + "isSingletonInt", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SingletonInt__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_SingletonInt__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_SingletonInt__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (s *jsiiProxy_SingletonInt) validateIsSingletonIntParameters(value *float64) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SingletonInt__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_SingletonInt__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_SingletonInt__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (s *jsiiProxy_SingletonInt) validateIsSingletonIntParameters(value *float64) error { ++ if value == nil { ++ return fmt.Errorf("parameter value is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SingletonString.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_SingletonString.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_SingletonString.go --runtime-type-checking +@@ -16,10 +16,13 @@ + type jsiiProxy_SingletonString struct { + _ byte // padding + } + + func (s *jsiiProxy_SingletonString) IsSingletonString(value *string) *bool { ++ if err := s.validateIsSingletonStringParameters(value); err != nil { ++ panic(err) ++ } + var returns *bool + + _jsii_.Invoke( + s, + "isSingletonString", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SingletonString__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_SingletonString__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_SingletonString__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (s *jsiiProxy_SingletonString) validateIsSingletonStringParameters(value *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SingletonString__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_SingletonString__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_SingletonString__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (s *jsiiProxy_SingletonString) validateIsSingletonStringParameters(value *string) error { ++ if value == nil { ++ return fmt.Errorf("parameter value is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StableClass.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_StableClass.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_StableClass.go --runtime-type-checking +@@ -40,10 +40,13 @@ + + + func NewStableClass(readonlyString *string, mutableNumber *float64) StableClass { + _init_.Initialize() + ++ if err := validateNewStableClassParameters(readonlyString); err != nil { ++ panic(err) ++ } + j := jsiiProxy_StableClass{} + + _jsii_.Create( + "jsii-calc.StableClass", + []interface{}{readonlyString, mutableNumber}, +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StableClass__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_StableClass__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_StableClass__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateNewStableClassParameters(readonlyString *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StableClass__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_StableClass__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_StableClass__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func validateNewStableClassParameters(readonlyString *string) error { ++ if readonlyString == nil { ++ return fmt.Errorf("parameter readonlyString is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StaticContext.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_StaticContext.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_StaticContext.go --runtime-type-checking +@@ -43,10 +43,13 @@ + return returns + } + + func StaticContext_SetStaticVariable(val *bool) { + _init_.Initialize() ++ if err := validateStaticContext_SetStaticVariableParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.StaticSet( + "jsii-calc.StaticContext", + "staticVariable", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StaticContext__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_StaticContext__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_StaticContext__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateStaticContext_SetStaticVariableParameters(val *bool) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StaticContext__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_StaticContext__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_StaticContext__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func validateStaticContext_SetStaticVariableParameters(val *bool) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Statics.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Statics.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Statics.go --runtime-type-checking +@@ -28,10 +28,13 @@ + + + func NewStatics(value *string) Statics { + _init_.Initialize() + ++ if err := validateNewStaticsParameters(value); err != nil { ++ panic(err) ++ } + j := jsiiProxy_Statics{} + + _jsii_.Create( + "jsii-calc.Statics", + []interface{}{value}, +@@ -53,10 +56,13 @@ + + // Jsdocs for static method. + func Statics_StaticMethod(name *string) *string { + _init_.Initialize() + ++ if err := validateStatics_StaticMethodParameters(name); err != nil { ++ panic(err) ++ } + var returns *string + + _jsii_.StaticInvoke( + "jsii-calc.Statics", + "staticMethod", +@@ -111,10 +117,13 @@ + return returns + } + + func Statics_SetInstance(val Statics) { + _init_.Initialize() ++ if err := validateStatics_SetInstanceParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.StaticSet( + "jsii-calc.Statics", + "instance", + val, + ) +@@ -131,10 +140,13 @@ + return returns + } + + func Statics_SetNonConstStatic(val *float64) { + _init_.Initialize() ++ if err := validateStatics_SetNonConstStaticParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.StaticSet( + "jsii-calc.Statics", + "nonConstStatic", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Statics__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Statics__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Statics__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,24 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateStatics_StaticMethodParameters(name *string) error { ++ return nil ++} ++ ++func validateStatics_SetInstanceParameters(val Statics) error { ++ return nil ++} ++ ++func validateStatics_SetNonConstStaticParameters(val *float64) error { ++ return nil ++} ++ ++func validateNewStaticsParameters(value *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Statics__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Statics__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Statics__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,42 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func validateStatics_StaticMethodParameters(name *string) error { ++ if name == nil { ++ return fmt.Errorf("parameter name is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func validateStatics_SetInstanceParameters(val Statics) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func validateStatics_SetNonConstStaticParameters(val *float64) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func validateNewStaticsParameters(value *string) error { ++ if value == nil { ++ return fmt.Errorf("parameter value is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StripInternal.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_StripInternal.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_StripInternal.go --runtime-type-checking +@@ -50,10 +50,13 @@ + s, + ) + } + + func (j *jsiiProxy_StripInternal)SetYouSeeMe(val *string) { ++ if err := j.validateSetYouSeeMeParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "youSeeMe", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StripInternal__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_StripInternal__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_StripInternal__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_StripInternal) validateSetYouSeeMeParameters(val *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StripInternal__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_StripInternal__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_StripInternal__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (j *jsiiProxy_StripInternal) validateSetYouSeeMeParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StructPassing.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_StructPassing.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_StructPassing.go --runtime-type-checking +@@ -40,10 +40,13 @@ + } + + func StructPassing_HowManyVarArgsDidIPass(_positional *float64, inputs ...*TopLevelStruct) *float64 { + _init_.Initialize() + ++ if err := validateStructPassing_HowManyVarArgsDidIPassParameters(_positional, inputs); err != nil { ++ panic(err) ++ } + args := []interface{}{_positional} + for _, a := range inputs { + args = append(args, a) + } + +@@ -60,10 +63,13 @@ + } + + func StructPassing_RoundTrip(_positional *float64, input *TopLevelStruct) *TopLevelStruct { + _init_.Initialize() + ++ if err := validateStructPassing_RoundTripParameters(_positional, input); err != nil { ++ panic(err) ++ } + var returns *TopLevelStruct + + _jsii_.StaticInvoke( + "jsii-calc.StructPassing", + "roundTrip", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StructPassing__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_StructPassing__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_StructPassing__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,16 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateStructPassing_HowManyVarArgsDidIPassParameters(_positional *float64, inputs []*TopLevelStruct) error { ++ return nil ++} ++ ++func validateStructPassing_RoundTripParameters(_positional *float64, input *TopLevelStruct) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StructPassing__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_StructPassing__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_StructPassing__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,42 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++) ++ ++func validateStructPassing_HowManyVarArgsDidIPassParameters(_positional *float64, inputs []*TopLevelStruct) error { ++ if _positional == nil { ++ return fmt.Errorf("parameter _positional is required, but nil was provided") ++ } ++ ++ if inputs == nil { ++ return fmt.Errorf("parameter inputs is required, but nil was provided") ++ } ++ if err := _jsii_.ValidateStruct(inputs, func() string { return "parameter inputs" }); err != nil { ++ return err ++ } ++ ++ return nil ++} ++ ++func validateStructPassing_RoundTripParameters(_positional *float64, input *TopLevelStruct) error { ++ if _positional == nil { ++ return fmt.Errorf("parameter _positional is required, but nil was provided") ++ } ++ ++ if input == nil { ++ return fmt.Errorf("parameter input is required, but nil was provided") ++ } ++ if err := _jsii_.ValidateStruct(input, func() string { return "parameter input" }); err != nil { ++ return err ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StructUnionConsumer.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_StructUnionConsumer.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_StructUnionConsumer.go --runtime-type-checking +@@ -15,10 +15,13 @@ + } + + func StructUnionConsumer_IsStructA(struct_ interface{}) *bool { + _init_.Initialize() + ++ if err := validateStructUnionConsumer_IsStructAParameters(struct_); err != nil { ++ panic(err) ++ } + var returns *bool + + _jsii_.StaticInvoke( + "jsii-calc.StructUnionConsumer", + "isStructA", +@@ -30,10 +33,13 @@ + } + + func StructUnionConsumer_IsStructB(struct_ interface{}) *bool { + _init_.Initialize() + ++ if err := validateStructUnionConsumer_IsStructBParameters(struct_); err != nil { ++ panic(err) ++ } + var returns *bool + + _jsii_.StaticInvoke( + "jsii-calc.StructUnionConsumer", + "isStructB", +@@ -45,10 +51,13 @@ + } + + func StructUnionConsumer_ProvideStruct(which *string) interface{} { + _init_.Initialize() + ++ if err := validateStructUnionConsumer_ProvideStructParameters(which); err != nil { ++ panic(err) ++ } + var returns interface{} + + _jsii_.StaticInvoke( + "jsii-calc.StructUnionConsumer", + "provideStruct", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StructUnionConsumer__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_StructUnionConsumer__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_StructUnionConsumer__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,20 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateStructUnionConsumer_IsStructAParameters(struct_ interface{}) error { ++ return nil ++} ++ ++func validateStructUnionConsumer_IsStructBParameters(struct_ interface{}) error { ++ return nil ++} ++ ++func validateStructUnionConsumer_ProvideStructParameters(which *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StructUnionConsumer__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_StructUnionConsumer__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_StructUnionConsumer__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,92 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++) ++ ++func validateStructUnionConsumer_IsStructAParameters(struct_ interface{}) error { ++ if struct_ == nil { ++ return fmt.Errorf("parameter struct_ is required, but nil was provided") ++ } ++ switch struct_.(type) { ++ case *StructA: ++ struct_ := struct_.(*StructA) ++ if err := _jsii_.ValidateStruct(struct_, func() string { return "parameter struct_" }); err != nil { ++ return err ++ } ++ case StructA: ++ struct__ := struct_.(StructA) ++ struct_ := &struct__ ++ if err := _jsii_.ValidateStruct(struct_, func() string { return "parameter struct_" }); err != nil { ++ return err ++ } ++ case *StructB: ++ struct_ := struct_.(*StructB) ++ if err := _jsii_.ValidateStruct(struct_, func() string { return "parameter struct_" }); err != nil { ++ return err ++ } ++ case StructB: ++ struct__ := struct_.(StructB) ++ struct_ := &struct__ ++ if err := _jsii_.ValidateStruct(struct_, func() string { return "parameter struct_" }); err != nil { ++ return err ++ } ++ default: ++ if !_jsii_.IsAnonymousProxy(struct_) { ++ return fmt.Errorf("parameter struct_ must be one of the allowed types: *StructA, *StructB; received %#v (a %T)", struct_, struct_) ++ } ++ } ++ ++ return nil ++} ++ ++func validateStructUnionConsumer_IsStructBParameters(struct_ interface{}) error { ++ if struct_ == nil { ++ return fmt.Errorf("parameter struct_ is required, but nil was provided") ++ } ++ switch struct_.(type) { ++ case *StructA: ++ struct_ := struct_.(*StructA) ++ if err := _jsii_.ValidateStruct(struct_, func() string { return "parameter struct_" }); err != nil { ++ return err ++ } ++ case StructA: ++ struct__ := struct_.(StructA) ++ struct_ := &struct__ ++ if err := _jsii_.ValidateStruct(struct_, func() string { return "parameter struct_" }); err != nil { ++ return err ++ } ++ case *StructB: ++ struct_ := struct_.(*StructB) ++ if err := _jsii_.ValidateStruct(struct_, func() string { return "parameter struct_" }); err != nil { ++ return err ++ } ++ case StructB: ++ struct__ := struct_.(StructB) ++ struct_ := &struct__ ++ if err := _jsii_.ValidateStruct(struct_, func() string { return "parameter struct_" }); err != nil { ++ return err ++ } ++ default: ++ if !_jsii_.IsAnonymousProxy(struct_) { ++ return fmt.Errorf("parameter struct_ must be one of the allowed types: *StructA, *StructB; received %#v (a %T)", struct_, struct_) ++ } ++ } ++ ++ return nil ++} ++ ++func validateStructUnionConsumer_ProvideStructParameters(which *string) error { ++ if which == nil { ++ return fmt.Errorf("parameter which is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Sum.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Sum.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Sum.go --runtime-type-checking +@@ -126,34 +126,46 @@ + s, + ) + } + + func (j *jsiiProxy_Sum)SetDecorationPostfixes(val *[]*string) { ++ if err := j.validateSetDecorationPostfixesParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "decorationPostfixes", + val, + ) + } + + func (j *jsiiProxy_Sum)SetDecorationPrefixes(val *[]*string) { ++ if err := j.validateSetDecorationPrefixesParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "decorationPrefixes", + val, + ) + } + + func (j *jsiiProxy_Sum)SetParts(val *[]scopejsiicalclib.NumericValue) { ++ if err := j.validateSetPartsParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "parts", + val, + ) + } + + func (j *jsiiProxy_Sum)SetStringStyle(val composition.CompositeOperation_CompositionStringStyle) { ++ if err := j.validateSetStringStyleParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "stringStyle", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Sum__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Sum__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Sum__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,24 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (j *jsiiProxy_Sum) validateSetDecorationPostfixesParameters(val *[]*string) error { ++ return nil ++} ++ ++func (j *jsiiProxy_Sum) validateSetDecorationPrefixesParameters(val *[]*string) error { ++ return nil ++} ++ ++func (j *jsiiProxy_Sum) validateSetPartsParameters(val *[]scopejsiicalclib.NumericValue) error { ++ return nil ++} ++ ++func (j *jsiiProxy_Sum) validateSetStringStyleParameters(val composition.CompositeOperation_CompositionStringStyle) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Sum__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_Sum__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_Sum__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,45 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/composition" ++ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ++) ++ ++func (j *jsiiProxy_Sum) validateSetDecorationPostfixesParameters(val *[]*string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_Sum) validateSetDecorationPrefixesParameters(val *[]*string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_Sum) validateSetPartsParameters(val *[]scopejsiicalclib.NumericValue) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_Sum) validateSetStringStyleParameters(val composition.CompositeOperation_CompositionStringStyle) error { ++ if val == "" { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SupportsNiceJavaBuilder.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_SupportsNiceJavaBuilder.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_SupportsNiceJavaBuilder.go --runtime-type-checking +@@ -62,10 +62,13 @@ + + + func NewSupportsNiceJavaBuilder(id *float64, defaultBar *float64, props *SupportsNiceJavaBuilderProps, rest ...*string) SupportsNiceJavaBuilder { + _init_.Initialize() + ++ if err := validateNewSupportsNiceJavaBuilderParameters(id, props, rest); err != nil { ++ panic(err) ++ } + args := []interface{}{id, defaultBar, props} + for _, a := range rest { + args = append(args, a) + } +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SupportsNiceJavaBuilder__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_SupportsNiceJavaBuilder__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_SupportsNiceJavaBuilder__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateNewSupportsNiceJavaBuilderParameters(id *float64, props *SupportsNiceJavaBuilderProps, rest []*string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SupportsNiceJavaBuilder__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_SupportsNiceJavaBuilder__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_SupportsNiceJavaBuilder__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,28 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++) ++ ++func validateNewSupportsNiceJavaBuilderParameters(id *float64, props *SupportsNiceJavaBuilderProps, rest []*string) error { ++ if id == nil { ++ return fmt.Errorf("parameter id is required, but nil was provided") ++ } ++ ++ if err := _jsii_.ValidateStruct(props, func() string { return "parameter props" }); err != nil { ++ return err ++ } ++ ++ if rest == nil { ++ return fmt.Errorf("parameter rest is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SupportsNiceJavaBuilderWithRequiredProps.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_SupportsNiceJavaBuilderWithRequiredProps.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_SupportsNiceJavaBuilderWithRequiredProps.go --runtime-type-checking +@@ -51,10 +51,13 @@ + + + func NewSupportsNiceJavaBuilderWithRequiredProps(id *float64, props *SupportsNiceJavaBuilderProps) SupportsNiceJavaBuilderWithRequiredProps { + _init_.Initialize() + ++ if err := validateNewSupportsNiceJavaBuilderWithRequiredPropsParameters(id, props); err != nil { ++ panic(err) ++ } + j := jsiiProxy_SupportsNiceJavaBuilderWithRequiredProps{} + + _jsii_.Create( + "jsii-calc.SupportsNiceJavaBuilderWithRequiredProps", + []interface{}{id, props}, +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SupportsNiceJavaBuilderWithRequiredProps__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_SupportsNiceJavaBuilderWithRequiredProps__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_SupportsNiceJavaBuilderWithRequiredProps__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateNewSupportsNiceJavaBuilderWithRequiredPropsParameters(id *float64, props *SupportsNiceJavaBuilderProps) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SupportsNiceJavaBuilderWithRequiredProps__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_SupportsNiceJavaBuilderWithRequiredProps__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_SupportsNiceJavaBuilderWithRequiredProps__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,27 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++) ++ ++func validateNewSupportsNiceJavaBuilderWithRequiredPropsParameters(id *float64, props *SupportsNiceJavaBuilderProps) error { ++ if id == nil { ++ return fmt.Errorf("parameter id is required, but nil was provided") ++ } ++ ++ if props == nil { ++ return fmt.Errorf("parameter props is required, but nil was provided") ++ } ++ if err := _jsii_.ValidateStruct(props, func() string { return "parameter props" }); err != nil { ++ return err ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SyncVirtualMethods.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_SyncVirtualMethods.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_SyncVirtualMethods.go --runtime-type-checking +@@ -119,42 +119,57 @@ + s, + ) + } + + func (j *jsiiProxy_SyncVirtualMethods)SetA(val *float64) { ++ if err := j.validateSetAParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "a", + val, + ) + } + + func (j *jsiiProxy_SyncVirtualMethods)SetCallerIsProperty(val *float64) { ++ if err := j.validateSetCallerIsPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "callerIsProperty", + val, + ) + } + + func (j *jsiiProxy_SyncVirtualMethods)SetOtherProperty(val *string) { ++ if err := j.validateSetOtherPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "otherProperty", + val, + ) + } + + func (j *jsiiProxy_SyncVirtualMethods)SetTheProperty(val *string) { ++ if err := j.validateSetThePropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "theProperty", + val, + ) + } + + func (j *jsiiProxy_SyncVirtualMethods)SetValueOfOtherProperty(val *string) { ++ if err := j.validateSetValueOfOtherPropertyParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "valueOfOtherProperty", + val, + ) +@@ -185,18 +200,24 @@ + + return returns + } + + func (s *jsiiProxy_SyncVirtualMethods) ModifyOtherProperty(value *string) { ++ if err := s.validateModifyOtherPropertyParameters(value); err != nil { ++ panic(err) ++ } + _jsii_.InvokeVoid( + s, + "modifyOtherProperty", + []interface{}{value}, + ) + } + + func (s *jsiiProxy_SyncVirtualMethods) ModifyValueOfTheProperty(value *string) { ++ if err := s.validateModifyValueOfThePropertyParameters(value); err != nil { ++ panic(err) ++ } + _jsii_.InvokeVoid( + s, + "modifyValueOfTheProperty", + []interface{}{value}, + ) +@@ -253,10 +274,13 @@ + + return returns + } + + func (s *jsiiProxy_SyncVirtualMethods) VirtualMethod(n *float64) *float64 { ++ if err := s.validateVirtualMethodParameters(n); err != nil { ++ panic(err) ++ } + var returns *float64 + + _jsii_.Invoke( + s, + "virtualMethod", +@@ -266,10 +290,13 @@ + + return returns + } + + func (s *jsiiProxy_SyncVirtualMethods) WriteA(value *float64) { ++ if err := s.validateWriteAParameters(value); err != nil { ++ panic(err) ++ } + _jsii_.InvokeVoid( + s, + "writeA", + []interface{}{value}, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SyncVirtualMethods__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_SyncVirtualMethods__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_SyncVirtualMethods__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,44 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (s *jsiiProxy_SyncVirtualMethods) validateModifyOtherPropertyParameters(value *string) error { ++ return nil ++} ++ ++func (s *jsiiProxy_SyncVirtualMethods) validateModifyValueOfThePropertyParameters(value *string) error { ++ return nil ++} ++ ++func (s *jsiiProxy_SyncVirtualMethods) validateVirtualMethodParameters(n *float64) error { ++ return nil ++} ++ ++func (s *jsiiProxy_SyncVirtualMethods) validateWriteAParameters(value *float64) error { ++ return nil ++} ++ ++func (j *jsiiProxy_SyncVirtualMethods) validateSetAParameters(val *float64) error { ++ return nil ++} ++ ++func (j *jsiiProxy_SyncVirtualMethods) validateSetCallerIsPropertyParameters(val *float64) error { ++ return nil ++} ++ ++func (j *jsiiProxy_SyncVirtualMethods) validateSetOtherPropertyParameters(val *string) error { ++ return nil ++} ++ ++func (j *jsiiProxy_SyncVirtualMethods) validateSetThePropertyParameters(val *string) error { ++ return nil ++} ++ ++func (j *jsiiProxy_SyncVirtualMethods) validateSetValueOfOtherPropertyParameters(val *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SyncVirtualMethods__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_SyncVirtualMethods__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_SyncVirtualMethods__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,82 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (s *jsiiProxy_SyncVirtualMethods) validateModifyOtherPropertyParameters(value *string) error { ++ if value == nil { ++ return fmt.Errorf("parameter value is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (s *jsiiProxy_SyncVirtualMethods) validateModifyValueOfThePropertyParameters(value *string) error { ++ if value == nil { ++ return fmt.Errorf("parameter value is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (s *jsiiProxy_SyncVirtualMethods) validateVirtualMethodParameters(n *float64) error { ++ if n == nil { ++ return fmt.Errorf("parameter n is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (s *jsiiProxy_SyncVirtualMethods) validateWriteAParameters(value *float64) error { ++ if value == nil { ++ return fmt.Errorf("parameter value is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_SyncVirtualMethods) validateSetAParameters(val *float64) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_SyncVirtualMethods) validateSetCallerIsPropertyParameters(val *float64) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_SyncVirtualMethods) validateSetOtherPropertyParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_SyncVirtualMethods) validateSetThePropertyParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (j *jsiiProxy_SyncVirtualMethods) validateSetValueOfOtherPropertyParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_TestStructWithEnum.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_TestStructWithEnum.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_TestStructWithEnum.go --runtime-type-checking +@@ -66,10 +66,13 @@ + t, + ) + } + + func (t *jsiiProxy_TestStructWithEnum) IsStringEnumA(input *StructWithEnum) *bool { ++ if err := t.validateIsStringEnumAParameters(input); err != nil { ++ panic(err) ++ } + var returns *bool + + _jsii_.Invoke( + t, + "isStringEnumA", +@@ -79,10 +82,13 @@ + + return returns + } + + func (t *jsiiProxy_TestStructWithEnum) IsStringEnumB(input *StructWithEnum) *bool { ++ if err := t.validateIsStringEnumBParameters(input); err != nil { ++ panic(err) ++ } + var returns *bool + + _jsii_.Invoke( + t, + "isStringEnumB", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_TestStructWithEnum__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_TestStructWithEnum__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_TestStructWithEnum__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,16 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (t *jsiiProxy_TestStructWithEnum) validateIsStringEnumAParameters(input *StructWithEnum) error { ++ return nil ++} ++ ++func (t *jsiiProxy_TestStructWithEnum) validateIsStringEnumBParameters(input *StructWithEnum) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_TestStructWithEnum__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_TestStructWithEnum__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_TestStructWithEnum__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,34 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++) ++ ++func (t *jsiiProxy_TestStructWithEnum) validateIsStringEnumAParameters(input *StructWithEnum) error { ++ if input == nil { ++ return fmt.Errorf("parameter input is required, but nil was provided") ++ } ++ if err := _jsii_.ValidateStruct(input, func() string { return "parameter input" }); err != nil { ++ return err ++ } ++ ++ return nil ++} ++ ++func (t *jsiiProxy_TestStructWithEnum) validateIsStringEnumBParameters(input *StructWithEnum) error { ++ if input == nil { ++ return fmt.Errorf("parameter input is required, but nil was provided") ++ } ++ if err := _jsii_.ValidateStruct(input, func() string { return "parameter input" }); err != nil { ++ return err ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_UnaryOperation__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_UnaryOperation__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_UnaryOperation__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateNewUnaryOperationParameters(operand scopejsiicalclib.NumericValue) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_UnaryOperation__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_UnaryOperation__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_UnaryOperation__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,20 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++ ++ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ++) ++ ++func validateNewUnaryOperationParameters(operand scopejsiicalclib.NumericValue) error { ++ if operand == nil { ++ return fmt.Errorf("parameter operand is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_UpcasingReflectable.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_UpcasingReflectable.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_UpcasingReflectable.go --runtime-type-checking +@@ -32,10 +32,13 @@ + + + func NewUpcasingReflectable(delegate *map[string]interface{}) UpcasingReflectable { + _init_.Initialize() + ++ if err := validateNewUpcasingReflectableParameters(delegate); err != nil { ++ panic(err) ++ } + j := jsiiProxy_UpcasingReflectable{} + + _jsii_.Create( + "jsii-calc.UpcasingReflectable", + []interface{}{delegate}, +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_UpcasingReflectable__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_UpcasingReflectable__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_UpcasingReflectable__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,12 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateNewUpcasingReflectableParameters(delegate *map[string]interface{}) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_UpcasingReflectable__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_UpcasingReflectable__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_UpcasingReflectable__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func validateNewUpcasingReflectableParameters(delegate *map[string]interface{}) error { ++ if delegate == nil { ++ return fmt.Errorf("parameter delegate is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_UsesInterfaceWithProperties.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_UsesInterfaceWithProperties.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_UsesInterfaceWithProperties.go --runtime-type-checking +@@ -30,10 +30,13 @@ + + + func NewUsesInterfaceWithProperties(obj IInterfaceWithProperties) UsesInterfaceWithProperties { + _init_.Initialize() + ++ if err := validateNewUsesInterfaceWithPropertiesParameters(obj); err != nil { ++ panic(err) ++ } + j := jsiiProxy_UsesInterfaceWithProperties{} + + _jsii_.Create( + "jsii-calc.UsesInterfaceWithProperties", + []interface{}{obj}, +@@ -65,10 +68,13 @@ + + return returns + } + + func (u *jsiiProxy_UsesInterfaceWithProperties) ReadStringAndNumber(ext IInterfaceWithPropertiesExtension) *string { ++ if err := u.validateReadStringAndNumberParameters(ext); err != nil { ++ panic(err) ++ } + var returns *string + + _jsii_.Invoke( + u, + "readStringAndNumber", +@@ -78,10 +84,13 @@ + + return returns + } + + func (u *jsiiProxy_UsesInterfaceWithProperties) WriteAndRead(value *string) *string { ++ if err := u.validateWriteAndReadParameters(value); err != nil { ++ panic(err) ++ } + var returns *string + + _jsii_.Invoke( + u, + "writeAndRead", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_UsesInterfaceWithProperties__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_UsesInterfaceWithProperties__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_UsesInterfaceWithProperties__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,20 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (u *jsiiProxy_UsesInterfaceWithProperties) validateReadStringAndNumberParameters(ext IInterfaceWithPropertiesExtension) error { ++ return nil ++} ++ ++func (u *jsiiProxy_UsesInterfaceWithProperties) validateWriteAndReadParameters(value *string) error { ++ return nil ++} ++ ++func validateNewUsesInterfaceWithPropertiesParameters(obj IInterfaceWithProperties) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_UsesInterfaceWithProperties__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_UsesInterfaceWithProperties__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_UsesInterfaceWithProperties__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,34 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (u *jsiiProxy_UsesInterfaceWithProperties) validateReadStringAndNumberParameters(ext IInterfaceWithPropertiesExtension) error { ++ if ext == nil { ++ return fmt.Errorf("parameter ext is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (u *jsiiProxy_UsesInterfaceWithProperties) validateWriteAndReadParameters(value *string) error { ++ if value == nil { ++ return fmt.Errorf("parameter value is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func validateNewUsesInterfaceWithPropertiesParameters(obj IInterfaceWithProperties) error { ++ if obj == nil { ++ return fmt.Errorf("parameter obj is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_VariadicInvoker.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_VariadicInvoker.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_VariadicInvoker.go --runtime-type-checking +@@ -16,10 +16,13 @@ + } + + func NewVariadicInvoker(method VariadicMethod) VariadicInvoker { + _init_.Initialize() + ++ if err := validateNewVariadicInvokerParameters(method); err != nil { ++ panic(err) ++ } + j := jsiiProxy_VariadicInvoker{} + + _jsii_.Create( + "jsii-calc.VariadicInvoker", + []interface{}{method}, +@@ -38,10 +41,13 @@ + v, + ) + } + + func (v *jsiiProxy_VariadicInvoker) AsArray(values ...*float64) *[]*float64 { ++ if err := v.validateAsArrayParameters(values); err != nil { ++ panic(err) ++ } + args := []interface{}{} + for _, a := range values { + args = append(args, a) + } +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_VariadicInvoker__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_VariadicInvoker__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_VariadicInvoker__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,16 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (v *jsiiProxy_VariadicInvoker) validateAsArrayParameters(values []*float64) error { ++ return nil ++} ++ ++func validateNewVariadicInvokerParameters(method VariadicMethod) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_VariadicInvoker__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_VariadicInvoker__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_VariadicInvoker__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,26 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (v *jsiiProxy_VariadicInvoker) validateAsArrayParameters(values []*float64) error { ++ if values == nil { ++ return fmt.Errorf("parameter values is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func validateNewVariadicInvokerParameters(method VariadicMethod) error { ++ if method == nil { ++ return fmt.Errorf("parameter method is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_VariadicMethod.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_VariadicMethod.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_VariadicMethod.go --runtime-type-checking +@@ -16,10 +16,13 @@ + } + + func NewVariadicMethod(prefix ...*float64) VariadicMethod { + _init_.Initialize() + ++ if err := validateNewVariadicMethodParameters(prefix); err != nil { ++ panic(err) ++ } + args := []interface{}{} + for _, a := range prefix { + args = append(args, a) + } + +@@ -48,10 +51,13 @@ + v, + ) + } + + func (v *jsiiProxy_VariadicMethod) AsArray(first *float64, others ...*float64) *[]*float64 { ++ if err := v.validateAsArrayParameters(first, others); err != nil { ++ panic(err) ++ } + args := []interface{}{first} + for _, a := range others { + args = append(args, a) + } +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_VariadicMethod__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_VariadicMethod__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_VariadicMethod__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,16 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (v *jsiiProxy_VariadicMethod) validateAsArrayParameters(first *float64, others []*float64) error { ++ return nil ++} ++ ++func validateNewVariadicMethodParameters(prefix []*float64) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_VariadicMethod__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_VariadicMethod__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_VariadicMethod__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,30 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (v *jsiiProxy_VariadicMethod) validateAsArrayParameters(first *float64, others []*float64) error { ++ if first == nil { ++ return fmt.Errorf("parameter first is required, but nil was provided") ++ } ++ ++ if others == nil { ++ return fmt.Errorf("parameter others is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func validateNewVariadicMethodParameters(prefix []*float64) error { ++ if prefix == nil { ++ return fmt.Errorf("parameter prefix is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_VirtualMethodPlayground.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_VirtualMethodPlayground.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_VirtualMethodPlayground.go --runtime-type-checking +@@ -42,10 +42,13 @@ + v, + ) + } + + func (v *jsiiProxy_VirtualMethodPlayground) OverrideMeAsync(index *float64) *float64 { ++ if err := v.validateOverrideMeAsyncParameters(index); err != nil { ++ panic(err) ++ } + var returns *float64 + + _jsii_.Invoke( + v, + "overrideMeAsync", +@@ -55,10 +58,13 @@ + + return returns + } + + func (v *jsiiProxy_VirtualMethodPlayground) OverrideMeSync(index *float64) *float64 { ++ if err := v.validateOverrideMeSyncParameters(index); err != nil { ++ panic(err) ++ } + var returns *float64 + + _jsii_.Invoke( + v, + "overrideMeSync", +@@ -68,10 +74,13 @@ + + return returns + } + + func (v *jsiiProxy_VirtualMethodPlayground) ParallelSumAsync(count *float64) *float64 { ++ if err := v.validateParallelSumAsyncParameters(count); err != nil { ++ panic(err) ++ } + var returns *float64 + + _jsii_.Invoke( + v, + "parallelSumAsync", +@@ -81,10 +90,13 @@ + + return returns + } + + func (v *jsiiProxy_VirtualMethodPlayground) SerialSumAsync(count *float64) *float64 { ++ if err := v.validateSerialSumAsyncParameters(count); err != nil { ++ panic(err) ++ } + var returns *float64 + + _jsii_.Invoke( + v, + "serialSumAsync", +@@ -94,10 +106,13 @@ + + return returns + } + + func (v *jsiiProxy_VirtualMethodPlayground) SumSync(count *float64) *float64 { ++ if err := v.validateSumSyncParameters(count); err != nil { ++ panic(err) ++ } + var returns *float64 + + _jsii_.Invoke( + v, + "sumSync", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_VirtualMethodPlayground__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_VirtualMethodPlayground__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_VirtualMethodPlayground__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,28 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (v *jsiiProxy_VirtualMethodPlayground) validateOverrideMeAsyncParameters(index *float64) error { ++ return nil ++} ++ ++func (v *jsiiProxy_VirtualMethodPlayground) validateOverrideMeSyncParameters(index *float64) error { ++ return nil ++} ++ ++func (v *jsiiProxy_VirtualMethodPlayground) validateParallelSumAsyncParameters(count *float64) error { ++ return nil ++} ++ ++func (v *jsiiProxy_VirtualMethodPlayground) validateSerialSumAsyncParameters(count *float64) error { ++ return nil ++} ++ ++func (v *jsiiProxy_VirtualMethodPlayground) validateSumSyncParameters(count *float64) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_VirtualMethodPlayground__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/jsiicalc_VirtualMethodPlayground__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsiicalc_VirtualMethodPlayground__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,50 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc ++ ++import ( ++ "fmt" ++) ++ ++func (v *jsiiProxy_VirtualMethodPlayground) validateOverrideMeAsyncParameters(index *float64) error { ++ if index == nil { ++ return fmt.Errorf("parameter index is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (v *jsiiProxy_VirtualMethodPlayground) validateOverrideMeSyncParameters(index *float64) error { ++ if index == nil { ++ return fmt.Errorf("parameter index is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (v *jsiiProxy_VirtualMethodPlayground) validateParallelSumAsyncParameters(count *float64) error { ++ if count == nil { ++ return fmt.Errorf("parameter count is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (v *jsiiProxy_VirtualMethodPlayground) validateSerialSumAsyncParameters(count *float64) error { ++ if count == nil { ++ return fmt.Errorf("parameter count is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func (v *jsiiProxy_VirtualMethodPlayground) validateSumSyncParameters(count *float64) error { ++ if count == nil { ++ return fmt.Errorf("parameter count is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2530/module2530_MyClass.go.diff 1`] = ` +--- go/jsiicalc/module2530/module2530_MyClass.go --no-runtime-type-checking ++++ go/jsiicalc/module2530/module2530_MyClass.go --runtime-type-checking +@@ -18,10 +18,13 @@ + } + + func NewMyClass(_arg *float64) MyClass { + _init_.Initialize() + ++ if err := validateNewMyClassParameters(_arg); err != nil { ++ panic(err) ++ } + j := jsiiProxy_MyClass{} + + _jsii_.Create( + "jsii-calc.module2530.MyClass", + []interface{}{_arg}, +@@ -42,18 +45,24 @@ + } + + func MyClass_Bar(_arg *bool) { + _init_.Initialize() + ++ if err := validateMyClass_BarParameters(_arg); err != nil { ++ panic(err) ++ } + _jsii_.StaticInvokeVoid( + "jsii-calc.module2530.MyClass", + "bar", + []interface{}{_arg}, + ) + } + + func (m *jsiiProxy_MyClass) Foo(_arg *string) { ++ if err := m.validateFooParameters(_arg); err != nil { ++ panic(err) ++ } + _jsii_.InvokeVoid( + m, + "foo", + []interface{}{_arg}, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2530/module2530_MyClass__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/module2530/module2530_MyClass__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/module2530/module2530_MyClass__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,19 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++package module2530 ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (m *jsiiProxy_MyClass) validateFooParameters(_arg *string) error { ++ return nil ++} ++ ++func validateMyClass_BarParameters(_arg *bool) error { ++ return nil ++} ++ ++func validateNewMyClassParameters(_arg *float64) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2530/module2530_MyClass__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/module2530/module2530_MyClass__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/module2530/module2530_MyClass__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,33 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++package module2530 ++ ++import ( ++ "fmt" ++) ++ ++func (m *jsiiProxy_MyClass) validateFooParameters(_arg *string) error { ++ if _arg == nil { ++ return fmt.Errorf("parameter _arg is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func validateMyClass_BarParameters(_arg *bool) error { ++ if _arg == nil { ++ return fmt.Errorf("parameter _arg is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func validateNewMyClassParameters(_arg *float64) error { ++ if _arg == nil { ++ return fmt.Errorf("parameter _arg is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2647/module2647_ExtendAndImplement.go.diff 1`] = ` +--- go/jsiicalc/module2647/module2647_ExtendAndImplement.go --no-runtime-type-checking ++++ go/jsiicalc/module2647/module2647_ExtendAndImplement.go --runtime-type-checking +@@ -31,10 +31,13 @@ + + // Deprecated. + func NewExtendAndImplement(very scopejsiicalcbaseofbase.Very) ExtendAndImplement { + _init_.Initialize() + ++ if err := validateNewExtendAndImplementParameters(very); err != nil { ++ panic(err) ++ } + j := jsiiProxy_ExtendAndImplement{} + + _jsii_.Create( + "jsii-calc.module2647.ExtendAndImplement", + []interface{}{very}, +@@ -54,10 +57,13 @@ + e, + ) + } + + func (e *jsiiProxy_ExtendAndImplement) Foo(obj jcb.IBaseInterface) { ++ if err := e.validateFooParameters(obj); err != nil { ++ panic(err) ++ } + _jsii_.InvokeVoid( + e, + "foo", + []interface{}{obj}, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2647/module2647_ExtendAndImplement__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/module2647/module2647_ExtendAndImplement__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/module2647/module2647_ExtendAndImplement__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,15 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++package module2647 ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (e *jsiiProxy_ExtendAndImplement) validateFooParameters(obj jcb.IBaseInterface) error { ++ return nil ++} ++ ++func validateNewExtendAndImplementParameters(very scopejsiicalcbaseofbase.Very) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2647/module2647_ExtendAndImplement__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/module2647/module2647_ExtendAndImplement__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/module2647/module2647_ExtendAndImplement__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,28 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++package module2647 ++ ++import ( ++ "fmt" ++ ++ "github.com/aws/jsii/jsii-calc/go/jcb" ++ "github.com/aws/jsii/jsii-calc/go/scopejsiicalcbaseofbase/v2" ++) ++ ++func (e *jsiiProxy_ExtendAndImplement) validateFooParameters(obj jcb.IBaseInterface) error { ++ if obj == nil { ++ return fmt.Errorf("parameter obj is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func validateNewExtendAndImplementParameters(very scopejsiicalcbaseofbase.Very) error { ++ if very == nil { ++ return fmt.Errorf("parameter very is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2689/methods/methods_MyClass.go.diff 1`] = ` +--- go/jsiicalc/module2689/methods/methods_MyClass.go --no-runtime-type-checking ++++ go/jsiicalc/module2689/methods/methods_MyClass.go --runtime-type-checking +@@ -41,18 +41,24 @@ + m, + ) + } + + func (m *jsiiProxy_MyClass) Bar(_bar *map[string]*jcb.BaseProps) { ++ if err := m.validateBarParameters(_bar); err != nil { ++ panic(err) ++ } + _jsii_.InvokeVoid( + m, + "bar", + []interface{}{_bar}, + ) + } + + func (m *jsiiProxy_MyClass) Foo(_values *[]scopejsiicalclib.Number) { ++ if err := m.validateFooParameters(_values); err != nil { ++ panic(err) ++ } + _jsii_.InvokeVoid( + m, + "foo", + []interface{}{_values}, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2689/methods/methods_MyClass__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/module2689/methods/methods_MyClass__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/module2689/methods/methods_MyClass__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,15 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++package methods ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (m *jsiiProxy_MyClass) validateBarParameters(_bar *map[string]*jcb.BaseProps) error { ++ return nil ++} ++ ++func (m *jsiiProxy_MyClass) validateFooParameters(_values *[]scopejsiicalclib.Number) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2689/methods/methods_MyClass__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/module2689/methods/methods_MyClass__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/module2689/methods/methods_MyClass__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,35 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++package methods ++ ++import ( ++ "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++ ++ "github.com/aws/jsii/jsii-calc/go/jcb" ++ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ++) ++ ++func (m *jsiiProxy_MyClass) validateBarParameters(_bar *map[string]*jcb.BaseProps) error { ++ if _bar == nil { ++ return fmt.Errorf("parameter _bar is required, but nil was provided") ++ } ++ for idx_f35a19, v := range *_bar { ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter _bar[%#v]", idx_f35a19) }); err != nil { ++ return err ++ } ++ } ++ ++ return nil ++} ++ ++func (m *jsiiProxy_MyClass) validateFooParameters(_values *[]scopejsiicalclib.Number) error { ++ if _values == nil { ++ return fmt.Errorf("parameter _values is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/pythonself_ClassWithSelf.go.diff 1`] = ` +--- go/jsiicalc/pythonself/pythonself_ClassWithSelf.go --no-runtime-type-checking ++++ go/jsiicalc/pythonself/pythonself_ClassWithSelf.go --runtime-type-checking +@@ -27,10 +27,13 @@ + + + func NewClassWithSelf(self *string) ClassWithSelf { + _init_.Initialize() + ++ if err := validateNewClassWithSelfParameters(self); err != nil { ++ panic(err) ++ } + j := jsiiProxy_ClassWithSelf{} + + _jsii_.Create( + "jsii-calc.PythonSelf.ClassWithSelf", + []interface{}{self}, +@@ -49,10 +52,13 @@ + c, + ) + } + + func (c *jsiiProxy_ClassWithSelf) Method(self *float64) *string { ++ if err := c.validateMethodParameters(self); err != nil { ++ panic(err) ++ } + var returns *string + + _jsii_.Invoke( + c, + "method", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/pythonself_ClassWithSelf__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/pythonself/pythonself_ClassWithSelf__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/pythonself/pythonself_ClassWithSelf__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,15 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++package pythonself ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (c *jsiiProxy_ClassWithSelf) validateMethodParameters(self *float64) error { ++ return nil ++} ++ ++func validateNewClassWithSelfParameters(self *string) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/pythonself_ClassWithSelf__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/pythonself/pythonself_ClassWithSelf__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/pythonself/pythonself_ClassWithSelf__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,25 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++package pythonself ++ ++import ( ++ "fmt" ++) ++ ++func (c *jsiiProxy_ClassWithSelf) validateMethodParameters(self *float64) error { ++ if self == nil { ++ return fmt.Errorf("parameter self is required, but nil was provided") ++ } ++ ++ return nil ++} ++ ++func validateNewClassWithSelfParameters(self *string) error { ++ if self == nil { ++ return fmt.Errorf("parameter self is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/pythonself_ClassWithSelfKwarg.go.diff 1`] = ` +--- go/jsiicalc/pythonself/pythonself_ClassWithSelfKwarg.go --no-runtime-type-checking ++++ go/jsiicalc/pythonself/pythonself_ClassWithSelfKwarg.go --runtime-type-checking +@@ -26,10 +26,13 @@ + + + func NewClassWithSelfKwarg(props *StructWithSelf) ClassWithSelfKwarg { + _init_.Initialize() + ++ if err := validateNewClassWithSelfKwargParameters(props); err != nil { ++ panic(err) ++ } + j := jsiiProxy_ClassWithSelfKwarg{} + + _jsii_.Create( + "jsii-calc.PythonSelf.ClassWithSelfKwarg", + []interface{}{props}, +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/pythonself_ClassWithSelfKwarg__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/pythonself/pythonself_ClassWithSelfKwarg__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/pythonself/pythonself_ClassWithSelfKwarg__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++package pythonself ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateNewClassWithSelfKwargParameters(props *StructWithSelf) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/pythonself_ClassWithSelfKwarg__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/pythonself/pythonself_ClassWithSelfKwarg__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/pythonself/pythonself_ClassWithSelfKwarg__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,22 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++package pythonself ++ ++import ( ++ "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++) ++ ++func validateNewClassWithSelfKwargParameters(props *StructWithSelf) error { ++ if props == nil { ++ return fmt.Errorf("parameter props is required, but nil was provided") ++ } ++ if err := _jsii_.ValidateStruct(props, func() string { return "parameter props" }); err != nil { ++ return err ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/pythonself_IInterfaceWithSelf.go.diff 1`] = ` +--- go/jsiicalc/pythonself/pythonself_IInterfaceWithSelf.go --no-runtime-type-checking ++++ go/jsiicalc/pythonself/pythonself_IInterfaceWithSelf.go --runtime-type-checking +@@ -12,10 +12,13 @@ + type jsiiProxy_IInterfaceWithSelf struct { + _ byte // padding + } + + func (i *jsiiProxy_IInterfaceWithSelf) Method(self *float64) *string { ++ if err := i.validateMethodParameters(self); err != nil { ++ panic(err) ++ } + var returns *string + + _jsii_.Invoke( + i, + "method", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/pythonself_IInterfaceWithSelf__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/pythonself/pythonself_IInterfaceWithSelf__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/pythonself/pythonself_IInterfaceWithSelf__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++package pythonself ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (i *jsiiProxy_IInterfaceWithSelf) validateMethodParameters(self *float64) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/pythonself_IInterfaceWithSelf__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/pythonself/pythonself_IInterfaceWithSelf__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/pythonself/pythonself_IInterfaceWithSelf__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++package pythonself ++ ++import ( ++ "fmt" ++) ++ ++func (i *jsiiProxy_IInterfaceWithSelf) validateMethodParameters(self *float64) error { ++ if self == nil { ++ return fmt.Errorf("parameter self is required, but nil was provided") ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/isolated/isolated_Kwargs.go.diff 1`] = ` +--- go/jsiicalc/submodule/isolated/isolated_Kwargs.go --no-runtime-type-checking ++++ go/jsiicalc/submodule/isolated/isolated_Kwargs.go --runtime-type-checking +@@ -17,10 +17,13 @@ + } + + func Kwargs_Method(props *child.KwargsProps) *bool { + _init_.Initialize() + ++ if err := validateKwargs_MethodParameters(props); err != nil { ++ panic(err) ++ } + var returns *bool + + _jsii_.StaticInvoke( + "jsii-calc.submodule.isolated.Kwargs", + "method", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/isolated/isolated_Kwargs__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/submodule/isolated/isolated_Kwargs__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/submodule/isolated/isolated_Kwargs__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++package isolated ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateKwargs_MethodParameters(props *child.KwargsProps) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/isolated/isolated_Kwargs__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/submodule/isolated/isolated_Kwargs__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/submodule/isolated/isolated_Kwargs__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,19 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++package isolated ++ ++import ( ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++ ++ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/submodule/child" ++) ++ ++func validateKwargs_MethodParameters(props *child.KwargsProps) error { ++ if err := _jsii_.ValidateStruct(props, func() string { return "parameter props" }); err != nil { ++ return err ++ } ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/submodule_MyClass.go.diff 1`] = ` +--- go/jsiicalc/submodule/submodule_MyClass.go --no-runtime-type-checking ++++ go/jsiicalc/submodule/submodule_MyClass.go --runtime-type-checking +@@ -79,10 +79,13 @@ + + + func NewMyClass(props *child.SomeStruct) MyClass { + _init_.Initialize() + ++ if err := validateNewMyClassParameters(props); err != nil { ++ panic(err) ++ } + j := jsiiProxy_MyClass{} + + _jsii_.Create( + "jsii-calc.submodule.MyClass", + []interface{}{props}, +@@ -109,10 +112,13 @@ + val, + ) + } + + func (m *jsiiProxy_MyClass) MethodWithSpecialParam(param *param.SpecialParameter) *string { ++ if err := m.validateMethodWithSpecialParamParameters(param); err != nil { ++ panic(err) ++ } + var returns *string + + _jsii_.Invoke( + m, + "methodWithSpecialParam", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/submodule_MyClass__no_runtime_type_checking.go.diff 1`] = ` +--- go/jsiicalc/submodule/submodule_MyClass__no_runtime_type_checking.go --no-runtime-type-checking ++++ go/jsiicalc/submodule/submodule_MyClass__no_runtime_type_checking.go --runtime-type-checking +@@ -0,0 +1,15 @@ ++//go:build no_runtime_type_checking ++// +build no_runtime_type_checking ++ ++package submodule ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func (m *jsiiProxy_MyClass) validateMethodWithSpecialParamParameters(param *param.SpecialParameter) error { ++ return nil ++} ++ ++func validateNewMyClassParameters(props *child.SomeStruct) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/submodule_MyClass__runtime_type_checks.go.diff 1`] = ` +--- go/jsiicalc/submodule/submodule_MyClass__runtime_type_checks.go --no-runtime-type-checking ++++ go/jsiicalc/submodule/submodule_MyClass__runtime_type_checks.go --runtime-type-checking +@@ -0,0 +1,36 @@ ++//go:build !no_runtime_type_checking ++// +build !no_runtime_type_checking ++ ++package submodule ++ ++import ( ++ "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++ ++ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/submodule/child" ++ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/submodule/param" ++) ++ ++func (m *jsiiProxy_MyClass) validateMethodWithSpecialParamParameters(param *param.SpecialParameter) error { ++ if param == nil { ++ return fmt.Errorf("parameter param is required, but nil was provided") ++ } ++ if err := _jsii_.ValidateStruct(param, func() string { return "parameter param" }); err != nil { ++ return err ++ } ++ ++ return nil ++} ++ ++func validateNewMyClassParameters(props *child.SomeStruct) error { ++ if props == nil { ++ return fmt.Errorf("parameter props is required, but nil was provided") ++ } ++ if err := _jsii_.ValidateStruct(props, func() string { return "parameter props" }); err != nil { ++ return err ++ } ++ ++ return nil ++} ++ `; diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.js.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.js.snap index 0e10379ee7..812d4648ea 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.js.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.js.snap @@ -376,10 +376,6 @@ class BaseProps(scope.jsii_calc_base_of_base.VeryBaseProps): :param foo: - :param bar: - ''' - if __debug__: - type_hints = typing.get_type_hints(BaseProps.__init__) - check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) - check_type(argname="argument bar", value=bar, expected_type=type_hints["bar"]) self._values: typing.Dict[str, typing.Any] = { "foo": foo, "bar": bar, @@ -447,9 +443,6 @@ class StaticConsumer( ''' :param args: - ''' - if __debug__: - type_hints = typing.get_type_hints(StaticConsumer.consume) - check_type(argname="argument args", value=args, expected_type=typing.Tuple[type_hints["args"], ...]) # pyright: ignore [reportGeneralTypeIssues] return typing.cast(None, jsii.sinvoke(cls, "consume", [*args])) @@ -508,32 +501,32 @@ exports[`Generated code for "@scope/jsii-calc-base": / `; exports[`Generated code for "@scope/jsii-calc-base": /python/src/scope/jsii_calc_base/__init__.py.diff 1`] = ` ---- python/src/scope/jsii_calc_base/__init__.py --runtime-type-checking -+++ python/src/scope/jsii_calc_base/__init__.py --no-runtime-type-checking -@@ -50,14 +50,10 @@ +--- python/src/scope/jsii_calc_base/__init__.py --no-runtime-type-checking ++++ python/src/scope/jsii_calc_base/__init__.py --runtime-type-checking +@@ -50,10 +50,14 @@ ) -> None: ''' :param foo: - :param bar: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(BaseProps.__init__) -- check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) -- check_type(argname="argument bar", value=bar, expected_type=type_hints["bar"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(BaseProps.__init__) ++ check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) ++ check_type(argname="argument bar", value=bar, expected_type=type_hints["bar"]) self._values: typing.Dict[str, typing.Any] = { "foo": foo, "bar": bar, } -@@ -121,13 +117,10 @@ +@@ -117,10 +121,13 @@ @builtins.classmethod def consume(cls, *args: typing.Any) -> None: ''' :param args: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(StaticConsumer.consume) -- check_type(argname="argument args", value=args, expected_type=typing.Tuple[type_hints["args"], ...]) # pyright: ignore [reportGeneralTypeIssues] ++ if __debug__: ++ type_hints = typing.get_type_hints(StaticConsumer.consume) ++ check_type(argname="argument args", value=args, expected_type=typing.Tuple[type_hints["args"], ...]) # pyright: ignore [reportGeneralTypeIssues] return typing.cast(None, jsii.sinvoke(cls, "consume", [*args])) @@ -905,9 +898,6 @@ class StaticConsumer( ''' :param _args: - ''' - if __debug__: - type_hints = typing.get_type_hints(StaticConsumer.consume) - check_type(argname="argument _args", value=_args, expected_type=typing.Tuple[type_hints["_args"], ...]) # pyright: ignore [reportGeneralTypeIssues] return typing.cast(None, jsii.sinvoke(cls, "consume", [*_args])) @@ -938,9 +928,6 @@ class VeryBaseProps: ''' :param foo: - ''' - if __debug__: - type_hints = typing.get_type_hints(VeryBaseProps.__init__) - check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) self._values: typing.Dict[str, typing.Any] = { "foo": foo, } @@ -1019,31 +1006,31 @@ exports[`Generated code for "@scope/jsii-calc-base-of-base": /python/src/scope/jsii_calc_base_of_base/__init__.py.diff 1`] = ` ---- python/src/scope/jsii_calc_base_of_base/__init__.py --runtime-type-checking -+++ python/src/scope/jsii_calc_base_of_base/__init__.py --no-runtime-type-checking -@@ -39,13 +39,10 @@ +--- python/src/scope/jsii_calc_base_of_base/__init__.py --no-runtime-type-checking ++++ python/src/scope/jsii_calc_base_of_base/__init__.py --runtime-type-checking +@@ -39,10 +39,13 @@ @builtins.classmethod def consume(cls, *_args: typing.Any) -> None: ''' :param _args: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(StaticConsumer.consume) -- check_type(argname="argument _args", value=_args, expected_type=typing.Tuple[type_hints["_args"], ...]) # pyright: ignore [reportGeneralTypeIssues] ++ if __debug__: ++ type_hints = typing.get_type_hints(StaticConsumer.consume) ++ check_type(argname="argument _args", value=_args, expected_type=typing.Tuple[type_hints["_args"], ...]) # pyright: ignore [reportGeneralTypeIssues] return typing.cast(None, jsii.sinvoke(cls, "consume", [*_args])) class Very(metaclass=jsii.JSIIMeta, jsii_type="@scope/jsii-calc-base-of-base.Very"): '''(experimental) Something here. -@@ -72,13 +69,10 @@ +@@ -69,10 +72,13 @@ class VeryBaseProps: def __init__(self, *, foo: Very) -> None: ''' :param foo: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(VeryBaseProps.__init__) -- check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(VeryBaseProps.__init__) ++ check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) self._values: typing.Dict[str, typing.Any] = { "foo": foo, } @@ -1416,9 +1403,6 @@ class BaseFor2647( :stability: deprecated ''' - if __debug__: - type_hints = typing.get_type_hints(BaseFor2647.__init__) - check_type(argname="argument very", value=very, expected_type=type_hints["very"]) jsii.create(self.__class__, self, [very]) @jsii.member(jsii_name="foo") @@ -1428,9 +1412,6 @@ class BaseFor2647( :stability: deprecated ''' - if __debug__: - type_hints = typing.get_type_hints(BaseFor2647.foo) - check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) return typing.cast(None, jsii.invoke(self, "foo", [obj])) @@ -1452,10 +1433,6 @@ class DiamondLeft: :stability: deprecated ''' - if __debug__: - type_hints = typing.get_type_hints(DiamondLeft.__init__) - check_type(argname="argument hoisted_top", value=hoisted_top, expected_type=type_hints["hoisted_top"]) - check_type(argname="argument left", value=left, expected_type=type_hints["left"]) self._values: typing.Dict[str, typing.Any] = {} if hoisted_top is not None: self._values["hoisted_top"] = hoisted_top @@ -1508,10 +1485,6 @@ class DiamondRight: :stability: deprecated ''' - if __debug__: - type_hints = typing.get_type_hints(DiamondRight.__init__) - check_type(argname="argument hoisted_top", value=hoisted_top, expected_type=type_hints["hoisted_top"]) - check_type(argname="argument right", value=right, expected_type=type_hints["right"]) self._values: typing.Dict[str, typing.Any] = {} if hoisted_top is not None: self._values["hoisted_top"] = hoisted_top @@ -1713,11 +1686,6 @@ class MyFirstStruct: :stability: deprecated ''' - if __debug__: - type_hints = typing.get_type_hints(MyFirstStruct.__init__) - check_type(argname="argument anumber", value=anumber, expected_type=type_hints["anumber"]) - check_type(argname="argument astring", value=astring, expected_type=type_hints["astring"]) - check_type(argname="argument first_optional", value=first_optional, expected_type=type_hints["first_optional"]) self._values: typing.Dict[str, typing.Any] = { "anumber": anumber, "astring": astring, @@ -1878,11 +1846,6 @@ class StructWithOnlyOptionals: :stability: deprecated ''' - if __debug__: - type_hints = typing.get_type_hints(StructWithOnlyOptionals.__init__) - check_type(argname="argument optional1", value=optional1, expected_type=type_hints["optional1"]) - check_type(argname="argument optional2", value=optional2, expected_type=type_hints["optional2"]) - check_type(argname="argument optional3", value=optional3, expected_type=type_hints["optional3"]) self._values: typing.Dict[str, typing.Any] = {} if optional1 is not None: self._values["optional1"] = optional1 @@ -1946,9 +1909,6 @@ class Number( :stability: deprecated ''' - if __debug__: - type_hints = typing.get_type_hints(Number.__init__) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.create(self.__class__, self, [value]) @builtins.property @@ -2125,9 +2085,6 @@ class NestingClass( :stability: deprecated ''' - if __debug__: - type_hints = typing.get_type_hints(NestingClass.NestedStruct.__init__) - check_type(argname="argument name", value=name, expected_type=type_hints["name"]) self._values: typing.Dict[str, typing.Any] = { "name": name, } @@ -2166,10 +2123,6 @@ class ReflectableEntry: :stability: deprecated ''' - if __debug__: - type_hints = typing.get_type_hints(ReflectableEntry.__init__) - check_type(argname="argument key", value=key, expected_type=type_hints["key"]) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) self._values: typing.Dict[str, typing.Any] = { "key": key, "value": value, @@ -2229,9 +2182,6 @@ class Reflector( :stability: deprecated ''' - if __debug__: - type_hints = typing.get_type_hints(Reflector.as_map) - check_type(argname="argument reflectable", value=reflectable, expected_type=type_hints["reflectable"]) return typing.cast(typing.Mapping[builtins.str, typing.Any], jsii.invoke(self, "asMap", [reflectable])) @@ -2263,17 +2213,17 @@ exports[`Generated code for "@scope/jsii-calc-lib": / 1 `; exports[`Generated code for "@scope/jsii-calc-lib": /python/src/scope/jsii_calc_lib/__init__.py.diff 1`] = ` ---- python/src/scope/jsii_calc_lib/__init__.py --runtime-type-checking -+++ python/src/scope/jsii_calc_lib/__init__.py --no-runtime-type-checking -@@ -34,25 +34,19 @@ +--- python/src/scope/jsii_calc_lib/__init__.py --no-runtime-type-checking ++++ python/src/scope/jsii_calc_lib/__init__.py --runtime-type-checking +@@ -34,19 +34,25 @@ ''' :param very: - :stability: deprecated ''' -- if __debug__: -- type_hints = typing.get_type_hints(BaseFor2647.__init__) -- check_type(argname="argument very", value=very, expected_type=type_hints["very"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(BaseFor2647.__init__) ++ check_type(argname="argument very", value=very, expected_type=type_hints["very"]) jsii.create(self.__class__, self, [very]) @jsii.member(jsii_name="foo") @@ -2283,85 +2233,85 @@ exports[`Generated code for "@scope/jsii-calc-lib": /py :stability: deprecated ''' -- if __debug__: -- type_hints = typing.get_type_hints(BaseFor2647.foo) -- check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(BaseFor2647.foo) ++ check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) return typing.cast(None, jsii.invoke(self, "foo", [obj])) @jsii.data_type( jsii_type="@scope/jsii-calc-lib.DiamondLeft", -@@ -70,14 +64,10 @@ +@@ -64,10 +70,14 @@ :param hoisted_top: :param left: :stability: deprecated ''' -- if __debug__: -- type_hints = typing.get_type_hints(DiamondLeft.__init__) -- check_type(argname="argument hoisted_top", value=hoisted_top, expected_type=type_hints["hoisted_top"]) -- check_type(argname="argument left", value=left, expected_type=type_hints["left"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(DiamondLeft.__init__) ++ check_type(argname="argument hoisted_top", value=hoisted_top, expected_type=type_hints["hoisted_top"]) ++ check_type(argname="argument left", value=left, expected_type=type_hints["left"]) self._values: typing.Dict[str, typing.Any] = {} if hoisted_top is not None: self._values["hoisted_top"] = hoisted_top if left is not None: self._values["left"] = left -@@ -126,14 +116,10 @@ +@@ -116,10 +126,14 @@ :param hoisted_top: :param right: :stability: deprecated ''' -- if __debug__: -- type_hints = typing.get_type_hints(DiamondRight.__init__) -- check_type(argname="argument hoisted_top", value=hoisted_top, expected_type=type_hints["hoisted_top"]) -- check_type(argname="argument right", value=right, expected_type=type_hints["right"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(DiamondRight.__init__) ++ check_type(argname="argument hoisted_top", value=hoisted_top, expected_type=type_hints["hoisted_top"]) ++ check_type(argname="argument right", value=right, expected_type=type_hints["right"]) self._values: typing.Dict[str, typing.Any] = {} if hoisted_top is not None: self._values["hoisted_top"] = hoisted_top if right is not None: self._values["right"] = right -@@ -331,15 +317,10 @@ +@@ -317,10 +331,15 @@ :param astring: (deprecated) A string value. :param first_optional: :stability: deprecated ''' -- if __debug__: -- type_hints = typing.get_type_hints(MyFirstStruct.__init__) -- check_type(argname="argument anumber", value=anumber, expected_type=type_hints["anumber"]) -- check_type(argname="argument astring", value=astring, expected_type=type_hints["astring"]) -- check_type(argname="argument first_optional", value=first_optional, expected_type=type_hints["first_optional"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(MyFirstStruct.__init__) ++ check_type(argname="argument anumber", value=anumber, expected_type=type_hints["anumber"]) ++ check_type(argname="argument astring", value=astring, expected_type=type_hints["astring"]) ++ check_type(argname="argument first_optional", value=first_optional, expected_type=type_hints["first_optional"]) self._values: typing.Dict[str, typing.Any] = { "anumber": anumber, "astring": astring, } if first_optional is not None: -@@ -496,15 +477,10 @@ +@@ -477,10 +496,15 @@ :param optional2: :param optional3: :stability: deprecated ''' -- if __debug__: -- type_hints = typing.get_type_hints(StructWithOnlyOptionals.__init__) -- check_type(argname="argument optional1", value=optional1, expected_type=type_hints["optional1"]) -- check_type(argname="argument optional2", value=optional2, expected_type=type_hints["optional2"]) -- check_type(argname="argument optional3", value=optional3, expected_type=type_hints["optional3"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(StructWithOnlyOptionals.__init__) ++ check_type(argname="argument optional1", value=optional1, expected_type=type_hints["optional1"]) ++ check_type(argname="argument optional2", value=optional2, expected_type=type_hints["optional2"]) ++ check_type(argname="argument optional3", value=optional3, expected_type=type_hints["optional3"]) self._values: typing.Dict[str, typing.Any] = {} if optional1 is not None: self._values["optional1"] = optional1 if optional2 is not None: self._values["optional2"] = optional2 -@@ -564,13 +540,10 @@ +@@ -540,10 +564,13 @@ :param value: The number. :stability: deprecated ''' -- if __debug__: -- type_hints = typing.get_type_hints(Number.__init__) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(Number.__init__) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.create(self.__class__, self, [value]) @builtins.property @@ -2370,46 +2320,46 @@ exports[`Generated code for "@scope/jsii-calc-lib": /py `; exports[`Generated code for "@scope/jsii-calc-lib": /python/src/scope/jsii_calc_lib/custom_submodule_name/__init__.py.diff 1`] = ` ---- python/src/scope/jsii_calc_lib/custom_submodule_name/__init__.py --runtime-type-checking -+++ python/src/scope/jsii_calc_lib/custom_submodule_name/__init__.py --no-runtime-type-checking -@@ -97,13 +97,10 @@ +--- python/src/scope/jsii_calc_lib/custom_submodule_name/__init__.py --no-runtime-type-checking ++++ python/src/scope/jsii_calc_lib/custom_submodule_name/__init__.py --runtime-type-checking +@@ -97,10 +97,13 @@ :param name: :stability: deprecated ''' -- if __debug__: -- type_hints = typing.get_type_hints(NestingClass.NestedStruct.__init__) -- check_type(argname="argument name", value=name, expected_type=type_hints["name"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(NestingClass.NestedStruct.__init__) ++ check_type(argname="argument name", value=name, expected_type=type_hints["name"]) self._values: typing.Dict[str, typing.Any] = { "name": name, } @builtins.property -@@ -138,14 +135,10 @@ +@@ -135,10 +138,14 @@ :param key: :param value: :stability: deprecated ''' -- if __debug__: -- type_hints = typing.get_type_hints(ReflectableEntry.__init__) -- check_type(argname="argument key", value=key, expected_type=type_hints["key"]) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ReflectableEntry.__init__) ++ check_type(argname="argument key", value=key, expected_type=type_hints["key"]) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) self._values: typing.Dict[str, typing.Any] = { "key": key, "value": value, } -@@ -201,13 +194,10 @@ +@@ -194,10 +201,13 @@ ''' :param reflectable: - :stability: deprecated ''' -- if __debug__: -- type_hints = typing.get_type_hints(Reflector.as_map) -- check_type(argname="argument reflectable", value=reflectable, expected_type=type_hints["reflectable"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(Reflector.as_map) ++ check_type(argname="argument reflectable", value=reflectable, expected_type=type_hints["reflectable"]) return typing.cast(typing.Mapping[builtins.str, typing.Any], jsii.invoke(self, "asMap", [reflectable])) @@ -2984,9 +2934,6 @@ class AbstractSuite( :param seed: a \`\`string\`\`. ''' - if __debug__: - type_hints = typing.get_type_hints(AbstractSuite.work_it_all) - check_type(argname="argument seed", value=seed, expected_type=type_hints["seed"]) return typing.cast(builtins.str, jsii.invoke(self, "workItAll", [seed])) @builtins.property @@ -3007,9 +2954,6 @@ class _AbstractSuiteProxy(AbstractSuite): ''' :param str: - ''' - if __debug__: - type_hints = typing.get_type_hints(AbstractSuite._some_method) - check_type(argname="argument str", value=str, expected_type=type_hints["str"]) return typing.cast(builtins.str, jsii.invoke(self, "someMethod", [str])) @builtins.property @@ -3019,9 +2963,6 @@ class _AbstractSuiteProxy(AbstractSuite): @_property.setter def _property(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(AbstractSuite, "_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "property", value) # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class @@ -3043,9 +2984,6 @@ class AllTypes(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.AllTypes"): ''' :param inp: - ''' - if __debug__: - type_hints = typing.get_type_hints(AllTypes.any_in) - check_type(argname="argument inp", value=inp, expected_type=type_hints["inp"]) return typing.cast(None, jsii.invoke(self, "anyIn", [inp])) @jsii.member(jsii_name="anyOut") @@ -3057,9 +2995,6 @@ class AllTypes(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.AllTypes"): ''' :param value: - ''' - if __debug__: - type_hints = typing.get_type_hints(AllTypes.enum_method) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast("StringEnum", jsii.invoke(self, "enumMethod", [value])) @builtins.property @@ -3074,9 +3009,6 @@ class AllTypes(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.AllTypes"): @any_array_property.setter def any_array_property(self, value: typing.List[typing.Any]) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(AllTypes, "any_array_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "anyArrayProperty", value) @builtins.property @@ -3086,9 +3018,6 @@ class AllTypes(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.AllTypes"): @any_map_property.setter def any_map_property(self, value: typing.Mapping[builtins.str, typing.Any]) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(AllTypes, "any_map_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "anyMapProperty", value) @builtins.property @@ -3098,9 +3027,6 @@ class AllTypes(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.AllTypes"): @any_property.setter def any_property(self, value: typing.Any) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(AllTypes, "any_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "anyProperty", value) @builtins.property @@ -3110,9 +3036,6 @@ class AllTypes(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.AllTypes"): @array_property.setter def array_property(self, value: typing.List[builtins.str]) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(AllTypes, "array_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "arrayProperty", value) @builtins.property @@ -3122,9 +3045,6 @@ class AllTypes(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.AllTypes"): @boolean_property.setter def boolean_property(self, value: builtins.bool) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(AllTypes, "boolean_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "booleanProperty", value) @builtins.property @@ -3134,9 +3054,6 @@ class AllTypes(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.AllTypes"): @date_property.setter def date_property(self, value: datetime.datetime) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(AllTypes, "date_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "dateProperty", value) @builtins.property @@ -3146,9 +3063,6 @@ class AllTypes(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.AllTypes"): @enum_property.setter def enum_property(self, value: "AllTypesEnum") -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(AllTypes, "enum_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "enumProperty", value) @builtins.property @@ -3158,9 +3072,6 @@ class AllTypes(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.AllTypes"): @json_property.setter def json_property(self, value: typing.Mapping[typing.Any, typing.Any]) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(AllTypes, "json_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "jsonProperty", value) @builtins.property @@ -3173,9 +3084,6 @@ class AllTypes(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.AllTypes"): self, value: typing.Mapping[builtins.str, scope.jsii_calc_lib.Number], ) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(AllTypes, "map_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "mapProperty", value) @builtins.property @@ -3185,9 +3093,6 @@ class AllTypes(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.AllTypes"): @number_property.setter def number_property(self, value: jsii.Number) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(AllTypes, "number_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "numberProperty", value) @builtins.property @@ -3197,9 +3102,6 @@ class AllTypes(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.AllTypes"): @string_property.setter def string_property(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(AllTypes, "string_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "stringProperty", value) @builtins.property @@ -3214,9 +3116,6 @@ class AllTypes(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.AllTypes"): self, value: typing.List[typing.Union[jsii.Number, scope.jsii_calc_lib.NumericValue]], ) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(AllTypes, "union_array_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "unionArrayProperty", value) @builtins.property @@ -3231,9 +3130,6 @@ class AllTypes(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.AllTypes"): self, value: typing.Mapping[builtins.str, typing.Union[builtins.str, jsii.Number, scope.jsii_calc_lib.Number]], ) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(AllTypes, "union_map_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "unionMapProperty", value) @builtins.property @@ -3248,9 +3144,6 @@ class AllTypes(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.AllTypes"): self, value: typing.Union[builtins.str, jsii.Number, scope.jsii_calc_lib.Number, "Multiply"], ) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(AllTypes, "union_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "unionProperty", value) @builtins.property @@ -3260,9 +3153,6 @@ class AllTypes(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.AllTypes"): @unknown_array_property.setter def unknown_array_property(self, value: typing.List[typing.Any]) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(AllTypes, "unknown_array_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "unknownArrayProperty", value) @builtins.property @@ -3275,9 +3165,6 @@ class AllTypes(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.AllTypes"): self, value: typing.Mapping[builtins.str, typing.Any], ) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(AllTypes, "unknown_map_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "unknownMapProperty", value) @builtins.property @@ -3287,9 +3174,6 @@ class AllTypes(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.AllTypes"): @unknown_property.setter def unknown_property(self, value: typing.Any) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(AllTypes, "unknown_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "unknownProperty", value) @builtins.property @@ -3299,9 +3183,6 @@ class AllTypes(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.AllTypes"): @optional_enum_value.setter def optional_enum_value(self, value: typing.Optional["StringEnum"]) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(AllTypes, "optional_enum_value").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "optionalEnumValue", value) @@ -3325,10 +3206,6 @@ class AllowedMethodNames( :param _p1: - :param _p2: - ''' - if __debug__: - type_hints = typing.get_type_hints(AllowedMethodNames.get_bar) - check_type(argname="argument _p1", value=_p1, expected_type=type_hints["_p1"]) - check_type(argname="argument _p2", value=_p2, expected_type=type_hints["_p2"]) return typing.cast(None, jsii.invoke(self, "getBar", [_p1, _p2])) @jsii.member(jsii_name="getFoo") @@ -3337,9 +3214,6 @@ class AllowedMethodNames( :param with_param: - ''' - if __debug__: - type_hints = typing.get_type_hints(AllowedMethodNames.get_foo) - check_type(argname="argument with_param", value=with_param, expected_type=type_hints["with_param"]) return typing.cast(builtins.str, jsii.invoke(self, "getFoo", [with_param])) @jsii.member(jsii_name="setBar") @@ -3349,11 +3223,6 @@ class AllowedMethodNames( :param _y: - :param _z: - ''' - if __debug__: - type_hints = typing.get_type_hints(AllowedMethodNames.set_bar) - check_type(argname="argument _x", value=_x, expected_type=type_hints["_x"]) - check_type(argname="argument _y", value=_y, expected_type=type_hints["_y"]) - check_type(argname="argument _z", value=_z, expected_type=type_hints["_z"]) return typing.cast(None, jsii.invoke(self, "setBar", [_x, _y, _z])) @jsii.member(jsii_name="setFoo") @@ -3363,10 +3232,6 @@ class AllowedMethodNames( :param _x: - :param _y: - ''' - if __debug__: - type_hints = typing.get_type_hints(AllowedMethodNames.set_foo) - check_type(argname="argument _x", value=_x, expected_type=type_hints["_x"]) - check_type(argname="argument _y", value=_y, expected_type=type_hints["_y"]) return typing.cast(None, jsii.invoke(self, "setFoo", [_x, _y])) @@ -3386,9 +3251,6 @@ class AmbiguousParameters( :param scope: :param props: ''' - if __debug__: - type_hints = typing.get_type_hints(AmbiguousParameters.__init__) - check_type(argname="argument scope_", value=scope_, expected_type=type_hints["scope_"]) props_ = StructParameterType(scope=scope, props=props) jsii.create(self.__class__, self, [scope_, props_]) @@ -3439,9 +3301,6 @@ class AsyncVirtualMethods( ''' :param mult: - ''' - if __debug__: - type_hints = typing.get_type_hints(AsyncVirtualMethods.override_me) - check_type(argname="argument mult", value=mult, expected_type=type_hints["mult"]) return typing.cast(jsii.Number, jsii.ainvoke(self, "overrideMe", [mult])) @jsii.member(jsii_name="overrideMeToo") @@ -3506,10 +3365,6 @@ class BinaryOperation( :param lhs: Left-hand side operand. :param rhs: Right-hand side operand. ''' - if __debug__: - type_hints = typing.get_type_hints(BinaryOperation.__init__) - check_type(argname="argument lhs", value=lhs, expected_type=type_hints["lhs"]) - check_type(argname="argument rhs", value=rhs, expected_type=type_hints["rhs"]) jsii.create(self.__class__, self, [lhs, rhs]) @jsii.member(jsii_name="hello") @@ -3574,9 +3429,6 @@ class _BurriedAnonymousObjectProxy(BurriedAnonymousObject): :return: \`\`value\`\` ''' - if __debug__: - type_hints = typing.get_type_hints(BurriedAnonymousObject.give_it_back) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast(typing.Any, jsii.invoke(self, "giveItBack", [value])) # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class @@ -3630,9 +3482,6 @@ class Calculator( :param value: - ''' - if __debug__: - type_hints = typing.get_type_hints(Calculator.add) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast(None, jsii.invoke(self, "add", [value])) @jsii.member(jsii_name="mul") @@ -3641,9 +3490,6 @@ class Calculator( :param value: - ''' - if __debug__: - type_hints = typing.get_type_hints(Calculator.mul) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast(None, jsii.invoke(self, "mul", [value])) @jsii.member(jsii_name="neg") @@ -3657,9 +3503,6 @@ class Calculator( :param value: - ''' - if __debug__: - type_hints = typing.get_type_hints(Calculator.pow) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast(None, jsii.invoke(self, "pow", [value])) @jsii.member(jsii_name="readUnionValue") @@ -3695,9 +3538,6 @@ class Calculator( @curr.setter def curr(self, value: scope.jsii_calc_lib.NumericValue) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(Calculator, "curr").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "curr", value) @builtins.property @@ -3708,9 +3548,6 @@ class Calculator( @max_value.setter def max_value(self, value: typing.Optional[jsii.Number]) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(Calculator, "max_value").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "maxValue", value) @builtins.property @@ -3726,9 +3563,6 @@ class Calculator( self, value: typing.Optional[typing.Union["Add", "Multiply", "Power"]], ) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(Calculator, "union_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "unionProperty", value) @@ -3749,10 +3583,6 @@ class CalculatorProps: :param initial_value: The initial value of the calculator. NOTE: Any number works here, it's fine. Default: 0 :param maximum_value: The maximum value the calculator can store. Default: none ''' - if __debug__: - type_hints = typing.get_type_hints(CalculatorProps.__init__) - check_type(argname="argument initial_value", value=initial_value, expected_type=type_hints["initial_value"]) - check_type(argname="argument maximum_value", value=maximum_value, expected_type=type_hints["maximum_value"]) self._values: typing.Dict[str, typing.Any] = {} if initial_value is not None: self._values["initial_value"] = initial_value @@ -3802,9 +3632,6 @@ class ClassWithCollectionOfUnions( ''' :param union_property: - ''' - if __debug__: - type_hints = typing.get_type_hints(ClassWithCollectionOfUnions.__init__) - check_type(argname="argument union_property", value=union_property, expected_type=type_hints["union_property"]) jsii.create(self.__class__, self, [union_property]) @builtins.property @@ -3819,9 +3646,6 @@ class ClassWithCollectionOfUnions( self, value: typing.List[typing.Mapping[builtins.str, typing.Union["StructA", "StructB"]]], ) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(ClassWithCollectionOfUnions, "union_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "unionProperty", value) @@ -3838,10 +3662,6 @@ class ClassWithCollections( :param map: - :param array: - ''' - if __debug__: - type_hints = typing.get_type_hints(ClassWithCollections.__init__) - check_type(argname="argument map", value=map, expected_type=type_hints["map"]) - check_type(argname="argument array", value=array, expected_type=type_hints["array"]) jsii.create(self.__class__, self, [map, array]) @jsii.member(jsii_name="createAList") @@ -3861,9 +3681,6 @@ class ClassWithCollections( @static_array.setter # type: ignore[no-redef] def static_array(cls, value: typing.List[builtins.str]) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(ClassWithCollections, "static_array").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.sset(cls, "staticArray", value) @jsii.python.classproperty @@ -3873,9 +3690,6 @@ class ClassWithCollections( @static_map.setter # type: ignore[no-redef] def static_map(cls, value: typing.Mapping[builtins.str, builtins.str]) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(ClassWithCollections, "static_map").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.sset(cls, "staticMap", value) @builtins.property @@ -3885,9 +3699,6 @@ class ClassWithCollections( @array.setter def array(self, value: typing.List[builtins.str]) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(ClassWithCollections, "array").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "array", value) @builtins.property @@ -3897,9 +3708,6 @@ class ClassWithCollections( @map.setter def map(self, value: typing.Mapping[builtins.str, builtins.str]) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(ClassWithCollections, "map").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "map", value) @@ -3925,11 +3733,6 @@ class ClassWithContainerTypes( :param obj_prop: :param record_prop: ''' - if __debug__: - type_hints = typing.get_type_hints(ClassWithContainerTypes.__init__) - check_type(argname="argument array", value=array, expected_type=type_hints["array"]) - check_type(argname="argument record", value=record, expected_type=type_hints["record"]) - check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) props = ContainerProps( array_prop=array_prop, obj_prop=obj_prop, record_prop=record_prop ) @@ -3983,9 +3786,6 @@ class ClassWithJavaReservedWords( ''' :param int: - ''' - if __debug__: - type_hints = typing.get_type_hints(ClassWithJavaReservedWords.__init__) - check_type(argname="argument int", value=int, expected_type=type_hints["int"]) jsii.create(self.__class__, self, [int]) @jsii.member(jsii_name="import") @@ -3993,9 +3793,6 @@ class ClassWithJavaReservedWords( ''' :param assert_: - ''' - if __debug__: - type_hints = typing.get_type_hints(ClassWithJavaReservedWords.import_) - check_type(argname="argument assert_", value=assert_, expected_type=type_hints["assert_"]) return typing.cast(builtins.str, jsii.invoke(self, "import", [assert_])) @builtins.property @@ -4018,9 +3815,6 @@ class ClassWithMutableObjectLiteralProperty( @mutable_object.setter def mutable_object(self, value: "IMutableObjectLiteral") -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(ClassWithMutableObjectLiteralProperty, "mutable_object").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "mutableObject", value) @@ -4035,9 +3829,6 @@ class ClassWithNestedUnion( ''' :param union_property: - ''' - if __debug__: - type_hints = typing.get_type_hints(ClassWithNestedUnion.__init__) - check_type(argname="argument union_property", value=union_property, expected_type=type_hints["union_property"]) jsii.create(self.__class__, self, [union_property]) @builtins.property @@ -4052,9 +3843,6 @@ class ClassWithNestedUnion( self, value: typing.List[typing.Union[typing.Mapping[builtins.str, typing.Union["StructA", "StructB"]], typing.List[typing.Union["StructA", "StructB"]]]], ) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(ClassWithNestedUnion, "union_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "unionProperty", value) @@ -4089,9 +3877,6 @@ class ConfusingToJackson( self, value: typing.Optional[typing.Union[scope.jsii_calc_lib.IFriendly, typing.List[typing.Union[scope.jsii_calc_lib.IFriendly, "AbstractClass"]]]], ) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(ConfusingToJackson, "union_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "unionProperty", value) @@ -4109,9 +3894,6 @@ class ConfusingToJacksonStruct: ''' :param union_property: ''' - if __debug__: - type_hints = typing.get_type_hints(ConfusingToJacksonStruct.__init__) - check_type(argname="argument union_property", value=union_property, expected_type=type_hints["union_property"]) self._values: typing.Dict[str, typing.Any] = {} if union_property is not None: self._values["union_property"] = union_property @@ -4143,9 +3925,6 @@ class ConstructorPassesThisOut( ''' :param consumer: - ''' - if __debug__: - type_hints = typing.get_type_hints(ConstructorPassesThisOut.__init__) - check_type(argname="argument consumer", value=consumer, expected_type=type_hints["consumer"]) jsii.create(self.__class__, self, [consumer]) @@ -4197,9 +3976,6 @@ class ConsumePureInterface( ''' :param delegate: - ''' - if __debug__: - type_hints = typing.get_type_hints(ConsumePureInterface.__init__) - check_type(argname="argument delegate", value=delegate, expected_type=type_hints["delegate"]) jsii.create(self.__class__, self, [delegate]) @jsii.member(jsii_name="workItBaby") @@ -4232,9 +4008,6 @@ class ConsumerCanRingBell( :param ringer: - ''' - if __debug__: - type_hints = typing.get_type_hints(ConsumerCanRingBell.static_implemented_by_object_literal) - check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) return typing.cast(builtins.bool, jsii.sinvoke(cls, "staticImplementedByObjectLiteral", [ringer])) @jsii.member(jsii_name="staticImplementedByPrivateClass") @@ -4249,9 +4022,6 @@ class ConsumerCanRingBell( :param ringer: - ''' - if __debug__: - type_hints = typing.get_type_hints(ConsumerCanRingBell.static_implemented_by_private_class) - check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) return typing.cast(builtins.bool, jsii.sinvoke(cls, "staticImplementedByPrivateClass", [ringer])) @jsii.member(jsii_name="staticImplementedByPublicClass") @@ -4263,9 +4033,6 @@ class ConsumerCanRingBell( :param ringer: - ''' - if __debug__: - type_hints = typing.get_type_hints(ConsumerCanRingBell.static_implemented_by_public_class) - check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) return typing.cast(builtins.bool, jsii.sinvoke(cls, "staticImplementedByPublicClass", [ringer])) @jsii.member(jsii_name="staticWhenTypedAsClass") @@ -4277,9 +4044,6 @@ class ConsumerCanRingBell( :param ringer: - ''' - if __debug__: - type_hints = typing.get_type_hints(ConsumerCanRingBell.static_when_typed_as_class) - check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) return typing.cast(builtins.bool, jsii.sinvoke(cls, "staticWhenTypedAsClass", [ringer])) @jsii.member(jsii_name="implementedByObjectLiteral") @@ -4290,9 +4054,6 @@ class ConsumerCanRingBell( :param ringer: - ''' - if __debug__: - type_hints = typing.get_type_hints(ConsumerCanRingBell.implemented_by_object_literal) - check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) return typing.cast(builtins.bool, jsii.invoke(self, "implementedByObjectLiteral", [ringer])) @jsii.member(jsii_name="implementedByPrivateClass") @@ -4303,9 +4064,6 @@ class ConsumerCanRingBell( :param ringer: - ''' - if __debug__: - type_hints = typing.get_type_hints(ConsumerCanRingBell.implemented_by_private_class) - check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) return typing.cast(builtins.bool, jsii.invoke(self, "implementedByPrivateClass", [ringer])) @jsii.member(jsii_name="implementedByPublicClass") @@ -4316,9 +4074,6 @@ class ConsumerCanRingBell( :param ringer: - ''' - if __debug__: - type_hints = typing.get_type_hints(ConsumerCanRingBell.implemented_by_public_class) - check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) return typing.cast(builtins.bool, jsii.invoke(self, "implementedByPublicClass", [ringer])) @jsii.member(jsii_name="whenTypedAsClass") @@ -4329,9 +4084,6 @@ class ConsumerCanRingBell( :param ringer: - ''' - if __debug__: - type_hints = typing.get_type_hints(ConsumerCanRingBell.when_typed_as_class) - check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) return typing.cast(builtins.bool, jsii.invoke(self, "whenTypedAsClass", [ringer])) @@ -4350,9 +4102,6 @@ class ConsumersOfThisCrazyTypeSystem( ''' :param obj: - ''' - if __debug__: - type_hints = typing.get_type_hints(ConsumersOfThisCrazyTypeSystem.consume_another_public_interface) - check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) return typing.cast(builtins.str, jsii.invoke(self, "consumeAnotherPublicInterface", [obj])) @jsii.member(jsii_name="consumeNonInternalInterface") @@ -4363,9 +4112,6 @@ class ConsumersOfThisCrazyTypeSystem( ''' :param obj: - ''' - if __debug__: - type_hints = typing.get_type_hints(ConsumersOfThisCrazyTypeSystem.consume_non_internal_interface) - check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) return typing.cast(typing.Any, jsii.invoke(self, "consumeNonInternalInterface", [obj])) @@ -4391,11 +4137,6 @@ class ContainerProps: :param obj_prop: :param record_prop: ''' - if __debug__: - type_hints = typing.get_type_hints(ContainerProps.__init__) - check_type(argname="argument array_prop", value=array_prop, expected_type=type_hints["array_prop"]) - check_type(argname="argument obj_prop", value=obj_prop, expected_type=type_hints["obj_prop"]) - check_type(argname="argument record_prop", value=record_prop, expected_type=type_hints["record_prop"]) self._values: typing.Dict[str, typing.Any] = { "array_prop": array_prop, "obj_prop": obj_prop, @@ -4465,9 +4206,6 @@ class DataRenderer(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.DataRenderer"): ''' :param data: - ''' - if __debug__: - type_hints = typing.get_type_hints(DataRenderer.render_arbitrary) - check_type(argname="argument data", value=data, expected_type=type_hints["data"]) return typing.cast(builtins.str, jsii.invoke(self, "renderArbitrary", [data])) @jsii.member(jsii_name="renderMap") @@ -4475,9 +4213,6 @@ class DataRenderer(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.DataRenderer"): ''' :param map: - ''' - if __debug__: - type_hints = typing.get_type_hints(DataRenderer.render_map) - check_type(argname="argument map", value=map, expected_type=type_hints["map"]) return typing.cast(builtins.str, jsii.invoke(self, "renderMap", [map])) @@ -4510,11 +4245,6 @@ class DefaultedConstructorArgument( :param arg2: - :param arg3: - ''' - if __debug__: - type_hints = typing.get_type_hints(DefaultedConstructorArgument.__init__) - check_type(argname="argument arg1", value=arg1, expected_type=type_hints["arg1"]) - check_type(argname="argument arg2", value=arg2, expected_type=type_hints["arg2"]) - check_type(argname="argument arg3", value=arg3, expected_type=type_hints["arg3"]) jsii.create(self.__class__, self, [arg1, arg2, arg3]) @builtins.property @@ -4576,10 +4306,6 @@ class DeprecatedClass(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.DeprecatedCl :stability: deprecated ''' - if __debug__: - type_hints = typing.get_type_hints(DeprecatedClass.__init__) - check_type(argname="argument readonly_string", value=readonly_string, expected_type=type_hints["readonly_string"]) - check_type(argname="argument mutable_number", value=mutable_number, expected_type=type_hints["mutable_number"]) jsii.create(self.__class__, self, [readonly_string, mutable_number]) @jsii.member(jsii_name="method") @@ -4613,9 +4339,6 @@ class DeprecatedClass(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.DeprecatedCl @mutable_property.setter def mutable_property(self, value: typing.Optional[jsii.Number]) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(DeprecatedClass, "mutable_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "mutableProperty", value) @@ -4655,9 +4378,6 @@ class DeprecatedStruct: :stability: deprecated ''' - if __debug__: - type_hints = typing.get_type_hints(DeprecatedStruct.__init__) - check_type(argname="argument readonly_property", value=readonly_property, expected_type=type_hints["readonly_property"]) self._values: typing.Dict[str, typing.Any] = { "readonly_property": readonly_property, } @@ -4726,17 +4446,6 @@ class DerivedStruct(scope.jsii_calc_lib.MyFirstStruct): :param optional_any: :param optional_array: ''' - if __debug__: - type_hints = typing.get_type_hints(DerivedStruct.__init__) - check_type(argname="argument anumber", value=anumber, expected_type=type_hints["anumber"]) - check_type(argname="argument astring", value=astring, expected_type=type_hints["astring"]) - check_type(argname="argument first_optional", value=first_optional, expected_type=type_hints["first_optional"]) - check_type(argname="argument another_required", value=another_required, expected_type=type_hints["another_required"]) - check_type(argname="argument bool", value=bool, expected_type=type_hints["bool"]) - check_type(argname="argument non_primitive", value=non_primitive, expected_type=type_hints["non_primitive"]) - check_type(argname="argument another_optional", value=another_optional, expected_type=type_hints["another_optional"]) - check_type(argname="argument optional_any", value=optional_any, expected_type=type_hints["optional_any"]) - check_type(argname="argument optional_array", value=optional_array, expected_type=type_hints["optional_array"]) self._values: typing.Dict[str, typing.Any] = { "anumber": anumber, "astring": astring, @@ -4857,12 +4566,6 @@ class DiamondBottom(scope.jsii_calc_lib.DiamondLeft, scope.jsii_calc_lib.Diamond :param right: :param bottom: ''' - if __debug__: - type_hints = typing.get_type_hints(DiamondBottom.__init__) - check_type(argname="argument hoisted_top", value=hoisted_top, expected_type=type_hints["hoisted_top"]) - check_type(argname="argument left", value=left, expected_type=type_hints["left"]) - check_type(argname="argument right", value=right, expected_type=type_hints["right"]) - check_type(argname="argument bottom", value=bottom, expected_type=type_hints["bottom"]) self._values: typing.Dict[str, typing.Any] = {} if hoisted_top is not None: self._values["hoisted_top"] = hoisted_top @@ -4924,9 +4627,6 @@ class DiamondInheritanceBaseLevelStruct: ''' :param base_level_property: ''' - if __debug__: - type_hints = typing.get_type_hints(DiamondInheritanceBaseLevelStruct.__init__) - check_type(argname="argument base_level_property", value=base_level_property, expected_type=type_hints["base_level_property"]) self._values: typing.Dict[str, typing.Any] = { "base_level_property": base_level_property, } @@ -4968,10 +4668,6 @@ class DiamondInheritanceFirstMidLevelStruct(DiamondInheritanceBaseLevelStruct): :param base_level_property: :param first_mid_level_property: ''' - if __debug__: - type_hints = typing.get_type_hints(DiamondInheritanceFirstMidLevelStruct.__init__) - check_type(argname="argument base_level_property", value=base_level_property, expected_type=type_hints["base_level_property"]) - check_type(argname="argument first_mid_level_property", value=first_mid_level_property, expected_type=type_hints["first_mid_level_property"]) self._values: typing.Dict[str, typing.Any] = { "base_level_property": base_level_property, "first_mid_level_property": first_mid_level_property, @@ -5020,10 +4716,6 @@ class DiamondInheritanceSecondMidLevelStruct(DiamondInheritanceBaseLevelStruct): :param base_level_property: :param second_mid_level_property: ''' - if __debug__: - type_hints = typing.get_type_hints(DiamondInheritanceSecondMidLevelStruct.__init__) - check_type(argname="argument base_level_property", value=base_level_property, expected_type=type_hints["base_level_property"]) - check_type(argname="argument second_mid_level_property", value=second_mid_level_property, expected_type=type_hints["second_mid_level_property"]) self._values: typing.Dict[str, typing.Any] = { "base_level_property": base_level_property, "second_mid_level_property": second_mid_level_property, @@ -5083,12 +4775,6 @@ class DiamondInheritanceTopLevelStruct( :param second_mid_level_property: :param top_level_property: ''' - if __debug__: - type_hints = typing.get_type_hints(DiamondInheritanceTopLevelStruct.__init__) - check_type(argname="argument base_level_property", value=base_level_property, expected_type=type_hints["base_level_property"]) - check_type(argname="argument first_mid_level_property", value=first_mid_level_property, expected_type=type_hints["first_mid_level_property"]) - check_type(argname="argument second_mid_level_property", value=second_mid_level_property, expected_type=type_hints["second_mid_level_property"]) - check_type(argname="argument top_level_property", value=top_level_property, expected_type=type_hints["top_level_property"]) self._values: typing.Dict[str, typing.Any] = { "base_level_property": base_level_property, "first_mid_level_property": first_mid_level_property, @@ -5172,9 +4858,6 @@ class DoNotOverridePrivates( ''' :param new_value: - ''' - if __debug__: - type_hints = typing.get_type_hints(DoNotOverridePrivates.change_private_property_value) - check_type(argname="argument new_value", value=new_value, expected_type=type_hints["new_value"]) return typing.cast(None, jsii.invoke(self, "changePrivatePropertyValue", [new_value])) @jsii.member(jsii_name="privateMethodValue") @@ -5207,11 +4890,6 @@ class DoNotRecognizeAnyAsOptional( :param _optional_any: - :param _optional_string: - ''' - if __debug__: - type_hints = typing.get_type_hints(DoNotRecognizeAnyAsOptional.method) - check_type(argname="argument _required_any", value=_required_any, expected_type=type_hints["_required_any"]) - check_type(argname="argument _optional_any", value=_optional_any, expected_type=type_hints["_optional_any"]) - check_type(argname="argument _optional_string", value=_optional_string, expected_type=type_hints["_optional_string"]) return typing.cast(None, jsii.invoke(self, "method", [_required_any, _optional_any, _optional_string])) @@ -5279,10 +4957,6 @@ class DontComplainAboutVariadicAfterOptional( :param optional: - :param things: - ''' - if __debug__: - type_hints = typing.get_type_hints(DontComplainAboutVariadicAfterOptional.optional_and_variadic) - check_type(argname="argument optional", value=optional, expected_type=type_hints["optional"]) - check_type(argname="argument things", value=things, expected_type=typing.Tuple[type_hints["things"], ...]) # pyright: ignore [reportGeneralTypeIssues] return typing.cast(builtins.str, jsii.invoke(self, "optionalAndVariadic", [optional, *things])) @@ -5296,9 +4970,6 @@ class DummyObj: ''' :param example: ''' - if __debug__: - type_hints = typing.get_type_hints(DummyObj.__init__) - check_type(argname="argument example", value=example, expected_type=type_hints["example"]) self._values: typing.Dict[str, typing.Any] = { "example": example, } @@ -5331,9 +5002,6 @@ class DynamicPropertyBearer( ''' :param value_store: - ''' - if __debug__: - type_hints = typing.get_type_hints(DynamicPropertyBearer.__init__) - check_type(argname="argument value_store", value=value_store, expected_type=type_hints["value_store"]) jsii.create(self.__class__, self, [value_store]) @builtins.property @@ -5343,9 +5011,6 @@ class DynamicPropertyBearer( @dynamic_property.setter def dynamic_property(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(DynamicPropertyBearer, "dynamic_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "dynamicProperty", value) @builtins.property @@ -5355,9 +5020,6 @@ class DynamicPropertyBearer( @value_store.setter def value_store(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(DynamicPropertyBearer, "value_store").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "valueStore", value) @@ -5370,9 +5032,6 @@ class DynamicPropertyBearerChild( ''' :param original_value: - ''' - if __debug__: - type_hints = typing.get_type_hints(DynamicPropertyBearerChild.__init__) - check_type(argname="argument original_value", value=original_value, expected_type=type_hints["original_value"]) jsii.create(self.__class__, self, [original_value]) @jsii.member(jsii_name="overrideValue") @@ -5383,9 +5042,6 @@ class DynamicPropertyBearerChild( :return: the old value that was set. ''' - if __debug__: - type_hints = typing.get_type_hints(DynamicPropertyBearerChild.override_value) - check_type(argname="argument new_value", value=new_value, expected_type=type_hints["new_value"]) return typing.cast(builtins.str, jsii.invoke(self, "overrideValue", [new_value])) @builtins.property @@ -5402,9 +5058,6 @@ class Entropy(metaclass=jsii.JSIIAbstractClass, jsii_type="jsii-calc.Entropy"): :param clock: your implementation of \`\`WallClock\`\`. ''' - if __debug__: - type_hints = typing.get_type_hints(Entropy.__init__) - check_type(argname="argument clock", value=clock, expected_type=type_hints["clock"]) jsii.create(self.__class__, self, [clock]) @jsii.member(jsii_name="increase") @@ -5436,9 +5089,6 @@ class _EntropyProxy(Entropy): :return: \`\`word\`\`. ''' - if __debug__: - type_hints = typing.get_type_hints(Entropy.repeat) - check_type(argname="argument word", value=word, expected_type=type_hints["word"]) return typing.cast(builtins.str, jsii.invoke(self, "repeat", [word])) # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class @@ -5479,10 +5129,6 @@ class EraseUndefinedHashValues( :param opts: - :param key: - ''' - if __debug__: - type_hints = typing.get_type_hints(EraseUndefinedHashValues.does_key_exist) - check_type(argname="argument opts", value=opts, expected_type=type_hints["opts"]) - check_type(argname="argument key", value=key, expected_type=type_hints["key"]) return typing.cast(builtins.bool, jsii.sinvoke(cls, "doesKeyExist", [opts, key])) @jsii.member(jsii_name="prop1IsNull") @@ -5514,10 +5160,6 @@ class EraseUndefinedHashValuesOptions: :param option1: :param option2: ''' - if __debug__: - type_hints = typing.get_type_hints(EraseUndefinedHashValuesOptions.__init__) - check_type(argname="argument option1", value=option1, expected_type=type_hints["option1"]) - check_type(argname="argument option2", value=option2, expected_type=type_hints["option2"]) self._values: typing.Dict[str, typing.Any] = {} if option1 is not None: self._values["option1"] = option1 @@ -5565,10 +5207,6 @@ class ExperimentalClass( :stability: experimental ''' - if __debug__: - type_hints = typing.get_type_hints(ExperimentalClass.__init__) - check_type(argname="argument readonly_string", value=readonly_string, expected_type=type_hints["readonly_string"]) - check_type(argname="argument mutable_number", value=mutable_number, expected_type=type_hints["mutable_number"]) jsii.create(self.__class__, self, [readonly_string, mutable_number]) @jsii.member(jsii_name="method") @@ -5596,9 +5234,6 @@ class ExperimentalClass( @mutable_property.setter def mutable_property(self, value: typing.Optional[jsii.Number]) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(ExperimentalClass, "mutable_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "mutableProperty", value) @@ -5630,9 +5265,6 @@ class ExperimentalStruct: :stability: experimental ''' - if __debug__: - type_hints = typing.get_type_hints(ExperimentalStruct.__init__) - check_type(argname="argument readonly_property", value=readonly_property, expected_type=type_hints["readonly_property"]) self._values: typing.Dict[str, typing.Any] = { "readonly_property": readonly_property, } @@ -5666,9 +5298,6 @@ class ExportedBaseClass( ''' :param success: - ''' - if __debug__: - type_hints = typing.get_type_hints(ExportedBaseClass.__init__) - check_type(argname="argument success", value=success, expected_type=type_hints["success"]) jsii.create(self.__class__, self, [success]) @builtins.property @@ -5688,10 +5317,6 @@ class ExtendsInternalInterface: :param boom: :param prop: ''' - if __debug__: - type_hints = typing.get_type_hints(ExtendsInternalInterface.__init__) - check_type(argname="argument boom", value=boom, expected_type=type_hints["boom"]) - check_type(argname="argument prop", value=prop, expected_type=type_hints["prop"]) self._values: typing.Dict[str, typing.Any] = { "boom": boom, "prop": prop, @@ -5737,10 +5362,6 @@ class ExternalClass(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.ExternalClass" :external: true ''' - if __debug__: - type_hints = typing.get_type_hints(ExternalClass.__init__) - check_type(argname="argument readonly_string", value=readonly_string, expected_type=type_hints["readonly_string"]) - check_type(argname="argument mutable_number", value=mutable_number, expected_type=type_hints["mutable_number"]) jsii.create(self.__class__, self, [readonly_string, mutable_number]) @jsii.member(jsii_name="method") @@ -5768,9 +5389,6 @@ class ExternalClass(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.ExternalClass" @mutable_property.setter def mutable_property(self, value: typing.Optional[jsii.Number]) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(ExternalClass, "mutable_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "mutableProperty", value) @@ -5802,9 +5420,6 @@ class ExternalStruct: :external: true ''' - if __debug__: - type_hints = typing.get_type_hints(ExternalStruct.__init__) - check_type(argname="argument readonly_property", value=readonly_property, expected_type=type_hints["readonly_property"]) self._values: typing.Dict[str, typing.Any] = { "readonly_property": readonly_property, } @@ -5951,9 +5566,6 @@ class Greetee: :param name: The name of the greetee. Default: world ''' - if __debug__: - type_hints = typing.get_type_hints(Greetee.__init__) - check_type(argname="argument name", value=name, expected_type=type_hints["name"]) self._values: typing.Dict[str, typing.Any] = {} if name is not None: self._values["name"] = name @@ -5991,9 +5603,6 @@ class GreetingAugmenter( ''' :param friendly: - ''' - if __debug__: - type_hints = typing.get_type_hints(GreetingAugmenter.better_greeting) - check_type(argname="argument friendly", value=friendly, expected_type=type_hints["friendly"]) return typing.cast(builtins.str, jsii.invoke(self, "betterGreeting", [friendly])) @@ -6077,9 +5686,6 @@ class _IAnotherPublicInterfaceProxy: @a.setter def a(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(IAnotherPublicInterface, "a").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "a", value) # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface @@ -6126,9 +5732,6 @@ class _IBellRingerProxy: ''' :param bell: - ''' - if __debug__: - type_hints = typing.get_type_hints(IBellRinger.your_turn) - check_type(argname="argument bell", value=bell, expected_type=type_hints["bell"]) return typing.cast(None, jsii.invoke(self, "yourTurn", [bell])) # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface @@ -6157,9 +5760,6 @@ class _IConcreteBellRingerProxy: ''' :param bell: - ''' - if __debug__: - type_hints = typing.get_type_hints(IConcreteBellRinger.your_turn) - check_type(argname="argument bell", value=bell, expected_type=type_hints["bell"]) return typing.cast(None, jsii.invoke(self, "yourTurn", [bell])) # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface @@ -6219,9 +5819,6 @@ class _IDeprecatedInterfaceProxy: @mutable_property.setter def mutable_property(self, value: typing.Optional[jsii.Number]) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(IDeprecatedInterface, "mutable_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "mutableProperty", value) @jsii.member(jsii_name="method") @@ -6280,9 +5877,6 @@ class _IExperimentalInterfaceProxy: @mutable_property.setter def mutable_property(self, value: typing.Optional[jsii.Number]) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(IExperimentalInterface, "mutable_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "mutableProperty", value) @jsii.member(jsii_name="method") @@ -6328,9 +5922,6 @@ class _IExtendsPrivateInterfaceProxy: @private.setter def private(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(IExtendsPrivateInterface, "private").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "private", value) # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface @@ -6380,9 +5971,6 @@ class _IExternalInterfaceProxy: @mutable_property.setter def mutable_property(self, value: typing.Optional[jsii.Number]) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(IExternalInterface, "mutable_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "mutableProperty", value) @jsii.member(jsii_name="method") @@ -6568,10 +6156,6 @@ class _IInterfaceWithOptionalMethodArgumentsProxy: :param arg1: - :param arg2: - ''' - if __debug__: - type_hints = typing.get_type_hints(IInterfaceWithOptionalMethodArguments.hello) - check_type(argname="argument arg1", value=arg1, expected_type=type_hints["arg1"]) - check_type(argname="argument arg2", value=arg2, expected_type=type_hints["arg2"]) return typing.cast(None, jsii.invoke(self, "hello", [arg1, arg2])) # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface @@ -6610,9 +6194,6 @@ class _IInterfaceWithPropertiesProxy: @read_write_string.setter def read_write_string(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(IInterfaceWithProperties, "read_write_string").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "readWriteString", value) # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface @@ -6646,9 +6227,6 @@ class _IInterfaceWithPropertiesExtensionProxy( @foo.setter def foo(self, value: jsii.Number) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(IInterfaceWithPropertiesExtension, "foo").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "foo", value) # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface @@ -7172,9 +6750,6 @@ class _IMutableObjectLiteralProxy: @value.setter def value(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(IMutableObjectLiteral, "value").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "value", value) # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface @@ -7214,9 +6789,6 @@ class _INonInternalInterfaceProxy( @b.setter def b(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(INonInternalInterface, "b").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "b", value) @builtins.property @@ -7226,9 +6798,6 @@ class _INonInternalInterfaceProxy( @c.setter def c(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(INonInternalInterface, "c").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "c", value) # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface @@ -7265,9 +6834,6 @@ class _IObjectWithPropertyProxy: @property.setter def property(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(IObjectWithProperty, "property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "property", value) @jsii.member(jsii_name="wasSet") @@ -7464,9 +7030,6 @@ class _IStableInterfaceProxy: @mutable_property.setter def mutable_property(self, value: typing.Optional[jsii.Number]) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(IStableInterface, "mutable_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "mutableProperty", value) @jsii.member(jsii_name="method") @@ -7537,9 +7100,6 @@ class ImplementInternalInterface( @prop.setter def prop(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(ImplementInternalInterface, "prop").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "prop", value) @@ -7589,9 +7149,6 @@ class ImplementsPrivateInterface( @private.setter def private(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(ImplementsPrivateInterface, "private").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "private", value) @@ -7613,11 +7170,6 @@ class ImplictBaseOfBase(scope.jsii_calc_base.BaseProps): :param bar: - :param goo: ''' - if __debug__: - type_hints = typing.get_type_hints(ImplictBaseOfBase.__init__) - check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) - check_type(argname="argument bar", value=bar, expected_type=type_hints["bar"]) - check_type(argname="argument goo", value=goo, expected_type=type_hints["goo"]) self._values: typing.Dict[str, typing.Any] = { "foo": foo, "bar": bar, @@ -7696,9 +7248,6 @@ class InterfacesMaker(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.InterfacesMa ''' :param count: - ''' - if __debug__: - type_hints = typing.get_type_hints(InterfacesMaker.make_interfaces) - check_type(argname="argument count", value=count, expected_type=type_hints["count"]) return typing.cast(typing.List[scope.jsii_calc_lib.IDoublable], jsii.sinvoke(cls, "makeInterfaces", [count])) @@ -7807,9 +7356,6 @@ class JSObjectLiteralToNativeClass( @prop_a.setter def prop_a(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(JSObjectLiteralToNativeClass, "prop_a").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "propA", value) @builtins.property @@ -7819,9 +7365,6 @@ class JSObjectLiteralToNativeClass( @prop_b.setter def prop_b(self, value: jsii.Number) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(JSObjectLiteralToNativeClass, "prop_b").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "propB", value) @@ -8047,9 +7590,6 @@ class JavaReservedWords( @while_.setter def while_(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(JavaReservedWords, "while_").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "while", value) @@ -8155,9 +7695,6 @@ class JsonFormatter(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.JsonFormatter" ''' :param value: - ''' - if __debug__: - type_hints = typing.get_type_hints(JsonFormatter.stringify) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast(typing.Optional[builtins.str], jsii.sinvoke(cls, "stringify", [value])) @@ -8191,9 +7728,6 @@ class LevelOne(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.LevelOne"): ''' :param value: ''' - if __debug__: - type_hints = typing.get_type_hints(LevelOne.PropBooleanValue.__init__) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) self._values: typing.Dict[str, typing.Any] = { "value": value, } @@ -8231,9 +7765,6 @@ class LevelOne(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.LevelOne"): ''' if isinstance(prop, dict): prop = LevelOne.PropBooleanValue(**prop) - if __debug__: - type_hints = typing.get_type_hints(LevelOne.PropProperty.__init__) - check_type(argname="argument prop", value=prop, expected_type=type_hints["prop"]) self._values: typing.Dict[str, typing.Any] = { "prop": prop, } @@ -8272,9 +7803,6 @@ class LevelOneProps: ''' if isinstance(prop, dict): prop = LevelOne.PropProperty(**prop) - if __debug__: - type_hints = typing.get_type_hints(LevelOneProps.__init__) - check_type(argname="argument prop", value=prop, expected_type=type_hints["prop"]) self._values: typing.Dict[str, typing.Any] = { "prop": prop, } @@ -8326,13 +7854,6 @@ class LoadBalancedFargateServiceProps: :param public_load_balancer: Determines whether the Application Load Balancer will be internet-facing. Default: true :param public_tasks: Determines whether your Fargate Service will be assigned a public IP address. Default: false ''' - if __debug__: - type_hints = typing.get_type_hints(LoadBalancedFargateServiceProps.__init__) - check_type(argname="argument container_port", value=container_port, expected_type=type_hints["container_port"]) - check_type(argname="argument cpu", value=cpu, expected_type=type_hints["cpu"]) - check_type(argname="argument memory_mib", value=memory_mib, expected_type=type_hints["memory_mib"]) - check_type(argname="argument public_load_balancer", value=public_load_balancer, expected_type=type_hints["public_load_balancer"]) - check_type(argname="argument public_tasks", value=public_tasks, expected_type=type_hints["public_tasks"]) self._values: typing.Dict[str, typing.Any] = {} if container_port is not None: self._values["container_port"] = container_port @@ -8463,10 +7984,6 @@ class Multiply( :param lhs: Left-hand side operand. :param rhs: Right-hand side operand. ''' - if __debug__: - type_hints = typing.get_type_hints(Multiply.__init__) - check_type(argname="argument lhs", value=lhs, expected_type=type_hints["lhs"]) - check_type(argname="argument rhs", value=rhs, expected_type=type_hints["rhs"]) jsii.create(self.__class__, self, [lhs, rhs]) @jsii.member(jsii_name="farewell") @@ -8518,9 +8035,6 @@ class NestedStruct: ''' :param number_prop: When provided, must be > 0. ''' - if __debug__: - type_hints = typing.get_type_hints(NestedStruct.__init__) - check_type(argname="argument number_prop", value=number_prop, expected_type=type_hints["number_prop"]) self._values: typing.Dict[str, typing.Any] = { "number_prop": number_prop, } @@ -8595,10 +8109,6 @@ class NullShouldBeTreatedAsUndefined( :param _param1: - :param optional: - ''' - if __debug__: - type_hints = typing.get_type_hints(NullShouldBeTreatedAsUndefined.__init__) - check_type(argname="argument _param1", value=_param1, expected_type=type_hints["_param1"]) - check_type(argname="argument optional", value=optional, expected_type=type_hints["optional"]) jsii.create(self.__class__, self, [_param1, optional]) @jsii.member(jsii_name="giveMeUndefined") @@ -8606,9 +8116,6 @@ class NullShouldBeTreatedAsUndefined( ''' :param value: - ''' - if __debug__: - type_hints = typing.get_type_hints(NullShouldBeTreatedAsUndefined.give_me_undefined) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast(None, jsii.invoke(self, "giveMeUndefined", [value])) @jsii.member(jsii_name="giveMeUndefinedInsideAnObject") @@ -8640,9 +8147,6 @@ class NullShouldBeTreatedAsUndefined( @change_me_to_undefined.setter def change_me_to_undefined(self, value: typing.Optional[builtins.str]) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(NullShouldBeTreatedAsUndefined, "change_me_to_undefined").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "changeMeToUndefined", value) @@ -8665,10 +8169,6 @@ class NullShouldBeTreatedAsUndefinedData: :param array_with_three_elements_and_undefined_as_second_argument: :param this_should_be_undefined: ''' - if __debug__: - type_hints = typing.get_type_hints(NullShouldBeTreatedAsUndefinedData.__init__) - check_type(argname="argument array_with_three_elements_and_undefined_as_second_argument", value=array_with_three_elements_and_undefined_as_second_argument, expected_type=type_hints["array_with_three_elements_and_undefined_as_second_argument"]) - check_type(argname="argument this_should_be_undefined", value=this_should_be_undefined, expected_type=type_hints["this_should_be_undefined"]) self._values: typing.Dict[str, typing.Any] = { "array_with_three_elements_and_undefined_as_second_argument": array_with_three_elements_and_undefined_as_second_argument, } @@ -8707,9 +8207,6 @@ class NumberGenerator(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.NumberGenera ''' :param generator: - ''' - if __debug__: - type_hints = typing.get_type_hints(NumberGenerator.__init__) - check_type(argname="argument generator", value=generator, expected_type=type_hints["generator"]) jsii.create(self.__class__, self, [generator]) @jsii.member(jsii_name="isSameGenerator") @@ -8717,9 +8214,6 @@ class NumberGenerator(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.NumberGenera ''' :param gen: - ''' - if __debug__: - type_hints = typing.get_type_hints(NumberGenerator.is_same_generator) - check_type(argname="argument gen", value=gen, expected_type=type_hints["gen"]) return typing.cast(builtins.bool, jsii.invoke(self, "isSameGenerator", [gen])) @jsii.member(jsii_name="nextTimes100") @@ -8733,9 +8227,6 @@ class NumberGenerator(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.NumberGenera @generator.setter def generator(self, value: IRandomNumberGenerator) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(NumberGenerator, "generator").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "generator", value) @@ -8757,9 +8248,6 @@ class ObjectRefsInCollections( :param values: - ''' - if __debug__: - type_hints = typing.get_type_hints(ObjectRefsInCollections.sum_from_array) - check_type(argname="argument values", value=values, expected_type=type_hints["values"]) return typing.cast(jsii.Number, jsii.invoke(self, "sumFromArray", [values])) @jsii.member(jsii_name="sumFromMap") @@ -8771,9 +8259,6 @@ class ObjectRefsInCollections( :param values: - ''' - if __debug__: - type_hints = typing.get_type_hints(ObjectRefsInCollections.sum_from_map) - check_type(argname="argument values", value=values, expected_type=type_hints["values"]) return typing.cast(jsii.Number, jsii.invoke(self, "sumFromMap", [values])) @@ -8818,9 +8303,6 @@ class OptionalArgumentInvoker( ''' :param delegate: - ''' - if __debug__: - type_hints = typing.get_type_hints(OptionalArgumentInvoker.__init__) - check_type(argname="argument delegate", value=delegate, expected_type=type_hints["delegate"]) jsii.create(self.__class__, self, [delegate]) @jsii.member(jsii_name="invokeWithOptional") @@ -8847,11 +8329,6 @@ class OptionalConstructorArgument( :param arg2: - :param arg3: - ''' - if __debug__: - type_hints = typing.get_type_hints(OptionalConstructorArgument.__init__) - check_type(argname="argument arg1", value=arg1, expected_type=type_hints["arg1"]) - check_type(argname="argument arg2", value=arg2, expected_type=type_hints["arg2"]) - check_type(argname="argument arg3", value=arg3, expected_type=type_hints["arg3"]) jsii.create(self.__class__, self, [arg1, arg2, arg3]) @builtins.property @@ -8880,9 +8357,6 @@ class OptionalStruct: ''' :param field: ''' - if __debug__: - type_hints = typing.get_type_hints(OptionalStruct.__init__) - check_type(argname="argument field", value=field, expected_type=type_hints["field"]) self._values: typing.Dict[str, typing.Any] = {} if field is not None: self._values["field"] = field @@ -8962,9 +8436,6 @@ class OverridableProtectedMember( @_override_read_write.setter def _override_read_write(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(OverridableProtectedMember, "_override_read_write").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "overrideReadWrite", value) @@ -8980,9 +8451,6 @@ class OverrideReturnsObject( ''' :param obj: - ''' - if __debug__: - type_hints = typing.get_type_hints(OverrideReturnsObject.test) - check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) return typing.cast(jsii.Number, jsii.invoke(self, "test", [obj])) @@ -8997,9 +8465,6 @@ class ParentStruct982: :param foo: ''' - if __debug__: - type_hints = typing.get_type_hints(ParentStruct982.__init__) - check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) self._values: typing.Dict[str, typing.Any] = { "foo": foo, } @@ -9058,11 +8523,6 @@ class _PartiallyInitializedThisConsumerProxy(PartiallyInitializedThisConsumer): :param dt: - :param ev: - ''' - if __debug__: - type_hints = typing.get_type_hints(PartiallyInitializedThisConsumer.consume_partially_initialized_this) - check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) - check_type(argname="argument dt", value=dt, expected_type=type_hints["dt"]) - check_type(argname="argument ev", value=ev, expected_type=type_hints["ev"]) return typing.cast(builtins.str, jsii.invoke(self, "consumePartiallyInitializedThis", [obj, dt, ev])) # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class @@ -9078,9 +8538,6 @@ class Polymorphism(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Polymorphism"): ''' :param friendly: - ''' - if __debug__: - type_hints = typing.get_type_hints(Polymorphism.say_hello) - check_type(argname="argument friendly", value=friendly, expected_type=type_hints["friendly"]) return typing.cast(builtins.str, jsii.invoke(self, "sayHello", [friendly])) @@ -9101,10 +8558,6 @@ class Power( :param base: The base of the power. :param pow: The number of times to multiply. ''' - if __debug__: - type_hints = typing.get_type_hints(Power.__init__) - check_type(argname="argument base", value=base, expected_type=type_hints["base"]) - check_type(argname="argument pow", value=pow, expected_type=type_hints["pow"]) jsii.create(self.__class__, self, [base, pow]) @builtins.property @@ -9312,9 +8765,6 @@ class ReferenceEnumFromScopedPackage( ''' :param value: - ''' - if __debug__: - type_hints = typing.get_type_hints(ReferenceEnumFromScopedPackage.save_foo) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast(None, jsii.invoke(self, "saveFoo", [value])) @builtins.property @@ -9327,9 +8777,6 @@ class ReferenceEnumFromScopedPackage( self, value: typing.Optional[scope.jsii_calc_lib.EnumFromScopedModule], ) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(ReferenceEnumFromScopedPackage, "foo").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "foo", value) @@ -9375,10 +8822,6 @@ class RootStruct: ''' if isinstance(nested_struct, dict): nested_struct = NestedStruct(**nested_struct) - if __debug__: - type_hints = typing.get_type_hints(RootStruct.__init__) - check_type(argname="argument string_prop", value=string_prop, expected_type=type_hints["string_prop"]) - check_type(argname="argument nested_struct", value=nested_struct, expected_type=type_hints["nested_struct"]) self._values: typing.Dict[str, typing.Any] = { "string_prop": string_prop, } @@ -9449,11 +8892,6 @@ class RuntimeTypeChecking( :param arg2: - :param arg3: - ''' - if __debug__: - type_hints = typing.get_type_hints(RuntimeTypeChecking.method_with_defaulted_arguments) - check_type(argname="argument arg1", value=arg1, expected_type=type_hints["arg1"]) - check_type(argname="argument arg2", value=arg2, expected_type=type_hints["arg2"]) - check_type(argname="argument arg3", value=arg3, expected_type=type_hints["arg3"]) return typing.cast(None, jsii.invoke(self, "methodWithDefaultedArguments", [arg1, arg2, arg3])) @jsii.member(jsii_name="methodWithOptionalAnyArgument") @@ -9461,9 +8899,6 @@ class RuntimeTypeChecking( ''' :param arg: - ''' - if __debug__: - type_hints = typing.get_type_hints(RuntimeTypeChecking.method_with_optional_any_argument) - check_type(argname="argument arg", value=arg, expected_type=type_hints["arg"]) return typing.cast(None, jsii.invoke(self, "methodWithOptionalAnyArgument", [arg])) @jsii.member(jsii_name="methodWithOptionalArguments") @@ -9479,11 +8914,6 @@ class RuntimeTypeChecking( :param arg2: - :param arg3: - ''' - if __debug__: - type_hints = typing.get_type_hints(RuntimeTypeChecking.method_with_optional_arguments) - check_type(argname="argument arg1", value=arg1, expected_type=type_hints["arg1"]) - check_type(argname="argument arg2", value=arg2, expected_type=type_hints["arg2"]) - check_type(argname="argument arg3", value=arg3, expected_type=type_hints["arg3"]) return typing.cast(None, jsii.invoke(self, "methodWithOptionalArguments", [arg1, arg2, arg3])) @@ -9506,10 +8936,6 @@ class SecondLevelStruct: :param deeper_required_prop: It's long and required. :param deeper_optional_prop: It's long, but you'll almost never pass it. ''' - if __debug__: - type_hints = typing.get_type_hints(SecondLevelStruct.__init__) - check_type(argname="argument deeper_required_prop", value=deeper_required_prop, expected_type=type_hints["deeper_required_prop"]) - check_type(argname="argument deeper_optional_prop", value=deeper_optional_prop, expected_type=type_hints["deeper_optional_prop"]) self._values: typing.Dict[str, typing.Any] = { "deeper_required_prop": deeper_required_prop, } @@ -9575,9 +9001,6 @@ class SingletonInt(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.SingletonInt"): ''' :param value: - ''' - if __debug__: - type_hints = typing.get_type_hints(SingletonInt.is_singleton_int) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast(builtins.bool, jsii.invoke(self, "isSingletonInt", [value])) @@ -9600,9 +9023,6 @@ class SingletonString(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.SingletonStr ''' :param value: - ''' - if __debug__: - type_hints = typing.get_type_hints(SingletonString.is_singleton_string) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast(builtins.bool, jsii.invoke(self, "isSingletonString", [value])) @@ -9630,10 +9050,6 @@ class SmellyStruct: :param property: :param yet_anoter_one: ''' - if __debug__: - type_hints = typing.get_type_hints(SmellyStruct.__init__) - check_type(argname="argument property", value=property, expected_type=type_hints["property"]) - check_type(argname="argument yet_anoter_one", value=yet_anoter_one, expected_type=type_hints["yet_anoter_one"]) self._values: typing.Dict[str, typing.Any] = { "property": property, "yet_anoter_one": yet_anoter_one, @@ -9688,10 +9104,6 @@ class StableClass(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.StableClass"): :param readonly_string: - :param mutable_number: - ''' - if __debug__: - type_hints = typing.get_type_hints(StableClass.__init__) - check_type(argname="argument readonly_string", value=readonly_string, expected_type=type_hints["readonly_string"]) - check_type(argname="argument mutable_number", value=mutable_number, expected_type=type_hints["mutable_number"]) jsii.create(self.__class__, self, [readonly_string, mutable_number]) @jsii.member(jsii_name="method") @@ -9710,9 +9122,6 @@ class StableClass(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.StableClass"): @mutable_property.setter def mutable_property(self, value: typing.Optional[jsii.Number]) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(StableClass, "mutable_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "mutableProperty", value) @@ -9732,9 +9141,6 @@ class StableStruct: ''' :param readonly_property: ''' - if __debug__: - type_hints = typing.get_type_hints(StableStruct.__init__) - check_type(argname="argument readonly_property", value=readonly_property, expected_type=type_hints["readonly_property"]) self._values: typing.Dict[str, typing.Any] = { "readonly_property": readonly_property, } @@ -9775,9 +9181,6 @@ class StaticContext(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.StaticContext" @static_variable.setter # type: ignore[no-redef] def static_variable(cls, value: builtins.bool) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(StaticContext, "static_variable").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.sset(cls, "staticVariable", value) @@ -9811,9 +9214,6 @@ class Statics(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Statics"): ''' :param value: - ''' - if __debug__: - type_hints = typing.get_type_hints(Statics.__init__) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.create(self.__class__, self, [value]) @jsii.member(jsii_name="staticMethod") @@ -9823,9 +9223,6 @@ class Statics(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Statics"): :param name: The name of the person to say hello to. ''' - if __debug__: - type_hints = typing.get_type_hints(Statics.static_method) - check_type(argname="argument name", value=name, expected_type=type_hints["name"]) return typing.cast(builtins.str, jsii.sinvoke(cls, "staticMethod", [name])) @jsii.member(jsii_name="justMethod") @@ -9866,9 +9263,6 @@ class Statics(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Statics"): @instance.setter # type: ignore[no-redef] def instance(cls, value: "Statics") -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(Statics, "instance").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.sset(cls, "instance", value) @jsii.python.classproperty @@ -9878,9 +9272,6 @@ class Statics(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Statics"): @non_const_static.setter # type: ignore[no-redef] def non_const_static(cls, value: jsii.Number) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(Statics, "non_const_static").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.sset(cls, "nonConstStatic", value) @builtins.property @@ -9907,9 +9298,6 @@ class StripInternal(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.StripInternal" @you_see_me.setter def you_see_me(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(StripInternal, "you_see_me").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "youSeeMe", value) @@ -9936,11 +9324,6 @@ class StructA: :param optional_number: :param optional_string: ''' - if __debug__: - type_hints = typing.get_type_hints(StructA.__init__) - check_type(argname="argument required_string", value=required_string, expected_type=type_hints["required_string"]) - check_type(argname="argument optional_number", value=optional_number, expected_type=type_hints["optional_number"]) - check_type(argname="argument optional_string", value=optional_string, expected_type=type_hints["optional_string"]) self._values: typing.Dict[str, typing.Any] = { "required_string": required_string, } @@ -10002,11 +9385,6 @@ class StructB: ''' if isinstance(optional_struct_a, dict): optional_struct_a = StructA(**optional_struct_a) - if __debug__: - type_hints = typing.get_type_hints(StructB.__init__) - check_type(argname="argument required_string", value=required_string, expected_type=type_hints["required_string"]) - check_type(argname="argument optional_boolean", value=optional_boolean, expected_type=type_hints["optional_boolean"]) - check_type(argname="argument optional_struct_a", value=optional_struct_a, expected_type=type_hints["optional_struct_a"]) self._values: typing.Dict[str, typing.Any] = { "required_string": required_string, } @@ -10062,10 +9440,6 @@ class StructParameterType: :param scope: :param props: ''' - if __debug__: - type_hints = typing.get_type_hints(StructParameterType.__init__) - check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"]) - check_type(argname="argument props", value=props, expected_type=type_hints["props"]) self._values: typing.Dict[str, typing.Any] = { "scope": scope, } @@ -10112,10 +9486,6 @@ class StructPassing(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.StructPassing" :param _positional: - :param inputs: - ''' - if __debug__: - type_hints = typing.get_type_hints(StructPassing.how_many_var_args_did_i_pass) - check_type(argname="argument _positional", value=_positional, expected_type=type_hints["_positional"]) - check_type(argname="argument inputs", value=inputs, expected_type=typing.Tuple[type_hints["inputs"], ...]) # pyright: ignore [reportGeneralTypeIssues] return typing.cast(jsii.Number, jsii.sinvoke(cls, "howManyVarArgsDidIPass", [_positional, *inputs])) @jsii.member(jsii_name="roundTrip") @@ -10134,9 +9504,6 @@ class StructPassing(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.StructPassing" :param second_level: A union to really stress test our serialization. :param optional: You don't have to pass this. ''' - if __debug__: - type_hints = typing.get_type_hints(StructPassing.round_trip) - check_type(argname="argument _positional", value=_positional, expected_type=type_hints["_positional"]) input = TopLevelStruct( required=required, second_level=second_level, optional=optional ) @@ -10157,9 +9524,6 @@ class StructUnionConsumer( ''' :param struct: - ''' - if __debug__: - type_hints = typing.get_type_hints(StructUnionConsumer.is_struct_a) - check_type(argname="argument struct", value=struct, expected_type=type_hints["struct"]) return typing.cast(builtins.bool, jsii.sinvoke(cls, "isStructA", [struct])) @jsii.member(jsii_name="isStructB") @@ -10171,9 +9535,6 @@ class StructUnionConsumer( ''' :param struct: - ''' - if __debug__: - type_hints = typing.get_type_hints(StructUnionConsumer.is_struct_b) - check_type(argname="argument struct", value=struct, expected_type=type_hints["struct"]) return typing.cast(builtins.bool, jsii.sinvoke(cls, "isStructB", [struct])) @jsii.member(jsii_name="provideStruct") @@ -10182,9 +9543,6 @@ class StructUnionConsumer( ''' :param which: - ''' - if __debug__: - type_hints = typing.get_type_hints(StructUnionConsumer.provide_struct) - check_type(argname="argument which", value=which, expected_type=type_hints["which"]) return typing.cast(typing.Union[StructA, StructB], jsii.sinvoke(cls, "provideStruct", [which])) @@ -10202,9 +9560,6 @@ class StructWithCollectionOfUnionts: ''' :param union_property: ''' - if __debug__: - type_hints = typing.get_type_hints(StructWithCollectionOfUnionts.__init__) - check_type(argname="argument union_property", value=union_property, expected_type=type_hints["union_property"]) self._values: typing.Dict[str, typing.Any] = { "union_property": union_property, } @@ -10245,10 +9600,6 @@ class StructWithEnum: :param foo: An enum value. :param bar: Optional enum value (of type integer). Default: AllTypesEnum.YOUR_ENUM_VALUE ''' - if __debug__: - type_hints = typing.get_type_hints(StructWithEnum.__init__) - check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) - check_type(argname="argument bar", value=bar, expected_type=type_hints["bar"]) self._values: typing.Dict[str, typing.Any] = { "foo": foo, } @@ -10308,12 +9659,6 @@ class StructWithJavaReservedWords: :param result: :param that: ''' - if __debug__: - type_hints = typing.get_type_hints(StructWithJavaReservedWords.__init__) - check_type(argname="argument default", value=default, expected_type=type_hints["default"]) - check_type(argname="argument assert_", value=assert_, expected_type=type_hints["assert_"]) - check_type(argname="argument result", value=result, expected_type=type_hints["result"]) - check_type(argname="argument that", value=that, expected_type=type_hints["that"]) self._values: typing.Dict[str, typing.Any] = { "default": default, } @@ -10384,9 +9729,6 @@ class Sum( @parts.setter def parts(self, value: typing.List[scope.jsii_calc_lib.NumericValue]) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(Sum, "parts").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "parts", value) @@ -10406,10 +9748,6 @@ class SupportsNiceJavaBuilderProps: :param bar: Some number, like 42. :param id: An \`\`id\`\` field here is terrible API design, because the constructor of \`\`SupportsNiceJavaBuilder\`\` already has a parameter named \`\`id\`\`. But here we are, doing it like we didn't care. ''' - if __debug__: - type_hints = typing.get_type_hints(SupportsNiceJavaBuilderProps.__init__) - check_type(argname="argument bar", value=bar, expected_type=type_hints["bar"]) - check_type(argname="argument id", value=id, expected_type=type_hints["id"]) self._values: typing.Dict[str, typing.Any] = { "bar": bar, } @@ -10462,9 +9800,6 @@ class SupportsNiceJavaBuilderWithRequiredProps( :param bar: Some number, like 42. :param id: An \`\`id\`\` field here is terrible API design, because the constructor of \`\`SupportsNiceJavaBuilder\`\` already has a parameter named \`\`id\`\`. But here we are, doing it like we didn't care. ''' - if __debug__: - type_hints = typing.get_type_hints(SupportsNiceJavaBuilderWithRequiredProps.__init__) - check_type(argname="argument id_", value=id_, expected_type=type_hints["id_"]) props = SupportsNiceJavaBuilderProps(bar=bar, id=id) jsii.create(self.__class__, self, [id_, props]) @@ -10506,9 +9841,6 @@ class SyncVirtualMethods( ''' :param value: - ''' - if __debug__: - type_hints = typing.get_type_hints(SyncVirtualMethods.modify_other_property) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast(None, jsii.invoke(self, "modifyOtherProperty", [value])) @jsii.member(jsii_name="modifyValueOfTheProperty") @@ -10516,9 +9848,6 @@ class SyncVirtualMethods( ''' :param value: - ''' - if __debug__: - type_hints = typing.get_type_hints(SyncVirtualMethods.modify_value_of_the_property) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast(None, jsii.invoke(self, "modifyValueOfTheProperty", [value])) @jsii.member(jsii_name="readA") @@ -10542,9 +9871,6 @@ class SyncVirtualMethods( ''' :param n: - ''' - if __debug__: - type_hints = typing.get_type_hints(SyncVirtualMethods.virtual_method) - check_type(argname="argument n", value=n, expected_type=type_hints["n"]) return typing.cast(jsii.Number, jsii.invoke(self, "virtualMethod", [n])) @jsii.member(jsii_name="writeA") @@ -10552,9 +9878,6 @@ class SyncVirtualMethods( ''' :param value: - ''' - if __debug__: - type_hints = typing.get_type_hints(SyncVirtualMethods.write_a) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast(None, jsii.invoke(self, "writeA", [value])) @builtins.property @@ -10569,9 +9892,6 @@ class SyncVirtualMethods( @a.setter def a(self, value: jsii.Number) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(SyncVirtualMethods, "a").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "a", value) @builtins.property @@ -10581,9 +9901,6 @@ class SyncVirtualMethods( @caller_is_property.setter def caller_is_property(self, value: jsii.Number) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(SyncVirtualMethods, "caller_is_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "callerIsProperty", value) @builtins.property @@ -10593,9 +9910,6 @@ class SyncVirtualMethods( @other_property.setter def other_property(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(SyncVirtualMethods, "other_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "otherProperty", value) @builtins.property @@ -10605,9 +9919,6 @@ class SyncVirtualMethods( @the_property.setter def the_property(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(SyncVirtualMethods, "the_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "theProperty", value) @builtins.property @@ -10617,9 +9928,6 @@ class SyncVirtualMethods( @value_of_other_property.setter def value_of_other_property(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(SyncVirtualMethods, "value_of_other_property").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "valueOfOtherProperty", value) @@ -10706,11 +10014,6 @@ class TopLevelStruct: :param second_level: A union to really stress test our serialization. :param optional: You don't have to pass this. ''' - if __debug__: - type_hints = typing.get_type_hints(TopLevelStruct.__init__) - check_type(argname="argument required", value=required, expected_type=type_hints["required"]) - check_type(argname="argument second_level", value=second_level, expected_type=type_hints["second_level"]) - check_type(argname="argument optional", value=optional, expected_type=type_hints["optional"]) self._values: typing.Dict[str, typing.Any] = { "required": required, "second_level": second_level, @@ -10805,9 +10108,6 @@ class UnaryOperation( ''' :param operand: - ''' - if __debug__: - type_hints = typing.get_type_hints(UnaryOperation.__init__) - check_type(argname="argument operand", value=operand, expected_type=type_hints["operand"]) jsii.create(self.__class__, self, [operand]) @builtins.property @@ -10842,10 +10142,6 @@ class UnionProperties: :param bar: :param foo: ''' - if __debug__: - type_hints = typing.get_type_hints(UnionProperties.__init__) - check_type(argname="argument bar", value=bar, expected_type=type_hints["bar"]) - check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) self._values: typing.Dict[str, typing.Any] = { "bar": bar, } @@ -10886,9 +10182,6 @@ class UpcasingReflectable( ''' :param delegate: - ''' - if __debug__: - type_hints = typing.get_type_hints(UpcasingReflectable.__init__) - check_type(argname="argument delegate", value=delegate, expected_type=type_hints["delegate"]) jsii.create(self.__class__, self, [delegate]) @jsii.python.classproperty @@ -10935,9 +10228,6 @@ class UsesInterfaceWithProperties( ''' :param obj: - ''' - if __debug__: - type_hints = typing.get_type_hints(UsesInterfaceWithProperties.__init__) - check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) jsii.create(self.__class__, self, [obj]) @jsii.member(jsii_name="justRead") @@ -10952,9 +10242,6 @@ class UsesInterfaceWithProperties( ''' :param ext: - ''' - if __debug__: - type_hints = typing.get_type_hints(UsesInterfaceWithProperties.read_string_and_number) - check_type(argname="argument ext", value=ext, expected_type=type_hints["ext"]) return typing.cast(builtins.str, jsii.invoke(self, "readStringAndNumber", [ext])) @jsii.member(jsii_name="writeAndRead") @@ -10962,9 +10249,6 @@ class UsesInterfaceWithProperties( ''' :param value: - ''' - if __debug__: - type_hints = typing.get_type_hints(UsesInterfaceWithProperties.write_and_read) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast(builtins.str, jsii.invoke(self, "writeAndRead", [value])) @builtins.property @@ -10978,9 +10262,6 @@ class VariadicInvoker(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.VariadicInvo ''' :param method: - ''' - if __debug__: - type_hints = typing.get_type_hints(VariadicInvoker.__init__) - check_type(argname="argument method", value=method, expected_type=type_hints["method"]) jsii.create(self.__class__, self, [method]) @jsii.member(jsii_name="asArray") @@ -10988,9 +10269,6 @@ class VariadicInvoker(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.VariadicInvo ''' :param values: - ''' - if __debug__: - type_hints = typing.get_type_hints(VariadicInvoker.as_array) - check_type(argname="argument values", value=values, expected_type=typing.Tuple[type_hints["values"], ...]) # pyright: ignore [reportGeneralTypeIssues] return typing.cast(typing.List[jsii.Number], jsii.invoke(self, "asArray", [*values])) @@ -10999,9 +10277,6 @@ class VariadicMethod(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.VariadicMetho ''' :param prefix: a prefix that will be use for all values returned by \`\`#asArray\`\`. ''' - if __debug__: - type_hints = typing.get_type_hints(VariadicMethod.__init__) - check_type(argname="argument prefix", value=prefix, expected_type=typing.Tuple[type_hints["prefix"], ...]) # pyright: ignore [reportGeneralTypeIssues] jsii.create(self.__class__, self, [*prefix]) @jsii.member(jsii_name="asArray") @@ -11014,10 +10289,6 @@ class VariadicMethod(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.VariadicMetho :param first: the first element of the array to be returned (after the \`\`prefix\`\` provided at construction time). :param others: other elements to be included in the array. ''' - if __debug__: - type_hints = typing.get_type_hints(VariadicMethod.as_array) - check_type(argname="argument first", value=first, expected_type=type_hints["first"]) - check_type(argname="argument others", value=others, expected_type=typing.Tuple[type_hints["others"], ...]) # pyright: ignore [reportGeneralTypeIssues] return typing.cast(typing.List[jsii.Number], jsii.invoke(self, "asArray", [first, *others])) @@ -11033,9 +10304,6 @@ class VirtualMethodPlayground( ''' :param index: - ''' - if __debug__: - type_hints = typing.get_type_hints(VirtualMethodPlayground.override_me_async) - check_type(argname="argument index", value=index, expected_type=type_hints["index"]) return typing.cast(jsii.Number, jsii.ainvoke(self, "overrideMeAsync", [index])) @jsii.member(jsii_name="overrideMeSync") @@ -11043,9 +10311,6 @@ class VirtualMethodPlayground( ''' :param index: - ''' - if __debug__: - type_hints = typing.get_type_hints(VirtualMethodPlayground.override_me_sync) - check_type(argname="argument index", value=index, expected_type=type_hints["index"]) return typing.cast(jsii.Number, jsii.invoke(self, "overrideMeSync", [index])) @jsii.member(jsii_name="parallelSumAsync") @@ -11053,9 +10318,6 @@ class VirtualMethodPlayground( ''' :param count: - ''' - if __debug__: - type_hints = typing.get_type_hints(VirtualMethodPlayground.parallel_sum_async) - check_type(argname="argument count", value=count, expected_type=type_hints["count"]) return typing.cast(jsii.Number, jsii.ainvoke(self, "parallelSumAsync", [count])) @jsii.member(jsii_name="serialSumAsync") @@ -11063,9 +10325,6 @@ class VirtualMethodPlayground( ''' :param count: - ''' - if __debug__: - type_hints = typing.get_type_hints(VirtualMethodPlayground.serial_sum_async) - check_type(argname="argument count", value=count, expected_type=type_hints["count"]) return typing.cast(jsii.Number, jsii.ainvoke(self, "serialSumAsync", [count])) @jsii.member(jsii_name="sumSync") @@ -11073,9 +10332,6 @@ class VirtualMethodPlayground( ''' :param count: - ''' - if __debug__: - type_hints = typing.get_type_hints(VirtualMethodPlayground.sum_sync) - check_type(argname="argument count", value=count, expected_type=type_hints["count"]) return typing.cast(jsii.Number, jsii.invoke(self, "sumSync", [count])) @@ -11127,9 +10383,6 @@ class WithPrivatePropertyInConstructor( ''' :param private_field: - ''' - if __debug__: - type_hints = typing.get_type_hints(WithPrivatePropertyInConstructor.__init__) - check_type(argname="argument private_field", value=private_field, expected_type=type_hints["private_field"]) jsii.create(self.__class__, self, [private_field]) @builtins.property @@ -11174,9 +10427,6 @@ class _AbstractClassProxy( ''' :param name: - ''' - if __debug__: - type_hints = typing.get_type_hints(AbstractClass.abstract_method) - check_type(argname="argument name", value=name, expected_type=type_hints["name"]) return typing.cast(builtins.str, jsii.invoke(self, "abstractMethod", [name])) # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class @@ -11196,10 +10446,6 @@ class Add(BinaryOperation, metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Add"): :param lhs: Left-hand side operand. :param rhs: Right-hand side operand. ''' - if __debug__: - type_hints = typing.get_type_hints(Add.__init__) - check_type(argname="argument lhs", value=lhs, expected_type=type_hints["lhs"]) - check_type(argname="argument rhs", value=rhs, expected_type=type_hints["rhs"]) jsii.create(self.__class__, self, [lhs, rhs]) @jsii.member(jsii_name="toString") @@ -11247,9 +10493,6 @@ class Bell(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Bell"): @rung.setter def rung(self, value: builtins.bool) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(Bell, "rung").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "rung", value) @@ -11264,10 +10507,6 @@ class ChildStruct982(ParentStruct982): :param foo: :param bar: ''' - if __debug__: - type_hints = typing.get_type_hints(ChildStruct982.__init__) - check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) - check_type(argname="argument bar", value=bar, expected_type=type_hints["bar"]) self._values: typing.Dict[str, typing.Any] = { "foo": foo, "bar": bar, @@ -11312,9 +10551,6 @@ class ClassThatImplementsTheInternalInterface( @a.setter def a(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(ClassThatImplementsTheInternalInterface, "a").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "a", value) @builtins.property @@ -11324,9 +10560,6 @@ class ClassThatImplementsTheInternalInterface( @b.setter def b(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(ClassThatImplementsTheInternalInterface, "b").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "b", value) @builtins.property @@ -11336,9 +10569,6 @@ class ClassThatImplementsTheInternalInterface( @c.setter def c(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(ClassThatImplementsTheInternalInterface, "c").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "c", value) @builtins.property @@ -11348,9 +10578,6 @@ class ClassThatImplementsTheInternalInterface( @d.setter def d(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(ClassThatImplementsTheInternalInterface, "d").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "d", value) @@ -11369,9 +10596,6 @@ class ClassThatImplementsThePrivateInterface( @a.setter def a(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(ClassThatImplementsThePrivateInterface, "a").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "a", value) @builtins.property @@ -11381,9 +10605,6 @@ class ClassThatImplementsThePrivateInterface( @b.setter def b(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(ClassThatImplementsThePrivateInterface, "b").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "b", value) @builtins.property @@ -11393,9 +10614,6 @@ class ClassThatImplementsThePrivateInterface( @c.setter def c(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(ClassThatImplementsThePrivateInterface, "c").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "c", value) @builtins.property @@ -11405,9 +10623,6 @@ class ClassThatImplementsThePrivateInterface( @e.setter def e(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(ClassThatImplementsThePrivateInterface, "e").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "e", value) @@ -11429,10 +10644,6 @@ class ClassWithPrivateConstructorAndAutomaticProperties( :param read_only_string: - :param read_write_string: - ''' - if __debug__: - type_hints = typing.get_type_hints(ClassWithPrivateConstructorAndAutomaticProperties.create) - check_type(argname="argument read_only_string", value=read_only_string, expected_type=type_hints["read_only_string"]) - check_type(argname="argument read_write_string", value=read_write_string, expected_type=type_hints["read_write_string"]) return typing.cast("ClassWithPrivateConstructorAndAutomaticProperties", jsii.sinvoke(cls, "create", [read_only_string, read_write_string])) @builtins.property @@ -11447,9 +10658,6 @@ class ClassWithPrivateConstructorAndAutomaticProperties( @read_write_string.setter def read_write_string(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(ClassWithPrivateConstructorAndAutomaticProperties, "read_write_string").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "readWriteString", value) @@ -11568,9 +10776,6 @@ class JSII417Derived( ''' :param property: - ''' - if __debug__: - type_hints = typing.get_type_hints(JSII417Derived.__init__) - check_type(argname="argument property", value=property, expected_type=type_hints["property"]) jsii.create(self.__class__, self, [property]) @jsii.member(jsii_name="bar") @@ -11595,9 +10800,6 @@ class Negate(UnaryOperation, metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Negat ''' :param operand: - ''' - if __debug__: - type_hints = typing.get_type_hints(Negate.__init__) - check_type(argname="argument operand", value=operand, expected_type=type_hints["operand"]) jsii.create(self.__class__, self, [operand]) @jsii.member(jsii_name="farewell") @@ -11661,12 +10863,6 @@ class SupportsNiceJavaBuilder( :param props: some props once can provide. :param rest: a variadic continuation. ''' - if __debug__: - type_hints = typing.get_type_hints(SupportsNiceJavaBuilder.__init__) - check_type(argname="argument id", value=id, expected_type=type_hints["id"]) - check_type(argname="argument default_bar", value=default_bar, expected_type=type_hints["default_bar"]) - check_type(argname="argument props", value=props, expected_type=type_hints["props"]) - check_type(argname="argument rest", value=rest, expected_type=typing.Tuple[type_hints["rest"], ...]) # pyright: ignore [reportGeneralTypeIssues] jsii.create(self.__class__, self, [id, default_bar, props, *rest]) @builtins.property @@ -12061,9 +11257,6 @@ class UseOptions(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.anonymous.UseOpti ''' :param option: - ''' - if __debug__: - type_hints = typing.get_type_hints(UseOptions.consume) - check_type(argname="argument option", value=option, expected_type=type_hints["option"]) return typing.cast(builtins.str, jsii.sinvoke(cls, "consume", [option])) @jsii.member(jsii_name="privideAsAny") @@ -12072,9 +11265,6 @@ class UseOptions(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.anonymous.UseOpti ''' :param which: - ''' - if __debug__: - type_hints = typing.get_type_hints(UseOptions.privide_as_any) - check_type(argname="argument which", value=which, expected_type=type_hints["which"]) return typing.cast(typing.Any, jsii.sinvoke(cls, "privideAsAny", [which])) @jsii.member(jsii_name="provide") @@ -12083,9 +11273,6 @@ class UseOptions(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.anonymous.UseOpti ''' :param which: - ''' - if __debug__: - type_hints = typing.get_type_hints(UseOptions.provide) - check_type(argname="argument which", value=which, expected_type=type_hints["which"]) return typing.cast(typing.Union[IOptionA, IOptionB], jsii.sinvoke(cls, "provide", [which])) @@ -12146,9 +11333,6 @@ class _Cdk16625Proxy(Cdk16625): :param gen: a VERY pseudo random number generator. ''' - if __debug__: - type_hints = typing.get_type_hints(Cdk16625._unwrap) - check_type(argname="argument gen", value=gen, expected_type=type_hints["gen"]) return typing.cast(jsii.Number, jsii.invoke(self, "unwrap", [gen])) # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class @@ -12203,9 +11387,6 @@ class UnimportedSubmoduleType( ''' :param value: - ''' - if __debug__: - type_hints = typing.get_type_hints(UnimportedSubmoduleType.__init__) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.create(self.__class__, self, [value]) @jsii.member(jsii_name="next") @@ -12282,9 +11463,6 @@ class CompositeOperation( @decoration_postfixes.setter def decoration_postfixes(self, value: typing.List[builtins.str]) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(CompositeOperation, "decoration_postfixes").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "decorationPostfixes", value) @builtins.property @@ -12295,9 +11473,6 @@ class CompositeOperation( @decoration_prefixes.setter def decoration_prefixes(self, value: typing.List[builtins.str]) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(CompositeOperation, "decoration_prefixes").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "decorationPrefixes", value) @builtins.property @@ -12308,9 +11483,6 @@ class CompositeOperation( @string_style.setter def string_style(self, value: "CompositeOperation.CompositionStringStyle") -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(CompositeOperation, "string_style").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "stringStyle", value) @jsii.enum( @@ -12380,9 +11552,6 @@ class Base( @prop.setter def prop(self, value: builtins.str) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(Base, "prop").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "prop", value) @@ -12434,9 +11603,6 @@ class Foo( @bar.setter def bar(self, value: typing.Optional[builtins.str]) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(Foo, "bar").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "bar", value) @@ -12450,9 +11616,6 @@ class Hello: ''' :param foo: ''' - if __debug__: - type_hints = typing.get_type_hints(Hello.__init__) - check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) self._values: typing.Dict[str, typing.Any] = { "foo": foo, } @@ -12510,9 +11673,6 @@ class Hello: ''' :param foo: ''' - if __debug__: - type_hints = typing.get_type_hints(Hello.__init__) - check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) self._values: typing.Dict[str, typing.Any] = { "foo": foo, } @@ -12575,10 +11735,6 @@ class ImplementMeOpts: :param name: :param count: ''' - if __debug__: - type_hints = typing.get_type_hints(ImplementMeOpts.__init__) - check_type(argname="argument name", value=name, expected_type=type_hints["name"]) - check_type(argname="argument count", value=count, expected_type=type_hints["count"]) self._values: typing.Dict[str, typing.Any] = { "name": name, } @@ -12621,9 +11777,6 @@ class OverrideMe( ''' :param receiver: - ''' - if __debug__: - type_hints = typing.get_type_hints(OverrideMe.call_abstract) - check_type(argname="argument receiver", value=receiver, expected_type=type_hints["receiver"]) return typing.cast(builtins.bool, jsii.sinvoke(cls, "callAbstract", [receiver])) @jsii.member(jsii_name="implementMe") @@ -12696,9 +11849,6 @@ class MyClass(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.module2530.MyClass") ''' :param _: - ''' - if __debug__: - type_hints = typing.get_type_hints(MyClass.__init__) - check_type(argname="argument _", value=_, expected_type=type_hints["_"]) jsii.create(self.__class__, self, [_]) @jsii.member(jsii_name="bar") @@ -12707,9 +11857,6 @@ class MyClass(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.module2530.MyClass") ''' :param _: - ''' - if __debug__: - type_hints = typing.get_type_hints(MyClass.bar) - check_type(argname="argument _", value=_, expected_type=type_hints["_"]) return typing.cast(None, jsii.sinvoke(cls, "bar", [_])) @jsii.member(jsii_name="foo") @@ -12717,9 +11864,6 @@ class MyClass(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.module2530.MyClass") ''' :param _: - ''' - if __debug__: - type_hints = typing.get_type_hints(MyClass.foo) - check_type(argname="argument _", value=_, expected_type=type_hints["_"]) return typing.cast(None, jsii.invoke(self, "foo", [_])) @@ -12806,9 +11950,6 @@ class ExtendAndImplement( :stability: deprecated ''' - if __debug__: - type_hints = typing.get_type_hints(ExtendAndImplement.__init__) - check_type(argname="argument very", value=very, expected_type=type_hints["very"]) jsii.create(self.__class__, self, [very]) @jsii.member(jsii_name="hello") @@ -12895,9 +12036,6 @@ class MyClass( ''' :param _bar: - ''' - if __debug__: - type_hints = typing.get_type_hints(MyClass.bar) - check_type(argname="argument _bar", value=_bar, expected_type=type_hints["_bar"]) return typing.cast(None, jsii.invoke(self, "bar", [_bar])) @jsii.member(jsii_name="foo") @@ -12905,9 +12043,6 @@ class MyClass( ''' :param _values: - ''' - if __debug__: - type_hints = typing.get_type_hints(MyClass.foo) - check_type(argname="argument _values", value=_values, expected_type=type_hints["_values"]) return typing.cast(None, jsii.invoke(self, "foo", [_values])) @@ -13036,10 +12171,6 @@ class MyStruct: :param base_map: :param numbers: ''' - if __debug__: - type_hints = typing.get_type_hints(MyStruct.__init__) - check_type(argname="argument base_map", value=base_map, expected_type=type_hints["base_map"]) - check_type(argname="argument numbers", value=numbers, expected_type=type_hints["numbers"]) self._values: typing.Dict[str, typing.Any] = { "base_map": base_map, "numbers": numbers, @@ -13131,9 +12262,6 @@ class Bar: ''' :param bar1: ''' - if __debug__: - type_hints = typing.get_type_hints(Bar.__init__) - check_type(argname="argument bar1", value=bar1, expected_type=type_hints["bar1"]) self._values: typing.Dict[str, typing.Any] = { "bar1": bar1, } @@ -13192,9 +12320,6 @@ class Bar: ''' :param bar2: ''' - if __debug__: - type_hints = typing.get_type_hints(Bar.__init__) - check_type(argname="argument bar2", value=bar2, expected_type=type_hints["bar2"]) self._values: typing.Dict[str, typing.Any] = { "bar2": bar2, } @@ -13235,11 +12360,6 @@ class Foo(Bar, _Bar_ec7eccad): :param bar1: :param foo2: ''' - if __debug__: - type_hints = typing.get_type_hints(Foo.__init__) - check_type(argname="argument bar2", value=bar2, expected_type=type_hints["bar2"]) - check_type(argname="argument bar1", value=bar1, expected_type=type_hints["bar1"]) - check_type(argname="argument foo2", value=foo2, expected_type=type_hints["foo2"]) self._values: typing.Dict[str, typing.Any] = { "bar2": bar2, "bar1": bar1, @@ -13762,9 +12882,6 @@ class ClassWithSelf( ''' :param self: - ''' - if __debug__: - type_hints = typing.get_type_hints(ClassWithSelf.__init__) - check_type(argname="argument self", value=self, expected_type=type_hints["self"]) jsii.create(self_.__class__, self_, [self]) @jsii.member(jsii_name="method") @@ -13772,9 +12889,6 @@ class ClassWithSelf( ''' :param self: - ''' - if __debug__: - type_hints = typing.get_type_hints(ClassWithSelf.method) - check_type(argname="argument self", value=self, expected_type=type_hints["self"]) return typing.cast(builtins.str, jsii.invoke(self_, "method", [self])) @builtins.property @@ -13819,9 +12933,6 @@ class _IInterfaceWithSelfProxy: ''' :param self: - ''' - if __debug__: - type_hints = typing.get_type_hints(IInterfaceWithSelf.method) - check_type(argname="argument self", value=self, expected_type=type_hints["self"]) return typing.cast(builtins.str, jsii.invoke(self_, "method", [self])) # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface @@ -13838,9 +12949,6 @@ class StructWithSelf: ''' :param self: ''' - if __debug__: - type_hints = typing.get_type_hints(StructWithSelf.__init__) - check_type(argname="argument self", value=self, expected_type=type_hints["self"]) self_._values: typing.Dict[str, typing.Any] = { "self": self, } @@ -13918,9 +13026,6 @@ class Default: :see: https://github.com/aws/jsii/issues/2637 ''' - if __debug__: - type_hints = typing.get_type_hints(Default.__init__) - check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) self._values: typing.Dict[str, typing.Any] = { "foo": foo, } @@ -13989,9 +13094,6 @@ class MyClass(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.submodule.MyClass"): @all_types.setter def all_types(self, value: typing.Optional[_AllTypes_b08307c5]) -> None: - if __debug__: - type_hints = typing.get_type_hints(getattr(MyClass, "all_types").fset) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "allTypes", value) @@ -14046,9 +13148,6 @@ class MyClassReference: ''' :param reference: ''' - if __debug__: - type_hints = typing.get_type_hints(MyClassReference.__init__) - check_type(argname="argument reference", value=reference, expected_type=type_hints["reference"]) self._values: typing.Dict[str, typing.Any] = { "reference": reference, } @@ -14157,9 +13256,6 @@ class SomeStruct: ''' :param prop: ''' - if __debug__: - type_hints = typing.get_type_hints(SomeStruct.__init__) - check_type(argname="argument prop", value=prop, expected_type=type_hints["prop"]) self._values: typing.Dict[str, typing.Any] = { "prop": prop, } @@ -14192,9 +13288,6 @@ class Structure: ''' :param bool: ''' - if __debug__: - type_hints = typing.get_type_hints(Structure.__init__) - check_type(argname="argument bool", value=bool, expected_type=type_hints["bool"]) self._values: typing.Dict[str, typing.Any] = { "bool": bool, } @@ -14233,10 +13326,6 @@ class KwargsProps(SomeStruct): :param prop: :param extra: ''' - if __debug__: - type_hints = typing.get_type_hints(KwargsProps.__init__) - check_type(argname="argument prop", value=prop, expected_type=type_hints["prop"]) - check_type(argname="argument extra", value=extra, expected_type=type_hints["extra"]) self._values: typing.Dict[str, typing.Any] = { "prop": prop, } @@ -14464,9 +13553,6 @@ class SpecialParameter: ''' :param value: ''' - if __debug__: - type_hints = typing.get_type_hints(SpecialParameter.__init__) - check_type(argname="argument value", value=value, expected_type=type_hints["value"]) self._values: typing.Dict[str, typing.Any] = { "value": value, } @@ -14584,31 +13670,31 @@ exports[`Generated code for "jsii-calc": / 1`] = ` `; exports[`Generated code for "jsii-calc": /python/src/jsii_calc/__init__.py.diff 1`] = ` ---- python/src/jsii_calc/__init__.py --runtime-type-checking -+++ python/src/jsii_calc/__init__.py --no-runtime-type-checking -@@ -111,13 +111,10 @@ +--- python/src/jsii_calc/__init__.py --no-runtime-type-checking ++++ python/src/jsii_calc/__init__.py --runtime-type-checking +@@ -111,10 +111,13 @@ def work_it_all(self, seed: builtins.str) -> builtins.str: '''Sets \`\`seed\`\` to \`\`this.property\`\`, then calls \`\`someMethod\`\` with \`\`this.property\`\` and returns the result. :param seed: a \`\`string\`\`. ''' -- if __debug__: -- type_hints = typing.get_type_hints(AbstractSuite.work_it_all) -- check_type(argname="argument seed", value=seed, expected_type=type_hints["seed"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(AbstractSuite.work_it_all) ++ check_type(argname="argument seed", value=seed, expected_type=type_hints["seed"]) return typing.cast(builtins.str, jsii.invoke(self, "workItAll", [seed])) @builtins.property @jsii.member(jsii_name="property") @abc.abstractmethod -@@ -134,25 +131,19 @@ +@@ -131,19 +134,25 @@ @jsii.member(jsii_name="someMethod") def _some_method(self, str: builtins.str) -> builtins.str: ''' :param str: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(AbstractSuite._some_method) -- check_type(argname="argument str", value=str, expected_type=type_hints["str"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(AbstractSuite._some_method) ++ check_type(argname="argument str", value=str, expected_type=type_hints["str"]) return typing.cast(builtins.str, jsii.invoke(self, "someMethod", [str])) @builtins.property @@ -14618,51 +13704,51 @@ exports[`Generated code for "jsii-calc": /python/src/js @_property.setter def _property(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(AbstractSuite, "_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(AbstractSuite, "_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "property", value) # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class typing.cast(typing.Any, AbstractSuite).__jsii_proxy_class__ = lambda : _AbstractSuiteProxy -@@ -170,13 +161,10 @@ +@@ -161,10 +170,13 @@ @jsii.member(jsii_name="anyIn") def any_in(self, inp: typing.Any) -> None: ''' :param inp: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(AllTypes.any_in) -- check_type(argname="argument inp", value=inp, expected_type=type_hints["inp"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(AllTypes.any_in) ++ check_type(argname="argument inp", value=inp, expected_type=type_hints["inp"]) return typing.cast(None, jsii.invoke(self, "anyIn", [inp])) @jsii.member(jsii_name="anyOut") def any_out(self) -> typing.Any: return typing.cast(typing.Any, jsii.invoke(self, "anyOut", [])) -@@ -184,13 +172,10 @@ +@@ -172,10 +184,13 @@ @jsii.member(jsii_name="enumMethod") def enum_method(self, value: "StringEnum") -> "StringEnum": ''' :param value: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(AllTypes.enum_method) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(AllTypes.enum_method) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast("StringEnum", jsii.invoke(self, "enumMethod", [value])) @builtins.property @jsii.member(jsii_name="enumPropertyValue") def enum_property_value(self) -> jsii.Number: -@@ -201,97 +186,73 @@ +@@ -186,73 +201,97 @@ def any_array_property(self) -> typing.List[typing.Any]: return typing.cast(typing.List[typing.Any], jsii.get(self, "anyArrayProperty")) @any_array_property.setter def any_array_property(self, value: typing.List[typing.Any]) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(AllTypes, "any_array_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(AllTypes, "any_array_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "anyArrayProperty", value) @builtins.property @@ -14672,9 +13758,9 @@ exports[`Generated code for "jsii-calc": /python/src/js @any_map_property.setter def any_map_property(self, value: typing.Mapping[builtins.str, typing.Any]) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(AllTypes, "any_map_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(AllTypes, "any_map_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "anyMapProperty", value) @builtins.property @@ -14684,9 +13770,9 @@ exports[`Generated code for "jsii-calc": /python/src/js @any_property.setter def any_property(self, value: typing.Any) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(AllTypes, "any_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(AllTypes, "any_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "anyProperty", value) @builtins.property @@ -14696,9 +13782,9 @@ exports[`Generated code for "jsii-calc": /python/src/js @array_property.setter def array_property(self, value: typing.List[builtins.str]) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(AllTypes, "array_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(AllTypes, "array_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "arrayProperty", value) @builtins.property @@ -14708,9 +13794,9 @@ exports[`Generated code for "jsii-calc": /python/src/js @boolean_property.setter def boolean_property(self, value: builtins.bool) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(AllTypes, "boolean_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(AllTypes, "boolean_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "booleanProperty", value) @builtins.property @@ -14720,9 +13806,9 @@ exports[`Generated code for "jsii-calc": /python/src/js @date_property.setter def date_property(self, value: datetime.datetime) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(AllTypes, "date_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(AllTypes, "date_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "dateProperty", value) @builtins.property @@ -14732,9 +13818,9 @@ exports[`Generated code for "jsii-calc": /python/src/js @enum_property.setter def enum_property(self, value: "AllTypesEnum") -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(AllTypes, "enum_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(AllTypes, "enum_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "enumProperty", value) @builtins.property @@ -14744,23 +13830,23 @@ exports[`Generated code for "jsii-calc": /python/src/js @json_property.setter def json_property(self, value: typing.Mapping[typing.Any, typing.Any]) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(AllTypes, "json_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(AllTypes, "json_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "jsonProperty", value) @builtins.property @jsii.member(jsii_name="mapProperty") def map_property(self) -> typing.Mapping[builtins.str, scope.jsii_calc_lib.Number]: -@@ -300,37 +261,28 @@ +@@ -261,28 +300,37 @@ @map_property.setter def map_property( self, value: typing.Mapping[builtins.str, scope.jsii_calc_lib.Number], ) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(AllTypes, "map_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(AllTypes, "map_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "mapProperty", value) @builtins.property @@ -14770,9 +13856,9 @@ exports[`Generated code for "jsii-calc": /python/src/js @number_property.setter def number_property(self, value: jsii.Number) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(AllTypes, "number_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(AllTypes, "number_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "numberProperty", value) @builtins.property @@ -14782,51 +13868,51 @@ exports[`Generated code for "jsii-calc": /python/src/js @string_property.setter def string_property(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(AllTypes, "string_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(AllTypes, "string_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "stringProperty", value) @builtins.property @jsii.member(jsii_name="unionArrayProperty") def union_array_property( -@@ -341,13 +293,10 @@ +@@ -293,10 +341,13 @@ @union_array_property.setter def union_array_property( self, value: typing.List[typing.Union[jsii.Number, scope.jsii_calc_lib.NumericValue]], ) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(AllTypes, "union_array_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(AllTypes, "union_array_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "unionArrayProperty", value) @builtins.property @jsii.member(jsii_name="unionMapProperty") def union_map_property( -@@ -358,13 +307,10 @@ +@@ -307,10 +358,13 @@ @union_map_property.setter def union_map_property( self, value: typing.Mapping[builtins.str, typing.Union[builtins.str, jsii.Number, scope.jsii_calc_lib.Number]], ) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(AllTypes, "union_map_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(AllTypes, "union_map_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "unionMapProperty", value) @builtins.property @jsii.member(jsii_name="unionProperty") def union_property( -@@ -375,25 +321,19 @@ +@@ -321,19 +375,25 @@ @union_property.setter def union_property( self, value: typing.Union[builtins.str, jsii.Number, scope.jsii_calc_lib.Number, "Multiply"], ) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(AllTypes, "union_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(AllTypes, "union_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "unionProperty", value) @builtins.property @@ -14836,23 +13922,23 @@ exports[`Generated code for "jsii-calc": /python/src/js @unknown_array_property.setter def unknown_array_property(self, value: typing.List[typing.Any]) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(AllTypes, "unknown_array_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(AllTypes, "unknown_array_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "unknownArrayProperty", value) @builtins.property @jsii.member(jsii_name="unknownMapProperty") def unknown_map_property(self) -> typing.Mapping[builtins.str, typing.Any]: -@@ -402,37 +342,28 @@ +@@ -342,28 +402,37 @@ @unknown_map_property.setter def unknown_map_property( self, value: typing.Mapping[builtins.str, typing.Any], ) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(AllTypes, "unknown_map_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(AllTypes, "unknown_map_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "unknownMapProperty", value) @builtins.property @@ -14862,9 +13948,9 @@ exports[`Generated code for "jsii-calc": /python/src/js @unknown_property.setter def unknown_property(self, value: typing.Any) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(AllTypes, "unknown_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(AllTypes, "unknown_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "unknownProperty", value) @builtins.property @@ -14874,24 +13960,24 @@ exports[`Generated code for "jsii-calc": /python/src/js @optional_enum_value.setter def optional_enum_value(self, value: typing.Optional["StringEnum"]) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(AllTypes, "optional_enum_value").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(AllTypes, "optional_enum_value").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "optionalEnumValue", value) @jsii.enum(jsii_type="jsii-calc.AllTypesEnum") class AllTypesEnum(enum.Enum): -@@ -452,52 +383,36 @@ +@@ -383,36 +452,52 @@ def get_bar(self, _p1: builtins.str, _p2: jsii.Number) -> None: ''' :param _p1: - :param _p2: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(AllowedMethodNames.get_bar) -- check_type(argname="argument _p1", value=_p1, expected_type=type_hints["_p1"]) -- check_type(argname="argument _p2", value=_p2, expected_type=type_hints["_p2"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(AllowedMethodNames.get_bar) ++ check_type(argname="argument _p1", value=_p1, expected_type=type_hints["_p1"]) ++ check_type(argname="argument _p2", value=_p2, expected_type=type_hints["_p2"]) return typing.cast(None, jsii.invoke(self, "getBar", [_p1, _p2])) @jsii.member(jsii_name="getFoo") @@ -14900,9 +13986,9 @@ exports[`Generated code for "jsii-calc": /python/src/js :param with_param: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(AllowedMethodNames.get_foo) -- check_type(argname="argument with_param", value=with_param, expected_type=type_hints["with_param"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(AllowedMethodNames.get_foo) ++ check_type(argname="argument with_param", value=with_param, expected_type=type_hints["with_param"]) return typing.cast(builtins.str, jsii.invoke(self, "getFoo", [with_param])) @jsii.member(jsii_name="setBar") @@ -14912,11 +13998,11 @@ exports[`Generated code for "jsii-calc": /python/src/js :param _y: - :param _z: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(AllowedMethodNames.set_bar) -- check_type(argname="argument _x", value=_x, expected_type=type_hints["_x"]) -- check_type(argname="argument _y", value=_y, expected_type=type_hints["_y"]) -- check_type(argname="argument _z", value=_z, expected_type=type_hints["_z"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(AllowedMethodNames.set_bar) ++ check_type(argname="argument _x", value=_x, expected_type=type_hints["_x"]) ++ check_type(argname="argument _y", value=_y, expected_type=type_hints["_y"]) ++ check_type(argname="argument _z", value=_z, expected_type=type_hints["_z"]) return typing.cast(None, jsii.invoke(self, "setBar", [_x, _y, _z])) @jsii.member(jsii_name="setFoo") @@ -14926,81 +14012,81 @@ exports[`Generated code for "jsii-calc": /python/src/js :param _x: - :param _y: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(AllowedMethodNames.set_foo) -- check_type(argname="argument _x", value=_x, expected_type=type_hints["_x"]) -- check_type(argname="argument _y", value=_y, expected_type=type_hints["_y"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(AllowedMethodNames.set_foo) ++ check_type(argname="argument _x", value=_x, expected_type=type_hints["_x"]) ++ check_type(argname="argument _y", value=_y, expected_type=type_hints["_y"]) return typing.cast(None, jsii.invoke(self, "setFoo", [_x, _y])) class AmbiguousParameters( metaclass=jsii.JSIIMeta, -@@ -513,13 +428,10 @@ +@@ -428,10 +513,13 @@ ''' :param scope_: - :param scope: :param props: ''' -- if __debug__: -- type_hints = typing.get_type_hints(AmbiguousParameters.__init__) -- check_type(argname="argument scope_", value=scope_, expected_type=type_hints["scope_"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(AmbiguousParameters.__init__) ++ check_type(argname="argument scope_", value=scope_, expected_type=type_hints["scope_"]) props_ = StructParameterType(scope=scope, props=props) jsii.create(self.__class__, self, [scope_, props_]) @builtins.property -@@ -566,13 +478,10 @@ +@@ -478,10 +566,13 @@ @jsii.member(jsii_name="overrideMe") def override_me(self, mult: jsii.Number) -> jsii.Number: ''' :param mult: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(AsyncVirtualMethods.override_me) -- check_type(argname="argument mult", value=mult, expected_type=type_hints["mult"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(AsyncVirtualMethods.override_me) ++ check_type(argname="argument mult", value=mult, expected_type=type_hints["mult"]) return typing.cast(jsii.Number, jsii.ainvoke(self, "overrideMe", [mult])) @jsii.member(jsii_name="overrideMeToo") def override_me_too(self) -> jsii.Number: return typing.cast(jsii.Number, jsii.ainvoke(self, "overrideMeToo", [])) -@@ -633,14 +542,10 @@ +@@ -542,10 +633,14 @@ '''Creates a BinaryOperation. :param lhs: Left-hand side operand. :param rhs: Right-hand side operand. ''' -- if __debug__: -- type_hints = typing.get_type_hints(BinaryOperation.__init__) -- check_type(argname="argument lhs", value=lhs, expected_type=type_hints["lhs"]) -- check_type(argname="argument rhs", value=rhs, expected_type=type_hints["rhs"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(BinaryOperation.__init__) ++ check_type(argname="argument lhs", value=lhs, expected_type=type_hints["lhs"]) ++ check_type(argname="argument rhs", value=rhs, expected_type=type_hints["rhs"]) jsii.create(self.__class__, self, [lhs, rhs]) @jsii.member(jsii_name="hello") def hello(self) -> builtins.str: '''Say hello!''' -@@ -701,13 +606,10 @@ +@@ -606,10 +701,13 @@ :param value: the value that should be returned. :return: \`\`value\`\` ''' -- if __debug__: -- type_hints = typing.get_type_hints(BurriedAnonymousObject.give_it_back) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(BurriedAnonymousObject.give_it_back) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast(typing.Any, jsii.invoke(self, "giveItBack", [value])) # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class typing.cast(typing.Any, BurriedAnonymousObject).__jsii_proxy_class__ = lambda : _BurriedAnonymousObjectProxy -@@ -757,24 +659,18 @@ +@@ -659,18 +757,24 @@ def add(self, value: jsii.Number) -> None: '''Adds a number to the current value. :param value: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(Calculator.add) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(Calculator.add) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast(None, jsii.invoke(self, "add", [value])) @jsii.member(jsii_name="mul") @@ -15009,37 +14095,37 @@ exports[`Generated code for "jsii-calc": /python/src/js :param value: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(Calculator.mul) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(Calculator.mul) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast(None, jsii.invoke(self, "mul", [value])) @jsii.member(jsii_name="neg") def neg(self) -> None: '''Negates the current value.''' -@@ -784,13 +680,10 @@ +@@ -680,10 +784,13 @@ def pow(self, value: jsii.Number) -> None: '''Raises the current value by a power. :param value: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(Calculator.pow) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(Calculator.pow) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast(None, jsii.invoke(self, "pow", [value])) @jsii.member(jsii_name="readUnionValue") def read_union_value(self) -> jsii.Number: '''Returns teh value of the union property (if defined).''' -@@ -822,26 +715,20 @@ +@@ -715,20 +822,26 @@ '''The current value.''' return typing.cast(scope.jsii_calc_lib.NumericValue, jsii.get(self, "curr")) @curr.setter def curr(self, value: scope.jsii_calc_lib.NumericValue) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(Calculator, "curr").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(Calculator, "curr").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "curr", value) @builtins.property @@ -15050,95 +14136,95 @@ exports[`Generated code for "jsii-calc": /python/src/js @max_value.setter def max_value(self, value: typing.Optional[jsii.Number]) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(Calculator, "max_value").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(Calculator, "max_value").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "maxValue", value) @builtins.property @jsii.member(jsii_name="unionProperty") def union_property( -@@ -853,13 +740,10 @@ +@@ -740,10 +853,13 @@ @union_property.setter def union_property( self, value: typing.Optional[typing.Union["Add", "Multiply", "Power"]], ) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(Calculator, "union_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(Calculator, "union_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "unionProperty", value) @jsii.data_type( jsii_type="jsii-calc.CalculatorProps", -@@ -876,14 +760,10 @@ +@@ -760,10 +876,14 @@ '''Properties for Calculator. :param initial_value: The initial value of the calculator. NOTE: Any number works here, it's fine. Default: 0 :param maximum_value: The maximum value the calculator can store. Default: none ''' -- if __debug__: -- type_hints = typing.get_type_hints(CalculatorProps.__init__) -- check_type(argname="argument initial_value", value=initial_value, expected_type=type_hints["initial_value"]) -- check_type(argname="argument maximum_value", value=maximum_value, expected_type=type_hints["maximum_value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(CalculatorProps.__init__) ++ check_type(argname="argument initial_value", value=initial_value, expected_type=type_hints["initial_value"]) ++ check_type(argname="argument maximum_value", value=maximum_value, expected_type=type_hints["maximum_value"]) self._values: typing.Dict[str, typing.Any] = {} if initial_value is not None: self._values["initial_value"] = initial_value if maximum_value is not None: self._values["maximum_value"] = maximum_value -@@ -929,13 +809,10 @@ +@@ -809,10 +929,13 @@ union_property: typing.Sequence[typing.Mapping[builtins.str, typing.Union[typing.Union["StructA", typing.Dict[str, typing.Any]], typing.Union["StructB", typing.Dict[str, typing.Any]]]]], ) -> None: ''' :param union_property: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(ClassWithCollectionOfUnions.__init__) -- check_type(argname="argument union_property", value=union_property, expected_type=type_hints["union_property"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ClassWithCollectionOfUnions.__init__) ++ check_type(argname="argument union_property", value=union_property, expected_type=type_hints["union_property"]) jsii.create(self.__class__, self, [union_property]) @builtins.property @jsii.member(jsii_name="unionProperty") def union_property( -@@ -946,13 +823,10 @@ +@@ -823,10 +946,13 @@ @union_property.setter def union_property( self, value: typing.List[typing.Mapping[builtins.str, typing.Union["StructA", "StructB"]]], ) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(ClassWithCollectionOfUnions, "union_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(ClassWithCollectionOfUnions, "union_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "unionProperty", value) class ClassWithCollections( metaclass=jsii.JSIIMeta, -@@ -965,14 +839,10 @@ +@@ -839,10 +965,14 @@ ) -> None: ''' :param map: - :param array: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(ClassWithCollections.__init__) -- check_type(argname="argument map", value=map, expected_type=type_hints["map"]) -- check_type(argname="argument array", value=array, expected_type=type_hints["array"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ClassWithCollections.__init__) ++ check_type(argname="argument map", value=map, expected_type=type_hints["map"]) ++ check_type(argname="argument array", value=array, expected_type=type_hints["array"]) jsii.create(self.__class__, self, [map, array]) @jsii.member(jsii_name="createAList") @builtins.classmethod def create_a_list(cls) -> typing.List[builtins.str]: -@@ -988,49 +858,37 @@ +@@ -858,37 +988,49 @@ def static_array(cls) -> typing.List[builtins.str]: # pyright: ignore [reportGeneralTypeIssues] return typing.cast(typing.List[builtins.str], jsii.sget(cls, "staticArray")) @static_array.setter # type: ignore[no-redef] def static_array(cls, value: typing.List[builtins.str]) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(ClassWithCollections, "static_array").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(ClassWithCollections, "static_array").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.sset(cls, "staticArray", value) @jsii.python.classproperty @@ -15148,9 +14234,9 @@ exports[`Generated code for "jsii-calc": /python/src/js @static_map.setter # type: ignore[no-redef] def static_map(cls, value: typing.Mapping[builtins.str, builtins.str]) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(ClassWithCollections, "static_map").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(ClassWithCollections, "static_map").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.sset(cls, "staticMap", value) @builtins.property @@ -15160,9 +14246,9 @@ exports[`Generated code for "jsii-calc": /python/src/js @array.setter def array(self, value: typing.List[builtins.str]) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(ClassWithCollections, "array").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(ClassWithCollections, "array").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "array", value) @builtins.property @@ -15172,39 +14258,39 @@ exports[`Generated code for "jsii-calc": /python/src/js @map.setter def map(self, value: typing.Mapping[builtins.str, builtins.str]) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(ClassWithCollections, "map").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(ClassWithCollections, "map").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "map", value) class ClassWithContainerTypes( metaclass=jsii.JSIIMeta, -@@ -1052,15 +910,10 @@ +@@ -910,10 +1052,15 @@ :param obj: - :param array_prop: :param obj_prop: :param record_prop: ''' -- if __debug__: -- type_hints = typing.get_type_hints(ClassWithContainerTypes.__init__) -- check_type(argname="argument array", value=array, expected_type=type_hints["array"]) -- check_type(argname="argument record", value=record, expected_type=type_hints["record"]) -- check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ClassWithContainerTypes.__init__) ++ check_type(argname="argument array", value=array, expected_type=type_hints["array"]) ++ check_type(argname="argument record", value=record, expected_type=type_hints["record"]) ++ check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) props = ContainerProps( array_prop=array_prop, obj_prop=obj_prop, record_prop=record_prop ) jsii.create(self.__class__, self, [array, record, obj, props]) -@@ -1110,23 +963,17 @@ +@@ -963,17 +1110,23 @@ ): def __init__(self, int: builtins.str) -> None: ''' :param int: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(ClassWithJavaReservedWords.__init__) -- check_type(argname="argument int", value=int, expected_type=type_hints["int"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ClassWithJavaReservedWords.__init__) ++ check_type(argname="argument int", value=int, expected_type=type_hints["int"]) jsii.create(self.__class__, self, [int]) @jsii.member(jsii_name="import") @@ -15212,163 +14298,163 @@ exports[`Generated code for "jsii-calc": /python/src/js ''' :param assert_: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(ClassWithJavaReservedWords.import_) -- check_type(argname="argument assert_", value=assert_, expected_type=type_hints["assert_"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ClassWithJavaReservedWords.import_) ++ check_type(argname="argument assert_", value=assert_, expected_type=type_hints["assert_"]) return typing.cast(builtins.str, jsii.invoke(self, "import", [assert_])) @builtins.property @jsii.member(jsii_name="int") def int(self) -> builtins.str: -@@ -1145,13 +992,10 @@ +@@ -992,10 +1145,13 @@ def mutable_object(self) -> "IMutableObjectLiteral": return typing.cast("IMutableObjectLiteral", jsii.get(self, "mutableObject")) @mutable_object.setter def mutable_object(self, value: "IMutableObjectLiteral") -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(ClassWithMutableObjectLiteralProperty, "mutable_object").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(ClassWithMutableObjectLiteralProperty, "mutable_object").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "mutableObject", value) class ClassWithNestedUnion( metaclass=jsii.JSIIMeta, -@@ -1162,13 +1006,10 @@ +@@ -1006,10 +1162,13 @@ union_property: typing.Sequence[typing.Union[typing.Mapping[builtins.str, typing.Union[typing.Union["StructA", typing.Dict[str, typing.Any]], typing.Union["StructB", typing.Dict[str, typing.Any]]]], typing.Sequence[typing.Union[typing.Union["StructA", typing.Dict[str, typing.Any]], typing.Union["StructB", typing.Dict[str, typing.Any]]]]]], ) -> None: ''' :param union_property: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(ClassWithNestedUnion.__init__) -- check_type(argname="argument union_property", value=union_property, expected_type=type_hints["union_property"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ClassWithNestedUnion.__init__) ++ check_type(argname="argument union_property", value=union_property, expected_type=type_hints["union_property"]) jsii.create(self.__class__, self, [union_property]) @builtins.property @jsii.member(jsii_name="unionProperty") def union_property( -@@ -1179,13 +1020,10 @@ +@@ -1020,10 +1179,13 @@ @union_property.setter def union_property( self, value: typing.List[typing.Union[typing.Mapping[builtins.str, typing.Union["StructA", "StructB"]], typing.List[typing.Union["StructA", "StructB"]]]], ) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(ClassWithNestedUnion, "union_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(ClassWithNestedUnion, "union_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "unionProperty", value) class ConfusingToJackson( metaclass=jsii.JSIIMeta, -@@ -1216,13 +1054,10 @@ +@@ -1054,10 +1216,13 @@ @union_property.setter def union_property( self, value: typing.Optional[typing.Union[scope.jsii_calc_lib.IFriendly, typing.List[typing.Union[scope.jsii_calc_lib.IFriendly, "AbstractClass"]]]], ) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(ConfusingToJackson, "union_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(ConfusingToJackson, "union_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "unionProperty", value) @jsii.data_type( jsii_type="jsii-calc.ConfusingToJacksonStruct", -@@ -1236,13 +1071,10 @@ +@@ -1071,10 +1236,13 @@ union_property: typing.Optional[typing.Union[scope.jsii_calc_lib.IFriendly, typing.Sequence[typing.Union[scope.jsii_calc_lib.IFriendly, "AbstractClass"]]]] = None, ) -> None: ''' :param union_property: ''' -- if __debug__: -- type_hints = typing.get_type_hints(ConfusingToJacksonStruct.__init__) -- check_type(argname="argument union_property", value=union_property, expected_type=type_hints["union_property"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ConfusingToJacksonStruct.__init__) ++ check_type(argname="argument union_property", value=union_property, expected_type=type_hints["union_property"]) self._values: typing.Dict[str, typing.Any] = {} if union_property is not None: self._values["union_property"] = union_property @builtins.property -@@ -1270,13 +1102,10 @@ +@@ -1102,10 +1270,13 @@ ): def __init__(self, consumer: "PartiallyInitializedThisConsumer") -> None: ''' :param consumer: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(ConstructorPassesThisOut.__init__) -- check_type(argname="argument consumer", value=consumer, expected_type=type_hints["consumer"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ConstructorPassesThisOut.__init__) ++ check_type(argname="argument consumer", value=consumer, expected_type=type_hints["consumer"]) jsii.create(self.__class__, self, [consumer]) class Constructors(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Constructors"): def __init__(self) -> None: -@@ -1324,13 +1153,10 @@ +@@ -1153,10 +1324,13 @@ ): def __init__(self, delegate: "IStructReturningDelegate") -> None: ''' :param delegate: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(ConsumePureInterface.__init__) -- check_type(argname="argument delegate", value=delegate, expected_type=type_hints["delegate"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ConsumePureInterface.__init__) ++ check_type(argname="argument delegate", value=delegate, expected_type=type_hints["delegate"]) jsii.create(self.__class__, self, [delegate]) @jsii.member(jsii_name="workItBaby") def work_it_baby(self) -> "StructB": return typing.cast("StructB", jsii.invoke(self, "workItBaby", [])) -@@ -1359,13 +1185,10 @@ +@@ -1185,10 +1359,13 @@ Returns whether the bell was rung. :param ringer: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(ConsumerCanRingBell.static_implemented_by_object_literal) -- check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ConsumerCanRingBell.static_implemented_by_object_literal) ++ check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) return typing.cast(builtins.bool, jsii.sinvoke(cls, "staticImplementedByObjectLiteral", [ringer])) @jsii.member(jsii_name="staticImplementedByPrivateClass") @builtins.classmethod def static_implemented_by_private_class( -@@ -1376,13 +1199,10 @@ +@@ -1199,10 +1376,13 @@ Return whether the bell was rung. :param ringer: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(ConsumerCanRingBell.static_implemented_by_private_class) -- check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ConsumerCanRingBell.static_implemented_by_private_class) ++ check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) return typing.cast(builtins.bool, jsii.sinvoke(cls, "staticImplementedByPrivateClass", [ringer])) @jsii.member(jsii_name="staticImplementedByPublicClass") @builtins.classmethod def static_implemented_by_public_class(cls, ringer: "IBellRinger") -> builtins.bool: -@@ -1390,13 +1210,10 @@ +@@ -1210,10 +1390,13 @@ Return whether the bell was rung. :param ringer: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(ConsumerCanRingBell.static_implemented_by_public_class) -- check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ConsumerCanRingBell.static_implemented_by_public_class) ++ check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) return typing.cast(builtins.bool, jsii.sinvoke(cls, "staticImplementedByPublicClass", [ringer])) @jsii.member(jsii_name="staticWhenTypedAsClass") @builtins.classmethod def static_when_typed_as_class(cls, ringer: "IConcreteBellRinger") -> builtins.bool: -@@ -1404,65 +1221,50 @@ +@@ -1221,50 +1404,65 @@ Return whether the bell was rung. :param ringer: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(ConsumerCanRingBell.static_when_typed_as_class) -- check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ConsumerCanRingBell.static_when_typed_as_class) ++ check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) return typing.cast(builtins.bool, jsii.sinvoke(cls, "staticWhenTypedAsClass", [ringer])) @jsii.member(jsii_name="implementedByObjectLiteral") @@ -15379,9 +14465,9 @@ exports[`Generated code for "jsii-calc": /python/src/js :param ringer: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(ConsumerCanRingBell.implemented_by_object_literal) -- check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ConsumerCanRingBell.implemented_by_object_literal) ++ check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) return typing.cast(builtins.bool, jsii.invoke(self, "implementedByObjectLiteral", [ringer])) @jsii.member(jsii_name="implementedByPrivateClass") @@ -15392,9 +14478,9 @@ exports[`Generated code for "jsii-calc": /python/src/js :param ringer: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(ConsumerCanRingBell.implemented_by_private_class) -- check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ConsumerCanRingBell.implemented_by_private_class) ++ check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) return typing.cast(builtins.bool, jsii.invoke(self, "implementedByPrivateClass", [ringer])) @jsii.member(jsii_name="implementedByPublicClass") @@ -15405,9 +14491,9 @@ exports[`Generated code for "jsii-calc": /python/src/js :param ringer: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(ConsumerCanRingBell.implemented_by_public_class) -- check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ConsumerCanRingBell.implemented_by_public_class) ++ check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) return typing.cast(builtins.bool, jsii.invoke(self, "implementedByPublicClass", [ringer])) @jsii.member(jsii_name="whenTypedAsClass") @@ -15418,23 +14504,23 @@ exports[`Generated code for "jsii-calc": /python/src/js :param ringer: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(ConsumerCanRingBell.when_typed_as_class) -- check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ConsumerCanRingBell.when_typed_as_class) ++ check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) return typing.cast(builtins.bool, jsii.invoke(self, "whenTypedAsClass", [ringer])) class ConsumersOfThisCrazyTypeSystem( metaclass=jsii.JSIIMeta, -@@ -1477,26 +1279,20 @@ +@@ -1279,20 +1477,26 @@ obj: "IAnotherPublicInterface", ) -> builtins.str: ''' :param obj: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(ConsumersOfThisCrazyTypeSystem.consume_another_public_interface) -- check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ConsumersOfThisCrazyTypeSystem.consume_another_public_interface) ++ check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) return typing.cast(builtins.str, jsii.invoke(self, "consumeAnotherPublicInterface", [obj])) @jsii.member(jsii_name="consumeNonInternalInterface") @@ -15445,39 +14531,39 @@ exports[`Generated code for "jsii-calc": /python/src/js ''' :param obj: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(ConsumersOfThisCrazyTypeSystem.consume_non_internal_interface) -- check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ConsumersOfThisCrazyTypeSystem.consume_non_internal_interface) ++ check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) return typing.cast(typing.Any, jsii.invoke(self, "consumeNonInternalInterface", [obj])) @jsii.data_type( jsii_type="jsii-calc.ContainerProps", -@@ -1518,15 +1314,10 @@ +@@ -1314,10 +1518,15 @@ ''' :param array_prop: :param obj_prop: :param record_prop: ''' -- if __debug__: -- type_hints = typing.get_type_hints(ContainerProps.__init__) -- check_type(argname="argument array_prop", value=array_prop, expected_type=type_hints["array_prop"]) -- check_type(argname="argument obj_prop", value=obj_prop, expected_type=type_hints["obj_prop"]) -- check_type(argname="argument record_prop", value=record_prop, expected_type=type_hints["record_prop"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ContainerProps.__init__) ++ check_type(argname="argument array_prop", value=array_prop, expected_type=type_hints["array_prop"]) ++ check_type(argname="argument obj_prop", value=obj_prop, expected_type=type_hints["obj_prop"]) ++ check_type(argname="argument record_prop", value=record_prop, expected_type=type_hints["record_prop"]) self._values: typing.Dict[str, typing.Any] = { "array_prop": array_prop, "obj_prop": obj_prop, "record_prop": record_prop, } -@@ -1592,23 +1383,17 @@ +@@ -1383,17 +1592,23 @@ data: typing.Mapping[builtins.str, typing.Any], ) -> builtins.str: ''' :param data: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(DataRenderer.render_arbitrary) -- check_type(argname="argument data", value=data, expected_type=type_hints["data"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(DataRenderer.render_arbitrary) ++ check_type(argname="argument data", value=data, expected_type=type_hints["data"]) return typing.cast(builtins.str, jsii.invoke(self, "renderArbitrary", [data])) @jsii.member(jsii_name="renderMap") @@ -15485,241 +14571,241 @@ exports[`Generated code for "jsii-calc": /python/src/js ''' :param map: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(DataRenderer.render_map) -- check_type(argname="argument map", value=map, expected_type=type_hints["map"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(DataRenderer.render_map) ++ check_type(argname="argument map", value=map, expected_type=type_hints["map"]) return typing.cast(builtins.str, jsii.invoke(self, "renderMap", [map])) class Default(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Default"): '''A class named "Default". -@@ -1637,15 +1422,10 @@ +@@ -1422,10 +1637,15 @@ ''' :param arg1: - :param arg2: - :param arg3: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(DefaultedConstructorArgument.__init__) -- check_type(argname="argument arg1", value=arg1, expected_type=type_hints["arg1"]) -- check_type(argname="argument arg2", value=arg2, expected_type=type_hints["arg2"]) -- check_type(argname="argument arg3", value=arg3, expected_type=type_hints["arg3"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(DefaultedConstructorArgument.__init__) ++ check_type(argname="argument arg1", value=arg1, expected_type=type_hints["arg1"]) ++ check_type(argname="argument arg2", value=arg2, expected_type=type_hints["arg2"]) ++ check_type(argname="argument arg3", value=arg3, expected_type=type_hints["arg3"]) jsii.create(self.__class__, self, [arg1, arg2, arg3]) @builtins.property @jsii.member(jsii_name="arg1") def arg1(self) -> jsii.Number: -@@ -1703,14 +1483,10 @@ +@@ -1483,10 +1703,14 @@ :deprecated: this constructor is "just" okay :stability: deprecated ''' -- if __debug__: -- type_hints = typing.get_type_hints(DeprecatedClass.__init__) -- check_type(argname="argument readonly_string", value=readonly_string, expected_type=type_hints["readonly_string"]) -- check_type(argname="argument mutable_number", value=mutable_number, expected_type=type_hints["mutable_number"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(DeprecatedClass.__init__) ++ check_type(argname="argument readonly_string", value=readonly_string, expected_type=type_hints["readonly_string"]) ++ check_type(argname="argument mutable_number", value=mutable_number, expected_type=type_hints["mutable_number"]) jsii.create(self.__class__, self, [readonly_string, mutable_number]) @jsii.member(jsii_name="method") def method(self) -> None: ''' -@@ -1740,13 +1516,10 @@ +@@ -1516,10 +1740,13 @@ ''' return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "mutableProperty")) @mutable_property.setter def mutable_property(self, value: typing.Optional[jsii.Number]) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(DeprecatedClass, "mutable_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(DeprecatedClass, "mutable_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "mutableProperty", value) @jsii.enum(jsii_type="jsii-calc.DeprecatedEnum") class DeprecatedEnum(enum.Enum): -@@ -1782,13 +1555,10 @@ +@@ -1555,10 +1782,13 @@ :deprecated: it just wraps a string :stability: deprecated ''' -- if __debug__: -- type_hints = typing.get_type_hints(DeprecatedStruct.__init__) -- check_type(argname="argument readonly_property", value=readonly_property, expected_type=type_hints["readonly_property"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(DeprecatedStruct.__init__) ++ check_type(argname="argument readonly_property", value=readonly_property, expected_type=type_hints["readonly_property"]) self._values: typing.Dict[str, typing.Any] = { "readonly_property": readonly_property, } @builtins.property -@@ -1853,21 +1623,10 @@ +@@ -1623,10 +1853,21 @@ :param non_primitive: An example of a non primitive property. :param another_optional: This is optional. :param optional_any: :param optional_array: ''' -- if __debug__: -- type_hints = typing.get_type_hints(DerivedStruct.__init__) -- check_type(argname="argument anumber", value=anumber, expected_type=type_hints["anumber"]) -- check_type(argname="argument astring", value=astring, expected_type=type_hints["astring"]) -- check_type(argname="argument first_optional", value=first_optional, expected_type=type_hints["first_optional"]) -- check_type(argname="argument another_required", value=another_required, expected_type=type_hints["another_required"]) -- check_type(argname="argument bool", value=bool, expected_type=type_hints["bool"]) -- check_type(argname="argument non_primitive", value=non_primitive, expected_type=type_hints["non_primitive"]) -- check_type(argname="argument another_optional", value=another_optional, expected_type=type_hints["another_optional"]) -- check_type(argname="argument optional_any", value=optional_any, expected_type=type_hints["optional_any"]) -- check_type(argname="argument optional_array", value=optional_array, expected_type=type_hints["optional_array"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(DerivedStruct.__init__) ++ check_type(argname="argument anumber", value=anumber, expected_type=type_hints["anumber"]) ++ check_type(argname="argument astring", value=astring, expected_type=type_hints["astring"]) ++ check_type(argname="argument first_optional", value=first_optional, expected_type=type_hints["first_optional"]) ++ check_type(argname="argument another_required", value=another_required, expected_type=type_hints["another_required"]) ++ check_type(argname="argument bool", value=bool, expected_type=type_hints["bool"]) ++ check_type(argname="argument non_primitive", value=non_primitive, expected_type=type_hints["non_primitive"]) ++ check_type(argname="argument another_optional", value=another_optional, expected_type=type_hints["another_optional"]) ++ check_type(argname="argument optional_any", value=optional_any, expected_type=type_hints["optional_any"]) ++ check_type(argname="argument optional_array", value=optional_array, expected_type=type_hints["optional_array"]) self._values: typing.Dict[str, typing.Any] = { "anumber": anumber, "astring": astring, "another_required": another_required, "bool": bool, -@@ -1984,16 +1743,10 @@ +@@ -1743,10 +1984,16 @@ :param hoisted_top: :param left: :param right: :param bottom: ''' -- if __debug__: -- type_hints = typing.get_type_hints(DiamondBottom.__init__) -- check_type(argname="argument hoisted_top", value=hoisted_top, expected_type=type_hints["hoisted_top"]) -- check_type(argname="argument left", value=left, expected_type=type_hints["left"]) -- check_type(argname="argument right", value=right, expected_type=type_hints["right"]) -- check_type(argname="argument bottom", value=bottom, expected_type=type_hints["bottom"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(DiamondBottom.__init__) ++ check_type(argname="argument hoisted_top", value=hoisted_top, expected_type=type_hints["hoisted_top"]) ++ check_type(argname="argument left", value=left, expected_type=type_hints["left"]) ++ check_type(argname="argument right", value=right, expected_type=type_hints["right"]) ++ check_type(argname="argument bottom", value=bottom, expected_type=type_hints["bottom"]) self._values: typing.Dict[str, typing.Any] = {} if hoisted_top is not None: self._values["hoisted_top"] = hoisted_top if left is not None: self._values["left"] = left -@@ -2051,13 +1804,10 @@ +@@ -1804,10 +2051,13 @@ class DiamondInheritanceBaseLevelStruct: def __init__(self, *, base_level_property: builtins.str) -> None: ''' :param base_level_property: ''' -- if __debug__: -- type_hints = typing.get_type_hints(DiamondInheritanceBaseLevelStruct.__init__) -- check_type(argname="argument base_level_property", value=base_level_property, expected_type=type_hints["base_level_property"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(DiamondInheritanceBaseLevelStruct.__init__) ++ check_type(argname="argument base_level_property", value=base_level_property, expected_type=type_hints["base_level_property"]) self._values: typing.Dict[str, typing.Any] = { "base_level_property": base_level_property, } @builtins.property -@@ -2095,14 +1845,10 @@ +@@ -1845,10 +2095,14 @@ ) -> None: ''' :param base_level_property: :param first_mid_level_property: ''' -- if __debug__: -- type_hints = typing.get_type_hints(DiamondInheritanceFirstMidLevelStruct.__init__) -- check_type(argname="argument base_level_property", value=base_level_property, expected_type=type_hints["base_level_property"]) -- check_type(argname="argument first_mid_level_property", value=first_mid_level_property, expected_type=type_hints["first_mid_level_property"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(DiamondInheritanceFirstMidLevelStruct.__init__) ++ check_type(argname="argument base_level_property", value=base_level_property, expected_type=type_hints["base_level_property"]) ++ check_type(argname="argument first_mid_level_property", value=first_mid_level_property, expected_type=type_hints["first_mid_level_property"]) self._values: typing.Dict[str, typing.Any] = { "base_level_property": base_level_property, "first_mid_level_property": first_mid_level_property, } -@@ -2147,14 +1893,10 @@ +@@ -1893,10 +2147,14 @@ ) -> None: ''' :param base_level_property: :param second_mid_level_property: ''' -- if __debug__: -- type_hints = typing.get_type_hints(DiamondInheritanceSecondMidLevelStruct.__init__) -- check_type(argname="argument base_level_property", value=base_level_property, expected_type=type_hints["base_level_property"]) -- check_type(argname="argument second_mid_level_property", value=second_mid_level_property, expected_type=type_hints["second_mid_level_property"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(DiamondInheritanceSecondMidLevelStruct.__init__) ++ check_type(argname="argument base_level_property", value=base_level_property, expected_type=type_hints["base_level_property"]) ++ check_type(argname="argument second_mid_level_property", value=second_mid_level_property, expected_type=type_hints["second_mid_level_property"]) self._values: typing.Dict[str, typing.Any] = { "base_level_property": base_level_property, "second_mid_level_property": second_mid_level_property, } -@@ -2210,16 +1952,10 @@ +@@ -1952,10 +2210,16 @@ :param base_level_property: :param first_mid_level_property: :param second_mid_level_property: :param top_level_property: ''' -- if __debug__: -- type_hints = typing.get_type_hints(DiamondInheritanceTopLevelStruct.__init__) -- check_type(argname="argument base_level_property", value=base_level_property, expected_type=type_hints["base_level_property"]) -- check_type(argname="argument first_mid_level_property", value=first_mid_level_property, expected_type=type_hints["first_mid_level_property"]) -- check_type(argname="argument second_mid_level_property", value=second_mid_level_property, expected_type=type_hints["second_mid_level_property"]) -- check_type(argname="argument top_level_property", value=top_level_property, expected_type=type_hints["top_level_property"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(DiamondInheritanceTopLevelStruct.__init__) ++ check_type(argname="argument base_level_property", value=base_level_property, expected_type=type_hints["base_level_property"]) ++ check_type(argname="argument first_mid_level_property", value=first_mid_level_property, expected_type=type_hints["first_mid_level_property"]) ++ check_type(argname="argument second_mid_level_property", value=second_mid_level_property, expected_type=type_hints["second_mid_level_property"]) ++ check_type(argname="argument top_level_property", value=top_level_property, expected_type=type_hints["top_level_property"]) self._values: typing.Dict[str, typing.Any] = { "base_level_property": base_level_property, "first_mid_level_property": first_mid_level_property, "second_mid_level_property": second_mid_level_property, "top_level_property": top_level_property, -@@ -2299,13 +2035,10 @@ +@@ -2035,10 +2299,13 @@ @jsii.member(jsii_name="changePrivatePropertyValue") def change_private_property_value(self, new_value: builtins.str) -> None: ''' :param new_value: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(DoNotOverridePrivates.change_private_property_value) -- check_type(argname="argument new_value", value=new_value, expected_type=type_hints["new_value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(DoNotOverridePrivates.change_private_property_value) ++ check_type(argname="argument new_value", value=new_value, expected_type=type_hints["new_value"]) return typing.cast(None, jsii.invoke(self, "changePrivatePropertyValue", [new_value])) @jsii.member(jsii_name="privateMethodValue") def private_method_value(self) -> builtins.str: return typing.cast(builtins.str, jsii.invoke(self, "privateMethodValue", [])) -@@ -2334,15 +2067,10 @@ +@@ -2067,10 +2334,15 @@ ''' :param _required_any: - :param _optional_any: - :param _optional_string: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(DoNotRecognizeAnyAsOptional.method) -- check_type(argname="argument _required_any", value=_required_any, expected_type=type_hints["_required_any"]) -- check_type(argname="argument _optional_any", value=_optional_any, expected_type=type_hints["_optional_any"]) -- check_type(argname="argument _optional_string", value=_optional_string, expected_type=type_hints["_optional_string"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(DoNotRecognizeAnyAsOptional.method) ++ check_type(argname="argument _required_any", value=_required_any, expected_type=type_hints["_required_any"]) ++ check_type(argname="argument _optional_any", value=_optional_any, expected_type=type_hints["_optional_any"]) ++ check_type(argname="argument _optional_string", value=_optional_string, expected_type=type_hints["_optional_string"]) return typing.cast(None, jsii.invoke(self, "method", [_required_any, _optional_any, _optional_string])) class DocumentedClass(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.DocumentedClass"): '''Here's the first line of the TSDoc comment. -@@ -2406,14 +2134,10 @@ +@@ -2134,10 +2406,14 @@ ) -> builtins.str: ''' :param optional: - :param things: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(DontComplainAboutVariadicAfterOptional.optional_and_variadic) -- check_type(argname="argument optional", value=optional, expected_type=type_hints["optional"]) -- check_type(argname="argument things", value=things, expected_type=typing.Tuple[type_hints["things"], ...]) # pyright: ignore [reportGeneralTypeIssues] ++ if __debug__: ++ type_hints = typing.get_type_hints(DontComplainAboutVariadicAfterOptional.optional_and_variadic) ++ check_type(argname="argument optional", value=optional, expected_type=type_hints["optional"]) ++ check_type(argname="argument things", value=things, expected_type=typing.Tuple[type_hints["things"], ...]) # pyright: ignore [reportGeneralTypeIssues] return typing.cast(builtins.str, jsii.invoke(self, "optionalAndVariadic", [optional, *things])) @jsii.data_type( jsii_type="jsii-calc.DummyObj", -@@ -2423,13 +2147,10 @@ +@@ -2147,10 +2423,13 @@ class DummyObj: def __init__(self, *, example: builtins.str) -> None: ''' :param example: ''' -- if __debug__: -- type_hints = typing.get_type_hints(DummyObj.__init__) -- check_type(argname="argument example", value=example, expected_type=type_hints["example"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(DummyObj.__init__) ++ check_type(argname="argument example", value=example, expected_type=type_hints["example"]) self._values: typing.Dict[str, typing.Any] = { "example": example, } @builtins.property -@@ -2458,37 +2179,28 @@ +@@ -2179,28 +2458,37 @@ def __init__(self, value_store: builtins.str) -> None: ''' :param value_store: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(DynamicPropertyBearer.__init__) -- check_type(argname="argument value_store", value=value_store, expected_type=type_hints["value_store"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(DynamicPropertyBearer.__init__) ++ check_type(argname="argument value_store", value=value_store, expected_type=type_hints["value_store"]) jsii.create(self.__class__, self, [value_store]) @builtins.property @@ -15729,9 +14815,9 @@ exports[`Generated code for "jsii-calc": /python/src/js @dynamic_property.setter def dynamic_property(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(DynamicPropertyBearer, "dynamic_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(DynamicPropertyBearer, "dynamic_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "dynamicProperty", value) @builtins.property @@ -15741,23 +14827,23 @@ exports[`Generated code for "jsii-calc": /python/src/js @value_store.setter def value_store(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(DynamicPropertyBearer, "value_store").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(DynamicPropertyBearer, "value_store").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "valueStore", value) class DynamicPropertyBearerChild( DynamicPropertyBearer, -@@ -2497,26 +2209,20 @@ +@@ -2209,20 +2497,26 @@ ): def __init__(self, original_value: builtins.str) -> None: ''' :param original_value: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(DynamicPropertyBearerChild.__init__) -- check_type(argname="argument original_value", value=original_value, expected_type=type_hints["original_value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(DynamicPropertyBearerChild.__init__) ++ check_type(argname="argument original_value", value=original_value, expected_type=type_hints["original_value"]) jsii.create(self.__class__, self, [original_value]) @jsii.member(jsii_name="overrideValue") @@ -15768,379 +14854,379 @@ exports[`Generated code for "jsii-calc": /python/src/js :return: the old value that was set. ''' -- if __debug__: -- type_hints = typing.get_type_hints(DynamicPropertyBearerChild.override_value) -- check_type(argname="argument new_value", value=new_value, expected_type=type_hints["new_value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(DynamicPropertyBearerChild.override_value) ++ check_type(argname="argument new_value", value=new_value, expected_type=type_hints["new_value"]) return typing.cast(builtins.str, jsii.invoke(self, "overrideValue", [new_value])) @builtins.property @jsii.member(jsii_name="originalValue") def original_value(self) -> builtins.str: -@@ -2529,13 +2235,10 @@ +@@ -2235,10 +2529,13 @@ def __init__(self, clock: "IWallClock") -> None: '''Creates a new instance of Entropy. :param clock: your implementation of \`\`WallClock\`\`. ''' -- if __debug__: -- type_hints = typing.get_type_hints(Entropy.__init__) -- check_type(argname="argument clock", value=clock, expected_type=type_hints["clock"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(Entropy.__init__) ++ check_type(argname="argument clock", value=clock, expected_type=type_hints["clock"]) jsii.create(self.__class__, self, [clock]) @jsii.member(jsii_name="increase") def increase(self) -> builtins.str: '''Increases entropy by consuming time from the clock (yes, this is a long shot, please don't judge). -@@ -2563,13 +2266,10 @@ +@@ -2266,10 +2563,13 @@ :param word: the value to return. :return: \`\`word\`\`. ''' -- if __debug__: -- type_hints = typing.get_type_hints(Entropy.repeat) -- check_type(argname="argument word", value=word, expected_type=type_hints["word"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(Entropy.repeat) ++ check_type(argname="argument word", value=word, expected_type=type_hints["word"]) return typing.cast(builtins.str, jsii.invoke(self, "repeat", [word])) # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class typing.cast(typing.Any, Entropy).__jsii_proxy_class__ = lambda : _EntropyProxy -@@ -2606,14 +2306,10 @@ +@@ -2306,10 +2606,14 @@ are being erased when sending values from native code to JS. :param opts: - :param key: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(EraseUndefinedHashValues.does_key_exist) -- check_type(argname="argument opts", value=opts, expected_type=type_hints["opts"]) -- check_type(argname="argument key", value=key, expected_type=type_hints["key"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(EraseUndefinedHashValues.does_key_exist) ++ check_type(argname="argument opts", value=opts, expected_type=type_hints["opts"]) ++ check_type(argname="argument key", value=key, expected_type=type_hints["key"]) return typing.cast(builtins.bool, jsii.sinvoke(cls, "doesKeyExist", [opts, key])) @jsii.member(jsii_name="prop1IsNull") @builtins.classmethod def prop1_is_null(cls) -> typing.Mapping[builtins.str, typing.Any]: -@@ -2641,14 +2337,10 @@ +@@ -2337,10 +2641,14 @@ ) -> None: ''' :param option1: :param option2: ''' -- if __debug__: -- type_hints = typing.get_type_hints(EraseUndefinedHashValuesOptions.__init__) -- check_type(argname="argument option1", value=option1, expected_type=type_hints["option1"]) -- check_type(argname="argument option2", value=option2, expected_type=type_hints["option2"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(EraseUndefinedHashValuesOptions.__init__) ++ check_type(argname="argument option1", value=option1, expected_type=type_hints["option1"]) ++ check_type(argname="argument option2", value=option2, expected_type=type_hints["option2"]) self._values: typing.Dict[str, typing.Any] = {} if option1 is not None: self._values["option1"] = option1 if option2 is not None: self._values["option2"] = option2 -@@ -2692,14 +2384,10 @@ +@@ -2384,10 +2692,14 @@ :param readonly_string: - :param mutable_number: - :stability: experimental ''' -- if __debug__: -- type_hints = typing.get_type_hints(ExperimentalClass.__init__) -- check_type(argname="argument readonly_string", value=readonly_string, expected_type=type_hints["readonly_string"]) -- check_type(argname="argument mutable_number", value=mutable_number, expected_type=type_hints["mutable_number"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ExperimentalClass.__init__) ++ check_type(argname="argument readonly_string", value=readonly_string, expected_type=type_hints["readonly_string"]) ++ check_type(argname="argument mutable_number", value=mutable_number, expected_type=type_hints["mutable_number"]) jsii.create(self.__class__, self, [readonly_string, mutable_number]) @jsii.member(jsii_name="method") def method(self) -> None: ''' -@@ -2723,13 +2411,10 @@ +@@ -2411,10 +2723,13 @@ ''' return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "mutableProperty")) @mutable_property.setter def mutable_property(self, value: typing.Optional[jsii.Number]) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(ExperimentalClass, "mutable_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(ExperimentalClass, "mutable_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "mutableProperty", value) @jsii.enum(jsii_type="jsii-calc.ExperimentalEnum") class ExperimentalEnum(enum.Enum): -@@ -2757,13 +2442,10 @@ +@@ -2442,10 +2757,13 @@ ''' :param readonly_property: :stability: experimental ''' -- if __debug__: -- type_hints = typing.get_type_hints(ExperimentalStruct.__init__) -- check_type(argname="argument readonly_property", value=readonly_property, expected_type=type_hints["readonly_property"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ExperimentalStruct.__init__) ++ check_type(argname="argument readonly_property", value=readonly_property, expected_type=type_hints["readonly_property"]) self._values: typing.Dict[str, typing.Any] = { "readonly_property": readonly_property, } @builtins.property -@@ -2793,13 +2475,10 @@ +@@ -2475,10 +2793,13 @@ ): def __init__(self, success: builtins.bool) -> None: ''' :param success: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(ExportedBaseClass.__init__) -- check_type(argname="argument success", value=success, expected_type=type_hints["success"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ExportedBaseClass.__init__) ++ check_type(argname="argument success", value=success, expected_type=type_hints["success"]) jsii.create(self.__class__, self, [success]) @builtins.property @jsii.member(jsii_name="success") def success(self) -> builtins.bool: -@@ -2815,14 +2494,10 @@ +@@ -2494,10 +2815,14 @@ def __init__(self, *, boom: builtins.bool, prop: builtins.str) -> None: ''' :param boom: :param prop: ''' -- if __debug__: -- type_hints = typing.get_type_hints(ExtendsInternalInterface.__init__) -- check_type(argname="argument boom", value=boom, expected_type=type_hints["boom"]) -- check_type(argname="argument prop", value=prop, expected_type=type_hints["prop"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ExtendsInternalInterface.__init__) ++ check_type(argname="argument boom", value=boom, expected_type=type_hints["boom"]) ++ check_type(argname="argument prop", value=prop, expected_type=type_hints["prop"]) self._values: typing.Dict[str, typing.Any] = { "boom": boom, "prop": prop, } -@@ -2864,14 +2539,10 @@ +@@ -2539,10 +2864,14 @@ :param readonly_string: - :param mutable_number: - :external: true ''' -- if __debug__: -- type_hints = typing.get_type_hints(ExternalClass.__init__) -- check_type(argname="argument readonly_string", value=readonly_string, expected_type=type_hints["readonly_string"]) -- check_type(argname="argument mutable_number", value=mutable_number, expected_type=type_hints["mutable_number"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ExternalClass.__init__) ++ check_type(argname="argument readonly_string", value=readonly_string, expected_type=type_hints["readonly_string"]) ++ check_type(argname="argument mutable_number", value=mutable_number, expected_type=type_hints["mutable_number"]) jsii.create(self.__class__, self, [readonly_string, mutable_number]) @jsii.member(jsii_name="method") def method(self) -> None: ''' -@@ -2895,13 +2566,10 @@ +@@ -2566,10 +2895,13 @@ ''' return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "mutableProperty")) @mutable_property.setter def mutable_property(self, value: typing.Optional[jsii.Number]) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(ExternalClass, "mutable_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(ExternalClass, "mutable_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "mutableProperty", value) @jsii.enum(jsii_type="jsii-calc.ExternalEnum") class ExternalEnum(enum.Enum): -@@ -2929,13 +2597,10 @@ +@@ -2597,10 +2929,13 @@ ''' :param readonly_property: :external: true ''' -- if __debug__: -- type_hints = typing.get_type_hints(ExternalStruct.__init__) -- check_type(argname="argument readonly_property", value=readonly_property, expected_type=type_hints["readonly_property"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ExternalStruct.__init__) ++ check_type(argname="argument readonly_property", value=readonly_property, expected_type=type_hints["readonly_property"]) self._values: typing.Dict[str, typing.Any] = { "readonly_property": readonly_property, } @builtins.property -@@ -3078,13 +2743,10 @@ +@@ -2743,10 +3078,13 @@ def __init__(self, *, name: typing.Optional[builtins.str] = None) -> None: '''These are some arguments you can pass to a method. :param name: The name of the greetee. Default: world ''' -- if __debug__: -- type_hints = typing.get_type_hints(Greetee.__init__) -- check_type(argname="argument name", value=name, expected_type=type_hints["name"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(Greetee.__init__) ++ check_type(argname="argument name", value=name, expected_type=type_hints["name"]) self._values: typing.Dict[str, typing.Any] = {} if name is not None: self._values["name"] = name @builtins.property -@@ -3118,13 +2780,10 @@ +@@ -2780,10 +3118,13 @@ @jsii.member(jsii_name="betterGreeting") def better_greeting(self, friendly: scope.jsii_calc_lib.IFriendly) -> builtins.str: ''' :param friendly: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(GreetingAugmenter.better_greeting) -- check_type(argname="argument friendly", value=friendly, expected_type=type_hints["friendly"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(GreetingAugmenter.better_greeting) ++ check_type(argname="argument friendly", value=friendly, expected_type=type_hints["friendly"]) return typing.cast(builtins.str, jsii.invoke(self, "betterGreeting", [friendly])) @jsii.interface(jsii_type="jsii-calc.IAnonymousImplementationProvider") class IAnonymousImplementationProvider(typing_extensions.Protocol): -@@ -3204,13 +2863,10 @@ +@@ -2863,10 +3204,13 @@ def a(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "a")) @a.setter def a(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(IAnotherPublicInterface, "a").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(IAnotherPublicInterface, "a").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "a", value) # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface typing.cast(typing.Any, IAnotherPublicInterface).__jsii_proxy_class__ = lambda : _IAnotherPublicInterfaceProxy -@@ -3253,13 +2909,10 @@ +@@ -2909,10 +3253,13 @@ @jsii.member(jsii_name="yourTurn") def your_turn(self, bell: IBell) -> None: ''' :param bell: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(IBellRinger.your_turn) -- check_type(argname="argument bell", value=bell, expected_type=type_hints["bell"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(IBellRinger.your_turn) ++ check_type(argname="argument bell", value=bell, expected_type=type_hints["bell"]) return typing.cast(None, jsii.invoke(self, "yourTurn", [bell])) # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface typing.cast(typing.Any, IBellRinger).__jsii_proxy_class__ = lambda : _IBellRingerProxy -@@ -3284,13 +2937,10 @@ +@@ -2937,10 +3284,13 @@ @jsii.member(jsii_name="yourTurn") def your_turn(self, bell: "Bell") -> None: ''' :param bell: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(IConcreteBellRinger.your_turn) -- check_type(argname="argument bell", value=bell, expected_type=type_hints["bell"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(IConcreteBellRinger.your_turn) ++ check_type(argname="argument bell", value=bell, expected_type=type_hints["bell"]) return typing.cast(None, jsii.invoke(self, "yourTurn", [bell])) # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface typing.cast(typing.Any, IConcreteBellRinger).__jsii_proxy_class__ = lambda : _IConcreteBellRingerProxy -@@ -3346,13 +2996,10 @@ +@@ -2996,10 +3346,13 @@ ''' return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "mutableProperty")) @mutable_property.setter def mutable_property(self, value: typing.Optional[jsii.Number]) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(IDeprecatedInterface, "mutable_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(IDeprecatedInterface, "mutable_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "mutableProperty", value) @jsii.member(jsii_name="method") def method(self) -> None: ''' -@@ -3407,13 +3054,10 @@ +@@ -3054,10 +3407,13 @@ ''' return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "mutableProperty")) @mutable_property.setter def mutable_property(self, value: typing.Optional[jsii.Number]) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(IExperimentalInterface, "mutable_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(IExperimentalInterface, "mutable_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "mutableProperty", value) @jsii.member(jsii_name="method") def method(self) -> None: ''' -@@ -3455,13 +3099,10 @@ +@@ -3099,10 +3455,13 @@ def private(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "private")) @private.setter def private(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(IExtendsPrivateInterface, "private").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(IExtendsPrivateInterface, "private").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "private", value) # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface typing.cast(typing.Any, IExtendsPrivateInterface).__jsii_proxy_class__ = lambda : _IExtendsPrivateInterfaceProxy -@@ -3507,13 +3148,10 @@ +@@ -3148,10 +3507,13 @@ ''' return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "mutableProperty")) @mutable_property.setter def mutable_property(self, value: typing.Optional[jsii.Number]) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(IExternalInterface, "mutable_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(IExternalInterface, "mutable_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "mutableProperty", value) @jsii.member(jsii_name="method") def method(self) -> None: ''' -@@ -3695,14 +3333,10 @@ +@@ -3333,10 +3695,14 @@ ) -> None: ''' :param arg1: - :param arg2: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(IInterfaceWithOptionalMethodArguments.hello) -- check_type(argname="argument arg1", value=arg1, expected_type=type_hints["arg1"]) -- check_type(argname="argument arg2", value=arg2, expected_type=type_hints["arg2"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(IInterfaceWithOptionalMethodArguments.hello) ++ check_type(argname="argument arg1", value=arg1, expected_type=type_hints["arg1"]) ++ check_type(argname="argument arg2", value=arg2, expected_type=type_hints["arg2"]) return typing.cast(None, jsii.invoke(self, "hello", [arg1, arg2])) # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface typing.cast(typing.Any, IInterfaceWithOptionalMethodArguments).__jsii_proxy_class__ = lambda : _IInterfaceWithOptionalMethodArgumentsProxy -@@ -3737,13 +3371,10 @@ +@@ -3371,10 +3737,13 @@ def read_write_string(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "readWriteString")) @read_write_string.setter def read_write_string(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(IInterfaceWithProperties, "read_write_string").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(IInterfaceWithProperties, "read_write_string").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "readWriteString", value) # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface typing.cast(typing.Any, IInterfaceWithProperties).__jsii_proxy_class__ = lambda : _IInterfaceWithPropertiesProxy -@@ -3773,13 +3404,10 @@ +@@ -3404,10 +3773,13 @@ def foo(self) -> jsii.Number: return typing.cast(jsii.Number, jsii.get(self, "foo")) @foo.setter def foo(self, value: jsii.Number) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(IInterfaceWithPropertiesExtension, "foo").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(IInterfaceWithPropertiesExtension, "foo").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "foo", value) # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface typing.cast(typing.Any, IInterfaceWithPropertiesExtension).__jsii_proxy_class__ = lambda : _IInterfaceWithPropertiesExtensionProxy -@@ -4299,13 +3927,10 @@ +@@ -3927,10 +4299,13 @@ def value(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "value")) @value.setter def value(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(IMutableObjectLiteral, "value").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(IMutableObjectLiteral, "value").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "value", value) # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface typing.cast(typing.Any, IMutableObjectLiteral).__jsii_proxy_class__ = lambda : _IMutableObjectLiteralProxy -@@ -4341,25 +3966,19 @@ +@@ -3966,19 +4341,25 @@ def b(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "b")) @b.setter def b(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(INonInternalInterface, "b").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(INonInternalInterface, "b").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "b", value) @builtins.property @@ -16150,109 +15236,109 @@ exports[`Generated code for "jsii-calc": /python/src/js @c.setter def c(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(INonInternalInterface, "c").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(INonInternalInterface, "c").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "c", value) # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface typing.cast(typing.Any, INonInternalInterface).__jsii_proxy_class__ = lambda : _INonInternalInterfaceProxy -@@ -4392,13 +4011,10 @@ +@@ -4011,10 +4392,13 @@ def property(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "property")) @property.setter def property(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(IObjectWithProperty, "property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(IObjectWithProperty, "property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "property", value) @jsii.member(jsii_name="wasSet") def was_set(self) -> builtins.bool: return typing.cast(builtins.bool, jsii.invoke(self, "wasSet", [])) -@@ -4591,13 +4207,10 @@ +@@ -4207,10 +4591,13 @@ def mutable_property(self) -> typing.Optional[jsii.Number]: return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "mutableProperty")) @mutable_property.setter def mutable_property(self, value: typing.Optional[jsii.Number]) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(IStableInterface, "mutable_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(IStableInterface, "mutable_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "mutableProperty", value) @jsii.member(jsii_name="method") def method(self) -> None: return typing.cast(None, jsii.invoke(self, "method", [])) -@@ -4664,13 +4277,10 @@ +@@ -4277,10 +4664,13 @@ def prop(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "prop")) @prop.setter def prop(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(ImplementInternalInterface, "prop").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(ImplementInternalInterface, "prop").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "prop", value) class Implementation(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Implementation"): def __init__(self) -> None: -@@ -4716,13 +4326,10 @@ +@@ -4326,10 +4716,13 @@ def private(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "private")) @private.setter def private(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(ImplementsPrivateInterface, "private").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(ImplementsPrivateInterface, "private").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "private", value) @jsii.data_type( jsii_type="jsii-calc.ImplictBaseOfBase", -@@ -4740,15 +4347,10 @@ +@@ -4347,10 +4740,15 @@ ''' :param foo: - :param bar: - :param goo: ''' -- if __debug__: -- type_hints = typing.get_type_hints(ImplictBaseOfBase.__init__) -- check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) -- check_type(argname="argument bar", value=bar, expected_type=type_hints["bar"]) -- check_type(argname="argument goo", value=goo, expected_type=type_hints["goo"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ImplictBaseOfBase.__init__) ++ check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) ++ check_type(argname="argument bar", value=bar, expected_type=type_hints["bar"]) ++ check_type(argname="argument goo", value=goo, expected_type=type_hints["goo"]) self._values: typing.Dict[str, typing.Any] = { "foo": foo, "bar": bar, "goo": goo, } -@@ -4823,13 +4425,10 @@ +@@ -4425,10 +4823,13 @@ count: jsii.Number, ) -> typing.List[scope.jsii_calc_lib.IDoublable]: ''' :param count: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(InterfacesMaker.make_interfaces) -- check_type(argname="argument count", value=count, expected_type=type_hints["count"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(InterfacesMaker.make_interfaces) ++ check_type(argname="argument count", value=count, expected_type=type_hints["count"]) return typing.cast(typing.List[scope.jsii_calc_lib.IDoublable], jsii.sinvoke(cls, "makeInterfaces", [count])) class Isomorphism(metaclass=jsii.JSIIAbstractClass, jsii_type="jsii-calc.Isomorphism"): '''Checks the "same instance" isomorphism is preserved within the constructor. -@@ -4934,25 +4533,19 @@ +@@ -4533,19 +4934,25 @@ def prop_a(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "propA")) @prop_a.setter def prop_a(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(JSObjectLiteralToNativeClass, "prop_a").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(JSObjectLiteralToNativeClass, "prop_a").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "propA", value) @builtins.property @@ -16262,141 +15348,141 @@ exports[`Generated code for "jsii-calc": /python/src/js @prop_b.setter def prop_b(self, value: jsii.Number) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(JSObjectLiteralToNativeClass, "prop_b").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(JSObjectLiteralToNativeClass, "prop_b").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "propB", value) class JavaReservedWords( metaclass=jsii.JSIIMeta, -@@ -5174,13 +4767,10 @@ +@@ -4767,10 +5174,13 @@ def while_(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "while")) @while_.setter def while_(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(JavaReservedWords, "while_").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(JavaReservedWords, "while_").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "while", value) @jsii.implements(IJsii487External2, IJsii487External) class Jsii487Derived(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Jsii487Derived"): -@@ -5282,13 +4872,10 @@ +@@ -4872,10 +5282,13 @@ @builtins.classmethod def stringify(cls, value: typing.Any = None) -> typing.Optional[builtins.str]: ''' :param value: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(JsonFormatter.stringify) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(JsonFormatter.stringify) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast(typing.Optional[builtins.str], jsii.sinvoke(cls, "stringify", [value])) class LevelOne(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.LevelOne"): '''Validates that nested classes get correct code generation for the occasional forward reference.''' -@@ -5318,13 +4905,10 @@ +@@ -4905,10 +5318,13 @@ class PropBooleanValue: def __init__(self, *, value: builtins.bool) -> None: ''' :param value: ''' -- if __debug__: -- type_hints = typing.get_type_hints(LevelOne.PropBooleanValue.__init__) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(LevelOne.PropBooleanValue.__init__) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) self._values: typing.Dict[str, typing.Any] = { "value": value, } @builtins.property -@@ -5358,13 +4942,10 @@ +@@ -4942,10 +5358,13 @@ ''' :param prop: ''' if isinstance(prop, dict): prop = LevelOne.PropBooleanValue(**prop) -- if __debug__: -- type_hints = typing.get_type_hints(LevelOne.PropProperty.__init__) -- check_type(argname="argument prop", value=prop, expected_type=type_hints["prop"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(LevelOne.PropProperty.__init__) ++ check_type(argname="argument prop", value=prop, expected_type=type_hints["prop"]) self._values: typing.Dict[str, typing.Any] = { "prop": prop, } @builtins.property -@@ -5399,13 +4980,10 @@ +@@ -4980,10 +5399,13 @@ ''' :param prop: ''' if isinstance(prop, dict): prop = LevelOne.PropProperty(**prop) -- if __debug__: -- type_hints = typing.get_type_hints(LevelOneProps.__init__) -- check_type(argname="argument prop", value=prop, expected_type=type_hints["prop"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(LevelOneProps.__init__) ++ check_type(argname="argument prop", value=prop, expected_type=type_hints["prop"]) self._values: typing.Dict[str, typing.Any] = { "prop": prop, } @builtins.property -@@ -5453,17 +5031,10 @@ +@@ -5031,10 +5453,17 @@ :param cpu: The number of cpu units used by the task. Valid values, which determines your range of valid values for the memory parameter: 256 (.25 vCPU) - Available memory values: 0.5GB, 1GB, 2GB 512 (.5 vCPU) - Available memory values: 1GB, 2GB, 3GB, 4GB 1024 (1 vCPU) - Available memory values: 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB 2048 (2 vCPU) - Available memory values: Between 4GB and 16GB in 1GB increments 4096 (4 vCPU) - Available memory values: Between 8GB and 30GB in 1GB increments This default is set in the underlying FargateTaskDefinition construct. Default: 256 :param memory_mib: The amount (in MiB) of memory used by the task. This field is required and you must use one of the following values, which determines your range of valid values for the cpu parameter: 0.5GB, 1GB, 2GB - Available cpu values: 256 (.25 vCPU) 1GB, 2GB, 3GB, 4GB - Available cpu values: 512 (.5 vCPU) 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB - Available cpu values: 1024 (1 vCPU) Between 4GB and 16GB in 1GB increments - Available cpu values: 2048 (2 vCPU) Between 8GB and 30GB in 1GB increments - Available cpu values: 4096 (4 vCPU) This default is set in the underlying FargateTaskDefinition construct. Default: 512 :param public_load_balancer: Determines whether the Application Load Balancer will be internet-facing. Default: true :param public_tasks: Determines whether your Fargate Service will be assigned a public IP address. Default: false ''' -- if __debug__: -- type_hints = typing.get_type_hints(LoadBalancedFargateServiceProps.__init__) -- check_type(argname="argument container_port", value=container_port, expected_type=type_hints["container_port"]) -- check_type(argname="argument cpu", value=cpu, expected_type=type_hints["cpu"]) -- check_type(argname="argument memory_mib", value=memory_mib, expected_type=type_hints["memory_mib"]) -- check_type(argname="argument public_load_balancer", value=public_load_balancer, expected_type=type_hints["public_load_balancer"]) -- check_type(argname="argument public_tasks", value=public_tasks, expected_type=type_hints["public_tasks"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(LoadBalancedFargateServiceProps.__init__) ++ check_type(argname="argument container_port", value=container_port, expected_type=type_hints["container_port"]) ++ check_type(argname="argument cpu", value=cpu, expected_type=type_hints["cpu"]) ++ check_type(argname="argument memory_mib", value=memory_mib, expected_type=type_hints["memory_mib"]) ++ check_type(argname="argument public_load_balancer", value=public_load_balancer, expected_type=type_hints["public_load_balancer"]) ++ check_type(argname="argument public_tasks", value=public_tasks, expected_type=type_hints["public_tasks"]) self._values: typing.Dict[str, typing.Any] = {} if container_port is not None: self._values["container_port"] = container_port if cpu is not None: self._values["cpu"] = cpu -@@ -5590,14 +5161,10 @@ +@@ -5161,10 +5590,14 @@ '''Creates a BinaryOperation. :param lhs: Left-hand side operand. :param rhs: Right-hand side operand. ''' -- if __debug__: -- type_hints = typing.get_type_hints(Multiply.__init__) -- check_type(argname="argument lhs", value=lhs, expected_type=type_hints["lhs"]) -- check_type(argname="argument rhs", value=rhs, expected_type=type_hints["rhs"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(Multiply.__init__) ++ check_type(argname="argument lhs", value=lhs, expected_type=type_hints["lhs"]) ++ check_type(argname="argument rhs", value=rhs, expected_type=type_hints["rhs"]) jsii.create(self.__class__, self, [lhs, rhs]) @jsii.member(jsii_name="farewell") def farewell(self) -> builtins.str: '''Say farewell.''' -@@ -5645,13 +5212,10 @@ +@@ -5212,10 +5645,13 @@ class NestedStruct: def __init__(self, *, number_prop: jsii.Number) -> None: ''' :param number_prop: When provided, must be > 0. ''' -- if __debug__: -- type_hints = typing.get_type_hints(NestedStruct.__init__) -- check_type(argname="argument number_prop", value=number_prop, expected_type=type_hints["number_prop"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(NestedStruct.__init__) ++ check_type(argname="argument number_prop", value=number_prop, expected_type=type_hints["number_prop"]) self._values: typing.Dict[str, typing.Any] = { "number_prop": number_prop, } @builtins.property -@@ -5722,24 +5286,17 @@ +@@ -5286,17 +5722,24 @@ def __init__(self, _param1: builtins.str, optional: typing.Any = None) -> None: ''' :param _param1: - :param optional: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(NullShouldBeTreatedAsUndefined.__init__) -- check_type(argname="argument _param1", value=_param1, expected_type=type_hints["_param1"]) -- check_type(argname="argument optional", value=optional, expected_type=type_hints["optional"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(NullShouldBeTreatedAsUndefined.__init__) ++ check_type(argname="argument _param1", value=_param1, expected_type=type_hints["_param1"]) ++ check_type(argname="argument optional", value=optional, expected_type=type_hints["optional"]) jsii.create(self.__class__, self, [_param1, optional]) @jsii.member(jsii_name="giveMeUndefined") @@ -16404,52 +15490,52 @@ exports[`Generated code for "jsii-calc": /python/src/js ''' :param value: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(NullShouldBeTreatedAsUndefined.give_me_undefined) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(NullShouldBeTreatedAsUndefined.give_me_undefined) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast(None, jsii.invoke(self, "giveMeUndefined", [value])) @jsii.member(jsii_name="giveMeUndefinedInsideAnObject") def give_me_undefined_inside_an_object( self, -@@ -5767,13 +5324,10 @@ +@@ -5324,10 +5767,13 @@ def change_me_to_undefined(self) -> typing.Optional[builtins.str]: return typing.cast(typing.Optional[builtins.str], jsii.get(self, "changeMeToUndefined")) @change_me_to_undefined.setter def change_me_to_undefined(self, value: typing.Optional[builtins.str]) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(NullShouldBeTreatedAsUndefined, "change_me_to_undefined").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(NullShouldBeTreatedAsUndefined, "change_me_to_undefined").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "changeMeToUndefined", value) @jsii.data_type( jsii_type="jsii-calc.NullShouldBeTreatedAsUndefinedData", -@@ -5792,14 +5346,10 @@ +@@ -5346,10 +5792,14 @@ ) -> None: ''' :param array_with_three_elements_and_undefined_as_second_argument: :param this_should_be_undefined: ''' -- if __debug__: -- type_hints = typing.get_type_hints(NullShouldBeTreatedAsUndefinedData.__init__) -- check_type(argname="argument array_with_three_elements_and_undefined_as_second_argument", value=array_with_three_elements_and_undefined_as_second_argument, expected_type=type_hints["array_with_three_elements_and_undefined_as_second_argument"]) -- check_type(argname="argument this_should_be_undefined", value=this_should_be_undefined, expected_type=type_hints["this_should_be_undefined"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(NullShouldBeTreatedAsUndefinedData.__init__) ++ check_type(argname="argument array_with_three_elements_and_undefined_as_second_argument", value=array_with_three_elements_and_undefined_as_second_argument, expected_type=type_hints["array_with_three_elements_and_undefined_as_second_argument"]) ++ check_type(argname="argument this_should_be_undefined", value=this_should_be_undefined, expected_type=type_hints["this_should_be_undefined"]) self._values: typing.Dict[str, typing.Any] = { "array_with_three_elements_and_undefined_as_second_argument": array_with_three_elements_and_undefined_as_second_argument, } if this_should_be_undefined is not None: self._values["this_should_be_undefined"] = this_should_be_undefined -@@ -5834,23 +5384,17 @@ +@@ -5384,17 +5834,23 @@ def __init__(self, generator: IRandomNumberGenerator) -> None: ''' :param generator: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(NumberGenerator.__init__) -- check_type(argname="argument generator", value=generator, expected_type=type_hints["generator"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(NumberGenerator.__init__) ++ check_type(argname="argument generator", value=generator, expected_type=type_hints["generator"]) jsii.create(self.__class__, self, [generator]) @jsii.member(jsii_name="isSameGenerator") @@ -16457,241 +15543,241 @@ exports[`Generated code for "jsii-calc": /python/src/js ''' :param gen: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(NumberGenerator.is_same_generator) -- check_type(argname="argument gen", value=gen, expected_type=type_hints["gen"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(NumberGenerator.is_same_generator) ++ check_type(argname="argument gen", value=gen, expected_type=type_hints["gen"]) return typing.cast(builtins.bool, jsii.invoke(self, "isSameGenerator", [gen])) @jsii.member(jsii_name="nextTimes100") def next_times100(self) -> jsii.Number: return typing.cast(jsii.Number, jsii.invoke(self, "nextTimes100", [])) -@@ -5860,13 +5404,10 @@ +@@ -5404,10 +5860,13 @@ def generator(self) -> IRandomNumberGenerator: return typing.cast(IRandomNumberGenerator, jsii.get(self, "generator")) @generator.setter def generator(self, value: IRandomNumberGenerator) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(NumberGenerator, "generator").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(NumberGenerator, "generator").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "generator", value) class ObjectRefsInCollections( metaclass=jsii.JSIIMeta, -@@ -5884,13 +5425,10 @@ +@@ -5425,10 +5884,13 @@ ) -> jsii.Number: '''Returns the sum of all values. :param values: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(ObjectRefsInCollections.sum_from_array) -- check_type(argname="argument values", value=values, expected_type=type_hints["values"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ObjectRefsInCollections.sum_from_array) ++ check_type(argname="argument values", value=values, expected_type=type_hints["values"]) return typing.cast(jsii.Number, jsii.invoke(self, "sumFromArray", [values])) @jsii.member(jsii_name="sumFromMap") def sum_from_map( self, -@@ -5898,13 +5436,10 @@ +@@ -5436,10 +5898,13 @@ ) -> jsii.Number: '''Returns the sum of all values in a map. :param values: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(ObjectRefsInCollections.sum_from_map) -- check_type(argname="argument values", value=values, expected_type=type_hints["values"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ObjectRefsInCollections.sum_from_map) ++ check_type(argname="argument values", value=values, expected_type=type_hints["values"]) return typing.cast(jsii.Number, jsii.invoke(self, "sumFromMap", [values])) class ObjectWithPropertyProvider( metaclass=jsii.JSIIMeta, -@@ -5945,13 +5480,10 @@ +@@ -5480,10 +5945,13 @@ ): def __init__(self, delegate: IInterfaceWithOptionalMethodArguments) -> None: ''' :param delegate: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(OptionalArgumentInvoker.__init__) -- check_type(argname="argument delegate", value=delegate, expected_type=type_hints["delegate"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(OptionalArgumentInvoker.__init__) ++ check_type(argname="argument delegate", value=delegate, expected_type=type_hints["delegate"]) jsii.create(self.__class__, self, [delegate]) @jsii.member(jsii_name="invokeWithOptional") def invoke_with_optional(self) -> None: return typing.cast(None, jsii.invoke(self, "invokeWithOptional", [])) -@@ -5974,15 +5506,10 @@ +@@ -5506,10 +5974,15 @@ ''' :param arg1: - :param arg2: - :param arg3: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(OptionalConstructorArgument.__init__) -- check_type(argname="argument arg1", value=arg1, expected_type=type_hints["arg1"]) -- check_type(argname="argument arg2", value=arg2, expected_type=type_hints["arg2"]) -- check_type(argname="argument arg3", value=arg3, expected_type=type_hints["arg3"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(OptionalConstructorArgument.__init__) ++ check_type(argname="argument arg1", value=arg1, expected_type=type_hints["arg1"]) ++ check_type(argname="argument arg2", value=arg2, expected_type=type_hints["arg2"]) ++ check_type(argname="argument arg3", value=arg3, expected_type=type_hints["arg3"]) jsii.create(self.__class__, self, [arg1, arg2, arg3]) @builtins.property @jsii.member(jsii_name="arg1") def arg1(self) -> jsii.Number: -@@ -6007,13 +5534,10 @@ +@@ -5534,10 +6007,13 @@ class OptionalStruct: def __init__(self, *, field: typing.Optional[builtins.str] = None) -> None: ''' :param field: ''' -- if __debug__: -- type_hints = typing.get_type_hints(OptionalStruct.__init__) -- check_type(argname="argument field", value=field, expected_type=type_hints["field"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(OptionalStruct.__init__) ++ check_type(argname="argument field", value=field, expected_type=type_hints["field"]) self._values: typing.Dict[str, typing.Any] = {} if field is not None: self._values["field"] = field @builtins.property -@@ -6089,13 +5613,10 @@ +@@ -5613,10 +6089,13 @@ def _override_read_write(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "overrideReadWrite")) @_override_read_write.setter def _override_read_write(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(OverridableProtectedMember, "_override_read_write").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(OverridableProtectedMember, "_override_read_write").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "overrideReadWrite", value) class OverrideReturnsObject( metaclass=jsii.JSIIMeta, -@@ -6107,13 +5628,10 @@ +@@ -5628,10 +6107,13 @@ @jsii.member(jsii_name="test") def test(self, obj: IReturnsNumber) -> jsii.Number: ''' :param obj: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(OverrideReturnsObject.test) -- check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(OverrideReturnsObject.test) ++ check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) return typing.cast(jsii.Number, jsii.invoke(self, "test", [obj])) @jsii.data_type( jsii_type="jsii-calc.ParentStruct982", -@@ -6124,13 +5642,10 @@ +@@ -5642,10 +6124,13 @@ def __init__(self, *, foo: builtins.str) -> None: '''https://github.com/aws/jsii/issues/982. :param foo: ''' -- if __debug__: -- type_hints = typing.get_type_hints(ParentStruct982.__init__) -- check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ParentStruct982.__init__) ++ check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) self._values: typing.Dict[str, typing.Any] = { "foo": foo, } @builtins.property -@@ -6185,15 +5700,10 @@ +@@ -5700,10 +6185,15 @@ ''' :param obj: - :param dt: - :param ev: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(PartiallyInitializedThisConsumer.consume_partially_initialized_this) -- check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) -- check_type(argname="argument dt", value=dt, expected_type=type_hints["dt"]) -- check_type(argname="argument ev", value=ev, expected_type=type_hints["ev"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(PartiallyInitializedThisConsumer.consume_partially_initialized_this) ++ check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) ++ check_type(argname="argument dt", value=dt, expected_type=type_hints["dt"]) ++ check_type(argname="argument ev", value=ev, expected_type=type_hints["ev"]) return typing.cast(builtins.str, jsii.invoke(self, "consumePartiallyInitializedThis", [obj, dt, ev])) # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class typing.cast(typing.Any, PartiallyInitializedThisConsumer).__jsii_proxy_class__ = lambda : _PartiallyInitializedThisConsumerProxy -@@ -6205,13 +5715,10 @@ +@@ -5715,10 +6205,13 @@ @jsii.member(jsii_name="sayHello") def say_hello(self, friendly: scope.jsii_calc_lib.IFriendly) -> builtins.str: ''' :param friendly: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(Polymorphism.say_hello) -- check_type(argname="argument friendly", value=friendly, expected_type=type_hints["friendly"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(Polymorphism.say_hello) ++ check_type(argname="argument friendly", value=friendly, expected_type=type_hints["friendly"]) return typing.cast(builtins.str, jsii.invoke(self, "sayHello", [friendly])) class Power( _CompositeOperation_1c4d123b, -@@ -6228,14 +5735,10 @@ +@@ -5735,10 +6228,14 @@ '''Creates a Power operation. :param base: The base of the power. :param pow: The number of times to multiply. ''' -- if __debug__: -- type_hints = typing.get_type_hints(Power.__init__) -- check_type(argname="argument base", value=base, expected_type=type_hints["base"]) -- check_type(argname="argument pow", value=pow, expected_type=type_hints["pow"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(Power.__init__) ++ check_type(argname="argument base", value=base, expected_type=type_hints["base"]) ++ check_type(argname="argument pow", value=pow, expected_type=type_hints["pow"]) jsii.create(self.__class__, self, [base, pow]) @builtins.property @jsii.member(jsii_name="base") def base(self) -> scope.jsii_calc_lib.NumericValue: -@@ -6439,13 +5942,10 @@ +@@ -5942,10 +6439,13 @@ @jsii.member(jsii_name="saveFoo") def save_foo(self, value: scope.jsii_calc_lib.EnumFromScopedModule) -> None: ''' :param value: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(ReferenceEnumFromScopedPackage.save_foo) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ReferenceEnumFromScopedPackage.save_foo) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast(None, jsii.invoke(self, "saveFoo", [value])) @builtins.property @jsii.member(jsii_name="foo") def foo(self) -> typing.Optional[scope.jsii_calc_lib.EnumFromScopedModule]: -@@ -6454,13 +5954,10 @@ +@@ -5954,10 +6454,13 @@ @foo.setter def foo( self, value: typing.Optional[scope.jsii_calc_lib.EnumFromScopedModule], ) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(ReferenceEnumFromScopedPackage, "foo").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(ReferenceEnumFromScopedPackage, "foo").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "foo", value) class ReturnsPrivateImplementationOfInterface( metaclass=jsii.JSIIMeta, -@@ -6502,14 +5999,10 @@ +@@ -5999,10 +6502,14 @@ :param string_prop: May not be empty. :param nested_struct: ''' if isinstance(nested_struct, dict): nested_struct = NestedStruct(**nested_struct) -- if __debug__: -- type_hints = typing.get_type_hints(RootStruct.__init__) -- check_type(argname="argument string_prop", value=string_prop, expected_type=type_hints["string_prop"]) -- check_type(argname="argument nested_struct", value=nested_struct, expected_type=type_hints["nested_struct"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(RootStruct.__init__) ++ check_type(argname="argument string_prop", value=string_prop, expected_type=type_hints["string_prop"]) ++ check_type(argname="argument nested_struct", value=nested_struct, expected_type=type_hints["nested_struct"]) self._values: typing.Dict[str, typing.Any] = { "string_prop": string_prop, } if nested_struct is not None: self._values["nested_struct"] = nested_struct -@@ -6576,25 +6069,17 @@ +@@ -6069,17 +6576,25 @@ ''' :param arg1: - :param arg2: - :param arg3: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(RuntimeTypeChecking.method_with_defaulted_arguments) -- check_type(argname="argument arg1", value=arg1, expected_type=type_hints["arg1"]) -- check_type(argname="argument arg2", value=arg2, expected_type=type_hints["arg2"]) -- check_type(argname="argument arg3", value=arg3, expected_type=type_hints["arg3"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(RuntimeTypeChecking.method_with_defaulted_arguments) ++ check_type(argname="argument arg1", value=arg1, expected_type=type_hints["arg1"]) ++ check_type(argname="argument arg2", value=arg2, expected_type=type_hints["arg2"]) ++ check_type(argname="argument arg3", value=arg3, expected_type=type_hints["arg3"]) return typing.cast(None, jsii.invoke(self, "methodWithDefaultedArguments", [arg1, arg2, arg3])) @jsii.member(jsii_name="methodWithOptionalAnyArgument") @@ -16699,154 +15785,154 @@ exports[`Generated code for "jsii-calc": /python/src/js ''' :param arg: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(RuntimeTypeChecking.method_with_optional_any_argument) -- check_type(argname="argument arg", value=arg, expected_type=type_hints["arg"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(RuntimeTypeChecking.method_with_optional_any_argument) ++ check_type(argname="argument arg", value=arg, expected_type=type_hints["arg"]) return typing.cast(None, jsii.invoke(self, "methodWithOptionalAnyArgument", [arg])) @jsii.member(jsii_name="methodWithOptionalArguments") def method_with_optional_arguments( self, -@@ -6606,15 +6091,10 @@ +@@ -6091,10 +6606,15 @@ :param arg1: - :param arg2: - :param arg3: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(RuntimeTypeChecking.method_with_optional_arguments) -- check_type(argname="argument arg1", value=arg1, expected_type=type_hints["arg1"]) -- check_type(argname="argument arg2", value=arg2, expected_type=type_hints["arg2"]) -- check_type(argname="argument arg3", value=arg3, expected_type=type_hints["arg3"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(RuntimeTypeChecking.method_with_optional_arguments) ++ check_type(argname="argument arg1", value=arg1, expected_type=type_hints["arg1"]) ++ check_type(argname="argument arg2", value=arg2, expected_type=type_hints["arg2"]) ++ check_type(argname="argument arg3", value=arg3, expected_type=type_hints["arg3"]) return typing.cast(None, jsii.invoke(self, "methodWithOptionalArguments", [arg1, arg2, arg3])) @jsii.data_type( jsii_type="jsii-calc.SecondLevelStruct", -@@ -6633,14 +6113,10 @@ +@@ -6113,10 +6633,14 @@ ) -> None: ''' :param deeper_required_prop: It's long and required. :param deeper_optional_prop: It's long, but you'll almost never pass it. ''' -- if __debug__: -- type_hints = typing.get_type_hints(SecondLevelStruct.__init__) -- check_type(argname="argument deeper_required_prop", value=deeper_required_prop, expected_type=type_hints["deeper_required_prop"]) -- check_type(argname="argument deeper_optional_prop", value=deeper_optional_prop, expected_type=type_hints["deeper_optional_prop"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(SecondLevelStruct.__init__) ++ check_type(argname="argument deeper_required_prop", value=deeper_required_prop, expected_type=type_hints["deeper_required_prop"]) ++ check_type(argname="argument deeper_optional_prop", value=deeper_optional_prop, expected_type=type_hints["deeper_optional_prop"]) self._values: typing.Dict[str, typing.Any] = { "deeper_required_prop": deeper_required_prop, } if deeper_optional_prop is not None: self._values["deeper_optional_prop"] = deeper_optional_prop -@@ -6702,13 +6178,10 @@ +@@ -6178,10 +6702,13 @@ @jsii.member(jsii_name="isSingletonInt") def is_singleton_int(self, value: jsii.Number) -> builtins.bool: ''' :param value: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(SingletonInt.is_singleton_int) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(SingletonInt.is_singleton_int) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast(builtins.bool, jsii.invoke(self, "isSingletonInt", [value])) @jsii.enum(jsii_type="jsii-calc.SingletonIntEnum") class SingletonIntEnum(enum.Enum): -@@ -6727,13 +6200,10 @@ +@@ -6200,10 +6727,13 @@ @jsii.member(jsii_name="isSingletonString") def is_singleton_string(self, value: builtins.str) -> builtins.bool: ''' :param value: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(SingletonString.is_singleton_string) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(SingletonString.is_singleton_string) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast(builtins.bool, jsii.invoke(self, "isSingletonString", [value])) @jsii.enum(jsii_type="jsii-calc.SingletonStringEnum") class SingletonStringEnum(enum.Enum): -@@ -6757,14 +6227,10 @@ +@@ -6227,10 +6757,14 @@ ) -> None: ''' :param property: :param yet_anoter_one: ''' -- if __debug__: -- type_hints = typing.get_type_hints(SmellyStruct.__init__) -- check_type(argname="argument property", value=property, expected_type=type_hints["property"]) -- check_type(argname="argument yet_anoter_one", value=yet_anoter_one, expected_type=type_hints["yet_anoter_one"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(SmellyStruct.__init__) ++ check_type(argname="argument property", value=property, expected_type=type_hints["property"]) ++ check_type(argname="argument yet_anoter_one", value=yet_anoter_one, expected_type=type_hints["yet_anoter_one"]) self._values: typing.Dict[str, typing.Any] = { "property": property, "yet_anoter_one": yet_anoter_one, } -@@ -6815,14 +6281,10 @@ +@@ -6281,10 +6815,14 @@ ) -> None: ''' :param readonly_string: - :param mutable_number: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(StableClass.__init__) -- check_type(argname="argument readonly_string", value=readonly_string, expected_type=type_hints["readonly_string"]) -- check_type(argname="argument mutable_number", value=mutable_number, expected_type=type_hints["mutable_number"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(StableClass.__init__) ++ check_type(argname="argument readonly_string", value=readonly_string, expected_type=type_hints["readonly_string"]) ++ check_type(argname="argument mutable_number", value=mutable_number, expected_type=type_hints["mutable_number"]) jsii.create(self.__class__, self, [readonly_string, mutable_number]) @jsii.member(jsii_name="method") def method(self) -> None: return typing.cast(None, jsii.invoke(self, "method", [])) -@@ -6837,13 +6299,10 @@ +@@ -6299,10 +6837,13 @@ def mutable_property(self) -> typing.Optional[jsii.Number]: return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "mutableProperty")) @mutable_property.setter def mutable_property(self, value: typing.Optional[jsii.Number]) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(StableClass, "mutable_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(StableClass, "mutable_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "mutableProperty", value) @jsii.enum(jsii_type="jsii-calc.StableEnum") class StableEnum(enum.Enum): -@@ -6859,13 +6318,10 @@ +@@ -6318,10 +6859,13 @@ class StableStruct: def __init__(self, *, readonly_property: builtins.str) -> None: ''' :param readonly_property: ''' -- if __debug__: -- type_hints = typing.get_type_hints(StableStruct.__init__) -- check_type(argname="argument readonly_property", value=readonly_property, expected_type=type_hints["readonly_property"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(StableStruct.__init__) ++ check_type(argname="argument readonly_property", value=readonly_property, expected_type=type_hints["readonly_property"]) self._values: typing.Dict[str, typing.Any] = { "readonly_property": readonly_property, } @builtins.property -@@ -6902,13 +6358,10 @@ +@@ -6358,10 +6902,13 @@ def static_variable(cls) -> builtins.bool: # pyright: ignore [reportGeneralTypeIssues] return typing.cast(builtins.bool, jsii.sget(cls, "staticVariable")) @static_variable.setter # type: ignore[no-redef] def static_variable(cls, value: builtins.bool) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(StaticContext, "static_variable").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(StaticContext, "static_variable").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.sset(cls, "staticVariable", value) class StaticHelloParent( metaclass=jsii.JSIIMeta, -@@ -6938,25 +6391,19 @@ +@@ -6391,19 +6938,25 @@ class Statics(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Statics"): def __init__(self, value: builtins.str) -> None: ''' :param value: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(Statics.__init__) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(Statics.__init__) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.create(self.__class__, self, [value]) @jsii.member(jsii_name="staticMethod") @@ -16856,23 +15942,23 @@ exports[`Generated code for "jsii-calc": /python/src/js :param name: The name of the person to say hello to. ''' -- if __debug__: -- type_hints = typing.get_type_hints(Statics.static_method) -- check_type(argname="argument name", value=name, expected_type=type_hints["name"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(Statics.static_method) ++ check_type(argname="argument name", value=name, expected_type=type_hints["name"]) return typing.cast(builtins.str, jsii.sinvoke(cls, "staticMethod", [name])) @jsii.member(jsii_name="justMethod") def just_method(self) -> builtins.str: return typing.cast(builtins.str, jsii.invoke(self, "justMethod", [])) -@@ -6993,25 +6440,19 @@ +@@ -6440,19 +6993,25 @@ ''' return typing.cast("Statics", jsii.sget(cls, "instance")) @instance.setter # type: ignore[no-redef] def instance(cls, value: "Statics") -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(Statics, "instance").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(Statics, "instance").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.sset(cls, "instance", value) @jsii.python.classproperty @@ -16882,127 +15968,127 @@ exports[`Generated code for "jsii-calc": /python/src/js @non_const_static.setter # type: ignore[no-redef] def non_const_static(cls, value: jsii.Number) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(Statics, "non_const_static").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(Statics, "non_const_static").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.sset(cls, "nonConstStatic", value) @builtins.property @jsii.member(jsii_name="value") def value(self) -> builtins.str: -@@ -7034,13 +6475,10 @@ +@@ -6475,10 +7034,13 @@ def you_see_me(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "youSeeMe")) @you_see_me.setter def you_see_me(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(StripInternal, "you_see_me").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(StripInternal, "you_see_me").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "youSeeMe", value) @jsii.data_type( jsii_type="jsii-calc.StructA", -@@ -7063,15 +6501,10 @@ +@@ -6501,10 +7063,15 @@ :param required_string: :param optional_number: :param optional_string: ''' -- if __debug__: -- type_hints = typing.get_type_hints(StructA.__init__) -- check_type(argname="argument required_string", value=required_string, expected_type=type_hints["required_string"]) -- check_type(argname="argument optional_number", value=optional_number, expected_type=type_hints["optional_number"]) -- check_type(argname="argument optional_string", value=optional_string, expected_type=type_hints["optional_string"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(StructA.__init__) ++ check_type(argname="argument required_string", value=required_string, expected_type=type_hints["required_string"]) ++ check_type(argname="argument optional_number", value=optional_number, expected_type=type_hints["optional_number"]) ++ check_type(argname="argument optional_string", value=optional_string, expected_type=type_hints["optional_string"]) self._values: typing.Dict[str, typing.Any] = { "required_string": required_string, } if optional_number is not None: self._values["optional_number"] = optional_number -@@ -7129,15 +6562,10 @@ +@@ -6562,10 +7129,15 @@ :param optional_boolean: :param optional_struct_a: ''' if isinstance(optional_struct_a, dict): optional_struct_a = StructA(**optional_struct_a) -- if __debug__: -- type_hints = typing.get_type_hints(StructB.__init__) -- check_type(argname="argument required_string", value=required_string, expected_type=type_hints["required_string"]) -- check_type(argname="argument optional_boolean", value=optional_boolean, expected_type=type_hints["optional_boolean"]) -- check_type(argname="argument optional_struct_a", value=optional_struct_a, expected_type=type_hints["optional_struct_a"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(StructB.__init__) ++ check_type(argname="argument required_string", value=required_string, expected_type=type_hints["required_string"]) ++ check_type(argname="argument optional_boolean", value=optional_boolean, expected_type=type_hints["optional_boolean"]) ++ check_type(argname="argument optional_struct_a", value=optional_struct_a, expected_type=type_hints["optional_struct_a"]) self._values: typing.Dict[str, typing.Any] = { "required_string": required_string, } if optional_boolean is not None: self._values["optional_boolean"] = optional_boolean -@@ -7189,14 +6617,10 @@ +@@ -6617,10 +7189,14 @@ See: https://github.com/aws/aws-cdk/issues/4302 :param scope: :param props: ''' -- if __debug__: -- type_hints = typing.get_type_hints(StructParameterType.__init__) -- check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"]) -- check_type(argname="argument props", value=props, expected_type=type_hints["props"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(StructParameterType.__init__) ++ check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"]) ++ check_type(argname="argument props", value=props, expected_type=type_hints["props"]) self._values: typing.Dict[str, typing.Any] = { "scope": scope, } if props is not None: self._values["props"] = props -@@ -7239,14 +6663,10 @@ +@@ -6663,10 +7239,14 @@ ) -> jsii.Number: ''' :param _positional: - :param inputs: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(StructPassing.how_many_var_args_did_i_pass) -- check_type(argname="argument _positional", value=_positional, expected_type=type_hints["_positional"]) -- check_type(argname="argument inputs", value=inputs, expected_type=typing.Tuple[type_hints["inputs"], ...]) # pyright: ignore [reportGeneralTypeIssues] ++ if __debug__: ++ type_hints = typing.get_type_hints(StructPassing.how_many_var_args_did_i_pass) ++ check_type(argname="argument _positional", value=_positional, expected_type=type_hints["_positional"]) ++ check_type(argname="argument inputs", value=inputs, expected_type=typing.Tuple[type_hints["inputs"], ...]) # pyright: ignore [reportGeneralTypeIssues] return typing.cast(jsii.Number, jsii.sinvoke(cls, "howManyVarArgsDidIPass", [_positional, *inputs])) @jsii.member(jsii_name="roundTrip") @builtins.classmethod def round_trip( -@@ -7261,13 +6681,10 @@ +@@ -6681,10 +7261,13 @@ :param _positional: - :param required: This is a required field. :param second_level: A union to really stress test our serialization. :param optional: You don't have to pass this. ''' -- if __debug__: -- type_hints = typing.get_type_hints(StructPassing.round_trip) -- check_type(argname="argument _positional", value=_positional, expected_type=type_hints["_positional"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(StructPassing.round_trip) ++ check_type(argname="argument _positional", value=_positional, expected_type=type_hints["_positional"]) input = TopLevelStruct( required=required, second_level=second_level, optional=optional ) return typing.cast("TopLevelStruct", jsii.sinvoke(cls, "roundTrip", [_positional, input])) -@@ -7284,13 +6701,10 @@ +@@ -6701,10 +7284,13 @@ struct: typing.Union[typing.Union[StructA, typing.Dict[str, typing.Any]], typing.Union[StructB, typing.Dict[str, typing.Any]]], ) -> builtins.bool: ''' :param struct: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(StructUnionConsumer.is_struct_a) -- check_type(argname="argument struct", value=struct, expected_type=type_hints["struct"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(StructUnionConsumer.is_struct_a) ++ check_type(argname="argument struct", value=struct, expected_type=type_hints["struct"]) return typing.cast(builtins.bool, jsii.sinvoke(cls, "isStructA", [struct])) @jsii.member(jsii_name="isStructB") @builtins.classmethod def is_struct_b( -@@ -7298,24 +6712,18 @@ +@@ -6712,18 +7298,24 @@ struct: typing.Union[typing.Union[StructA, typing.Dict[str, typing.Any]], typing.Union[StructB, typing.Dict[str, typing.Any]]], ) -> builtins.bool: ''' :param struct: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(StructUnionConsumer.is_struct_b) -- check_type(argname="argument struct", value=struct, expected_type=type_hints["struct"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(StructUnionConsumer.is_struct_b) ++ check_type(argname="argument struct", value=struct, expected_type=type_hints["struct"]) return typing.cast(builtins.bool, jsii.sinvoke(cls, "isStructB", [struct])) @jsii.member(jsii_name="provideStruct") @@ -17011,112 +16097,112 @@ exports[`Generated code for "jsii-calc": /python/src/js ''' :param which: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(StructUnionConsumer.provide_struct) -- check_type(argname="argument which", value=which, expected_type=type_hints["which"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(StructUnionConsumer.provide_struct) ++ check_type(argname="argument which", value=which, expected_type=type_hints["which"]) return typing.cast(typing.Union[StructA, StructB], jsii.sinvoke(cls, "provideStruct", [which])) @jsii.data_type( jsii_type="jsii-calc.StructWithCollectionOfUnionts", -@@ -7329,13 +6737,10 @@ +@@ -6737,10 +7329,13 @@ union_property: typing.Sequence[typing.Mapping[builtins.str, typing.Union[typing.Union[StructA, typing.Dict[str, typing.Any]], typing.Union[StructB, typing.Dict[str, typing.Any]]]]], ) -> None: ''' :param union_property: ''' -- if __debug__: -- type_hints = typing.get_type_hints(StructWithCollectionOfUnionts.__init__) -- check_type(argname="argument union_property", value=union_property, expected_type=type_hints["union_property"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(StructWithCollectionOfUnionts.__init__) ++ check_type(argname="argument union_property", value=union_property, expected_type=type_hints["union_property"]) self._values: typing.Dict[str, typing.Any] = { "union_property": union_property, } @builtins.property -@@ -7372,14 +6777,10 @@ +@@ -6777,10 +7372,14 @@ ) -> None: ''' :param foo: An enum value. :param bar: Optional enum value (of type integer). Default: AllTypesEnum.YOUR_ENUM_VALUE ''' -- if __debug__: -- type_hints = typing.get_type_hints(StructWithEnum.__init__) -- check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) -- check_type(argname="argument bar", value=bar, expected_type=type_hints["bar"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(StructWithEnum.__init__) ++ check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) ++ check_type(argname="argument bar", value=bar, expected_type=type_hints["bar"]) self._values: typing.Dict[str, typing.Any] = { "foo": foo, } if bar is not None: self._values["bar"] = bar -@@ -7435,16 +6836,10 @@ +@@ -6836,10 +7435,16 @@ :param default: :param assert_: :param result: :param that: ''' -- if __debug__: -- type_hints = typing.get_type_hints(StructWithJavaReservedWords.__init__) -- check_type(argname="argument default", value=default, expected_type=type_hints["default"]) -- check_type(argname="argument assert_", value=assert_, expected_type=type_hints["assert_"]) -- check_type(argname="argument result", value=result, expected_type=type_hints["result"]) -- check_type(argname="argument that", value=that, expected_type=type_hints["that"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(StructWithJavaReservedWords.__init__) ++ check_type(argname="argument default", value=default, expected_type=type_hints["default"]) ++ check_type(argname="argument assert_", value=assert_, expected_type=type_hints["assert_"]) ++ check_type(argname="argument result", value=result, expected_type=type_hints["result"]) ++ check_type(argname="argument that", value=that, expected_type=type_hints["that"]) self._values: typing.Dict[str, typing.Any] = { "default": default, } if assert_ is not None: self._values["assert_"] = assert_ -@@ -7511,13 +6906,10 @@ +@@ -6906,10 +7511,13 @@ '''The parts to sum.''' return typing.cast(typing.List[scope.jsii_calc_lib.NumericValue], jsii.get(self, "parts")) @parts.setter def parts(self, value: typing.List[scope.jsii_calc_lib.NumericValue]) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(Sum, "parts").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(Sum, "parts").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "parts", value) @jsii.data_type( jsii_type="jsii-calc.SupportsNiceJavaBuilderProps", -@@ -7533,14 +6925,10 @@ +@@ -6925,10 +7533,14 @@ ) -> None: ''' :param bar: Some number, like 42. :param id: An \`\`id\`\` field here is terrible API design, because the constructor of \`\`SupportsNiceJavaBuilder\`\` already has a parameter named \`\`id\`\`. But here we are, doing it like we didn't care. ''' -- if __debug__: -- type_hints = typing.get_type_hints(SupportsNiceJavaBuilderProps.__init__) -- check_type(argname="argument bar", value=bar, expected_type=type_hints["bar"]) -- check_type(argname="argument id", value=id, expected_type=type_hints["id"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(SupportsNiceJavaBuilderProps.__init__) ++ check_type(argname="argument bar", value=bar, expected_type=type_hints["bar"]) ++ check_type(argname="argument id", value=id, expected_type=type_hints["id"]) self._values: typing.Dict[str, typing.Any] = { "bar": bar, } if id is not None: self._values["id"] = id -@@ -7589,13 +6977,10 @@ +@@ -6977,10 +7589,13 @@ ''' :param id_: some identifier of your choice. :param bar: Some number, like 42. :param id: An \`\`id\`\` field here is terrible API design, because the constructor of \`\`SupportsNiceJavaBuilder\`\` already has a parameter named \`\`id\`\`. But here we are, doing it like we didn't care. ''' -- if __debug__: -- type_hints = typing.get_type_hints(SupportsNiceJavaBuilderWithRequiredProps.__init__) -- check_type(argname="argument id_", value=id_, expected_type=type_hints["id_"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(SupportsNiceJavaBuilderWithRequiredProps.__init__) ++ check_type(argname="argument id_", value=id_, expected_type=type_hints["id_"]) props = SupportsNiceJavaBuilderProps(bar=bar, id=id) jsii.create(self.__class__, self, [id_, props]) @builtins.property -@@ -7633,23 +7018,17 @@ +@@ -7018,17 +7633,23 @@ @jsii.member(jsii_name="modifyOtherProperty") def modify_other_property(self, value: builtins.str) -> None: ''' :param value: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(SyncVirtualMethods.modify_other_property) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(SyncVirtualMethods.modify_other_property) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast(None, jsii.invoke(self, "modifyOtherProperty", [value])) @jsii.member(jsii_name="modifyValueOfTheProperty") @@ -17124,23 +16210,23 @@ exports[`Generated code for "jsii-calc": /python/src/js ''' :param value: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(SyncVirtualMethods.modify_value_of_the_property) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(SyncVirtualMethods.modify_value_of_the_property) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast(None, jsii.invoke(self, "modifyValueOfTheProperty", [value])) @jsii.member(jsii_name="readA") def read_a(self) -> jsii.Number: return typing.cast(jsii.Number, jsii.invoke(self, "readA", [])) -@@ -7669,23 +7048,17 @@ +@@ -7048,17 +7669,23 @@ @jsii.member(jsii_name="virtualMethod") def virtual_method(self, n: jsii.Number) -> jsii.Number: ''' :param n: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(SyncVirtualMethods.virtual_method) -- check_type(argname="argument n", value=n, expected_type=type_hints["n"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(SyncVirtualMethods.virtual_method) ++ check_type(argname="argument n", value=n, expected_type=type_hints["n"]) return typing.cast(jsii.Number, jsii.invoke(self, "virtualMethod", [n])) @jsii.member(jsii_name="writeA") @@ -17148,23 +16234,23 @@ exports[`Generated code for "jsii-calc": /python/src/js ''' :param value: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(SyncVirtualMethods.write_a) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(SyncVirtualMethods.write_a) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast(None, jsii.invoke(self, "writeA", [value])) @builtins.property @jsii.member(jsii_name="readonlyProperty") def readonly_property(self) -> builtins.str: -@@ -7696,61 +7069,46 @@ +@@ -7069,46 +7696,61 @@ def a(self) -> jsii.Number: return typing.cast(jsii.Number, jsii.get(self, "a")) @a.setter def a(self, value: jsii.Number) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(SyncVirtualMethods, "a").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(SyncVirtualMethods, "a").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "a", value) @builtins.property @@ -17174,9 +16260,9 @@ exports[`Generated code for "jsii-calc": /python/src/js @caller_is_property.setter def caller_is_property(self, value: jsii.Number) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(SyncVirtualMethods, "caller_is_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(SyncVirtualMethods, "caller_is_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "callerIsProperty", value) @builtins.property @@ -17186,9 +16272,9 @@ exports[`Generated code for "jsii-calc": /python/src/js @other_property.setter def other_property(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(SyncVirtualMethods, "other_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(SyncVirtualMethods, "other_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "otherProperty", value) @builtins.property @@ -17198,9 +16284,9 @@ exports[`Generated code for "jsii-calc": /python/src/js @the_property.setter def the_property(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(SyncVirtualMethods, "the_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(SyncVirtualMethods, "the_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "theProperty", value) @builtins.property @@ -17210,96 +16296,96 @@ exports[`Generated code for "jsii-calc": /python/src/js @value_of_other_property.setter def value_of_other_property(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(SyncVirtualMethods, "value_of_other_property").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(SyncVirtualMethods, "value_of_other_property").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "valueOfOtherProperty", value) class TestStructWithEnum( metaclass=jsii.JSIIMeta, -@@ -7833,15 +7191,10 @@ +@@ -7191,10 +7833,15 @@ ''' :param required: This is a required field. :param second_level: A union to really stress test our serialization. :param optional: You don't have to pass this. ''' -- if __debug__: -- type_hints = typing.get_type_hints(TopLevelStruct.__init__) -- check_type(argname="argument required", value=required, expected_type=type_hints["required"]) -- check_type(argname="argument second_level", value=second_level, expected_type=type_hints["second_level"]) -- check_type(argname="argument optional", value=optional, expected_type=type_hints["optional"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(TopLevelStruct.__init__) ++ check_type(argname="argument required", value=required, expected_type=type_hints["required"]) ++ check_type(argname="argument second_level", value=second_level, expected_type=type_hints["second_level"]) ++ check_type(argname="argument optional", value=optional, expected_type=type_hints["optional"]) self._values: typing.Dict[str, typing.Any] = { "required": required, "second_level": second_level, } if optional is not None: -@@ -7932,13 +7285,10 @@ +@@ -7285,10 +7932,13 @@ def __init__(self, operand: scope.jsii_calc_lib.NumericValue) -> None: ''' :param operand: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(UnaryOperation.__init__) -- check_type(argname="argument operand", value=operand, expected_type=type_hints["operand"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(UnaryOperation.__init__) ++ check_type(argname="argument operand", value=operand, expected_type=type_hints["operand"]) jsii.create(self.__class__, self, [operand]) @builtins.property @jsii.member(jsii_name="operand") def operand(self) -> scope.jsii_calc_lib.NumericValue: -@@ -7969,14 +7319,10 @@ +@@ -7319,10 +7969,14 @@ ) -> None: ''' :param bar: :param foo: ''' -- if __debug__: -- type_hints = typing.get_type_hints(UnionProperties.__init__) -- check_type(argname="argument bar", value=bar, expected_type=type_hints["bar"]) -- check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(UnionProperties.__init__) ++ check_type(argname="argument bar", value=bar, expected_type=type_hints["bar"]) ++ check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) self._values: typing.Dict[str, typing.Any] = { "bar": bar, } if foo is not None: self._values["foo"] = foo -@@ -8013,13 +7359,10 @@ +@@ -7359,10 +8013,13 @@ def __init__(self, delegate: typing.Mapping[builtins.str, typing.Any]) -> None: ''' :param delegate: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(UpcasingReflectable.__init__) -- check_type(argname="argument delegate", value=delegate, expected_type=type_hints["delegate"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(UpcasingReflectable.__init__) ++ check_type(argname="argument delegate", value=delegate, expected_type=type_hints["delegate"]) jsii.create(self.__class__, self, [delegate]) @jsii.python.classproperty @jsii.member(jsii_name="reflector") def REFLECTOR(cls) -> scope.jsii_calc_lib.custom_submodule_name.Reflector: -@@ -8062,13 +7405,10 @@ +@@ -7405,10 +8062,13 @@ ): def __init__(self, obj: IInterfaceWithProperties) -> None: ''' :param obj: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(UsesInterfaceWithProperties.__init__) -- check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(UsesInterfaceWithProperties.__init__) ++ check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) jsii.create(self.__class__, self, [obj]) @jsii.member(jsii_name="justRead") def just_read(self) -> builtins.str: return typing.cast(builtins.str, jsii.invoke(self, "justRead", [])) -@@ -8079,23 +7419,17 @@ +@@ -7419,17 +8079,23 @@ ext: IInterfaceWithPropertiesExtension, ) -> builtins.str: ''' :param ext: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(UsesInterfaceWithProperties.read_string_and_number) -- check_type(argname="argument ext", value=ext, expected_type=type_hints["ext"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(UsesInterfaceWithProperties.read_string_and_number) ++ check_type(argname="argument ext", value=ext, expected_type=type_hints["ext"]) return typing.cast(builtins.str, jsii.invoke(self, "readStringAndNumber", [ext])) @jsii.member(jsii_name="writeAndRead") @@ -17307,23 +16393,23 @@ exports[`Generated code for "jsii-calc": /python/src/js ''' :param value: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(UsesInterfaceWithProperties.write_and_read) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(UsesInterfaceWithProperties.write_and_read) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) return typing.cast(builtins.str, jsii.invoke(self, "writeAndRead", [value])) @builtins.property @jsii.member(jsii_name="obj") def obj(self) -> IInterfaceWithProperties: -@@ -8105,34 +7439,25 @@ +@@ -7439,25 +8105,34 @@ class VariadicInvoker(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.VariadicInvoker"): def __init__(self, method: "VariadicMethod") -> None: ''' :param method: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(VariadicInvoker.__init__) -- check_type(argname="argument method", value=method, expected_type=type_hints["method"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(VariadicInvoker.__init__) ++ check_type(argname="argument method", value=method, expected_type=type_hints["method"]) jsii.create(self.__class__, self, [method]) @jsii.member(jsii_name="asArray") @@ -17331,9 +16417,9 @@ exports[`Generated code for "jsii-calc": /python/src/js ''' :param values: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(VariadicInvoker.as_array) -- check_type(argname="argument values", value=values, expected_type=typing.Tuple[type_hints["values"], ...]) # pyright: ignore [reportGeneralTypeIssues] ++ if __debug__: ++ type_hints = typing.get_type_hints(VariadicInvoker.as_array) ++ check_type(argname="argument values", value=values, expected_type=typing.Tuple[type_hints["values"], ...]) # pyright: ignore [reportGeneralTypeIssues] return typing.cast(typing.List[jsii.Number], jsii.invoke(self, "asArray", [*values])) @@ -17342,38 +16428,38 @@ exports[`Generated code for "jsii-calc": /python/src/js ''' :param prefix: a prefix that will be use for all values returned by \`\`#asArray\`\`. ''' -- if __debug__: -- type_hints = typing.get_type_hints(VariadicMethod.__init__) -- check_type(argname="argument prefix", value=prefix, expected_type=typing.Tuple[type_hints["prefix"], ...]) # pyright: ignore [reportGeneralTypeIssues] ++ if __debug__: ++ type_hints = typing.get_type_hints(VariadicMethod.__init__) ++ check_type(argname="argument prefix", value=prefix, expected_type=typing.Tuple[type_hints["prefix"], ...]) # pyright: ignore [reportGeneralTypeIssues] jsii.create(self.__class__, self, [*prefix]) @jsii.member(jsii_name="asArray") def as_array( self, -@@ -8141,14 +7466,10 @@ +@@ -7466,10 +8141,14 @@ ) -> typing.List[jsii.Number]: ''' :param first: the first element of the array to be returned (after the \`\`prefix\`\` provided at construction time). :param others: other elements to be included in the array. ''' -- if __debug__: -- type_hints = typing.get_type_hints(VariadicMethod.as_array) -- check_type(argname="argument first", value=first, expected_type=type_hints["first"]) -- check_type(argname="argument others", value=others, expected_type=typing.Tuple[type_hints["others"], ...]) # pyright: ignore [reportGeneralTypeIssues] ++ if __debug__: ++ type_hints = typing.get_type_hints(VariadicMethod.as_array) ++ check_type(argname="argument first", value=first, expected_type=type_hints["first"]) ++ check_type(argname="argument others", value=others, expected_type=typing.Tuple[type_hints["others"], ...]) # pyright: ignore [reportGeneralTypeIssues] return typing.cast(typing.List[jsii.Number], jsii.invoke(self, "asArray", [first, *others])) class VirtualMethodPlayground( metaclass=jsii.JSIIMeta, -@@ -8160,53 +7481,38 @@ +@@ -7481,38 +8160,53 @@ @jsii.member(jsii_name="overrideMeAsync") def override_me_async(self, index: jsii.Number) -> jsii.Number: ''' :param index: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(VirtualMethodPlayground.override_me_async) -- check_type(argname="argument index", value=index, expected_type=type_hints["index"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(VirtualMethodPlayground.override_me_async) ++ check_type(argname="argument index", value=index, expected_type=type_hints["index"]) return typing.cast(jsii.Number, jsii.ainvoke(self, "overrideMeAsync", [index])) @jsii.member(jsii_name="overrideMeSync") @@ -17381,9 +16467,9 @@ exports[`Generated code for "jsii-calc": /python/src/js ''' :param index: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(VirtualMethodPlayground.override_me_sync) -- check_type(argname="argument index", value=index, expected_type=type_hints["index"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(VirtualMethodPlayground.override_me_sync) ++ check_type(argname="argument index", value=index, expected_type=type_hints["index"]) return typing.cast(jsii.Number, jsii.invoke(self, "overrideMeSync", [index])) @jsii.member(jsii_name="parallelSumAsync") @@ -17391,9 +16477,9 @@ exports[`Generated code for "jsii-calc": /python/src/js ''' :param count: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(VirtualMethodPlayground.parallel_sum_async) -- check_type(argname="argument count", value=count, expected_type=type_hints["count"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(VirtualMethodPlayground.parallel_sum_async) ++ check_type(argname="argument count", value=count, expected_type=type_hints["count"]) return typing.cast(jsii.Number, jsii.ainvoke(self, "parallelSumAsync", [count])) @jsii.member(jsii_name="serialSumAsync") @@ -17401,9 +16487,9 @@ exports[`Generated code for "jsii-calc": /python/src/js ''' :param count: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(VirtualMethodPlayground.serial_sum_async) -- check_type(argname="argument count", value=count, expected_type=type_hints["count"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(VirtualMethodPlayground.serial_sum_async) ++ check_type(argname="argument count", value=count, expected_type=type_hints["count"]) return typing.cast(jsii.Number, jsii.ainvoke(self, "serialSumAsync", [count])) @jsii.member(jsii_name="sumSync") @@ -17411,95 +16497,95 @@ exports[`Generated code for "jsii-calc": /python/src/js ''' :param count: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(VirtualMethodPlayground.sum_sync) -- check_type(argname="argument count", value=count, expected_type=type_hints["count"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(VirtualMethodPlayground.sum_sync) ++ check_type(argname="argument count", value=count, expected_type=type_hints["count"]) return typing.cast(jsii.Number, jsii.invoke(self, "sumSync", [count])) class VoidCallback( metaclass=jsii.JSIIAbstractClass, -@@ -8254,13 +7560,10 @@ +@@ -7560,10 +8254,13 @@ def __init__(self, private_field: typing.Optional[builtins.str] = None) -> None: ''' :param private_field: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(WithPrivatePropertyInConstructor.__init__) -- check_type(argname="argument private_field", value=private_field, expected_type=type_hints["private_field"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(WithPrivatePropertyInConstructor.__init__) ++ check_type(argname="argument private_field", value=private_field, expected_type=type_hints["private_field"]) jsii.create(self.__class__, self, [private_field]) @builtins.property @jsii.member(jsii_name="success") def success(self) -> builtins.bool: -@@ -8301,13 +7604,10 @@ +@@ -7604,10 +8301,13 @@ @jsii.member(jsii_name="abstractMethod") def abstract_method(self, name: builtins.str) -> builtins.str: ''' :param name: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(AbstractClass.abstract_method) -- check_type(argname="argument name", value=name, expected_type=type_hints["name"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(AbstractClass.abstract_method) ++ check_type(argname="argument name", value=name, expected_type=type_hints["name"]) return typing.cast(builtins.str, jsii.invoke(self, "abstractMethod", [name])) # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class typing.cast(typing.Any, AbstractClass).__jsii_proxy_class__ = lambda : _AbstractClassProxy -@@ -8323,14 +7623,10 @@ +@@ -7623,10 +8323,14 @@ '''Creates a BinaryOperation. :param lhs: Left-hand side operand. :param rhs: Right-hand side operand. ''' -- if __debug__: -- type_hints = typing.get_type_hints(Add.__init__) -- check_type(argname="argument lhs", value=lhs, expected_type=type_hints["lhs"]) -- check_type(argname="argument rhs", value=rhs, expected_type=type_hints["rhs"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(Add.__init__) ++ check_type(argname="argument lhs", value=lhs, expected_type=type_hints["lhs"]) ++ check_type(argname="argument rhs", value=rhs, expected_type=type_hints["rhs"]) jsii.create(self.__class__, self, [lhs, rhs]) @jsii.member(jsii_name="toString") def to_string(self) -> builtins.str: '''String representation of the value.''' -@@ -8374,13 +7670,10 @@ +@@ -7670,10 +8374,13 @@ def rung(self) -> builtins.bool: return typing.cast(builtins.bool, jsii.get(self, "rung")) @rung.setter def rung(self, value: builtins.bool) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(Bell, "rung").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(Bell, "rung").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "rung", value) @jsii.data_type( jsii_type="jsii-calc.ChildStruct982", -@@ -8391,14 +7684,10 @@ +@@ -7684,10 +8391,14 @@ def __init__(self, *, foo: builtins.str, bar: jsii.Number) -> None: ''' :param foo: :param bar: ''' -- if __debug__: -- type_hints = typing.get_type_hints(ChildStruct982.__init__) -- check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) -- check_type(argname="argument bar", value=bar, expected_type=type_hints["bar"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ChildStruct982.__init__) ++ check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) ++ check_type(argname="argument bar", value=bar, expected_type=type_hints["bar"]) self._values: typing.Dict[str, typing.Any] = { "foo": foo, "bar": bar, } -@@ -8439,49 +7728,37 @@ +@@ -7728,37 +8439,49 @@ def a(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "a")) @a.setter def a(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(ClassThatImplementsTheInternalInterface, "a").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(ClassThatImplementsTheInternalInterface, "a").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "a", value) @builtins.property @@ -17509,9 +16595,9 @@ exports[`Generated code for "jsii-calc": /python/src/js @b.setter def b(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(ClassThatImplementsTheInternalInterface, "b").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(ClassThatImplementsTheInternalInterface, "b").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "b", value) @builtins.property @@ -17521,9 +16607,9 @@ exports[`Generated code for "jsii-calc": /python/src/js @c.setter def c(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(ClassThatImplementsTheInternalInterface, "c").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(ClassThatImplementsTheInternalInterface, "c").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "c", value) @builtins.property @@ -17533,23 +16619,23 @@ exports[`Generated code for "jsii-calc": /python/src/js @d.setter def d(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(ClassThatImplementsTheInternalInterface, "d").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(ClassThatImplementsTheInternalInterface, "d").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "d", value) @jsii.implements(INonInternalInterface) class ClassThatImplementsThePrivateInterface( -@@ -8496,49 +7773,37 @@ +@@ -7773,37 +8496,49 @@ def a(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "a")) @a.setter def a(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(ClassThatImplementsThePrivateInterface, "a").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(ClassThatImplementsThePrivateInterface, "a").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "a", value) @builtins.property @@ -17559,9 +16645,9 @@ exports[`Generated code for "jsii-calc": /python/src/js @b.setter def b(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(ClassThatImplementsThePrivateInterface, "b").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(ClassThatImplementsThePrivateInterface, "b").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "b", value) @builtins.property @@ -17571,9 +16657,9 @@ exports[`Generated code for "jsii-calc": /python/src/js @c.setter def c(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(ClassThatImplementsThePrivateInterface, "c").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(ClassThatImplementsThePrivateInterface, "c").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "c", value) @builtins.property @@ -17583,83 +16669,83 @@ exports[`Generated code for "jsii-calc": /python/src/js @e.setter def e(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(ClassThatImplementsThePrivateInterface, "e").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(ClassThatImplementsThePrivateInterface, "e").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "e", value) @jsii.implements(IInterfaceWithProperties) class ClassWithPrivateConstructorAndAutomaticProperties( -@@ -8556,14 +7821,10 @@ +@@ -7821,10 +8556,14 @@ ) -> "ClassWithPrivateConstructorAndAutomaticProperties": ''' :param read_only_string: - :param read_write_string: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(ClassWithPrivateConstructorAndAutomaticProperties.create) -- check_type(argname="argument read_only_string", value=read_only_string, expected_type=type_hints["read_only_string"]) -- check_type(argname="argument read_write_string", value=read_write_string, expected_type=type_hints["read_write_string"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ClassWithPrivateConstructorAndAutomaticProperties.create) ++ check_type(argname="argument read_only_string", value=read_only_string, expected_type=type_hints["read_only_string"]) ++ check_type(argname="argument read_write_string", value=read_write_string, expected_type=type_hints["read_write_string"]) return typing.cast("ClassWithPrivateConstructorAndAutomaticProperties", jsii.sinvoke(cls, "create", [read_only_string, read_write_string])) @builtins.property @jsii.member(jsii_name="readOnlyString") def read_only_string(self) -> builtins.str: -@@ -8574,13 +7835,10 @@ +@@ -7835,10 +8574,13 @@ def read_write_string(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "readWriteString")) @read_write_string.setter def read_write_string(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(ClassWithPrivateConstructorAndAutomaticProperties, "read_write_string").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(ClassWithPrivateConstructorAndAutomaticProperties, "read_write_string").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "readWriteString", value) @jsii.implements(IIndirectlyImplemented) class FullCombo(BaseClass, metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.FullCombo"): -@@ -8695,13 +7953,10 @@ +@@ -7953,10 +8695,13 @@ ): def __init__(self, property: builtins.str) -> None: ''' :param property: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(JSII417Derived.__init__) -- check_type(argname="argument property", value=property, expected_type=type_hints["property"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(JSII417Derived.__init__) ++ check_type(argname="argument property", value=property, expected_type=type_hints["property"]) jsii.create(self.__class__, self, [property]) @jsii.member(jsii_name="bar") def bar(self) -> None: return typing.cast(None, jsii.invoke(self, "bar", [])) -@@ -8722,13 +7977,10 @@ +@@ -7977,10 +8722,13 @@ def __init__(self, operand: scope.jsii_calc_lib.NumericValue) -> None: ''' :param operand: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(Negate.__init__) -- check_type(argname="argument operand", value=operand, expected_type=type_hints["operand"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(Negate.__init__) ++ check_type(argname="argument operand", value=operand, expected_type=type_hints["operand"]) jsii.create(self.__class__, self, [operand]) @jsii.member(jsii_name="farewell") def farewell(self) -> builtins.str: '''Say farewell.''' -@@ -8788,16 +8040,10 @@ +@@ -8040,10 +8788,16 @@ :param id: some identifier. :param default_bar: the default value of \`\`bar\`\`. :param props: some props once can provide. :param rest: a variadic continuation. ''' -- if __debug__: -- type_hints = typing.get_type_hints(SupportsNiceJavaBuilder.__init__) -- check_type(argname="argument id", value=id, expected_type=type_hints["id"]) -- check_type(argname="argument default_bar", value=default_bar, expected_type=type_hints["default_bar"]) -- check_type(argname="argument props", value=props, expected_type=type_hints["props"]) -- check_type(argname="argument rest", value=rest, expected_type=typing.Tuple[type_hints["rest"], ...]) # pyright: ignore [reportGeneralTypeIssues] ++ if __debug__: ++ type_hints = typing.get_type_hints(SupportsNiceJavaBuilder.__init__) ++ check_type(argname="argument id", value=id, expected_type=type_hints["id"]) ++ check_type(argname="argument default_bar", value=default_bar, expected_type=type_hints["default_bar"]) ++ check_type(argname="argument props", value=props, expected_type=type_hints["props"]) ++ check_type(argname="argument rest", value=rest, expected_type=typing.Tuple[type_hints["rest"], ...]) # pyright: ignore [reportGeneralTypeIssues] jsii.create(self.__class__, self, [id, default_bar, props, *rest]) @builtins.property @@ -17668,17 +16754,17 @@ exports[`Generated code for "jsii-calc": /python/src/js `; exports[`Generated code for "jsii-calc": /python/src/jsii_calc/anonymous/__init__.py.diff 1`] = ` ---- python/src/jsii_calc/anonymous/__init__.py --runtime-type-checking -+++ python/src/jsii_calc/anonymous/__init__.py --no-runtime-type-checking -@@ -54,35 +54,26 @@ +--- python/src/jsii_calc/anonymous/__init__.py --no-runtime-type-checking ++++ python/src/jsii_calc/anonymous/__init__.py --runtime-type-checking +@@ -54,26 +54,35 @@ @builtins.classmethod def consume(cls, option: typing.Union[IOptionA, IOptionB]) -> builtins.str: ''' :param option: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(UseOptions.consume) -- check_type(argname="argument option", value=option, expected_type=type_hints["option"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(UseOptions.consume) ++ check_type(argname="argument option", value=option, expected_type=type_hints["option"]) return typing.cast(builtins.str, jsii.sinvoke(cls, "consume", [option])) @jsii.member(jsii_name="privideAsAny") @@ -17687,9 +16773,9 @@ exports[`Generated code for "jsii-calc": /python/src/js ''' :param which: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(UseOptions.privide_as_any) -- check_type(argname="argument which", value=which, expected_type=type_hints["which"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(UseOptions.privide_as_any) ++ check_type(argname="argument which", value=which, expected_type=type_hints["which"]) return typing.cast(typing.Any, jsii.sinvoke(cls, "privideAsAny", [which])) @jsii.member(jsii_name="provide") @@ -17698,9 +16784,9 @@ exports[`Generated code for "jsii-calc": /python/src/js ''' :param which: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(UseOptions.provide) -- check_type(argname="argument which", value=which, expected_type=type_hints["which"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(UseOptions.provide) ++ check_type(argname="argument which", value=which, expected_type=type_hints["which"]) return typing.cast(typing.Union[IOptionA, IOptionB], jsii.sinvoke(cls, "provide", [which])) @@ -17709,17 +16795,17 @@ exports[`Generated code for "jsii-calc": /python/src/js `; exports[`Generated code for "jsii-calc": /python/src/jsii_calc/cdk16625/__init__.py.diff 1`] = ` ---- python/src/jsii_calc/cdk16625/__init__.py --runtime-type-checking -+++ python/src/jsii_calc/cdk16625/__init__.py --no-runtime-type-checking -@@ -42,13 +42,10 @@ +--- python/src/jsii_calc/cdk16625/__init__.py --no-runtime-type-checking ++++ python/src/jsii_calc/cdk16625/__init__.py --runtime-type-checking +@@ -42,10 +42,13 @@ def _unwrap(self, gen: _IRandomNumberGenerator_9643a8b9) -> jsii.Number: '''Implement this functin to return \`\`gen.next()\`\`. It is extremely important that the \`\`donotimport\`\` submodule is NEVER explicitly loaded in the testing application (otherwise this test is void). :param gen: a VERY pseudo random number generator. ''' -- if __debug__: -- type_hints = typing.get_type_hints(Cdk16625._unwrap) -- check_type(argname="argument gen", value=gen, expected_type=type_hints["gen"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(Cdk16625._unwrap) ++ check_type(argname="argument gen", value=gen, expected_type=type_hints["gen"]) return typing.cast(jsii.Number, jsii.invoke(self, "unwrap", [gen])) # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class @@ -17727,17 +16813,17 @@ exports[`Generated code for "jsii-calc": /python/src/js `; exports[`Generated code for "jsii-calc": /python/src/jsii_calc/cdk16625/donotimport/__init__.py.diff 1`] = ` ---- python/src/jsii_calc/cdk16625/donotimport/__init__.py --runtime-type-checking -+++ python/src/jsii_calc/cdk16625/donotimport/__init__.py --no-runtime-type-checking -@@ -31,13 +31,10 @@ +--- python/src/jsii_calc/cdk16625/donotimport/__init__.py --no-runtime-type-checking ++++ python/src/jsii_calc/cdk16625/donotimport/__init__.py --runtime-type-checking +@@ -31,10 +31,13 @@ def __init__(self, value: jsii.Number) -> None: ''' :param value: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(UnimportedSubmoduleType.__init__) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(UnimportedSubmoduleType.__init__) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.create(self.__class__, self, [value]) @jsii.member(jsii_name="next") @@ -17746,17 +16832,17 @@ exports[`Generated code for "jsii-calc": /python/src/js `; exports[`Generated code for "jsii-calc": /python/src/jsii_calc/composition/__init__.py.diff 1`] = ` ---- python/src/jsii_calc/composition/__init__.py --runtime-type-checking -+++ python/src/jsii_calc/composition/__init__.py --no-runtime-type-checking -@@ -52,39 +52,30 @@ +--- python/src/jsii_calc/composition/__init__.py --no-runtime-type-checking ++++ python/src/jsii_calc/composition/__init__.py --runtime-type-checking +@@ -52,30 +52,39 @@ '''A set of postfixes to include in a decorated .toString().''' return typing.cast(typing.List[builtins.str], jsii.get(self, "decorationPostfixes")) @decoration_postfixes.setter def decoration_postfixes(self, value: typing.List[builtins.str]) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(CompositeOperation, "decoration_postfixes").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(CompositeOperation, "decoration_postfixes").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "decorationPostfixes", value) @builtins.property @@ -17767,9 +16853,9 @@ exports[`Generated code for "jsii-calc": /python/src/js @decoration_prefixes.setter def decoration_prefixes(self, value: typing.List[builtins.str]) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(CompositeOperation, "decoration_prefixes").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(CompositeOperation, "decoration_prefixes").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "decorationPrefixes", value) @builtins.property @@ -17780,9 +16866,9 @@ exports[`Generated code for "jsii-calc": /python/src/js @string_style.setter def string_style(self, value: "CompositeOperation.CompositionStringStyle") -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(CompositeOperation, "string_style").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(CompositeOperation, "string_style").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "stringStyle", value) @jsii.enum( @@ -17791,17 +16877,17 @@ exports[`Generated code for "jsii-calc": /python/src/js `; exports[`Generated code for "jsii-calc": /python/src/jsii_calc/derived_class_has_no_properties/__init__.py.diff 1`] = ` ---- python/src/jsii_calc/derived_class_has_no_properties/__init__.py --runtime-type-checking -+++ python/src/jsii_calc/derived_class_has_no_properties/__init__.py --no-runtime-type-checking -@@ -25,13 +25,10 @@ +--- python/src/jsii_calc/derived_class_has_no_properties/__init__.py --no-runtime-type-checking ++++ python/src/jsii_calc/derived_class_has_no_properties/__init__.py --runtime-type-checking +@@ -25,10 +25,13 @@ def prop(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "prop")) @prop.setter def prop(self, value: builtins.str) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(Base, "prop").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(Base, "prop").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "prop", value) @@ -17810,31 +16896,31 @@ exports[`Generated code for "jsii-calc": /python/src/js `; exports[`Generated code for "jsii-calc": /python/src/jsii_calc/interface_in_namespace_includes_classes/__init__.py.diff 1`] = ` ---- python/src/jsii_calc/interface_in_namespace_includes_classes/__init__.py --runtime-type-checking -+++ python/src/jsii_calc/interface_in_namespace_includes_classes/__init__.py --no-runtime-type-checking -@@ -25,13 +25,10 @@ +--- python/src/jsii_calc/interface_in_namespace_includes_classes/__init__.py --no-runtime-type-checking ++++ python/src/jsii_calc/interface_in_namespace_includes_classes/__init__.py --runtime-type-checking +@@ -25,10 +25,13 @@ def bar(self) -> typing.Optional[builtins.str]: return typing.cast(typing.Optional[builtins.str], jsii.get(self, "bar")) @bar.setter def bar(self, value: typing.Optional[builtins.str]) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(Foo, "bar").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(Foo, "bar").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "bar", value) @jsii.data_type( jsii_type="jsii-calc.InterfaceInNamespaceIncludesClasses.Hello", -@@ -41,13 +38,10 @@ +@@ -38,10 +41,13 @@ class Hello: def __init__(self, *, foo: jsii.Number) -> None: ''' :param foo: ''' -- if __debug__: -- type_hints = typing.get_type_hints(Hello.__init__) -- check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(Hello.__init__) ++ check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) self._values: typing.Dict[str, typing.Any] = { "foo": foo, } @@ -17843,17 +16929,17 @@ exports[`Generated code for "jsii-calc": /python/src/js `; exports[`Generated code for "jsii-calc": /python/src/jsii_calc/interface_in_namespace_only_interface/__init__.py.diff 1`] = ` ---- python/src/jsii_calc/interface_in_namespace_only_interface/__init__.py --runtime-type-checking -+++ python/src/jsii_calc/interface_in_namespace_only_interface/__init__.py --no-runtime-type-checking -@@ -21,13 +21,10 @@ +--- python/src/jsii_calc/interface_in_namespace_only_interface/__init__.py --no-runtime-type-checking ++++ python/src/jsii_calc/interface_in_namespace_only_interface/__init__.py --runtime-type-checking +@@ -21,10 +21,13 @@ class Hello: def __init__(self, *, foo: jsii.Number) -> None: ''' :param foo: ''' -- if __debug__: -- type_hints = typing.get_type_hints(Hello.__init__) -- check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(Hello.__init__) ++ check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) self._values: typing.Dict[str, typing.Any] = { "foo": foo, } @@ -17862,32 +16948,32 @@ exports[`Generated code for "jsii-calc": /python/src/js `; exports[`Generated code for "jsii-calc": /python/src/jsii_calc/jsii3656/__init__.py.diff 1`] = ` ---- python/src/jsii_calc/jsii3656/__init__.py --runtime-type-checking -+++ python/src/jsii_calc/jsii3656/__init__.py --no-runtime-type-checking -@@ -27,14 +27,10 @@ +--- python/src/jsii_calc/jsii3656/__init__.py --no-runtime-type-checking ++++ python/src/jsii_calc/jsii3656/__init__.py --runtime-type-checking +@@ -27,10 +27,14 @@ ) -> None: ''' :param name: :param count: ''' -- if __debug__: -- type_hints = typing.get_type_hints(ImplementMeOpts.__init__) -- check_type(argname="argument name", value=name, expected_type=type_hints["name"]) -- check_type(argname="argument count", value=count, expected_type=type_hints["count"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ImplementMeOpts.__init__) ++ check_type(argname="argument name", value=name, expected_type=type_hints["name"]) ++ check_type(argname="argument count", value=count, expected_type=type_hints["count"]) self._values: typing.Dict[str, typing.Any] = { "name": name, } if count is not None: self._values["count"] = count -@@ -73,13 +69,10 @@ +@@ -69,10 +73,13 @@ @builtins.classmethod def call_abstract(cls, receiver: "OverrideMe") -> builtins.bool: ''' :param receiver: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(OverrideMe.call_abstract) -- check_type(argname="argument receiver", value=receiver, expected_type=type_hints["receiver"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(OverrideMe.call_abstract) ++ check_type(argname="argument receiver", value=receiver, expected_type=type_hints["receiver"]) return typing.cast(builtins.bool, jsii.sinvoke(cls, "callAbstract", [receiver])) @jsii.member(jsii_name="implementMe") @@ -17896,17 +16982,17 @@ exports[`Generated code for "jsii-calc": /python/src/js `; exports[`Generated code for "jsii-calc": /python/src/jsii_calc/module2530/__init__.py.diff 1`] = ` ---- python/src/jsii_calc/module2530/__init__.py --runtime-type-checking -+++ python/src/jsii_calc/module2530/__init__.py --no-runtime-type-checking -@@ -21,34 +21,25 @@ +--- python/src/jsii_calc/module2530/__init__.py --no-runtime-type-checking ++++ python/src/jsii_calc/module2530/__init__.py --runtime-type-checking +@@ -21,25 +21,34 @@ def __init__(self, _: jsii.Number) -> None: ''' :param _: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(MyClass.__init__) -- check_type(argname="argument _", value=_, expected_type=type_hints["_"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(MyClass.__init__) ++ check_type(argname="argument _", value=_, expected_type=type_hints["_"]) jsii.create(self.__class__, self, [_]) @jsii.member(jsii_name="bar") @@ -17915,9 +17001,9 @@ exports[`Generated code for "jsii-calc": /python/src/js ''' :param _: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(MyClass.bar) -- check_type(argname="argument _", value=_, expected_type=type_hints["_"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(MyClass.bar) ++ check_type(argname="argument _", value=_, expected_type=type_hints["_"]) return typing.cast(None, jsii.sinvoke(cls, "bar", [_])) @jsii.member(jsii_name="foo") @@ -17925,9 +17011,9 @@ exports[`Generated code for "jsii-calc": /python/src/js ''' :param _: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(MyClass.foo) -- check_type(argname="argument _", value=_, expected_type=type_hints["_"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(MyClass.foo) ++ check_type(argname="argument _", value=_, expected_type=type_hints["_"]) return typing.cast(None, jsii.invoke(self, "foo", [_])) @@ -17936,17 +17022,17 @@ exports[`Generated code for "jsii-calc": /python/src/js `; exports[`Generated code for "jsii-calc": /python/src/jsii_calc/module2647/__init__.py.diff 1`] = ` ---- python/src/jsii_calc/module2647/__init__.py --runtime-type-checking -+++ python/src/jsii_calc/module2647/__init__.py --no-runtime-type-checking -@@ -31,13 +31,10 @@ +--- python/src/jsii_calc/module2647/__init__.py --no-runtime-type-checking ++++ python/src/jsii_calc/module2647/__init__.py --runtime-type-checking +@@ -31,10 +31,13 @@ ''' :param very: - :stability: deprecated ''' -- if __debug__: -- type_hints = typing.get_type_hints(ExtendAndImplement.__init__) -- check_type(argname="argument very", value=very, expected_type=type_hints["very"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ExtendAndImplement.__init__) ++ check_type(argname="argument very", value=very, expected_type=type_hints["very"]) jsii.create(self.__class__, self, [very]) @jsii.member(jsii_name="hello") @@ -17955,17 +17041,17 @@ exports[`Generated code for "jsii-calc": /python/src/js `; exports[`Generated code for "jsii-calc": /python/src/jsii_calc/module2689/methods/__init__.py.diff 1`] = ` ---- python/src/jsii_calc/module2689/methods/__init__.py --runtime-type-checking -+++ python/src/jsii_calc/module2689/methods/__init__.py --no-runtime-type-checking -@@ -29,23 +29,17 @@ +--- python/src/jsii_calc/module2689/methods/__init__.py --no-runtime-type-checking ++++ python/src/jsii_calc/module2689/methods/__init__.py --runtime-type-checking +@@ -29,17 +29,23 @@ _bar: typing.Mapping[builtins.str, typing.Union[scope.jsii_calc_base.BaseProps, typing.Dict[str, typing.Any]]], ) -> None: ''' :param _bar: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(MyClass.bar) -- check_type(argname="argument _bar", value=_bar, expected_type=type_hints["_bar"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(MyClass.bar) ++ check_type(argname="argument _bar", value=_bar, expected_type=type_hints["_bar"]) return typing.cast(None, jsii.invoke(self, "bar", [_bar])) @jsii.member(jsii_name="foo") @@ -17973,9 +17059,9 @@ exports[`Generated code for "jsii-calc": /python/src/js ''' :param _values: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(MyClass.foo) -- check_type(argname="argument _values", value=_values, expected_type=type_hints["_values"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(MyClass.foo) ++ check_type(argname="argument _values", value=_values, expected_type=type_hints["_values"]) return typing.cast(None, jsii.invoke(self, "foo", [_values])) @@ -17984,18 +17070,18 @@ exports[`Generated code for "jsii-calc": /python/src/js `; exports[`Generated code for "jsii-calc": /python/src/jsii_calc/module2689/structs/__init__.py.diff 1`] = ` ---- python/src/jsii_calc/module2689/structs/__init__.py --runtime-type-checking -+++ python/src/jsii_calc/module2689/structs/__init__.py --no-runtime-type-checking -@@ -30,14 +30,10 @@ +--- python/src/jsii_calc/module2689/structs/__init__.py --no-runtime-type-checking ++++ python/src/jsii_calc/module2689/structs/__init__.py --runtime-type-checking +@@ -30,10 +30,14 @@ ) -> None: ''' :param base_map: :param numbers: ''' -- if __debug__: -- type_hints = typing.get_type_hints(MyStruct.__init__) -- check_type(argname="argument base_map", value=base_map, expected_type=type_hints["base_map"]) -- check_type(argname="argument numbers", value=numbers, expected_type=type_hints["numbers"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(MyStruct.__init__) ++ check_type(argname="argument base_map", value=base_map, expected_type=type_hints["base_map"]) ++ check_type(argname="argument numbers", value=numbers, expected_type=type_hints["numbers"]) self._values: typing.Dict[str, typing.Any] = { "base_map": base_map, "numbers": numbers, @@ -18003,17 +17089,17 @@ exports[`Generated code for "jsii-calc": /python/src/js `; exports[`Generated code for "jsii-calc": /python/src/jsii_calc/module2692/submodule1/__init__.py.diff 1`] = ` ---- python/src/jsii_calc/module2692/submodule1/__init__.py --runtime-type-checking -+++ python/src/jsii_calc/module2692/submodule1/__init__.py --no-runtime-type-checking -@@ -21,13 +21,10 @@ +--- python/src/jsii_calc/module2692/submodule1/__init__.py --no-runtime-type-checking ++++ python/src/jsii_calc/module2692/submodule1/__init__.py --runtime-type-checking +@@ -21,10 +21,13 @@ class Bar: def __init__(self, *, bar1: builtins.str) -> None: ''' :param bar1: ''' -- if __debug__: -- type_hints = typing.get_type_hints(Bar.__init__) -- check_type(argname="argument bar1", value=bar1, expected_type=type_hints["bar1"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(Bar.__init__) ++ check_type(argname="argument bar1", value=bar1, expected_type=type_hints["bar1"]) self._values: typing.Dict[str, typing.Any] = { "bar1": bar1, } @@ -18022,33 +17108,33 @@ exports[`Generated code for "jsii-calc": /python/src/js `; exports[`Generated code for "jsii-calc": /python/src/jsii_calc/module2692/submodule2/__init__.py.diff 1`] = ` ---- python/src/jsii_calc/module2692/submodule2/__init__.py --runtime-type-checking -+++ python/src/jsii_calc/module2692/submodule2/__init__.py --no-runtime-type-checking -@@ -23,13 +23,10 @@ +--- python/src/jsii_calc/module2692/submodule2/__init__.py --no-runtime-type-checking ++++ python/src/jsii_calc/module2692/submodule2/__init__.py --runtime-type-checking +@@ -23,10 +23,13 @@ class Bar: def __init__(self, *, bar2: builtins.str) -> None: ''' :param bar2: ''' -- if __debug__: -- type_hints = typing.get_type_hints(Bar.__init__) -- check_type(argname="argument bar2", value=bar2, expected_type=type_hints["bar2"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(Bar.__init__) ++ check_type(argname="argument bar2", value=bar2, expected_type=type_hints["bar2"]) self._values: typing.Dict[str, typing.Any] = { "bar2": bar2, } @builtins.property -@@ -66,15 +63,10 @@ +@@ -63,10 +66,15 @@ ''' :param bar2: :param bar1: :param foo2: ''' -- if __debug__: -- type_hints = typing.get_type_hints(Foo.__init__) -- check_type(argname="argument bar2", value=bar2, expected_type=type_hints["bar2"]) -- check_type(argname="argument bar1", value=bar1, expected_type=type_hints["bar1"]) -- check_type(argname="argument foo2", value=foo2, expected_type=type_hints["foo2"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(Foo.__init__) ++ check_type(argname="argument bar2", value=bar2, expected_type=type_hints["bar2"]) ++ check_type(argname="argument bar1", value=bar1, expected_type=type_hints["bar1"]) ++ check_type(argname="argument foo2", value=foo2, expected_type=type_hints["foo2"]) self._values: typing.Dict[str, typing.Any] = { "bar2": bar2, "bar1": bar1, @@ -18057,17 +17143,17 @@ exports[`Generated code for "jsii-calc": /python/src/js `; exports[`Generated code for "jsii-calc": /python/src/jsii_calc/python_self/__init__.py.diff 1`] = ` ---- python/src/jsii_calc/python_self/__init__.py --runtime-type-checking -+++ python/src/jsii_calc/python_self/__init__.py --no-runtime-type-checking -@@ -19,23 +19,17 @@ +--- python/src/jsii_calc/python_self/__init__.py --no-runtime-type-checking ++++ python/src/jsii_calc/python_self/__init__.py --runtime-type-checking +@@ -19,17 +19,23 @@ ): def __init__(self_, self: builtins.str) -> None: ''' :param self: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(ClassWithSelf.__init__) -- check_type(argname="argument self", value=self, expected_type=type_hints["self"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ClassWithSelf.__init__) ++ check_type(argname="argument self", value=self, expected_type=type_hints["self"]) jsii.create(self_.__class__, self_, [self]) @jsii.member(jsii_name="method") @@ -18075,37 +17161,37 @@ exports[`Generated code for "jsii-calc": /python/src/js ''' :param self: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(ClassWithSelf.method) -- check_type(argname="argument self", value=self, expected_type=type_hints["self"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(ClassWithSelf.method) ++ check_type(argname="argument self", value=self, expected_type=type_hints["self"]) return typing.cast(builtins.str, jsii.invoke(self_, "method", [self])) @builtins.property @jsii.member(jsii_name="self") def self(self) -> builtins.str: -@@ -76,13 +70,10 @@ +@@ -70,10 +76,13 @@ @jsii.member(jsii_name="method") def method(self_, self: jsii.Number) -> builtins.str: ''' :param self: - ''' -- if __debug__: -- type_hints = typing.get_type_hints(IInterfaceWithSelf.method) -- check_type(argname="argument self", value=self, expected_type=type_hints["self"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(IInterfaceWithSelf.method) ++ check_type(argname="argument self", value=self, expected_type=type_hints["self"]) return typing.cast(builtins.str, jsii.invoke(self_, "method", [self])) # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface typing.cast(typing.Any, IInterfaceWithSelf).__jsii_proxy_class__ = lambda : _IInterfaceWithSelfProxy -@@ -95,13 +86,10 @@ +@@ -86,10 +95,13 @@ class StructWithSelf: def __init__(self_, *, self: builtins.str) -> None: ''' :param self: ''' -- if __debug__: -- type_hints = typing.get_type_hints(StructWithSelf.__init__) -- check_type(argname="argument self", value=self, expected_type=type_hints["self"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(StructWithSelf.__init__) ++ check_type(argname="argument self", value=self, expected_type=type_hints["self"]) self_._values: typing.Dict[str, typing.Any] = { "self": self, } @@ -18114,31 +17200,31 @@ exports[`Generated code for "jsii-calc": /python/src/js `; exports[`Generated code for "jsii-calc": /python/src/jsii_calc/submodule/__init__.py.diff 1`] = ` ---- python/src/jsii_calc/submodule/__init__.py --runtime-type-checking -+++ python/src/jsii_calc/submodule/__init__.py --no-runtime-type-checking -@@ -39,13 +39,10 @@ +--- python/src/jsii_calc/submodule/__init__.py --no-runtime-type-checking ++++ python/src/jsii_calc/submodule/__init__.py --runtime-type-checking +@@ -39,10 +39,13 @@ :param foo: :see: https://github.com/aws/jsii/issues/2637 ''' -- if __debug__: -- type_hints = typing.get_type_hints(Default.__init__) -- check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(Default.__init__) ++ check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) self._values: typing.Dict[str, typing.Any] = { "foo": foo, } @builtins.property -@@ -110,13 +107,10 @@ +@@ -107,10 +110,13 @@ def all_types(self) -> typing.Optional[_AllTypes_b08307c5]: return typing.cast(typing.Optional[_AllTypes_b08307c5], jsii.get(self, "allTypes")) @all_types.setter def all_types(self, value: typing.Optional[_AllTypes_b08307c5]) -> None: -- if __debug__: -- type_hints = typing.get_type_hints(getattr(MyClass, "all_types").fset) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(getattr(MyClass, "all_types").fset) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) jsii.set(self, "allTypes", value) @@ -18147,17 +17233,17 @@ exports[`Generated code for "jsii-calc": /python/src/js `; exports[`Generated code for "jsii-calc": /python/src/jsii_calc/submodule/back_references/__init__.py.diff 1`] = ` ---- python/src/jsii_calc/submodule/back_references/__init__.py --runtime-type-checking -+++ python/src/jsii_calc/submodule/back_references/__init__.py --no-runtime-type-checking -@@ -23,13 +23,10 @@ +--- python/src/jsii_calc/submodule/back_references/__init__.py --no-runtime-type-checking ++++ python/src/jsii_calc/submodule/back_references/__init__.py --runtime-type-checking +@@ -23,10 +23,13 @@ class MyClassReference: def __init__(self, *, reference: _MyClass_a2fdc0b6) -> None: ''' :param reference: ''' -- if __debug__: -- type_hints = typing.get_type_hints(MyClassReference.__init__) -- check_type(argname="argument reference", value=reference, expected_type=type_hints["reference"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(MyClassReference.__init__) ++ check_type(argname="argument reference", value=reference, expected_type=type_hints["reference"]) self._values: typing.Dict[str, typing.Any] = { "reference": reference, } @@ -18166,46 +17252,46 @@ exports[`Generated code for "jsii-calc": /python/src/js `; exports[`Generated code for "jsii-calc": /python/src/jsii_calc/submodule/child/__init__.py.diff 1`] = ` ---- python/src/jsii_calc/submodule/child/__init__.py --runtime-type-checking -+++ python/src/jsii_calc/submodule/child/__init__.py --no-runtime-type-checking -@@ -73,13 +73,10 @@ +--- python/src/jsii_calc/submodule/child/__init__.py --no-runtime-type-checking ++++ python/src/jsii_calc/submodule/child/__init__.py --runtime-type-checking +@@ -73,10 +73,13 @@ class SomeStruct: def __init__(self, *, prop: SomeEnum) -> None: ''' :param prop: ''' -- if __debug__: -- type_hints = typing.get_type_hints(SomeStruct.__init__) -- check_type(argname="argument prop", value=prop, expected_type=type_hints["prop"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(SomeStruct.__init__) ++ check_type(argname="argument prop", value=prop, expected_type=type_hints["prop"]) self._values: typing.Dict[str, typing.Any] = { "prop": prop, } @builtins.property -@@ -108,13 +105,10 @@ +@@ -105,10 +108,13 @@ class Structure: def __init__(self, *, bool: builtins.bool) -> None: ''' :param bool: ''' -- if __debug__: -- type_hints = typing.get_type_hints(Structure.__init__) -- check_type(argname="argument bool", value=bool, expected_type=type_hints["bool"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(Structure.__init__) ++ check_type(argname="argument bool", value=bool, expected_type=type_hints["bool"]) self._values: typing.Dict[str, typing.Any] = { "bool": bool, } @builtins.property -@@ -149,14 +143,10 @@ +@@ -143,10 +149,14 @@ ) -> None: ''' :param prop: :param extra: ''' -- if __debug__: -- type_hints = typing.get_type_hints(KwargsProps.__init__) -- check_type(argname="argument prop", value=prop, expected_type=type_hints["prop"]) -- check_type(argname="argument extra", value=extra, expected_type=type_hints["extra"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(KwargsProps.__init__) ++ check_type(argname="argument prop", value=prop, expected_type=type_hints["prop"]) ++ check_type(argname="argument extra", value=extra, expected_type=type_hints["extra"]) self._values: typing.Dict[str, typing.Any] = { "prop": prop, } @@ -18214,17 +17300,17 @@ exports[`Generated code for "jsii-calc": /python/src/js `; exports[`Generated code for "jsii-calc": /python/src/jsii_calc/submodule/param/__init__.py.diff 1`] = ` ---- python/src/jsii_calc/submodule/param/__init__.py --runtime-type-checking -+++ python/src/jsii_calc/submodule/param/__init__.py --no-runtime-type-checking -@@ -21,13 +21,10 @@ +--- python/src/jsii_calc/submodule/param/__init__.py --no-runtime-type-checking ++++ python/src/jsii_calc/submodule/param/__init__.py --runtime-type-checking +@@ -21,10 +21,13 @@ class SpecialParameter: def __init__(self, *, value: builtins.str) -> None: ''' :param value: ''' -- if __debug__: -- type_hints = typing.get_type_hints(SpecialParameter.__init__) -- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) ++ if __debug__: ++ type_hints = typing.get_type_hints(SpecialParameter.__init__) ++ check_type(argname="argument value", value=value, expected_type=type_hints["value"]) self._values: typing.Dict[str, typing.Any] = { "value": value, } diff --git a/packages/jsii-pacmak/test/generated-code/harness.ts b/packages/jsii-pacmak/test/generated-code/harness.ts index 5a7d588cc7..0861cd73ee 100644 --- a/packages/jsii-pacmak/test/generated-code/harness.ts +++ b/packages/jsii-pacmak/test/generated-code/harness.ts @@ -14,6 +14,9 @@ export const JSII_TEST_PACKAGES: readonly string[] = [ 'jsii-calc', ]; +const CREATED = Symbol('created'); +const DELETED = Symbol('deleted'); + const DIFF = Symbol('diff'); const FILE = Symbol('file'); const MISSING = Symbol('missing'); @@ -79,30 +82,35 @@ export function verifyGeneratedCodeFor( test(`Generated code for ${JSON.stringify(pkg)}`, async () => { const pkgRoot = path.resolve(__dirname, '..', '..', '..', pkg); + const outDirNotRuntimeTypeChecked = path.join( + outDir, + 'no-runtime-type-checking', + ); + await runPacmak(pkgRoot, targetName, outDirNotRuntimeTypeChecked, { + runtimeTypeChecking: false, + }); + expect({ + [TREE]: checkTree(outDirNotRuntimeTypeChecked), + }).toMatchSnapshot('/'); + + // Now we'll generate WITHOUT runtime type-checks, and assert on the differences const outDirRuntimeTypeChecked = path.join( outDir, 'runtime-type-checking', ); - await runPacmak(pkgRoot, targetName, outDirRuntimeTypeChecked); - expect({ [TREE]: checkTree(outDirRuntimeTypeChecked) }).toMatchSnapshot( - '/', - ); + await runPacmak(pkgRoot, targetName, outDirRuntimeTypeChecked, { + runtimeTypeChecking: true, + }); + + // Run MyPY on Python generated code... if (targetName === TargetName.PYTHON && !process.env.SKIP_MYPY_CHECK) { await runMypy(path.join(outDirRuntimeTypeChecked, targetName)); } - // Now we'll generate WITHOUT runtime type-checks, and assert on the differences - const outDirNotRuntimeTypeChecked = path.join( - outDir, - 'no-runtime-type-checking', - ); - await runPacmak(pkgRoot, targetName, outDirNotRuntimeTypeChecked, { - runtimeTypeChecking: false, - }); expect({ [TREE]: diffTrees( - outDirRuntimeTypeChecked, outDirNotRuntimeTypeChecked, + outDirRuntimeTypeChecked, ), [TREE_ROOT]: '', }).toMatchSnapshot('/'); @@ -169,23 +177,33 @@ export function diffTrees( const originalStat = tryStat(original); const updatedStat = tryStat(updated); + const relativeFile = path.relative(root, original).replace(/\\/g, '/'); + + if (updatedStat == null) { + return { [DELETED]: path.basename(original) }; + } + // Should exist on both sides AND have the same file type - expect(originalStat?.isDirectory()).toBe(updatedStat?.isDirectory()); - expect(originalStat?.isFile()).toBe(updatedStat?.isFile()); + if (originalStat != null) { + expect(originalStat?.isDirectory()).toBe(updatedStat?.isDirectory()); + expect(originalStat?.isFile()).toBe(updatedStat?.isFile()); + } - const relativeFile = path.relative(root, original).replace(/\\/g, '/'); - if (originalStat?.isFile()) { + if (updatedStat.isFile()) { if (original.endsWith('.tgz') || original.endsWith('.png')) { + // Allow no difference in binary file existence... + expect(originalStat).toBeDefined(); // This is a binary object, these should match exactly expect(fs.readFileSync(original)).toEqual(fs.readFileSync(updated)); return undefined; } const patch = createPatch( relativeFile, - fs.readFileSync(original, 'utf-8'), + // Note: if originalStat is null, the file is new in the diff... + originalStat != null ? fs.readFileSync(original, 'utf-8') : '', fs.readFileSync(updated, 'utf-8'), - '--runtime-type-checking', '--no-runtime-type-checking', + '--runtime-type-checking', { context: 5, ignoreWhitespace: false, @@ -202,11 +220,15 @@ export function diffTrees( const snapshotName = `/${relativeFile}.diff`; expect({ [DIFF]: patch.join('\n') }).toMatchSnapshot(snapshotName); - return `${path.basename(original)}.diff`; + return originalStat != null + ? `${path.basename(original)}.diff` + : { [CREATED]: `${path.basename(original)}.diff` }; } - return fs - .readdirSync(original) + return Array.from( + new Set([...fs.readdirSync(original), ...fs.readdirSync(updated)]), + ) + .sort() .map((entry) => ({ entry, subtree: diffTrees( @@ -231,7 +253,7 @@ function tryStat(at: string) { try { return fs.statSync(at); } catch (e: any) { - if (e.code !== os.constants.errno.ENOENT) { + if (e.code !== 'ENOENT') { throw e; } return undefined; @@ -242,9 +264,7 @@ async function runPacmak( root: string, targetName: TargetName, outdir: string, - { - runtimeTypeChecking = true, - }: { readonly runtimeTypeChecking?: boolean } = {}, + { runtimeTypeChecking }: { readonly runtimeTypeChecking: boolean }, ): Promise { return expect( pacmak({ @@ -364,7 +384,11 @@ async function runMypy(pythonRoot: string): Promise { ).resolves.not.toThrowError(); } -type TreeStructure = string | { [name: string]: TreeStructure }; +type TreeStructure = + | string + | { [name: string]: TreeStructure } + | { [CREATED]: string } + | { [DELETED]: string }; function formatTree(tree: TreeStructure | undefined): string { if (tree == null) { @@ -375,6 +399,13 @@ function formatTree(tree: TreeStructure | undefined): string { return `┗━ 📄 ${tree}`; } + if (DELETED in tree) { + return `┗━ 🗑 ${(tree as any)[DELETED]}`; + } + if (CREATED in tree) { + return `┗━ 🆕 ${(tree as any)[CREATED]}`; + } + // Sort the entries by name to minimize differences. const entries = Object.entries(tree).sort(([l], [r]) => l.localeCompare(r)); @@ -386,6 +417,16 @@ function formatTree(tree: TreeStructure | undefined): string { return `${box}━ 📄 ${name}`; } + if (DELETED in children) { + return `${box}━ 🗑 ${name}`; + } + if ( + CREATED in children && + typeof (children as any)[CREATED] === 'string' + ) { + return `${box}━ 🆕 ${name}`; + } + const subtree = formatTree(children) .split('\n') .map((line) => ` ${index < lastIndex ? '┃' : ' '} ${line}`)