diff --git a/packages/@jsii/java-runtime/pom.xml.t.js b/packages/@jsii/java-runtime/pom.xml.t.js index 34fab4329c..2489f00498 100644 --- a/packages/@jsii/java-runtime/pom.xml.t.js +++ b/packages/@jsii/java-runtime/pom.xml.t.js @@ -64,7 +64,7 @@ process.stdout.write(` [1.3.2,1.4.0) [13.0.0,24.0-a0) [5.8.0,5.10-a0) - [3.12.4,4.0-a0) + [4.11.0,5.0-a0) diff --git a/packages/jsii-pacmak/lib/targets/go/package.ts b/packages/jsii-pacmak/lib/targets/go/package.ts index c06fd43143..b388401b65 100644 --- a/packages/jsii-pacmak/lib/targets/go/package.ts +++ b/packages/jsii-pacmak/lib/targets/go/package.ts @@ -203,7 +203,7 @@ export abstract class Package { if (this.types.length > 0) { const { code } = context; - const initFile = join(this.directory, `${this.packageName}.go`); + const initFile = join(this.directory, `main.go`); code.openFile(initFile); code.line(`package ${this.packageName}`); code.line(); @@ -238,10 +238,7 @@ export abstract class Package { private emitTypes(context: EmitContext) { for (const type of this.types) { - const filePath = join( - this.directory, - `${this.packageName}_${type.name}.go`, - ); + const filePath = join(this.directory, `${type.name}.go`); context.code.openFile(filePath); this.emitHeader(context.code); @@ -266,23 +263,9 @@ export abstract class Package { return; } - emit.call( - this, - join( - this.directory, - `${this.packageName}_${type.name}__runtime_type_checks.go`, - ), - false, - ); + emit.call(this, join(this.directory, `${type.name}__checks.go`), false); - emit.call( - this, - join( - this.directory, - `${this.packageName}_${type.name}__no_runtime_type_checking.go`, - ), - true, - ); + emit.call(this, join(this.directory, `${type.name}__no_checks.go`), true); function emit(this: Package, filePath: string, forNoOp: boolean) { code.openFile(filePath); 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 ac1bf7249b..c6d4b04771 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 @@ -21,16 +21,16 @@ exports[`diamond-struct-parameter.ts: / 1`] = ` ┃ ┗━ 📄 Example.Test.Demo.csproj ┣━ 📁 go ┃ ┗━ 📁 testpkg + ┃ ┣━ 📄 Baz.go + ┃ ┣━ 📄 Consumer__checks.go + ┃ ┣━ 📄 Consumer__no_checks.go + ┃ ┣━ 📄 Consumer.go + ┃ ┣━ 📄 Foo.go + ┃ ┣━ 📄 FooBar.go ┃ ┣━ 📄 go.mod ┃ ┣━ 📁 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 - ┃ ┗━ 📄 testpkg.go + ┃ ┗━ 📄 main.go ┣━ 📁 java ┃ ┣━ 📄 pom.xml ┃ ┗━ 📁 src @@ -380,77 +380,7 @@ namespace Example.Test.Demo.Internal.DependencyResolution `; -exports[`diamond-struct-parameter.ts: /go/testpkg/go.mod 1`] = ` -module example.test/demo/testpkg - -go 1.18 - -require ( - github.com/aws/jsii-runtime-go v0.0.0 -) - -`; - -exports[`diamond-struct-parameter.ts: /go/testpkg/jsii/jsii.go 1`] = ` -// Package jsii contains the functionaility needed for jsii packages to -// initialize their dependencies and themselves. Users should never need to use this package -// directly. If you find you need to - please report a bug at -// https://github.com/aws/jsii/issues/new/choose -package jsii - -import ( - _ "embed" - - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -//go:embed testpkg-0.0.1.tgz -var tarball []byte - -// Initialize loads the necessary packages in the @jsii/kernel to support the enclosing module. -// The implementation is idempotent (and hence safe to be called over and over). -func Initialize() { - // Load this library into the kernel - _jsii_.Load("testpkg", "0.0.1", tarball) -} - -`; - -exports[`diamond-struct-parameter.ts: /go/testpkg/testpkg.go 1`] = ` -package testpkg - -import ( - "reflect" - - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -func init() { - _jsii_.RegisterStruct( - "testpkg.Baz", - reflect.TypeOf((*Baz)(nil)).Elem(), - ) - _jsii_.RegisterClass( - "testpkg.Consumer", - reflect.TypeOf((*Consumer)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_Consumer{} - }, - ) - _jsii_.RegisterStruct( - "testpkg.Foo", - reflect.TypeOf((*Foo)(nil)).Elem(), - ) - _jsii_.RegisterStruct( - "testpkg.FooBar", - reflect.TypeOf((*FooBar)(nil)).Elem(), - ) -} - -`; - -exports[`diamond-struct-parameter.ts: /go/testpkg/testpkg_Baz.go 1`] = ` +exports[`diamond-struct-parameter.ts: /go/testpkg/Baz.go 1`] = ` // testpkg package testpkg @@ -464,7 +394,7 @@ type Baz struct { `; -exports[`diamond-struct-parameter.ts: /go/testpkg/testpkg_Consumer.go 1`] = ` +exports[`diamond-struct-parameter.ts: /go/testpkg/Consumer.go 1`] = ` // testpkg package testpkg @@ -497,22 +427,7 @@ 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 - -// 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`] = ` +exports[`diamond-struct-parameter.ts: /go/testpkg/Consumer__checks.go 1`] = ` //go:build !no_runtime_type_checking // testpkg @@ -538,7 +453,22 @@ func validateConsumer_ConsumeBazParameters(baz *Baz) error { `; -exports[`diamond-struct-parameter.ts: /go/testpkg/testpkg_Foo.go 1`] = ` +exports[`diamond-struct-parameter.ts: /go/testpkg/Consumer__no_checks.go 1`] = ` +//go: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/Foo.go 1`] = ` // testpkg package testpkg @@ -550,7 +480,7 @@ type Foo struct { `; -exports[`diamond-struct-parameter.ts: /go/testpkg/testpkg_FooBar.go 1`] = ` +exports[`diamond-struct-parameter.ts: /go/testpkg/FooBar.go 1`] = ` // testpkg package testpkg @@ -561,6 +491,76 @@ type FooBar struct { } +`; + +exports[`diamond-struct-parameter.ts: /go/testpkg/go.mod 1`] = ` +module example.test/demo/testpkg + +go 1.18 + +require ( + github.com/aws/jsii-runtime-go v0.0.0 +) + +`; + +exports[`diamond-struct-parameter.ts: /go/testpkg/jsii/jsii.go 1`] = ` +// Package jsii contains the functionaility needed for jsii packages to +// initialize their dependencies and themselves. Users should never need to use this package +// directly. If you find you need to - please report a bug at +// https://github.com/aws/jsii/issues/new/choose +package jsii + +import ( + _ "embed" + + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +//go:embed testpkg-0.0.1.tgz +var tarball []byte + +// Initialize loads the necessary packages in the @jsii/kernel to support the enclosing module. +// The implementation is idempotent (and hence safe to be called over and over). +func Initialize() { + // Load this library into the kernel + _jsii_.Load("testpkg", "0.0.1", tarball) +} + +`; + +exports[`diamond-struct-parameter.ts: /go/testpkg/main.go 1`] = ` +package testpkg + +import ( + "reflect" + + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +func init() { + _jsii_.RegisterStruct( + "testpkg.Baz", + reflect.TypeOf((*Baz)(nil)).Elem(), + ) + _jsii_.RegisterClass( + "testpkg.Consumer", + reflect.TypeOf((*Consumer)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_Consumer{} + }, + ) + _jsii_.RegisterStruct( + "testpkg.Foo", + reflect.TypeOf((*Foo)(nil)).Elem(), + ) + _jsii_.RegisterStruct( + "testpkg.FooBar", + reflect.TypeOf((*FooBar)(nil)).Elem(), + ) +} + `; exports[`diamond-struct-parameter.ts: /java/pom.xml 1`] = ` @@ -1560,13 +1560,13 @@ exports[`nested-types.ts: / 1`] = ` ┃ ┣━ 📄 go.mod ┃ ┣━ 📁 jsii ┃ ┃ ┗━ 📄 jsii.go - ┃ ┣━ 📄 testpkg_Namespace1_Foo.go - ┃ ┣━ 📄 testpkg_Namespace1_IBar.go - ┃ ┣━ 📄 testpkg_Namespace1.go - ┃ ┣━ 📄 testpkg_Namespace2_Foo_Final.go - ┃ ┣━ 📄 testpkg_Namespace2_Foo.go - ┃ ┣━ 📄 testpkg_Namespace2.go - ┃ ┗━ 📄 testpkg.go + ┃ ┣━ 📄 main.go + ┃ ┣━ 📄 Namespace1_Foo.go + ┃ ┣━ 📄 Namespace1_IBar.go + ┃ ┣━ 📄 Namespace1.go + ┃ ┣━ 📄 Namespace2_Foo_Final.go + ┃ ┣━ 📄 Namespace2_Foo.go + ┃ ┗━ 📄 Namespace2.go ┣━ 📁 java ┃ ┣━ 📄 pom.xml ┃ ┗━ 📁 src @@ -1852,110 +1852,7 @@ namespace Example.Test.Demo `; -exports[`nested-types.ts: /go/testpkg/go.mod 1`] = ` -module example.test/demo/testpkg - -go 1.18 - -require ( - github.com/aws/jsii-runtime-go v0.0.0 -) - -`; - -exports[`nested-types.ts: /go/testpkg/jsii/jsii.go 1`] = ` -// Package jsii contains the functionaility needed for jsii packages to -// initialize their dependencies and themselves. Users should never need to use this package -// directly. If you find you need to - please report a bug at -// https://github.com/aws/jsii/issues/new/choose -package jsii - -import ( - _ "embed" - - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -//go:embed testpkg-0.0.1.tgz -var tarball []byte - -// Initialize loads the necessary packages in the @jsii/kernel to support the enclosing module. -// The implementation is idempotent (and hence safe to be called over and over). -func Initialize() { - // Load this library into the kernel - _jsii_.Load("testpkg", "0.0.1", tarball) -} - -`; - -exports[`nested-types.ts: /go/testpkg/testpkg.go 1`] = ` -package testpkg - -import ( - "reflect" - - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -func init() { - _jsii_.RegisterClass( - "testpkg.Namespace1", - reflect.TypeOf((*Namespace1)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, - }, - func() interface{} { - return &jsiiProxy_Namespace1{} - }, - ) - _jsii_.RegisterStruct( - "testpkg.Namespace1.Foo", - reflect.TypeOf((*Namespace1_Foo)(nil)).Elem(), - ) - _jsii_.RegisterInterface( - "testpkg.Namespace1.IBar", - reflect.TypeOf((*Namespace1_IBar)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "bar", GoGetter: "Bar"}, - _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, - }, - func() interface{} { - return &jsiiProxy_Namespace1_IBar{} - }, - ) - _jsii_.RegisterClass( - "testpkg.Namespace2", - reflect.TypeOf((*Namespace2)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, - }, - func() interface{} { - return &jsiiProxy_Namespace2{} - }, - ) - _jsii_.RegisterEnum( - "testpkg.Namespace2.Foo", - reflect.TypeOf((*Namespace2_Foo)(nil)).Elem(), - map[string]interface{}{ - "BAR": Namespace2_Foo_BAR, - "BAZ": Namespace2_Foo_BAZ, - }, - ) - _jsii_.RegisterClass( - "testpkg.Namespace2.Foo.Final", - reflect.TypeOf((*Namespace2_Foo_Final)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "done", GoGetter: "Done"}, - }, - func() interface{} { - return &jsiiProxy_Namespace2_Foo_Final{} - }, - ) -} - -`; - -exports[`nested-types.ts: /go/testpkg/testpkg_Namespace1.go 1`] = ` +exports[`nested-types.ts: /go/testpkg/Namespace1.go 1`] = ` // testpkg package testpkg @@ -2008,7 +1905,7 @@ func (n *jsiiProxy_Namespace1) Foo() { `; -exports[`nested-types.ts: /go/testpkg/testpkg_Namespace1_Foo.go 1`] = ` +exports[`nested-types.ts: /go/testpkg/Namespace1_Foo.go 1`] = ` // testpkg package testpkg @@ -2020,7 +1917,7 @@ type Namespace1_Foo struct { `; -exports[`nested-types.ts: /go/testpkg/testpkg_Namespace1_IBar.go 1`] = ` +exports[`nested-types.ts: /go/testpkg/Namespace1_IBar.go 1`] = ` // testpkg package testpkg @@ -2059,7 +1956,7 @@ func (j *jsiiProxy_Namespace1_IBar) Bar() *string { `; -exports[`nested-types.ts: /go/testpkg/testpkg_Namespace2.go 1`] = ` +exports[`nested-types.ts: /go/testpkg/Namespace2.go 1`] = ` // testpkg package testpkg @@ -2112,7 +2009,7 @@ func (n *jsiiProxy_Namespace2) Foo() { `; -exports[`nested-types.ts: /go/testpkg/testpkg_Namespace2_Foo.go 1`] = ` +exports[`nested-types.ts: /go/testpkg/Namespace2_Foo.go 1`] = ` // testpkg package testpkg @@ -2127,7 +2024,7 @@ const ( `; -exports[`nested-types.ts: /go/testpkg/testpkg_Namespace2_Foo_Final.go 1`] = ` +exports[`nested-types.ts: /go/testpkg/Namespace2_Foo_Final.go 1`] = ` // testpkg package testpkg @@ -2181,6 +2078,109 @@ func NewNamespace2_Foo_Final_Override(n Namespace2_Foo_Final) { } +`; + +exports[`nested-types.ts: /go/testpkg/go.mod 1`] = ` +module example.test/demo/testpkg + +go 1.18 + +require ( + github.com/aws/jsii-runtime-go v0.0.0 +) + +`; + +exports[`nested-types.ts: /go/testpkg/jsii/jsii.go 1`] = ` +// Package jsii contains the functionaility needed for jsii packages to +// initialize their dependencies and themselves. Users should never need to use this package +// directly. If you find you need to - please report a bug at +// https://github.com/aws/jsii/issues/new/choose +package jsii + +import ( + _ "embed" + + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +//go:embed testpkg-0.0.1.tgz +var tarball []byte + +// Initialize loads the necessary packages in the @jsii/kernel to support the enclosing module. +// The implementation is idempotent (and hence safe to be called over and over). +func Initialize() { + // Load this library into the kernel + _jsii_.Load("testpkg", "0.0.1", tarball) +} + +`; + +exports[`nested-types.ts: /go/testpkg/main.go 1`] = ` +package testpkg + +import ( + "reflect" + + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +func init() { + _jsii_.RegisterClass( + "testpkg.Namespace1", + reflect.TypeOf((*Namespace1)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, + }, + func() interface{} { + return &jsiiProxy_Namespace1{} + }, + ) + _jsii_.RegisterStruct( + "testpkg.Namespace1.Foo", + reflect.TypeOf((*Namespace1_Foo)(nil)).Elem(), + ) + _jsii_.RegisterInterface( + "testpkg.Namespace1.IBar", + reflect.TypeOf((*Namespace1_IBar)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "bar", GoGetter: "Bar"}, + _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, + }, + func() interface{} { + return &jsiiProxy_Namespace1_IBar{} + }, + ) + _jsii_.RegisterClass( + "testpkg.Namespace2", + reflect.TypeOf((*Namespace2)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, + }, + func() interface{} { + return &jsiiProxy_Namespace2{} + }, + ) + _jsii_.RegisterEnum( + "testpkg.Namespace2.Foo", + reflect.TypeOf((*Namespace2_Foo)(nil)).Elem(), + map[string]interface{}{ + "BAR": Namespace2_Foo_BAR, + "BAZ": Namespace2_Foo_BAZ, + }, + ) + _jsii_.RegisterClass( + "testpkg.Namespace2.Foo.Final", + reflect.TypeOf((*Namespace2_Foo_Final)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "done", GoGetter: "Done"}, + }, + func() interface{} { + return &jsiiProxy_Namespace2_Foo_Final{} + }, + ) +} + `; exports[`nested-types.ts: /java/pom.xml 1`] = ` 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 83d963d183..e0ee5d1573 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 @@ -4,22 +4,116 @@ exports[`Generated code for "@scope/jsii-calc-base": / 1`] = ` ┗━ 📁 go ┗━ 📁 jcb + ┣━ 📄 Base.go + ┣━ 📄 BaseProps.go ┣━ 📄 go.mod + ┣━ 📄 IBaseInterface.go ┣━ 📁 internal ┃ ┗━ 📄 types.go - ┣━ 📄 jcb_Base.go - ┣━ 📄 jcb_BaseProps.go - ┣━ 📄 jcb_IBaseInterface.go - ┣━ 📄 jcb_StaticConsumer.go - ┣━ 📄 jcb.go ┣━ 📁 jsii ┃ ┣━ 📄 jsii.go ┃ ┗━ 📄 scope-jsii-calc-base-0.0.0.tgz ┣━ 📄 LICENSE + ┣━ 📄 main.go ┣━ 📄 NOTICE + ┣━ 📄 StaticConsumer.go ┗━ 📄 version `; +exports[`Generated code for "@scope/jsii-calc-base": /go/jcb/Base.go 1`] = ` +// An example direct dependency for jsii-calc. +package jcb + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jcb/jsii" +) + +// A base class. +type Base interface { + // Returns: the name of the class (to verify native type names are created for derived classes). + TypeName() interface{} +} + +// The jsii proxy struct for Base +type jsiiProxy_Base struct { + _ byte // padding +} + +func NewBase_Override(b Base) { + _init_.Initialize() + + _jsii_.Create( + "@scope/jsii-calc-base.Base", + nil, // no parameters + b, + ) +} + +func (b *jsiiProxy_Base) TypeName() interface{} { + var returns interface{} + + _jsii_.Invoke( + b, + "typeName", + nil, // no parameters + &returns, + ) + + return returns +} + + +`; + +exports[`Generated code for "@scope/jsii-calc-base": /go/jcb/BaseProps.go 1`] = ` +// An example direct dependency for jsii-calc. +package jcb + +import ( + "github.com/aws/jsii/jsii-calc/go/scopejsiicalcbaseofbase/v2" +) + +type BaseProps struct { + Foo scopejsiicalcbaseofbase.Very \`field:"required" json:"foo" yaml:"foo"\` + Bar *string \`field:"required" json:"bar" yaml:"bar"\` +} + + +`; + +exports[`Generated code for "@scope/jsii-calc-base": /go/jcb/IBaseInterface.go 1`] = ` +// An example direct dependency for jsii-calc. +package jcb + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + + "github.com/aws/jsii/jsii-calc/go/jcb/internal" + "github.com/aws/jsii/jsii-calc/go/scopejsiicalcbaseofbase/v2" +) + +type IBaseInterface interface { + scopejsiicalcbaseofbase.IVeryBaseInterface + Bar() +} + +// The jsii proxy for IBaseInterface +type jsiiProxy_IBaseInterface struct { + internal.Type__scopejsiicalcbaseofbaseIVeryBaseInterface +} + +func (i *jsiiProxy_IBaseInterface) Bar() { + _jsii_.InvokeVoid( + i, + "bar", + nil, // no parameters + ) +} + + +`; + exports[`Generated code for "@scope/jsii-calc-base": /go/jcb/LICENSE 1`] = ` Apache License @@ -231,171 +325,7 @@ Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. `; -exports[`Generated code for "@scope/jsii-calc-base": /go/jcb/go.mod 1`] = ` -module github.com/aws/jsii/jsii-calc/go/jcb - -go 1.18 - -require ( - github.com/aws/jsii-runtime-go v0.0.0 - github.com/aws/jsii/jsii-calc/go/scopejsiicalcbaseofbase/v2 v2.1.1 -) - -`; - -exports[`Generated code for "@scope/jsii-calc-base": /go/jcb/internal/types.go 1`] = ` -package internal -import ( - "github.com/aws/jsii/jsii-calc/go/scopejsiicalcbaseofbase/v2" -) -type Type__scopejsiicalcbaseofbaseIVeryBaseInterface = scopejsiicalcbaseofbase.IVeryBaseInterface - -`; - -exports[`Generated code for "@scope/jsii-calc-base": /go/jcb/jcb.go 1`] = ` -package jcb - -import ( - "reflect" - - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -func init() { - _jsii_.RegisterClass( - "@scope/jsii-calc-base.Base", - reflect.TypeOf((*Base)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, - }, - func() interface{} { - return &jsiiProxy_Base{} - }, - ) - _jsii_.RegisterStruct( - "@scope/jsii-calc-base.BaseProps", - reflect.TypeOf((*BaseProps)(nil)).Elem(), - ) - _jsii_.RegisterInterface( - "@scope/jsii-calc-base.IBaseInterface", - reflect.TypeOf((*IBaseInterface)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "bar", GoMethod: "Bar"}, - _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, - }, - func() interface{} { - j := jsiiProxy_IBaseInterface{} - _jsii_.InitJsiiProxy(&j.Type__scopejsiicalcbaseofbaseIVeryBaseInterface) - return &j - }, - ) - _jsii_.RegisterClass( - "@scope/jsii-calc-base.StaticConsumer", - reflect.TypeOf((*StaticConsumer)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_StaticConsumer{} - }, - ) -} - -`; - -exports[`Generated code for "@scope/jsii-calc-base": /go/jcb/jcb_Base.go 1`] = ` -// An example direct dependency for jsii-calc. -package jcb - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jcb/jsii" -) - -// A base class. -type Base interface { - // Returns: the name of the class (to verify native type names are created for derived classes). - TypeName() interface{} -} - -// The jsii proxy struct for Base -type jsiiProxy_Base struct { - _ byte // padding -} - -func NewBase_Override(b Base) { - _init_.Initialize() - - _jsii_.Create( - "@scope/jsii-calc-base.Base", - nil, // no parameters - b, - ) -} - -func (b *jsiiProxy_Base) TypeName() interface{} { - var returns interface{} - - _jsii_.Invoke( - b, - "typeName", - nil, // no parameters - &returns, - ) - - return returns -} - - -`; - -exports[`Generated code for "@scope/jsii-calc-base": /go/jcb/jcb_BaseProps.go 1`] = ` -// An example direct dependency for jsii-calc. -package jcb - -import ( - "github.com/aws/jsii/jsii-calc/go/scopejsiicalcbaseofbase/v2" -) - -type BaseProps struct { - Foo scopejsiicalcbaseofbase.Very \`field:"required" json:"foo" yaml:"foo"\` - Bar *string \`field:"required" json:"bar" yaml:"bar"\` -} - - -`; - -exports[`Generated code for "@scope/jsii-calc-base": /go/jcb/jcb_IBaseInterface.go 1`] = ` -// An example direct dependency for jsii-calc. -package jcb - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - - "github.com/aws/jsii/jsii-calc/go/jcb/internal" - "github.com/aws/jsii/jsii-calc/go/scopejsiicalcbaseofbase/v2" -) - -type IBaseInterface interface { - scopejsiicalcbaseofbase.IVeryBaseInterface - Bar() -} - -// The jsii proxy for IBaseInterface -type jsiiProxy_IBaseInterface struct { - internal.Type__scopejsiicalcbaseofbaseIVeryBaseInterface -} - -func (i *jsiiProxy_IBaseInterface) Bar() { - _jsii_.InvokeVoid( - i, - "bar", - nil, // no parameters - ) -} - - -`; - -exports[`Generated code for "@scope/jsii-calc-base": /go/jcb/jcb_StaticConsumer.go 1`] = ` +exports[`Generated code for "@scope/jsii-calc-base": /go/jcb/StaticConsumer.go 1`] = ` // An example direct dependency for jsii-calc. package jcb @@ -453,6 +383,27 @@ func StaticConsumer_Consume(args ...interface{}) { } +`; + +exports[`Generated code for "@scope/jsii-calc-base": /go/jcb/go.mod 1`] = ` +module github.com/aws/jsii/jsii-calc/go/jcb + +go 1.18 + +require ( + github.com/aws/jsii-runtime-go v0.0.0 + github.com/aws/jsii/jsii-calc/go/scopejsiicalcbaseofbase/v2 v2.1.1 +) + +`; + +exports[`Generated code for "@scope/jsii-calc-base": /go/jcb/internal/types.go 1`] = ` +package internal +import ( + "github.com/aws/jsii/jsii-calc/go/scopejsiicalcbaseofbase/v2" +) +type Type__scopejsiicalcbaseofbaseIVeryBaseInterface = scopejsiicalcbaseofbase.IVeryBaseInterface + `; exports[`Generated code for "@scope/jsii-calc-base": /go/jcb/jsii/jsii.go 1`] = ` @@ -487,6 +438,55 @@ func Initialize() { exports[`Generated code for "@scope/jsii-calc-base": /go/jcb/jsii/scope-jsii-calc-base-0.0.0.tgz 1`] = `go/jcb/jsii/scope-jsii-calc-base-0.0.0.tgz is a tarball`; +exports[`Generated code for "@scope/jsii-calc-base": /go/jcb/main.go 1`] = ` +package jcb + +import ( + "reflect" + + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +func init() { + _jsii_.RegisterClass( + "@scope/jsii-calc-base.Base", + reflect.TypeOf((*Base)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, + }, + func() interface{} { + return &jsiiProxy_Base{} + }, + ) + _jsii_.RegisterStruct( + "@scope/jsii-calc-base.BaseProps", + reflect.TypeOf((*BaseProps)(nil)).Elem(), + ) + _jsii_.RegisterInterface( + "@scope/jsii-calc-base.IBaseInterface", + reflect.TypeOf((*IBaseInterface)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "bar", GoMethod: "Bar"}, + _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, + }, + func() interface{} { + j := jsiiProxy_IBaseInterface{} + _jsii_.InitJsiiProxy(&j.Type__scopejsiicalcbaseofbaseIVeryBaseInterface) + return &j + }, + ) + _jsii_.RegisterClass( + "@scope/jsii-calc-base.StaticConsumer", + reflect.TypeOf((*StaticConsumer)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_StaticConsumer{} + }, + ) +} + +`; + exports[`Generated code for "@scope/jsii-calc-base": /go/jcb/version 1`] = ` 0.0.0 @@ -502,17 +502,45 @@ exports[`Generated code for "@scope/jsii-calc-base-of-base": / 1`] = ` ┗━ 📁 go ┗━ 📁 scopejsiicalcbaseofbase ┣━ 📄 go.mod + ┣━ 📄 IVeryBaseInterface.go ┣━ 📁 jsii ┃ ┣━ 📄 jsii.go ┃ ┗━ 📄 scope-jsii-calc-base-of-base-2.1.1.tgz ┣━ 📄 LICENSE + ┣━ 📄 main.go ┣━ 📄 NOTICE - ┣━ 📄 scopejsiicalcbaseofbase_IVeryBaseInterface.go - ┣━ 📄 scopejsiicalcbaseofbase_StaticConsumer.go - ┣━ 📄 scopejsiicalcbaseofbase_Very.go - ┣━ 📄 scopejsiicalcbaseofbase_VeryBaseProps.go - ┣━ 📄 scopejsiicalcbaseofbase.go - ┗━ 📄 version + ┣━ 📄 StaticConsumer.go + ┣━ 📄 version + ┣━ 📄 Very.go + ┗━ 📄 VeryBaseProps.go +`; + +exports[`Generated code for "@scope/jsii-calc-base-of-base": /go/scopejsiicalcbaseofbase/IVeryBaseInterface.go 1`] = ` +// An example transitive dependency for jsii-calc. +package scopejsiicalcbaseofbase + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +type IVeryBaseInterface interface { + Foo() +} + +// The jsii proxy for IVeryBaseInterface +type jsiiProxy_IVeryBaseInterface struct { + _ byte // padding +} + +func (i *jsiiProxy_IVeryBaseInterface) Foo() { + _jsii_.InvokeVoid( + i, + "foo", + nil, // no parameters + ) +} + + `; exports[`Generated code for "@scope/jsii-calc-base-of-base": /go/scopejsiicalcbaseofbase/LICENSE 1`] = ` @@ -726,119 +754,7 @@ Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. `; -exports[`Generated code for "@scope/jsii-calc-base-of-base": /go/scopejsiicalcbaseofbase/go.mod 1`] = ` -module github.com/aws/jsii/jsii-calc/go/scopejsiicalcbaseofbase/v2 - -go 1.18 - -require ( - github.com/aws/jsii-runtime-go v0.0.0 -) - -`; - -exports[`Generated code for "@scope/jsii-calc-base-of-base": /go/scopejsiicalcbaseofbase/jsii/jsii.go 1`] = ` -// Package jsii contains the functionaility needed for jsii packages to -// initialize their dependencies and themselves. Users should never need to use this package -// directly. If you find you need to - please report a bug at -// https://github.com/aws/jsii/issues/new/choose -package jsii - -import ( - _ "embed" - - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -//go:embed scope-jsii-calc-base-of-base-2.1.1.tgz -var tarball []byte - -// Initialize loads the necessary packages in the @jsii/kernel to support the enclosing module. -// The implementation is idempotent (and hence safe to be called over and over). -func Initialize() { - // Load this library into the kernel - _jsii_.Load("@scope/jsii-calc-base-of-base", "2.1.1", tarball) -} - -`; - -exports[`Generated code for "@scope/jsii-calc-base-of-base": /go/scopejsiicalcbaseofbase/jsii/scope-jsii-calc-base-of-base-2.1.1.tgz 1`] = `go/scopejsiicalcbaseofbase/jsii/scope-jsii-calc-base-of-base-2.1.1.tgz is a tarball`; - -exports[`Generated code for "@scope/jsii-calc-base-of-base": /go/scopejsiicalcbaseofbase/scopejsiicalcbaseofbase.go 1`] = ` -package scopejsiicalcbaseofbase - -import ( - "reflect" - - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -func init() { - _jsii_.RegisterInterface( - "@scope/jsii-calc-base-of-base.IVeryBaseInterface", - reflect.TypeOf((*IVeryBaseInterface)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, - }, - func() interface{} { - return &jsiiProxy_IVeryBaseInterface{} - }, - ) - _jsii_.RegisterClass( - "@scope/jsii-calc-base-of-base.StaticConsumer", - reflect.TypeOf((*StaticConsumer)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_StaticConsumer{} - }, - ) - _jsii_.RegisterClass( - "@scope/jsii-calc-base-of-base.Very", - reflect.TypeOf((*Very)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "hey", GoMethod: "Hey"}, - }, - func() interface{} { - return &jsiiProxy_Very{} - }, - ) - _jsii_.RegisterStruct( - "@scope/jsii-calc-base-of-base.VeryBaseProps", - reflect.TypeOf((*VeryBaseProps)(nil)).Elem(), - ) -} - -`; - -exports[`Generated code for "@scope/jsii-calc-base-of-base": /go/scopejsiicalcbaseofbase/scopejsiicalcbaseofbase_IVeryBaseInterface.go 1`] = ` -// An example transitive dependency for jsii-calc. -package scopejsiicalcbaseofbase - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -type IVeryBaseInterface interface { - Foo() -} - -// The jsii proxy for IVeryBaseInterface -type jsiiProxy_IVeryBaseInterface struct { - _ byte // padding -} - -func (i *jsiiProxy_IVeryBaseInterface) Foo() { - _jsii_.InvokeVoid( - i, - "foo", - nil, // no parameters - ) -} - - -`; - -exports[`Generated code for "@scope/jsii-calc-base-of-base": /go/scopejsiicalcbaseofbase/scopejsiicalcbaseofbase_StaticConsumer.go 1`] = ` +exports[`Generated code for "@scope/jsii-calc-base-of-base": /go/scopejsiicalcbaseofbase/StaticConsumer.go 1`] = ` // An example transitive dependency for jsii-calc. package scopejsiicalcbaseofbase @@ -873,7 +789,7 @@ func StaticConsumer_Consume(_args ...interface{}) { `; -exports[`Generated code for "@scope/jsii-calc-base-of-base": /go/scopejsiicalcbaseofbase/scopejsiicalcbaseofbase_Very.go 1`] = ` +exports[`Generated code for "@scope/jsii-calc-base-of-base": /go/scopejsiicalcbaseofbase/Very.go 1`] = ` // An example transitive dependency for jsii-calc. package scopejsiicalcbaseofbase @@ -936,7 +852,7 @@ func (v *jsiiProxy_Very) Hey() *float64 { `; -exports[`Generated code for "@scope/jsii-calc-base-of-base": /go/scopejsiicalcbaseofbase/scopejsiicalcbaseofbase_VeryBaseProps.go 1`] = ` +exports[`Generated code for "@scope/jsii-calc-base-of-base": /go/scopejsiicalcbaseofbase/VeryBaseProps.go 1`] = ` // An example transitive dependency for jsii-calc. package scopejsiicalcbaseofbase @@ -948,74 +864,389 @@ type VeryBaseProps struct { `; -exports[`Generated code for "@scope/jsii-calc-base-of-base": /go/scopejsiicalcbaseofbase/version 1`] = ` -2.1.1 +exports[`Generated code for "@scope/jsii-calc-base-of-base": /go/scopejsiicalcbaseofbase/go.mod 1`] = ` +module github.com/aws/jsii/jsii-calc/go/scopejsiicalcbaseofbase/v2 -`; +go 1.18 -exports[`Generated code for "@scope/jsii-calc-base-of-base": / 1`] = ` - -┗━ 🕳 There is nothing here -`; +require ( + github.com/aws/jsii-runtime-go v0.0.0 +) -exports[`Generated code for "@scope/jsii-calc-lib": / 1`] = ` - - ┗━ 📁 go - ┗━ 📁 scopejsiicalclib - ┣━ 📁 customsubmodulename - ┃ ┣━ 📄 customsubmodulename_IReflectable.go - ┃ ┣━ 📄 customsubmodulename_NestingClass_NestedClass.go - ┃ ┣━ 📄 customsubmodulename_NestingClass_NestedStruct.go - ┃ ┣━ 📄 customsubmodulename_NestingClass.go - ┃ ┣━ 📄 customsubmodulename_ReflectableEntry.go - ┃ ┣━ 📄 customsubmodulename_Reflector.go - ┃ ┣━ 📄 customsubmodulename.go - ┃ ┗━ 📄 README.md - ┣━ 📁 deprecationremoval - ┃ ┣━ 📄 deprecationremoval_IInterface.go - ┃ ┣━ 📄 deprecationremoval_InterfaceFactory.go - ┃ ┗━ 📄 deprecationremoval.go - ┣━ 📄 go.mod - ┣━ 📁 internal - ┃ ┗━ 📄 types.go - ┣━ 📁 jsii - ┃ ┣━ 📄 jsii.go - ┃ ┗━ 📄 scope-jsii-calc-lib-0.0.0.tgz - ┣━ 📄 LICENSE - ┣━ 📄 NOTICE - ┣━ 📄 scopejsiicalclib_BaseFor2647.go - ┣━ 📄 scopejsiicalclib_DiamondLeft.go - ┣━ 📄 scopejsiicalclib_DiamondRight.go - ┣━ 📄 scopejsiicalclib_EnumFromScopedModule.go - ┣━ 📄 scopejsiicalclib_IDoublable.go - ┣━ 📄 scopejsiicalclib_IFriendly.go - ┣━ 📄 scopejsiicalclib_IThreeLevelsInterface.go - ┣━ 📄 scopejsiicalclib_MyFirstStruct.go - ┣━ 📄 scopejsiicalclib_Number.go - ┣━ 📄 scopejsiicalclib_NumericValue.go - ┣━ 📄 scopejsiicalclib_Operation.go - ┣━ 📄 scopejsiicalclib_StructWithOnlyOptionals.go - ┣━ 📄 scopejsiicalclib.go - ┗━ 📄 version `; -exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/LICENSE 1`] = ` - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +exports[`Generated code for "@scope/jsii-calc-base-of-base": /go/scopejsiicalcbaseofbase/jsii/jsii.go 1`] = ` +// Package jsii contains the functionaility needed for jsii packages to +// initialize their dependencies and themselves. Users should never need to use this package +// directly. If you find you need to - please report a bug at +// https://github.com/aws/jsii/issues/new/choose +package jsii - 1. Definitions. +import ( + _ "embed" - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. +//go:embed scope-jsii-calc-base-of-base-2.1.1.tgz +var tarball []byte - "Legal Entity" shall mean the union of the acting entity and all +// Initialize loads the necessary packages in the @jsii/kernel to support the enclosing module. +// The implementation is idempotent (and hence safe to be called over and over). +func Initialize() { + // Load this library into the kernel + _jsii_.Load("@scope/jsii-calc-base-of-base", "2.1.1", tarball) +} + +`; + +exports[`Generated code for "@scope/jsii-calc-base-of-base": /go/scopejsiicalcbaseofbase/jsii/scope-jsii-calc-base-of-base-2.1.1.tgz 1`] = `go/scopejsiicalcbaseofbase/jsii/scope-jsii-calc-base-of-base-2.1.1.tgz is a tarball`; + +exports[`Generated code for "@scope/jsii-calc-base-of-base": /go/scopejsiicalcbaseofbase/main.go 1`] = ` +package scopejsiicalcbaseofbase + +import ( + "reflect" + + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +func init() { + _jsii_.RegisterInterface( + "@scope/jsii-calc-base-of-base.IVeryBaseInterface", + reflect.TypeOf((*IVeryBaseInterface)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, + }, + func() interface{} { + return &jsiiProxy_IVeryBaseInterface{} + }, + ) + _jsii_.RegisterClass( + "@scope/jsii-calc-base-of-base.StaticConsumer", + reflect.TypeOf((*StaticConsumer)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_StaticConsumer{} + }, + ) + _jsii_.RegisterClass( + "@scope/jsii-calc-base-of-base.Very", + reflect.TypeOf((*Very)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "hey", GoMethod: "Hey"}, + }, + func() interface{} { + return &jsiiProxy_Very{} + }, + ) + _jsii_.RegisterStruct( + "@scope/jsii-calc-base-of-base.VeryBaseProps", + reflect.TypeOf((*VeryBaseProps)(nil)).Elem(), + ) +} + +`; + +exports[`Generated code for "@scope/jsii-calc-base-of-base": /go/scopejsiicalcbaseofbase/version 1`] = ` +2.1.1 + +`; + +exports[`Generated code for "@scope/jsii-calc-base-of-base": / 1`] = ` + +┗━ 🕳 There is nothing here +`; + +exports[`Generated code for "@scope/jsii-calc-lib": / 1`] = ` + + ┗━ 📁 go + ┗━ 📁 scopejsiicalclib + ┣━ 📄 BaseFor2647.go + ┣━ 📁 customsubmodulename + ┃ ┣━ 📄 IReflectable.go + ┃ ┣━ 📄 main.go + ┃ ┣━ 📄 NestingClass_NestedClass.go + ┃ ┣━ 📄 NestingClass_NestedStruct.go + ┃ ┣━ 📄 NestingClass.go + ┃ ┣━ 📄 README.md + ┃ ┣━ 📄 ReflectableEntry.go + ┃ ┗━ 📄 Reflector.go + ┣━ 📁 deprecationremoval + ┃ ┣━ 📄 IInterface.go + ┃ ┣━ 📄 InterfaceFactory.go + ┃ ┗━ 📄 main.go + ┣━ 📄 DiamondLeft.go + ┣━ 📄 DiamondRight.go + ┣━ 📄 EnumFromScopedModule.go + ┣━ 📄 go.mod + ┣━ 📄 IDoublable.go + ┣━ 📄 IFriendly.go + ┣━ 📁 internal + ┃ ┗━ 📄 types.go + ┣━ 📄 IThreeLevelsInterface.go + ┣━ 📁 jsii + ┃ ┣━ 📄 jsii.go + ┃ ┗━ 📄 scope-jsii-calc-lib-0.0.0.tgz + ┣━ 📄 LICENSE + ┣━ 📄 main.go + ┣━ 📄 MyFirstStruct.go + ┣━ 📄 NOTICE + ┣━ 📄 Number.go + ┣━ 📄 NumericValue.go + ┣━ 📄 Operation.go + ┣━ 📄 StructWithOnlyOptionals.go + ┗━ 📄 version +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/BaseFor2647.go 1`] = ` +// A simple calcuator library built on JSII. +package scopejsiicalclib + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib/jsii" + + "github.com/aws/jsii/jsii-calc/go/jcb" + "github.com/aws/jsii/jsii-calc/go/scopejsiicalcbaseofbase/v2" +) + +// A base class for testing #2647. +// +// The method \`foo\` has a parameter that uses a type +// from a dependent module. Since Go "reimplments" this method, it will also need +// to include an "import" statement for the calc-base module. +// See: https://github.com/aws/jsii/issues/2647 +// +// Deprecated. +type BaseFor2647 interface { + // Deprecated. + Foo(obj jcb.IBaseInterface) +} + +// The jsii proxy struct for BaseFor2647 +type jsiiProxy_BaseFor2647 struct { + _ byte // padding +} + +// Deprecated. +func NewBaseFor2647(very scopejsiicalcbaseofbase.Very) BaseFor2647 { + _init_.Initialize() + + j := jsiiProxy_BaseFor2647{} + + _jsii_.Create( + "@scope/jsii-calc-lib.BaseFor2647", + []interface{}{very}, + &j, + ) + + return &j +} + +// Deprecated. +func NewBaseFor2647_Override(b BaseFor2647, very scopejsiicalcbaseofbase.Very) { + _init_.Initialize() + + _jsii_.Create( + "@scope/jsii-calc-lib.BaseFor2647", + []interface{}{very}, + b, + ) +} + +func (b *jsiiProxy_BaseFor2647) Foo(obj jcb.IBaseInterface) { + _jsii_.InvokeVoid( + b, + "foo", + []interface{}{obj}, + ) +} + + +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/DiamondLeft.go 1`] = ` +// A simple calcuator library built on JSII. +package scopejsiicalclib + + +// Deprecated. +type DiamondLeft struct { + // Deprecated. + HoistedTop *string \`field:"optional" json:"hoistedTop" yaml:"hoistedTop"\` + // Deprecated. + Left *float64 \`field:"optional" json:"left" yaml:"left"\` +} + + +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/DiamondRight.go 1`] = ` +// A simple calcuator library built on JSII. +package scopejsiicalclib + + +// Deprecated. +type DiamondRight struct { + // Deprecated. + HoistedTop *string \`field:"optional" json:"hoistedTop" yaml:"hoistedTop"\` + // Deprecated. + Right *bool \`field:"optional" json:"right" yaml:"right"\` +} + + +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/EnumFromScopedModule.go 1`] = ` +// A simple calcuator library built on JSII. +package scopejsiicalclib + + +// Check that enums from \\@scoped packages can be references. +// +// See awslabs/jsii#138. +// Deprecated. +type EnumFromScopedModule string + +const ( + // Deprecated. + EnumFromScopedModule_VALUE1 EnumFromScopedModule = "VALUE1" + // Deprecated. + EnumFromScopedModule_VALUE2 EnumFromScopedModule = "VALUE2" +) + + +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/IDoublable.go 1`] = ` +// A simple calcuator library built on JSII. +package scopejsiicalclib + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +// The general contract for a concrete number. +// Deprecated. +type IDoublable interface { + // Deprecated. + DoubleValue() *float64 +} + +// The jsii proxy for IDoublable +type jsiiProxy_IDoublable struct { + _ byte // padding +} + +func (j *jsiiProxy_IDoublable) DoubleValue() *float64 { + var returns *float64 + _jsii_.Get( + j, + "doubleValue", + &returns, + ) + return returns +} + + +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/IFriendly.go 1`] = ` +// A simple calcuator library built on JSII. +package scopejsiicalclib + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +// Applies to classes that are considered friendly. +// +// These classes can be greeted with +// a "hello" or "goodbye" blessing and they will respond back in a fun and friendly manner. +// Deprecated. +type IFriendly interface { + // Say hello! + // Deprecated. + Hello() *string +} + +// The jsii proxy for IFriendly +type jsiiProxy_IFriendly struct { + _ byte // padding +} + +func (i *jsiiProxy_IFriendly) Hello() *string { + var returns *string + + _jsii_.Invoke( + i, + "hello", + nil, // no parameters + &returns, + ) + + return returns +} + + +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/IThreeLevelsInterface.go 1`] = ` +// A simple calcuator library built on JSII. +package scopejsiicalclib + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + + "github.com/aws/jsii/jsii-calc/go/jcb" + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib/internal" +) + +// Interface that inherits from packages 2 levels up the tree. +// +// Their presence validates that .NET/Java/jsii-reflect can track all fields +// far enough up the tree. +// Deprecated. +type IThreeLevelsInterface interface { + jcb.IBaseInterface + // Deprecated. + Baz() +} + +// The jsii proxy for IThreeLevelsInterface +type jsiiProxy_IThreeLevelsInterface struct { + internal.Type__jcbIBaseInterface +} + +func (i *jsiiProxy_IThreeLevelsInterface) Baz() { + _jsii_.InvokeVoid( + i, + "baz", + nil, // no parameters + ) +} + + +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/LICENSE 1`] = ` + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the @@ -1204,189 +1435,438 @@ exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib limitations under the License. `; -exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/NOTICE 1`] = ` -jsii -Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/MyFirstStruct.go 1`] = ` +// A simple calcuator library built on JSII. +package scopejsiicalclib -`; -exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/customsubmodulename/README.md 1`] = ` -# Submodule Readme +// This is the first struct we have created in jsii. +// Deprecated. +type MyFirstStruct struct { + // An awesome number value. + // Deprecated. + Anumber *float64 \`field:"required" json:"anumber" yaml:"anumber"\` + // A string value. + // Deprecated. + Astring *string \`field:"required" json:"astring" yaml:"astring"\` + // Deprecated. + FirstOptional *[]*string \`field:"optional" json:"firstOptional" yaml:"firstOptional"\` +} -This is a submodule readme. `; -exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/customsubmodulename/customsubmodulename.go 1`] = ` -package customsubmodulename - -import ( - "reflect" - - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -func init() { - _jsii_.RegisterInterface( - "@scope/jsii-calc-lib.submodule.IReflectable", - reflect.TypeOf((*IReflectable)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "entries", GoGetter: "Entries"}, - }, - func() interface{} { - return &jsiiProxy_IReflectable{} - }, - ) - _jsii_.RegisterClass( - "@scope/jsii-calc-lib.submodule.NestingClass", - reflect.TypeOf((*NestingClass)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_NestingClass{} - }, - ) - _jsii_.RegisterClass( - "@scope/jsii-calc-lib.submodule.NestingClass.NestedClass", - reflect.TypeOf((*NestingClass_NestedClass)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "property", GoGetter: "Property"}, - }, - func() interface{} { - return &jsiiProxy_NestingClass_NestedClass{} - }, - ) - _jsii_.RegisterStruct( - "@scope/jsii-calc-lib.submodule.NestingClass.NestedStruct", - reflect.TypeOf((*NestingClass_NestedStruct)(nil)).Elem(), - ) - _jsii_.RegisterStruct( - "@scope/jsii-calc-lib.submodule.ReflectableEntry", - reflect.TypeOf((*ReflectableEntry)(nil)).Elem(), - ) - _jsii_.RegisterClass( - "@scope/jsii-calc-lib.submodule.Reflector", - reflect.TypeOf((*Reflector)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "asMap", GoMethod: "AsMap"}, - }, - func() interface{} { - return &jsiiProxy_Reflector{} - }, - ) -} +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/NOTICE 1`] = ` +jsii +Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. `; -exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/customsubmodulename/customsubmodulename_IReflectable.go 1`] = ` -package customsubmodulename +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/Number.go 1`] = ` +// A simple calcuator library built on JSII. +package scopejsiicalclib import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib/jsii" ) +// Represents a concrete number. // Deprecated. -type IReflectable interface { +type Number interface { + NumericValue + IDoublable + // The number multiplied by 2. // Deprecated. - Entries() *[]*ReflectableEntry + DoubleValue() *float64 + // The number. + // Deprecated. + Value() *float64 + // String representation of the value. + // Deprecated. + ToString() *string + // Returns: the name of the class (to verify native type names are created for derived classes). + // Deprecated. + TypeName() interface{} } -// The jsii proxy for IReflectable -type jsiiProxy_IReflectable struct { - _ byte // padding +// The jsii proxy struct for Number +type jsiiProxy_Number struct { + jsiiProxy_NumericValue + jsiiProxy_IDoublable } -func (j *jsiiProxy_IReflectable) Entries() *[]*ReflectableEntry { - var returns *[]*ReflectableEntry +func (j *jsiiProxy_Number) DoubleValue() *float64 { + var returns *float64 _jsii_.Get( j, - "entries", + "doubleValue", &returns, ) return returns } - -`; - -exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/customsubmodulename/customsubmodulename_NestingClass.go 1`] = ` -package customsubmodulename - - -// This class is here to show we can use nested classes across module boundaries. -// Deprecated. -type NestingClass interface { -} - -// The jsii proxy struct for NestingClass -type jsiiProxy_NestingClass struct { - _ byte // padding -} - - -`; - -exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/customsubmodulename/customsubmodulename_NestingClass_NestedClass.go 1`] = ` -package customsubmodulename - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib/jsii" -) - -// This class is here to show we can use nested classes across module boundaries. -// Deprecated. -type NestingClass_NestedClass interface { - // Deprecated. - Property() *string -} - -// The jsii proxy struct for NestingClass_NestedClass -type jsiiProxy_NestingClass_NestedClass struct { - _ byte // padding -} - -func (j *jsiiProxy_NestingClass_NestedClass) Property() *string { - var returns *string +func (j *jsiiProxy_Number) Value() *float64 { + var returns *float64 _jsii_.Get( j, - "property", + "value", &returns, ) return returns } +// Creates a Number object. // Deprecated. -func NewNestingClass_NestedClass() NestingClass_NestedClass { +func NewNumber(value *float64) Number { _init_.Initialize() - j := jsiiProxy_NestingClass_NestedClass{} + j := jsiiProxy_Number{} _jsii_.Create( - "@scope/jsii-calc-lib.submodule.NestingClass.NestedClass", - nil, // no parameters + "@scope/jsii-calc-lib.Number", + []interface{}{value}, &j, ) return &j } +// Creates a Number object. // Deprecated. -func NewNestingClass_NestedClass_Override(n NestingClass_NestedClass) { +func NewNumber_Override(n Number, value *float64) { _init_.Initialize() _jsii_.Create( - "@scope/jsii-calc-lib.submodule.NestingClass.NestedClass", - nil, // no parameters + "@scope/jsii-calc-lib.Number", + []interface{}{value}, n, ) } +func (n *jsiiProxy_Number) ToString() *string { + var returns *string -`; - -exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/customsubmodulename/customsubmodulename_NestingClass_NestedStruct.go 1`] = ` -package customsubmodulename + _jsii_.Invoke( + n, + "toString", + nil, // no parameters + &returns, + ) + + return returns +} + +func (n *jsiiProxy_Number) TypeName() interface{} { + var returns interface{} + + _jsii_.Invoke( + n, + "typeName", + nil, // no parameters + &returns, + ) + + return returns +} + + +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/NumericValue.go 1`] = ` +// A simple calcuator library built on JSII. +package scopejsiicalclib + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib/jsii" + + "github.com/aws/jsii/jsii-calc/go/jcb" + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib/internal" +) + +// Abstract class which represents a numeric value. +// Deprecated. +type NumericValue interface { + jcb.Base + // The value. + // Deprecated. + Value() *float64 + // String representation of the value. + // Deprecated. + ToString() *string + // Returns: the name of the class (to verify native type names are created for derived classes). + // Deprecated. + TypeName() interface{} +} + +// The jsii proxy struct for NumericValue +type jsiiProxy_NumericValue struct { + internal.Type__jcbBase +} + +func (j *jsiiProxy_NumericValue) Value() *float64 { + var returns *float64 + _jsii_.Get( + j, + "value", + &returns, + ) + return returns +} + + +// Deprecated. +func NewNumericValue_Override(n NumericValue) { + _init_.Initialize() + + _jsii_.Create( + "@scope/jsii-calc-lib.NumericValue", + nil, // no parameters + n, + ) +} + +func (n *jsiiProxy_NumericValue) ToString() *string { + var returns *string + + _jsii_.Invoke( + n, + "toString", + nil, // no parameters + &returns, + ) + + return returns +} + +func (n *jsiiProxy_NumericValue) TypeName() interface{} { + var returns interface{} + + _jsii_.Invoke( + n, + "typeName", + nil, // no parameters + &returns, + ) + + return returns +} + + +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/Operation.go 1`] = ` +// A simple calcuator library built on JSII. +package scopejsiicalclib + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib/jsii" +) + +// Represents an operation on values. +// Deprecated. +type Operation interface { + NumericValue + // The value. + // Deprecated. + Value() *float64 + // String representation of the value. + // Deprecated. + ToString() *string + // Returns: the name of the class (to verify native type names are created for derived classes). + // Deprecated. + TypeName() interface{} +} + +// The jsii proxy struct for Operation +type jsiiProxy_Operation struct { + jsiiProxy_NumericValue +} + +func (j *jsiiProxy_Operation) Value() *float64 { + var returns *float64 + _jsii_.Get( + j, + "value", + &returns, + ) + return returns +} + + +// Deprecated. +func NewOperation_Override(o Operation) { + _init_.Initialize() + + _jsii_.Create( + "@scope/jsii-calc-lib.Operation", + nil, // no parameters + o, + ) +} + +func (o *jsiiProxy_Operation) ToString() *string { + var returns *string + + _jsii_.Invoke( + o, + "toString", + nil, // no parameters + &returns, + ) + + return returns +} + +func (o *jsiiProxy_Operation) TypeName() interface{} { + var returns interface{} + + _jsii_.Invoke( + o, + "typeName", + nil, // no parameters + &returns, + ) + + return returns +} + + +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/StructWithOnlyOptionals.go 1`] = ` +// A simple calcuator library built on JSII. +package scopejsiicalclib + + +// This is a struct with only optional properties. +// Deprecated. +type StructWithOnlyOptionals struct { + // The first optional! + // Deprecated. + Optional1 *string \`field:"optional" json:"optional1" yaml:"optional1"\` + // Deprecated. + Optional2 *float64 \`field:"optional" json:"optional2" yaml:"optional2"\` + // Deprecated. + Optional3 *bool \`field:"optional" json:"optional3" yaml:"optional3"\` +} + + +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/customsubmodulename/IReflectable.go 1`] = ` +package customsubmodulename + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +// Deprecated. +type IReflectable interface { + // Deprecated. + Entries() *[]*ReflectableEntry +} + +// The jsii proxy for IReflectable +type jsiiProxy_IReflectable struct { + _ byte // padding +} + +func (j *jsiiProxy_IReflectable) Entries() *[]*ReflectableEntry { + var returns *[]*ReflectableEntry + _jsii_.Get( + j, + "entries", + &returns, + ) + return returns +} + + +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/customsubmodulename/NestingClass.go 1`] = ` +package customsubmodulename + + +// This class is here to show we can use nested classes across module boundaries. +// Deprecated. +type NestingClass interface { +} + +// The jsii proxy struct for NestingClass +type jsiiProxy_NestingClass struct { + _ byte // padding +} + + +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/customsubmodulename/NestingClass_NestedClass.go 1`] = ` +package customsubmodulename + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib/jsii" +) + +// This class is here to show we can use nested classes across module boundaries. +// Deprecated. +type NestingClass_NestedClass interface { + // Deprecated. + Property() *string +} + +// The jsii proxy struct for NestingClass_NestedClass +type jsiiProxy_NestingClass_NestedClass struct { + _ byte // padding +} + +func (j *jsiiProxy_NestingClass_NestedClass) Property() *string { + var returns *string + _jsii_.Get( + j, + "property", + &returns, + ) + return returns +} + + +// Deprecated. +func NewNestingClass_NestedClass() NestingClass_NestedClass { + _init_.Initialize() + + j := jsiiProxy_NestingClass_NestedClass{} + + _jsii_.Create( + "@scope/jsii-calc-lib.submodule.NestingClass.NestedClass", + nil, // no parameters + &j, + ) + + return &j +} + +// Deprecated. +func NewNestingClass_NestedClass_Override(n NestingClass_NestedClass) { + _init_.Initialize() + + _jsii_.Create( + "@scope/jsii-calc-lib.submodule.NestingClass.NestedClass", + nil, // no parameters + n, + ) +} + + +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/customsubmodulename/NestingClass_NestedStruct.go 1`] = ` +package customsubmodulename // This is a struct, nested within a class. @@ -1401,7 +1881,14 @@ type NestingClass_NestedStruct struct { `; -exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/customsubmodulename/customsubmodulename_ReflectableEntry.go 1`] = ` +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/customsubmodulename/README.md 1`] = ` +# Submodule Readme + +This is a submodule readme. + +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/customsubmodulename/ReflectableEntry.go 1`] = ` package customsubmodulename @@ -1416,7 +1903,7 @@ type ReflectableEntry struct { `; -exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/customsubmodulename/customsubmodulename_Reflector.go 1`] = ` +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/customsubmodulename/Reflector.go 1`] = ` package customsubmodulename import ( @@ -1477,8 +1964,8 @@ func (r *jsiiProxy_Reflector) AsMap(reflectable IReflectable) *map[string]interf `; -exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/deprecationremoval/deprecationremoval.go 1`] = ` -package deprecationremoval +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/customsubmodulename/main.go 1`] = ` +package customsubmodulename import ( "reflect" @@ -1488,28 +1975,56 @@ import ( func init() { _jsii_.RegisterInterface( - "@scope/jsii-calc-lib.deprecationRemoval.IInterface", - reflect.TypeOf((*IInterface)(nil)).Elem(), + "@scope/jsii-calc-lib.submodule.IReflectable", + reflect.TypeOf((*IReflectable)(nil)).Elem(), []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, + _jsii_.MemberProperty{JsiiProperty: "entries", GoGetter: "Entries"}, }, func() interface{} { - return &jsiiProxy_IInterface{} + return &jsiiProxy_IReflectable{} }, ) _jsii_.RegisterClass( - "@scope/jsii-calc-lib.deprecationRemoval.InterfaceFactory", - reflect.TypeOf((*InterfaceFactory)(nil)).Elem(), + "@scope/jsii-calc-lib.submodule.NestingClass", + reflect.TypeOf((*NestingClass)(nil)).Elem(), nil, // no members func() interface{} { - return &jsiiProxy_InterfaceFactory{} + return &jsiiProxy_NestingClass{} + }, + ) + _jsii_.RegisterClass( + "@scope/jsii-calc-lib.submodule.NestingClass.NestedClass", + reflect.TypeOf((*NestingClass_NestedClass)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "property", GoGetter: "Property"}, + }, + func() interface{} { + return &jsiiProxy_NestingClass_NestedClass{} + }, + ) + _jsii_.RegisterStruct( + "@scope/jsii-calc-lib.submodule.NestingClass.NestedStruct", + reflect.TypeOf((*NestingClass_NestedStruct)(nil)).Elem(), + ) + _jsii_.RegisterStruct( + "@scope/jsii-calc-lib.submodule.ReflectableEntry", + reflect.TypeOf((*ReflectableEntry)(nil)).Elem(), + ) + _jsii_.RegisterClass( + "@scope/jsii-calc-lib.submodule.Reflector", + reflect.TypeOf((*Reflector)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "asMap", GoMethod: "AsMap"}, + }, + func() interface{} { + return &jsiiProxy_Reflector{} }, ) } `; -exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/deprecationremoval/deprecationremoval_IInterface.go 1`] = ` +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/deprecationremoval/IInterface.go 1`] = ` package deprecationremoval import ( @@ -1538,7 +2053,7 @@ func (i *jsiiProxy_IInterface) Method() { `; -exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/deprecationremoval/deprecationremoval_InterfaceFactory.go 1`] = ` +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/deprecationremoval/InterfaceFactory.go 1`] = ` package deprecationremoval import ( @@ -1572,6 +2087,38 @@ func InterfaceFactory_Create() IInterface { } +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/deprecationremoval/main.go 1`] = ` +package deprecationremoval + +import ( + "reflect" + + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +func init() { + _jsii_.RegisterInterface( + "@scope/jsii-calc-lib.deprecationRemoval.IInterface", + reflect.TypeOf((*IInterface)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, + }, + func() interface{} { + return &jsiiProxy_IInterface{} + }, + ) + _jsii_.RegisterClass( + "@scope/jsii-calc-lib.deprecationRemoval.InterfaceFactory", + reflect.TypeOf((*InterfaceFactory)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_InterfaceFactory{} + }, + ) +} + `; exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/go.mod 1`] = ` @@ -1631,7 +2178,7 @@ func Initialize() { exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/jsii/scope-jsii-calc-lib-0.0.0.tgz 1`] = `go/scopejsiicalclib/jsii/scope-jsii-calc-lib-0.0.0.tgz is a tarball`; -exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/scopejsiicalclib.go 1`] = ` +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/main.go 1`] = ` package scopejsiicalclib import ( @@ -1757,189 +2304,707 @@ func init() { `; -exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/scopejsiicalclib_BaseFor2647.go 1`] = ` -// A simple calcuator library built on JSII. -package scopejsiicalclib - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib/jsii" - - "github.com/aws/jsii/jsii-calc/go/jcb" - "github.com/aws/jsii/jsii-calc/go/scopejsiicalcbaseofbase/v2" -) - -// A base class for testing #2647. -// -// The method \`foo\` has a parameter that uses a type -// from a dependent module. Since Go "reimplments" this method, it will also need -// to include an "import" statement for the calc-base module. -// See: https://github.com/aws/jsii/issues/2647 -// -// Deprecated. -type BaseFor2647 interface { - // Deprecated. - Foo(obj jcb.IBaseInterface) -} - -// The jsii proxy struct for BaseFor2647 -type jsiiProxy_BaseFor2647 struct { - _ byte // padding -} - -// Deprecated. -func NewBaseFor2647(very scopejsiicalcbaseofbase.Very) BaseFor2647 { - _init_.Initialize() - - j := jsiiProxy_BaseFor2647{} - - _jsii_.Create( - "@scope/jsii-calc-lib.BaseFor2647", - []interface{}{very}, - &j, - ) - - return &j -} - -// Deprecated. -func NewBaseFor2647_Override(b BaseFor2647, very scopejsiicalcbaseofbase.Very) { - _init_.Initialize() - - _jsii_.Create( - "@scope/jsii-calc-lib.BaseFor2647", - []interface{}{very}, - b, - ) -} - -func (b *jsiiProxy_BaseFor2647) Foo(obj jcb.IBaseInterface) { - _jsii_.InvokeVoid( - b, - "foo", - []interface{}{obj}, - ) -} - +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/version 1`] = ` +0.0.0-devpreview `; -exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/scopejsiicalclib_DiamondLeft.go 1`] = ` -// A simple calcuator library built on JSII. -package scopejsiicalclib - - -// Deprecated. -type DiamondLeft struct { - // Deprecated. - HoistedTop *string \`field:"optional" json:"hoistedTop" yaml:"hoistedTop"\` - // Deprecated. - Left *float64 \`field:"optional" json:"left" yaml:"left"\` -} - - +exports[`Generated code for "@scope/jsii-calc-lib": / 1`] = ` + + ┗━ 📁 go + ┗━ 📁 scopejsiicalclib + ┣━ 🆕 BaseFor2647__checks.go + ┣━ 🆕 BaseFor2647__no_checks.go + ┣━ 📄 BaseFor2647.go.diff + ┣━ 📁 customsubmodulename + ┃ ┣━ 🆕 Reflector__checks.go + ┃ ┣━ 🆕 Reflector__no_checks.go + ┃ ┗━ 📄 Reflector.go.diff + ┣━ 🆕 Number__checks.go + ┣━ 🆕 Number__no_checks.go + ┗━ 📄 Number.go.diff `; -exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/scopejsiicalclib_DiamondRight.go 1`] = ` -// A simple calcuator library built on JSII. -package scopejsiicalclib - - -// Deprecated. -type DiamondRight struct { - // Deprecated. - HoistedTop *string \`field:"optional" json:"hoistedTop" yaml:"hoistedTop"\` - // Deprecated. - Right *bool \`field:"optional" json:"right" yaml:"right"\` -} - - +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/BaseFor2647.go.diff 1`] = ` +--- go/scopejsiicalclib/BaseFor2647.go --no-runtime-type-checking ++++ go/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_EnumFromScopedModule.go 1`] = ` -// A simple calcuator library built on JSII. -package scopejsiicalclib +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/BaseFor2647__checks.go.diff 1`] = ` +--- go/scopejsiicalclib/BaseFor2647__checks.go --no-runtime-type-checking ++++ go/scopejsiicalclib/BaseFor2647__checks.go --runtime-type-checking +@@ -0,0 +1,28 @@ ++//go: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/BaseFor2647__no_checks.go.diff 1`] = ` +--- go/scopejsiicalclib/BaseFor2647__no_checks.go --no-runtime-type-checking ++++ go/scopejsiicalclib/BaseFor2647__no_checks.go --runtime-type-checking +@@ -0,0 +1,15 @@ ++//go: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 ++} ++ +`; -// Check that enums from \\@scoped packages can be references. -// -// See awslabs/jsii#138. -// Deprecated. -type EnumFromScopedModule string +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/Number.go.diff 1`] = ` +--- go/scopejsiicalclib/Number.go --no-runtime-type-checking ++++ go/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}, +`; -const ( - // Deprecated. - EnumFromScopedModule_VALUE1 EnumFromScopedModule = "VALUE1" - // Deprecated. - EnumFromScopedModule_VALUE2 EnumFromScopedModule = "VALUE2" -) +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/Number__checks.go.diff 1`] = ` +--- go/scopejsiicalclib/Number__checks.go --no-runtime-type-checking ++++ go/scopejsiicalclib/Number__checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ ++//go: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 "@scope/jsii-calc-lib": /go/scopejsiicalclib/Number__no_checks.go.diff 1`] = ` +--- go/scopejsiicalclib/Number__no_checks.go --no-runtime-type-checking ++++ go/scopejsiicalclib/Number__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go: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/customsubmodulename/Reflector.go.diff 1`] = ` +--- go/scopejsiicalclib/customsubmodulename/Reflector.go --no-runtime-type-checking ++++ go/scopejsiicalclib/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/scopejsiicalclib_IDoublable.go 1`] = ` -// A simple calcuator library built on JSII. -package scopejsiicalclib +exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/customsubmodulename/Reflector__checks.go.diff 1`] = ` +--- go/scopejsiicalclib/customsubmodulename/Reflector__checks.go --no-runtime-type-checking ++++ go/scopejsiicalclib/customsubmodulename/Reflector__checks.go --runtime-type-checking +@@ -0,0 +1,16 @@ ++//go: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/customsubmodulename/Reflector__no_checks.go.diff 1`] = ` +--- go/scopejsiicalclib/customsubmodulename/Reflector__no_checks.go --no-runtime-type-checking ++++ go/scopejsiicalclib/customsubmodulename/Reflector__no_checks.go --runtime-type-checking +@@ -0,0 +1,10 @@ ++//go: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 "jsii-calc": / 1`] = ` + + ┗━ 📁 go + ┗━ 📁 jsiicalc + ┣━ 📄 AbstractClass.go + ┣━ 📄 AbstractClassBase.go + ┣━ 📄 AbstractClassReturner.go + ┣━ 📄 AbstractSuite.go + ┣━ 📄 Add.go + ┣━ 📄 AllowedMethodNames.go + ┣━ 📄 AllTypes.go + ┣━ 📄 AllTypesEnum.go + ┣━ 📄 AmbiguousParameters.go + ┣━ 📁 anonymous + ┃ ┣━ 📄 IOptionA.go + ┃ ┣━ 📄 IOptionB.go + ┃ ┣━ 📄 main.go + ┃ ┗━ 📄 UseOptions.go + ┣━ 📄 AnonymousImplementationProvider.go + ┣━ 📄 AsyncVirtualMethods.go + ┣━ 📄 AugmentableClass.go + ┣━ 📄 BaseClass.go + ┣━ 📄 BaseJsii976.go + ┣━ 📄 Bell.go + ┣━ 📄 BinaryOperation.go + ┣━ 📄 BurriedAnonymousObject.go + ┣━ 📄 Calculator.go + ┣━ 📄 CalculatorProps.go + ┣━ 📁 cdk16625 + ┃ ┣━ 📄 Cdk16625.go + ┃ ┣━ 📁 donotimport + ┃ ┃ ┣━ 📁 internal + ┃ ┃ ┃ ┗━ 📄 types.go + ┃ ┃ ┣━ 📄 main.go + ┃ ┃ ┗━ 📄 UnimportedSubmoduleType.go + ┃ ┗━ 📄 main.go + ┣━ 📁 cdk22369 + ┃ ┣━ 📄 AcceptsPath.go + ┃ ┣━ 📄 AcceptsPathProps.go + ┃ ┗━ 📄 main.go + ┣━ 📄 ChildStruct982.go + ┣━ 📄 ClassThatImplementsTheInternalInterface.go + ┣━ 📄 ClassThatImplementsThePrivateInterface.go + ┣━ 📄 ClassWithCollectionOfUnions.go + ┣━ 📄 ClassWithCollections.go + ┣━ 📄 ClassWithContainerTypes.go + ┣━ 📄 ClassWithDocs.go + ┣━ 📄 ClassWithJavaReservedWords.go + ┣━ 📄 ClassWithMutableObjectLiteralProperty.go + ┣━ 📄 ClassWithNestedUnion.go + ┣━ 📄 ClassWithPrivateConstructorAndAutomaticProperties.go + ┣━ 📁 composition + ┃ ┣━ 📄 CompositeOperation_CompositionStringStyle.go + ┃ ┣━ 📄 CompositeOperation.go + ┃ ┣━ 📁 internal + ┃ ┃ ┗━ 📄 types.go + ┃ ┗━ 📄 main.go + ┣━ 📄 ConfusingToJackson.go + ┣━ 📄 ConfusingToJacksonStruct.go + ┣━ 📄 ConstructorPassesThisOut.go + ┣━ 📄 Constructors.go + ┣━ 📄 ConsumePureInterface.go + ┣━ 📄 ConsumerCanRingBell.go + ┣━ 📄 ConsumersOfThisCrazyTypeSystem.go + ┣━ 📄 ContainerProps.go + ┣━ 📄 DataRenderer.go + ┣━ 📄 Default.go + ┣━ 📄 DefaultedConstructorArgument.go + ┣━ 📄 Demonstrate982.go + ┣━ 📄 DeprecatedClass.go + ┣━ 📄 DeprecatedEnum.go + ┣━ 📄 DeprecatedStruct.go + ┣━ 📁 derivedclasshasnoproperties + ┃ ┣━ 📄 Base.go + ┃ ┣━ 📄 Derived.go + ┃ ┗━ 📄 main.go + ┣━ 📄 DerivedStruct.go + ┣━ 📄 DiamondBottom.go + ┣━ 📄 DiamondInheritanceBaseLevelStruct.go + ┣━ 📄 DiamondInheritanceFirstMidLevelStruct.go + ┣━ 📄 DiamondInheritanceSecondMidLevelStruct.go + ┣━ 📄 DiamondInheritanceTopLevelStruct.go + ┣━ 📄 DisappointingCollectionSource.go + ┣━ 📄 DocumentedClass.go + ┣━ 📄 DoNotOverridePrivates.go + ┣━ 📄 DoNotRecognizeAnyAsOptional.go + ┣━ 📄 DontComplainAboutVariadicAfterOptional.go + ┣━ 📄 DoubleTrouble.go + ┣━ 📄 DummyObj.go + ┣━ 📄 DynamicPropertyBearer.go + ┣━ 📄 DynamicPropertyBearerChild.go + ┣━ 📄 Entropy.go + ┣━ 📄 EnumDispenser.go + ┣━ 📄 EraseUndefinedHashValues.go + ┣━ 📄 EraseUndefinedHashValuesOptions.go + ┣━ 📄 ExperimentalClass.go + ┣━ 📄 ExperimentalEnum.go + ┣━ 📄 ExperimentalStruct.go + ┣━ 📄 ExportedBaseClass.go + ┣━ 📄 ExtendsInternalInterface.go + ┣━ 📄 ExternalClass.go + ┣━ 📄 ExternalEnum.go + ┣━ 📄 ExternalStruct.go + ┣━ 📄 FullCombo.go + ┣━ 📄 GiveMeStructs.go + ┣━ 📄 go.mod + ┣━ 📄 Greetee.go + ┣━ 📄 GreetingAugmenter.go + ┣━ 📁 homonymousforwardreferences + ┃ ┣━ 📁 bar + ┃ ┃ ┣━ 📄 Consumer.go + ┃ ┃ ┣━ 📄 ConsumerProps.go + ┃ ┃ ┣━ 📄 Homonymous.go + ┃ ┃ ┗━ 📄 main.go + ┃ ┣━ 📁 foo + ┃ ┃ ┣━ 📄 Consumer.go + ┃ ┃ ┣━ 📄 ConsumerProps.go + ┃ ┃ ┣━ 📄 Homonymous.go + ┃ ┃ ┗━ 📄 main.go + ┃ ┗━ 📄 README.md + ┣━ 📄 IAnonymousImplementationProvider.go + ┣━ 📄 IAnonymouslyImplementMe.go + ┣━ 📄 IAnotherPublicInterface.go + ┣━ 📄 IBell.go + ┣━ 📄 IBellRinger.go + ┣━ 📄 IConcreteBellRinger.go + ┣━ 📄 IDeprecatedInterface.go + ┣━ 📄 IExperimentalInterface.go + ┣━ 📄 IExtendsPrivateInterface.go + ┣━ 📄 IExternalInterface.go + ┣━ 📄 IFriendlier.go + ┣━ 📄 IFriendlyRandomGenerator.go + ┣━ 📄 IIndirectlyImplemented.go + ┣━ 📄 IInterfaceImplementedByAbstractClass.go + ┣━ 📄 IInterfaceThatShouldNotBeADataType.go + ┣━ 📄 IInterfaceWithInternal.go + ┣━ 📄 IInterfaceWithMethods.go + ┣━ 📄 IInterfaceWithOptionalMethodArguments.go + ┣━ 📄 IInterfaceWithProperties.go + ┣━ 📄 IInterfaceWithPropertiesExtension.go + ┣━ 📄 IJavaReservedWordsInAnInterface.go + ┣━ 📄 IJSII417Derived.go + ┣━ 📄 IJSII417PublicBaseOfBase.go + ┣━ 📄 IJsii487External.go + ┣━ 📄 IJsii487External2.go + ┣━ 📄 IJsii496.go + ┣━ 📄 Implementation.go + ┣━ 📄 ImplementInternalInterface.go + ┣━ 📄 ImplementsInterfaceWithInternal.go + ┣━ 📄 ImplementsInterfaceWithInternalSubclass.go + ┣━ 📄 ImplementsPrivateInterface.go + ┣━ 📄 ImplictBaseOfBase.go + ┣━ 📄 IMutableObjectLiteral.go + ┣━ 📄 InbetweenClass.go + ┣━ 📄 INonInternalInterface.go + ┣━ 📄 InterfaceCollections.go + ┣━ 📁 interfaceinnamespaceincludesclasses + ┃ ┣━ 📄 Foo.go + ┃ ┣━ 📄 Hello.go + ┃ ┗━ 📄 main.go + ┣━ 📁 interfaceinnamespaceonlyinterface + ┃ ┣━ 📄 Hello.go + ┃ ┗━ 📄 main.go + ┣━ 📄 InterfacesMaker.go + ┣━ 📁 internal + ┃ ┗━ 📄 types.go + ┣━ 📄 IObjectWithProperty.go + ┣━ 📄 IOptionalMethod.go + ┣━ 📄 IPrivatelyImplemented.go + ┣━ 📄 IPublicInterface.go + ┣━ 📄 IPublicInterface2.go + ┣━ 📄 IRandomNumberGenerator.go + ┣━ 📄 IReturnJsii976.go + ┣━ 📄 IReturnsNumber.go + ┣━ 📄 Isomorphism.go + ┣━ 📄 Issue2638.go + ┣━ 📄 Issue2638B.go + ┣━ 📄 IStableInterface.go + ┣━ 📄 IStructReturningDelegate.go + ┣━ 📄 IWallClock.go + ┣━ 📄 JavaReservedWords.go + ┣━ 📁 jsii + ┃ ┣━ 📄 jsii-calc-3.20.120.tgz + ┃ ┗━ 📄 jsii.go + ┣━ 📁 jsii3656 + ┃ ┣━ 📄 ImplementMeOpts.go + ┃ ┣━ 📄 main.go + ┃ ┗━ 📄 OverrideMe.go + ┣━ 📄 JSII417Derived.go + ┣━ 📄 JSII417PublicBaseOfBase.go + ┣━ 📄 Jsii487Derived.go + ┣━ 📄 Jsii496Derived.go + ┣━ 📄 JsiiAgent.go + ┣━ 📄 JSObjectLiteralForInterface.go + ┣━ 📄 JSObjectLiteralToNative.go + ┣━ 📄 JSObjectLiteralToNativeClass.go + ┣━ 📄 JsonFormatter.go + ┣━ 📄 LevelOne_PropBooleanValue.go + ┣━ 📄 LevelOne_PropProperty.go + ┣━ 📄 LevelOne.go + ┣━ 📄 LevelOneProps.go + ┣━ 📄 LICENSE + ┣━ 📄 LoadBalancedFargateServiceProps.go + ┣━ 📄 main.go + ┣━ 📄 MethodNamedProperty.go + ┣━ 📁 module2530 + ┃ ┣━ 📄 main.go + ┃ ┗━ 📄 MyClass.go + ┣━ 📁 module2617 + ┃ ┣━ 📄 main.go + ┃ ┗━ 📄 OnlyStatics.go + ┣━ 📁 module2647 + ┃ ┣━ 📄 ExtendAndImplement.go + ┃ ┣━ 📁 internal + ┃ ┃ ┗━ 📄 types.go + ┃ ┗━ 📄 main.go + ┣━ 📁 module2689 + ┃ ┣━ 📁 methods + ┃ ┃ ┣━ 📄 main.go + ┃ ┃ ┗━ 📄 MyClass.go + ┃ ┣━ 📁 props + ┃ ┃ ┣━ 📄 main.go + ┃ ┃ ┗━ 📄 MyClass.go + ┃ ┣━ 📁 retval + ┃ ┃ ┣━ 📄 main.go + ┃ ┃ ┗━ 📄 MyClass.go + ┃ ┗━ 📁 structs + ┃ ┣━ 📄 main.go + ┃ ┗━ 📄 MyStruct.go + ┣━ 📁 module2692 + ┃ ┣━ 📁 submodule1 + ┃ ┃ ┣━ 📄 Bar.go + ┃ ┃ ┗━ 📄 main.go + ┃ ┗━ 📁 submodule2 + ┃ ┣━ 📄 Bar.go + ┃ ┣━ 📄 Foo.go + ┃ ┗━ 📄 main.go + ┣━ 📁 module2700 + ┃ ┣━ 📄 Base.go + ┃ ┣━ 📄 Derived.go + ┃ ┣━ 📄 IFoo.go + ┃ ┗━ 📄 main.go + ┣━ 📁 module2702 + ┃ ┣━ 📄 Baz.go + ┃ ┣━ 📄 Class1.go + ┃ ┣━ 📄 Class2.go + ┃ ┣━ 📄 Class3.go + ┃ ┣━ 📄 Construct.go + ┃ ┣━ 📄 IBaz.go + ┃ ┣━ 📄 IConstruct.go + ┃ ┣━ 📄 IFoo.go + ┃ ┣━ 📁 internal + ┃ ┃ ┗━ 📄 types.go + ┃ ┣━ 📄 IResource.go + ┃ ┣━ 📄 IVpc.go + ┃ ┣━ 📄 main.go + ┃ ┣━ 📄 Resource.go + ┃ ┗━ 📄 Vpc.go + ┣━ 📄 Multiply.go + ┣━ 📄 Negate.go + ┣━ 📄 NestedClassInstance.go + ┣━ 📄 NestedStruct.go + ┣━ 📄 NodeStandardLibrary.go + ┣━ 📁 nodirect + ┃ ┣━ 📁 sub1 + ┃ ┃ ┣━ 📄 main.go + ┃ ┃ ┗━ 📄 TypeFromSub1.go + ┃ ┗━ 📁 sub2 + ┃ ┣━ 📄 main.go + ┃ ┗━ 📄 TypeFromSub2.go + ┣━ 📄 NOTICE + ┣━ 📄 NullShouldBeTreatedAsUndefined.go + ┣━ 📄 NullShouldBeTreatedAsUndefinedData.go + ┣━ 📄 NumberGenerator.go + ┣━ 📄 ObjectRefsInCollections.go + ┣━ 📄 ObjectWithPropertyProvider.go + ┣━ 📄 Old.go + ┣━ 📁 onlystatic + ┃ ┣━ 📄 main.go + ┃ ┗━ 📄 OnlyStaticMethods.go + ┣━ 📄 OptionalArgumentInvoker.go + ┣━ 📄 OptionalConstructorArgument.go + ┣━ 📄 OptionalStruct.go + ┣━ 📄 OptionalStructConsumer.go + ┣━ 📄 OverridableProtectedMember.go + ┣━ 📄 OverrideReturnsObject.go + ┣━ 📄 ParamShadowsBuiltins.go + ┣━ 📄 ParamShadowsBuiltinsProps.go + ┣━ 📄 ParamShadowsScope.go + ┣━ 📄 ParentStruct982.go + ┣━ 📄 PartiallyInitializedThisConsumer.go + ┣━ 📄 Polymorphism.go + ┣━ 📄 Power.go + ┣━ 📄 PromiseNothing.go + ┣━ 📄 PropertyNamedProperty.go + ┣━ 📄 PublicClass.go + ┣━ 📄 PythonReservedWords.go + ┣━ 📁 pythonself + ┃ ┣━ 📄 ClassWithSelf.go + ┃ ┣━ 📄 ClassWithSelfKwarg.go + ┃ ┣━ 📄 IInterfaceWithSelf.go + ┃ ┣━ 📄 main.go + ┃ ┗━ 📄 StructWithSelf.go + ┣━ 📄 README.md + ┣━ 📄 ReferenceEnumFromScopedPackage.go + ┣━ 📄 ReturnsPrivateImplementationOfInterface.go + ┣━ 📄 RootStruct.go + ┣━ 📄 RootStructValidator.go + ┣━ 📄 RuntimeTypeChecking.go + ┣━ 📄 SecondLevelStruct.go + ┣━ 📄 SingleInstanceTwoTypes.go + ┣━ 📄 SingletonInt.go + ┣━ 📄 SingletonIntEnum.go + ┣━ 📄 SingletonString.go + ┣━ 📄 SingletonStringEnum.go + ┣━ 📄 SmellyStruct.go + ┣━ 📄 SomeTypeJsii976.go + ┣━ 📄 StableClass.go + ┣━ 📄 StableEnum.go + ┣━ 📄 StableStruct.go + ┣━ 📄 StaticContext.go + ┣━ 📄 StaticHelloChild.go + ┣━ 📄 StaticHelloParent.go + ┣━ 📄 Statics.go + ┣━ 📄 StringEnum.go + ┣━ 📄 StripInternal.go + ┣━ 📄 StructA.go + ┣━ 📄 StructB.go + ┣━ 📄 StructParameterType.go + ┣━ 📄 StructPassing.go + ┣━ 📄 StructUnionConsumer.go + ┣━ 📄 StructWithCollectionOfUnionts.go + ┣━ 📄 StructWithEnum.go + ┣━ 📄 StructWithJavaReservedWords.go + ┣━ 📁 submodule + ┃ ┣━ 📁 backreferences + ┃ ┃ ┣━ 📄 main.go + ┃ ┃ ┗━ 📄 MyClassReference.go + ┃ ┣━ 📁 child + ┃ ┃ ┣━ 📄 Awesomeness.go + ┃ ┃ ┣━ 📄 Goodness.go + ┃ ┃ ┣━ 📄 InnerClass.go + ┃ ┃ ┣━ 📄 KwargsProps.go + ┃ ┃ ┣━ 📄 main.go + ┃ ┃ ┣━ 📄 OuterClass.go + ┃ ┃ ┣━ 📄 SomeEnum.go + ┃ ┃ ┣━ 📄 SomeStruct.go + ┃ ┃ ┗━ 📄 Structure.go + ┃ ┣━ 📄 Default.go + ┃ ┣━ 📁 internal + ┃ ┃ ┗━ 📄 types.go + ┃ ┣━ 📁 isolated + ┃ ┃ ┣━ 📄 Kwargs.go + ┃ ┃ ┣━ 📄 main.go + ┃ ┃ ┗━ 📄 README.md + ┃ ┣━ 📄 main.go + ┃ ┣━ 📄 MyClass.go + ┃ ┣━ 📁 nestedsubmodule + ┃ ┃ ┣━ 📁 deeplynested + ┃ ┃ ┃ ┣━ 📄 INamespaced.go + ┃ ┃ ┃ ┗━ 📄 main.go + ┃ ┃ ┣━ 📁 internal + ┃ ┃ ┃ ┗━ 📄 types.go + ┃ ┃ ┣━ 📄 main.go + ┃ ┃ ┗━ 📄 Namespaced.go + ┃ ┣━ 📁 param + ┃ ┃ ┣━ 📄 main.go + ┃ ┃ ┗━ 📄 SpecialParameter.go + ┃ ┣━ 📄 README.md + ┃ ┗━ 📁 returnsparam + ┃ ┣━ 📄 main.go + ┃ ┗━ 📄 ReturnsSpecialParameter.go + ┣━ 📄 Sum.go + ┣━ 📄 SupportsNiceJavaBuilder.go + ┣━ 📄 SupportsNiceJavaBuilderProps.go + ┣━ 📄 SupportsNiceJavaBuilderWithRequiredProps.go + ┣━ 📄 SyncVirtualMethods.go + ┣━ 📄 TestStructWithEnum.go + ┣━ 📄 Thrower.go + ┣━ 📄 TopLevelStruct.go + ┣━ 📄 TwoMethodsWithSimilarCapitalization.go + ┣━ 📄 UmaskCheck.go + ┣━ 📄 UnaryOperation.go + ┣━ 📁 union + ┃ ┣━ 📄 ConsumesUnion.go + ┃ ┣━ 📄 IResolvable.go + ┃ ┣━ 📄 main.go + ┃ ┗━ 📄 Resolvable.go + ┣━ 📄 UnionProperties.go + ┣━ 📄 UpcasingReflectable.go + ┣━ 📄 UseBundledDependency.go + ┣━ 📄 UseCalcBase.go + ┣━ 📄 UsesInterfaceWithProperties.go + ┣━ 📄 VariadicInvoker.go + ┣━ 📄 VariadicMethod.go + ┣━ 📄 VariadicTypeUnion.go + ┣━ 📄 version + ┣━ 📄 VirtualMethodPlayground.go + ┣━ 📄 VoidCallback.go + ┗━ 📄 WithPrivatePropertyInConstructor.go +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/AbstractClass.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// The general contract for a concrete number. -// Deprecated. -type IDoublable interface { - // Deprecated. - DoubleValue() *float64 +type AbstractClass interface { + AbstractClassBase + IInterfaceImplementedByAbstractClass + AbstractProperty() *string + PropFromInterface() *string + AbstractMethod(name *string) *string + NonAbstractMethod() *float64 } -// The jsii proxy for IDoublable -type jsiiProxy_IDoublable struct { - _ byte // padding +// The jsii proxy struct for AbstractClass +type jsiiProxy_AbstractClass struct { + jsiiProxy_AbstractClassBase + jsiiProxy_IInterfaceImplementedByAbstractClass } -func (j *jsiiProxy_IDoublable) DoubleValue() *float64 { - var returns *float64 +func (j *jsiiProxy_AbstractClass) AbstractProperty() *string { + var returns *string _jsii_.Get( j, - "doubleValue", + "abstractProperty", &returns, ) return returns } +func (j *jsiiProxy_AbstractClass) PropFromInterface() *string { + var returns *string + _jsii_.Get( + j, + "propFromInterface", + &returns, + ) + return returns +} -`; - -exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/scopejsiicalclib_IFriendly.go 1`] = ` -// A simple calcuator library built on JSII. -package scopejsiicalclib -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) +func NewAbstractClass_Override(a AbstractClass) { + _init_.Initialize() -// Applies to classes that are considered friendly. -// -// These classes can be greeted with -// a "hello" or "goodbye" blessing and they will respond back in a fun and friendly manner. -// Deprecated. -type IFriendly interface { - // Say hello! - // Deprecated. - Hello() *string + _jsii_.Create( + "jsii-calc.AbstractClass", + nil, // no parameters + a, + ) } -// The jsii proxy for IFriendly -type jsiiProxy_IFriendly struct { - _ byte // padding +func (a *jsiiProxy_AbstractClass) AbstractMethod(name *string) *string { + var returns *string + + _jsii_.Invoke( + a, + "abstractMethod", + []interface{}{name}, + &returns, + ) + + return returns } -func (i *jsiiProxy_IFriendly) Hello() *string { - var returns *string +func (a *jsiiProxy_AbstractClass) NonAbstractMethod() *float64 { + var returns *float64 _jsii_.Invoke( - i, - "hello", + a, + "nonAbstractMethod", nil, // no parameters &returns, ) @@ -1950,154 +3015,109 @@ func (i *jsiiProxy_IFriendly) Hello() *string { `; -exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/scopejsiicalclib_IThreeLevelsInterface.go 1`] = ` -// A simple calcuator library built on JSII. -package scopejsiicalclib +exports[`Generated code for "jsii-calc": /go/jsiicalc/AbstractClassBase.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" - - "github.com/aws/jsii/jsii-calc/go/jcb" - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib/internal" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// Interface that inherits from packages 2 levels up the tree. -// -// Their presence validates that .NET/Java/jsii-reflect can track all fields -// far enough up the tree. -// Deprecated. -type IThreeLevelsInterface interface { - jcb.IBaseInterface - // Deprecated. - Baz() +type AbstractClassBase interface { + AbstractProperty() *string } -// The jsii proxy for IThreeLevelsInterface -type jsiiProxy_IThreeLevelsInterface struct { - internal.Type__jcbIBaseInterface +// The jsii proxy struct for AbstractClassBase +type jsiiProxy_AbstractClassBase struct { + _ byte // padding } -func (i *jsiiProxy_IThreeLevelsInterface) Baz() { - _jsii_.InvokeVoid( - i, - "baz", - nil, // no parameters +func (j *jsiiProxy_AbstractClassBase) AbstractProperty() *string { + var returns *string + _jsii_.Get( + j, + "abstractProperty", + &returns, ) + return returns } -`; - -exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/scopejsiicalclib_MyFirstStruct.go 1`] = ` -// A simple calcuator library built on JSII. -package scopejsiicalclib - +func NewAbstractClassBase_Override(a AbstractClassBase) { + _init_.Initialize() -// This is the first struct we have created in jsii. -// Deprecated. -type MyFirstStruct struct { - // An awesome number value. - // Deprecated. - Anumber *float64 \`field:"required" json:"anumber" yaml:"anumber"\` - // A string value. - // Deprecated. - Astring *string \`field:"required" json:"astring" yaml:"astring"\` - // Deprecated. - FirstOptional *[]*string \`field:"optional" json:"firstOptional" yaml:"firstOptional"\` + _jsii_.Create( + "jsii-calc.AbstractClassBase", + nil, // no parameters + a, + ) } `; -exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/scopejsiicalclib_Number.go 1`] = ` -// A simple calcuator library built on JSII. -package scopejsiicalclib +exports[`Generated code for "jsii-calc": /go/jsiicalc/AbstractClassReturner.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib/jsii" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// Represents a concrete number. -// Deprecated. -type Number interface { - NumericValue - IDoublable - // The number multiplied by 2. - // Deprecated. - DoubleValue() *float64 - // The number. - // Deprecated. - Value() *float64 - // String representation of the value. - // Deprecated. - ToString() *string - // Returns: the name of the class (to verify native type names are created for derived classes). - // Deprecated. - TypeName() interface{} -} - -// The jsii proxy struct for Number -type jsiiProxy_Number struct { - jsiiProxy_NumericValue - jsiiProxy_IDoublable +type AbstractClassReturner interface { + ReturnAbstractFromProperty() AbstractClassBase + GiveMeAbstract() AbstractClass + GiveMeInterface() IInterfaceImplementedByAbstractClass } -func (j *jsiiProxy_Number) DoubleValue() *float64 { - var returns *float64 - _jsii_.Get( - j, - "doubleValue", - &returns, - ) - return returns +// The jsii proxy struct for AbstractClassReturner +type jsiiProxy_AbstractClassReturner struct { + _ byte // padding } -func (j *jsiiProxy_Number) Value() *float64 { - var returns *float64 +func (j *jsiiProxy_AbstractClassReturner) ReturnAbstractFromProperty() AbstractClassBase { + var returns AbstractClassBase _jsii_.Get( j, - "value", + "returnAbstractFromProperty", &returns, ) return returns } -// Creates a Number object. -// Deprecated. -func NewNumber(value *float64) Number { +func NewAbstractClassReturner() AbstractClassReturner { _init_.Initialize() - j := jsiiProxy_Number{} + j := jsiiProxy_AbstractClassReturner{} _jsii_.Create( - "@scope/jsii-calc-lib.Number", - []interface{}{value}, + "jsii-calc.AbstractClassReturner", + nil, // no parameters &j, ) return &j } -// Creates a Number object. -// Deprecated. -func NewNumber_Override(n Number, value *float64) { +func NewAbstractClassReturner_Override(a AbstractClassReturner) { _init_.Initialize() _jsii_.Create( - "@scope/jsii-calc-lib.Number", - []interface{}{value}, - n, + "jsii-calc.AbstractClassReturner", + nil, // no parameters + a, ) } -func (n *jsiiProxy_Number) ToString() *string { - var returns *string +func (a *jsiiProxy_AbstractClassReturner) GiveMeAbstract() AbstractClass { + var returns AbstractClass _jsii_.Invoke( - n, - "toString", + a, + "giveMeAbstract", nil, // no parameters &returns, ) @@ -2105,12 +3125,12 @@ func (n *jsiiProxy_Number) ToString() *string { return returns } -func (n *jsiiProxy_Number) TypeName() interface{} { - var returns interface{} +func (a *jsiiProxy_AbstractClassReturner) GiveMeInterface() IInterfaceImplementedByAbstractClass { + var returns IInterfaceImplementedByAbstractClass _jsii_.Invoke( - n, - "typeName", + a, + "giveMeInterface", nil, // no parameters &returns, ) @@ -2121,80 +3141,78 @@ func (n *jsiiProxy_Number) TypeName() interface{} { `; -exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/scopejsiicalclib_NumericValue.go 1`] = ` -// A simple calcuator library built on JSII. -package scopejsiicalclib +exports[`Generated code for "jsii-calc": /go/jsiicalc/AbstractSuite.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib/jsii" - - "github.com/aws/jsii/jsii-calc/go/jcb" - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib/internal" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// Abstract class which represents a numeric value. -// Deprecated. -type NumericValue interface { - jcb.Base - // The value. - // Deprecated. - Value() *float64 - // String representation of the value. - // Deprecated. - ToString() *string - // Returns: the name of the class (to verify native type names are created for derived classes). - // Deprecated. - TypeName() interface{} +// Ensures abstract members implementations correctly register overrides in various languages. +type AbstractSuite interface { + Property() *string + SetProperty(val *string) + SomeMethod(str *string) *string + // Sets \`seed\` to \`this.property\`, then calls \`someMethod\` with \`this.property\` and returns the result. + WorkItAll(seed *string) *string } -// The jsii proxy struct for NumericValue -type jsiiProxy_NumericValue struct { - internal.Type__jcbBase +// The jsii proxy struct for AbstractSuite +type jsiiProxy_AbstractSuite struct { + _ byte // padding } -func (j *jsiiProxy_NumericValue) Value() *float64 { - var returns *float64 +func (j *jsiiProxy_AbstractSuite) Property() *string { + var returns *string _jsii_.Get( j, - "value", + "property", &returns, ) return returns } -// Deprecated. -func NewNumericValue_Override(n NumericValue) { +func NewAbstractSuite_Override(a AbstractSuite) { _init_.Initialize() _jsii_.Create( - "@scope/jsii-calc-lib.NumericValue", + "jsii-calc.AbstractSuite", nil, // no parameters - n, + a, ) } -func (n *jsiiProxy_NumericValue) ToString() *string { +func (j *jsiiProxy_AbstractSuite)SetProperty(val *string) { + _jsii_.Set( + j, + "property", + val, + ) +} + +func (a *jsiiProxy_AbstractSuite) SomeMethod(str *string) *string { var returns *string _jsii_.Invoke( - n, - "toString", - nil, // no parameters + a, + "someMethod", + []interface{}{str}, &returns, ) return returns } -func (n *jsiiProxy_NumericValue) TypeName() interface{} { - var returns interface{} +func (a *jsiiProxy_AbstractSuite) WorkItAll(seed *string) *string { + var returns *string _jsii_.Invoke( - n, - "typeName", - nil, // no parameters + a, + "workItAll", + []interface{}{seed}, &returns, ) @@ -2204,36 +3222,60 @@ func (n *jsiiProxy_NumericValue) TypeName() interface{} { `; -exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/scopejsiicalclib_Operation.go 1`] = ` -// A simple calcuator library built on JSII. -package scopejsiicalclib +exports[`Generated code for "jsii-calc": /go/jsiicalc/Add.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib/jsii" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" + + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ) -// Represents an operation on values. -// Deprecated. -type Operation interface { - NumericValue +// The "+" binary operation. +type Add interface { + BinaryOperation + // Left-hand side operand. + Lhs() scopejsiicalclib.NumericValue + // Right-hand side operand. + Rhs() scopejsiicalclib.NumericValue // The value. - // Deprecated. Value() *float64 + // Say hello! + Hello() *string // String representation of the value. - // Deprecated. ToString() *string // Returns: the name of the class (to verify native type names are created for derived classes). - // Deprecated. TypeName() interface{} } -// The jsii proxy struct for Operation -type jsiiProxy_Operation struct { - jsiiProxy_NumericValue +// The jsii proxy struct for Add +type jsiiProxy_Add struct { + jsiiProxy_BinaryOperation } -func (j *jsiiProxy_Operation) Value() *float64 { +func (j *jsiiProxy_Add) Lhs() scopejsiicalclib.NumericValue { + var returns scopejsiicalclib.NumericValue + _jsii_.Get( + j, + "lhs", + &returns, + ) + return returns +} + +func (j *jsiiProxy_Add) Rhs() scopejsiicalclib.NumericValue { + var returns scopejsiicalclib.NumericValue + _jsii_.Get( + j, + "rhs", + &returns, + ) + return returns +} + +func (j *jsiiProxy_Add) Value() *float64 { var returns *float64 _jsii_.Get( j, @@ -2244,22 +3286,50 @@ func (j *jsiiProxy_Operation) Value() *float64 { } -// Deprecated. -func NewOperation_Override(o Operation) { +// Creates a BinaryOperation. +func NewAdd(lhs scopejsiicalclib.NumericValue, rhs scopejsiicalclib.NumericValue) Add { _init_.Initialize() + j := jsiiProxy_Add{} + _jsii_.Create( - "@scope/jsii-calc-lib.Operation", + "jsii-calc.Add", + []interface{}{lhs, rhs}, + &j, + ) + + return &j +} + +// Creates a BinaryOperation. +func NewAdd_Override(a Add, lhs scopejsiicalclib.NumericValue, rhs scopejsiicalclib.NumericValue) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.Add", + []interface{}{lhs, rhs}, + a, + ) +} + +func (a *jsiiProxy_Add) Hello() *string { + var returns *string + + _jsii_.Invoke( + a, + "hello", nil, // no parameters - o, + &returns, ) + + return returns } -func (o *jsiiProxy_Operation) ToString() *string { +func (a *jsiiProxy_Add) ToString() *string { var returns *string _jsii_.Invoke( - o, + a, "toString", nil, // no parameters &returns, @@ -2268,11 +3338,11 @@ func (o *jsiiProxy_Operation) ToString() *string { return returns } -func (o *jsiiProxy_Operation) TypeName() interface{} { +func (a *jsiiProxy_Add) TypeName() interface{} { var returns interface{} _jsii_.Invoke( - o, + a, "typeName", nil, // no parameters &returns, @@ -2284,1230 +3354,769 @@ func (o *jsiiProxy_Operation) TypeName() interface{} { `; -exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/scopejsiicalclib_StructWithOnlyOptionals.go 1`] = ` -// A simple calcuator library built on JSII. -package scopejsiicalclib +exports[`Generated code for "jsii-calc": /go/jsiicalc/AllTypes.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc +import ( + "time" -// This is a struct with only optional properties. -// Deprecated. -type StructWithOnlyOptionals struct { - // The first optional! - // Deprecated. - Optional1 *string \`field:"optional" json:"optional1" yaml:"optional1"\` - // Deprecated. - Optional2 *float64 \`field:"optional" json:"optional2" yaml:"optional2"\` - // Deprecated. - Optional3 *bool \`field:"optional" json:"optional3" yaml:"optional3"\` + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" + + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" +) + +// This class includes property for all types supported by jsii. +// +// The setters will validate +// that the value set is of the expected type and throw otherwise. +type AllTypes interface { + AnyArrayProperty() *[]interface{} + SetAnyArrayProperty(val *[]interface{}) + AnyMapProperty() *map[string]interface{} + SetAnyMapProperty(val *map[string]interface{}) + AnyProperty() interface{} + SetAnyProperty(val interface{}) + ArrayProperty() *[]*string + SetArrayProperty(val *[]*string) + BooleanProperty() *bool + SetBooleanProperty(val *bool) + DateProperty() *time.Time + SetDateProperty(val *time.Time) + EnumProperty() AllTypesEnum + SetEnumProperty(val AllTypesEnum) + EnumPropertyValue() *float64 + JsonProperty() *map[string]interface{} + SetJsonProperty(val *map[string]interface{}) + MapProperty() *map[string]scopejsiicalclib.Number + SetMapProperty(val *map[string]scopejsiicalclib.Number) + NumberProperty() *float64 + SetNumberProperty(val *float64) + OptionalEnumValue() StringEnum + SetOptionalEnumValue(val StringEnum) + StringProperty() *string + SetStringProperty(val *string) + UnionArrayProperty() *[]interface{} + SetUnionArrayProperty(val *[]interface{}) + UnionMapProperty() *map[string]interface{} + SetUnionMapProperty(val *map[string]interface{}) + UnionProperty() interface{} + SetUnionProperty(val interface{}) + UnknownArrayProperty() *[]interface{} + SetUnknownArrayProperty(val *[]interface{}) + UnknownMapProperty() *map[string]interface{} + SetUnknownMapProperty(val *map[string]interface{}) + UnknownProperty() interface{} + SetUnknownProperty(val interface{}) + AnyIn(inp interface{}) + AnyOut() interface{} + EnumMethod(value StringEnum) StringEnum } +// The jsii proxy struct for AllTypes +type jsiiProxy_AllTypes struct { + _ byte // padding +} -`; +func (j *jsiiProxy_AllTypes) AnyArrayProperty() *[]interface{} { + var returns *[]interface{} + _jsii_.Get( + j, + "anyArrayProperty", + &returns, + ) + return returns +} -exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib/version 1`] = ` -0.0.0-devpreview +func (j *jsiiProxy_AllTypes) AnyMapProperty() *map[string]interface{} { + var returns *map[string]interface{} + _jsii_.Get( + j, + "anyMapProperty", + &returns, + ) + return returns +} -`; +func (j *jsiiProxy_AllTypes) AnyProperty() interface{} { + var returns interface{} + _jsii_.Get( + j, + "anyProperty", + &returns, + ) + return returns +} -exports[`Generated code for "@scope/jsii-calc-lib": / 1`] = ` - - ┗━ 📁 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", -`; +func (j *jsiiProxy_AllTypes) ArrayProperty() *[]*string { + var returns *[]*string + _jsii_.Get( + j, + "arrayProperty", + &returns, + ) + return returns +} -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,10 @@ -+//go: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 -+} -+ -`; +func (j *jsiiProxy_AllTypes) BooleanProperty() *bool { + var returns *bool + _jsii_.Get( + j, + "booleanProperty", + &returns, + ) + return returns +} -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,16 @@ -+//go: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 -+} -+ -`; +func (j *jsiiProxy_AllTypes) DateProperty() *time.Time { + var returns *time.Time + _jsii_.Get( + j, + "dateProperty", + &returns, + ) + return returns +} -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}, - ) -`; +func (j *jsiiProxy_AllTypes) EnumProperty() AllTypesEnum { + var returns AllTypesEnum + _jsii_.Get( + j, + "enumProperty", + &returns, + ) + return returns +} -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,15 @@ -+//go: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 -+} -+ -`; +func (j *jsiiProxy_AllTypes) EnumPropertyValue() *float64 { + var returns *float64 + _jsii_.Get( + j, + "enumPropertyValue", + &returns, + ) + return returns +} -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,28 @@ -+//go: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 -+} -+ -`; +func (j *jsiiProxy_AllTypes) JsonProperty() *map[string]interface{} { + var returns *map[string]interface{} + _jsii_.Get( + j, + "jsonProperty", + &returns, + ) + return returns +} -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}, -`; +func (j *jsiiProxy_AllTypes) MapProperty() *map[string]scopejsiicalclib.Number { + var returns *map[string]scopejsiicalclib.Number + _jsii_.Get( + j, + "mapProperty", + &returns, + ) + return returns +} -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,11 @@ -+//go: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 -+} -+ -`; +func (j *jsiiProxy_AllTypes) NumberProperty() *float64 { + var returns *float64 + _jsii_.Get( + j, + "numberProperty", + &returns, + ) + return returns +} -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,17 @@ -+//go: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 -+} -+ -`; +func (j *jsiiProxy_AllTypes) OptionalEnumValue() StringEnum { + var returns StringEnum + _jsii_.Get( + j, + "optionalEnumValue", + &returns, + ) + return returns +} -exports[`Generated code for "jsii-calc": / 1`] = ` - - ┗━ 📁 go - ┗━ 📁 jsiicalc - ┣━ 📁 anonymous - ┃ ┣━ 📄 anonymous_IOptionA.go - ┃ ┣━ 📄 anonymous_IOptionB.go - ┃ ┣━ 📄 anonymous_UseOptions.go - ┃ ┗━ 📄 anonymous.go - ┣━ 📁 cdk16625 - ┃ ┣━ 📄 cdk16625_Cdk16625.go - ┃ ┣━ 📄 cdk16625.go - ┃ ┗━ 📁 donotimport - ┃ ┣━ 📄 donotimport_UnimportedSubmoduleType.go - ┃ ┣━ 📄 donotimport.go - ┃ ┗━ 📁 internal - ┃ ┗━ 📄 types.go - ┣━ 📁 cdk22369 - ┃ ┣━ 📄 cdk22369_AcceptsPath.go - ┃ ┣━ 📄 cdk22369_AcceptsPathProps.go - ┃ ┗━ 📄 cdk22369.go - ┣━ 📁 composition - ┃ ┣━ 📄 composition_CompositeOperation_CompositionStringStyle.go - ┃ ┣━ 📄 composition_CompositeOperation.go - ┃ ┣━ 📄 composition.go - ┃ ┗━ 📁 internal - ┃ ┗━ 📄 types.go - ┣━ 📁 derivedclasshasnoproperties - ┃ ┣━ 📄 derivedclasshasnoproperties_Base.go - ┃ ┣━ 📄 derivedclasshasnoproperties_Derived.go - ┃ ┗━ 📄 derivedclasshasnoproperties.go - ┣━ 📄 go.mod - ┣━ 📁 homonymousforwardreferences - ┃ ┣━ 📁 bar - ┃ ┃ ┣━ 📄 bar_Consumer.go - ┃ ┃ ┣━ 📄 bar_ConsumerProps.go - ┃ ┃ ┣━ 📄 bar_Homonymous.go - ┃ ┃ ┗━ 📄 bar.go - ┃ ┣━ 📁 foo - ┃ ┃ ┣━ 📄 foo_Consumer.go - ┃ ┃ ┣━ 📄 foo_ConsumerProps.go - ┃ ┃ ┣━ 📄 foo_Homonymous.go - ┃ ┃ ┗━ 📄 foo.go - ┃ ┗━ 📄 README.md - ┣━ 📁 interfaceinnamespaceincludesclasses - ┃ ┣━ 📄 interfaceinnamespaceincludesclasses_Foo.go - ┃ ┣━ 📄 interfaceinnamespaceincludesclasses_Hello.go - ┃ ┗━ 📄 interfaceinnamespaceincludesclasses.go - ┣━ 📁 interfaceinnamespaceonlyinterface - ┃ ┣━ 📄 interfaceinnamespaceonlyinterface_Hello.go - ┃ ┗━ 📄 interfaceinnamespaceonlyinterface.go - ┣━ 📁 internal - ┃ ┗━ 📄 types.go - ┣━ 📁 jsii - ┃ ┣━ 📄 jsii-calc-3.20.120.tgz - ┃ ┗━ 📄 jsii.go - ┣━ 📁 jsii3656 - ┃ ┣━ 📄 jsii3656_ImplementMeOpts.go - ┃ ┣━ 📄 jsii3656_OverrideMe.go - ┃ ┗━ 📄 jsii3656.go - ┣━ 📄 jsiicalc_AbstractClass.go - ┣━ 📄 jsiicalc_AbstractClassBase.go - ┣━ 📄 jsiicalc_AbstractClassReturner.go - ┣━ 📄 jsiicalc_AbstractSuite.go - ┣━ 📄 jsiicalc_Add.go - ┣━ 📄 jsiicalc_AllowedMethodNames.go - ┣━ 📄 jsiicalc_AllTypes.go - ┣━ 📄 jsiicalc_AllTypesEnum.go - ┣━ 📄 jsiicalc_AmbiguousParameters.go - ┣━ 📄 jsiicalc_AnonymousImplementationProvider.go - ┣━ 📄 jsiicalc_AsyncVirtualMethods.go - ┣━ 📄 jsiicalc_AugmentableClass.go - ┣━ 📄 jsiicalc_BaseClass.go - ┣━ 📄 jsiicalc_BaseJsii976.go - ┣━ 📄 jsiicalc_Bell.go - ┣━ 📄 jsiicalc_BinaryOperation.go - ┣━ 📄 jsiicalc_BurriedAnonymousObject.go - ┣━ 📄 jsiicalc_Calculator.go - ┣━ 📄 jsiicalc_CalculatorProps.go - ┣━ 📄 jsiicalc_ChildStruct982.go - ┣━ 📄 jsiicalc_ClassThatImplementsTheInternalInterface.go - ┣━ 📄 jsiicalc_ClassThatImplementsThePrivateInterface.go - ┣━ 📄 jsiicalc_ClassWithCollectionOfUnions.go - ┣━ 📄 jsiicalc_ClassWithCollections.go - ┣━ 📄 jsiicalc_ClassWithContainerTypes.go - ┣━ 📄 jsiicalc_ClassWithDocs.go - ┣━ 📄 jsiicalc_ClassWithJavaReservedWords.go - ┣━ 📄 jsiicalc_ClassWithMutableObjectLiteralProperty.go - ┣━ 📄 jsiicalc_ClassWithNestedUnion.go - ┣━ 📄 jsiicalc_ClassWithPrivateConstructorAndAutomaticProperties.go - ┣━ 📄 jsiicalc_ConfusingToJackson.go - ┣━ 📄 jsiicalc_ConfusingToJacksonStruct.go - ┣━ 📄 jsiicalc_ConstructorPassesThisOut.go - ┣━ 📄 jsiicalc_Constructors.go - ┣━ 📄 jsiicalc_ConsumePureInterface.go - ┣━ 📄 jsiicalc_ConsumerCanRingBell.go - ┣━ 📄 jsiicalc_ConsumersOfThisCrazyTypeSystem.go - ┣━ 📄 jsiicalc_ContainerProps.go - ┣━ 📄 jsiicalc_DataRenderer.go - ┣━ 📄 jsiicalc_Default.go - ┣━ 📄 jsiicalc_DefaultedConstructorArgument.go - ┣━ 📄 jsiicalc_Demonstrate982.go - ┣━ 📄 jsiicalc_DeprecatedClass.go - ┣━ 📄 jsiicalc_DeprecatedEnum.go - ┣━ 📄 jsiicalc_DeprecatedStruct.go - ┣━ 📄 jsiicalc_DerivedStruct.go - ┣━ 📄 jsiicalc_DiamondBottom.go - ┣━ 📄 jsiicalc_DiamondInheritanceBaseLevelStruct.go - ┣━ 📄 jsiicalc_DiamondInheritanceFirstMidLevelStruct.go - ┣━ 📄 jsiicalc_DiamondInheritanceSecondMidLevelStruct.go - ┣━ 📄 jsiicalc_DiamondInheritanceTopLevelStruct.go - ┣━ 📄 jsiicalc_DisappointingCollectionSource.go - ┣━ 📄 jsiicalc_DocumentedClass.go - ┣━ 📄 jsiicalc_DoNotOverridePrivates.go - ┣━ 📄 jsiicalc_DoNotRecognizeAnyAsOptional.go - ┣━ 📄 jsiicalc_DontComplainAboutVariadicAfterOptional.go - ┣━ 📄 jsiicalc_DoubleTrouble.go - ┣━ 📄 jsiicalc_DummyObj.go - ┣━ 📄 jsiicalc_DynamicPropertyBearer.go - ┣━ 📄 jsiicalc_DynamicPropertyBearerChild.go - ┣━ 📄 jsiicalc_Entropy.go - ┣━ 📄 jsiicalc_EnumDispenser.go - ┣━ 📄 jsiicalc_EraseUndefinedHashValues.go - ┣━ 📄 jsiicalc_EraseUndefinedHashValuesOptions.go - ┣━ 📄 jsiicalc_ExperimentalClass.go - ┣━ 📄 jsiicalc_ExperimentalEnum.go - ┣━ 📄 jsiicalc_ExperimentalStruct.go - ┣━ 📄 jsiicalc_ExportedBaseClass.go - ┣━ 📄 jsiicalc_ExtendsInternalInterface.go - ┣━ 📄 jsiicalc_ExternalClass.go - ┣━ 📄 jsiicalc_ExternalEnum.go - ┣━ 📄 jsiicalc_ExternalStruct.go - ┣━ 📄 jsiicalc_FullCombo.go - ┣━ 📄 jsiicalc_GiveMeStructs.go - ┣━ 📄 jsiicalc_Greetee.go - ┣━ 📄 jsiicalc_GreetingAugmenter.go - ┣━ 📄 jsiicalc_IAnonymousImplementationProvider.go - ┣━ 📄 jsiicalc_IAnonymouslyImplementMe.go - ┣━ 📄 jsiicalc_IAnotherPublicInterface.go - ┣━ 📄 jsiicalc_IBell.go - ┣━ 📄 jsiicalc_IBellRinger.go - ┣━ 📄 jsiicalc_IConcreteBellRinger.go - ┣━ 📄 jsiicalc_IDeprecatedInterface.go - ┣━ 📄 jsiicalc_IExperimentalInterface.go - ┣━ 📄 jsiicalc_IExtendsPrivateInterface.go - ┣━ 📄 jsiicalc_IExternalInterface.go - ┣━ 📄 jsiicalc_IFriendlier.go - ┣━ 📄 jsiicalc_IFriendlyRandomGenerator.go - ┣━ 📄 jsiicalc_IIndirectlyImplemented.go - ┣━ 📄 jsiicalc_IInterfaceImplementedByAbstractClass.go - ┣━ 📄 jsiicalc_IInterfaceThatShouldNotBeADataType.go - ┣━ 📄 jsiicalc_IInterfaceWithInternal.go - ┣━ 📄 jsiicalc_IInterfaceWithMethods.go - ┣━ 📄 jsiicalc_IInterfaceWithOptionalMethodArguments.go - ┣━ 📄 jsiicalc_IInterfaceWithProperties.go - ┣━ 📄 jsiicalc_IInterfaceWithPropertiesExtension.go - ┣━ 📄 jsiicalc_IJavaReservedWordsInAnInterface.go - ┣━ 📄 jsiicalc_IJSII417Derived.go - ┣━ 📄 jsiicalc_IJSII417PublicBaseOfBase.go - ┣━ 📄 jsiicalc_IJsii487External.go - ┣━ 📄 jsiicalc_IJsii487External2.go - ┣━ 📄 jsiicalc_IJsii496.go - ┣━ 📄 jsiicalc_Implementation.go - ┣━ 📄 jsiicalc_ImplementInternalInterface.go - ┣━ 📄 jsiicalc_ImplementsInterfaceWithInternal.go - ┣━ 📄 jsiicalc_ImplementsInterfaceWithInternalSubclass.go - ┣━ 📄 jsiicalc_ImplementsPrivateInterface.go - ┣━ 📄 jsiicalc_ImplictBaseOfBase.go - ┣━ 📄 jsiicalc_IMutableObjectLiteral.go - ┣━ 📄 jsiicalc_InbetweenClass.go - ┣━ 📄 jsiicalc_INonInternalInterface.go - ┣━ 📄 jsiicalc_InterfaceCollections.go - ┣━ 📄 jsiicalc_InterfacesMaker.go - ┣━ 📄 jsiicalc_IObjectWithProperty.go - ┣━ 📄 jsiicalc_IOptionalMethod.go - ┣━ 📄 jsiicalc_IPrivatelyImplemented.go - ┣━ 📄 jsiicalc_IPublicInterface.go - ┣━ 📄 jsiicalc_IPublicInterface2.go - ┣━ 📄 jsiicalc_IRandomNumberGenerator.go - ┣━ 📄 jsiicalc_IReturnJsii976.go - ┣━ 📄 jsiicalc_IReturnsNumber.go - ┣━ 📄 jsiicalc_Isomorphism.go - ┣━ 📄 jsiicalc_Issue2638.go - ┣━ 📄 jsiicalc_Issue2638B.go - ┣━ 📄 jsiicalc_IStableInterface.go - ┣━ 📄 jsiicalc_IStructReturningDelegate.go - ┣━ 📄 jsiicalc_IWallClock.go - ┣━ 📄 jsiicalc_JavaReservedWords.go - ┣━ 📄 jsiicalc_JSII417Derived.go - ┣━ 📄 jsiicalc_JSII417PublicBaseOfBase.go - ┣━ 📄 jsiicalc_Jsii487Derived.go - ┣━ 📄 jsiicalc_Jsii496Derived.go - ┣━ 📄 jsiicalc_JsiiAgent.go - ┣━ 📄 jsiicalc_JSObjectLiteralForInterface.go - ┣━ 📄 jsiicalc_JSObjectLiteralToNative.go - ┣━ 📄 jsiicalc_JSObjectLiteralToNativeClass.go - ┣━ 📄 jsiicalc_JsonFormatter.go - ┣━ 📄 jsiicalc_LevelOne_PropBooleanValue.go - ┣━ 📄 jsiicalc_LevelOne_PropProperty.go - ┣━ 📄 jsiicalc_LevelOne.go - ┣━ 📄 jsiicalc_LevelOneProps.go - ┣━ 📄 jsiicalc_LoadBalancedFargateServiceProps.go - ┣━ 📄 jsiicalc_MethodNamedProperty.go - ┣━ 📄 jsiicalc_Multiply.go - ┣━ 📄 jsiicalc_Negate.go - ┣━ 📄 jsiicalc_NestedClassInstance.go - ┣━ 📄 jsiicalc_NestedStruct.go - ┣━ 📄 jsiicalc_NodeStandardLibrary.go - ┣━ 📄 jsiicalc_NullShouldBeTreatedAsUndefined.go - ┣━ 📄 jsiicalc_NullShouldBeTreatedAsUndefinedData.go - ┣━ 📄 jsiicalc_NumberGenerator.go - ┣━ 📄 jsiicalc_ObjectRefsInCollections.go - ┣━ 📄 jsiicalc_ObjectWithPropertyProvider.go - ┣━ 📄 jsiicalc_Old.go - ┣━ 📄 jsiicalc_OptionalArgumentInvoker.go - ┣━ 📄 jsiicalc_OptionalConstructorArgument.go - ┣━ 📄 jsiicalc_OptionalStruct.go - ┣━ 📄 jsiicalc_OptionalStructConsumer.go - ┣━ 📄 jsiicalc_OverridableProtectedMember.go - ┣━ 📄 jsiicalc_OverrideReturnsObject.go - ┣━ 📄 jsiicalc_ParamShadowsBuiltins.go - ┣━ 📄 jsiicalc_ParamShadowsBuiltinsProps.go - ┣━ 📄 jsiicalc_ParamShadowsScope.go - ┣━ 📄 jsiicalc_ParentStruct982.go - ┣━ 📄 jsiicalc_PartiallyInitializedThisConsumer.go - ┣━ 📄 jsiicalc_Polymorphism.go - ┣━ 📄 jsiicalc_Power.go - ┣━ 📄 jsiicalc_PromiseNothing.go - ┣━ 📄 jsiicalc_PropertyNamedProperty.go - ┣━ 📄 jsiicalc_PublicClass.go - ┣━ 📄 jsiicalc_PythonReservedWords.go - ┣━ 📄 jsiicalc_ReferenceEnumFromScopedPackage.go - ┣━ 📄 jsiicalc_ReturnsPrivateImplementationOfInterface.go - ┣━ 📄 jsiicalc_RootStruct.go - ┣━ 📄 jsiicalc_RootStructValidator.go - ┣━ 📄 jsiicalc_RuntimeTypeChecking.go - ┣━ 📄 jsiicalc_SecondLevelStruct.go - ┣━ 📄 jsiicalc_SingleInstanceTwoTypes.go - ┣━ 📄 jsiicalc_SingletonInt.go - ┣━ 📄 jsiicalc_SingletonIntEnum.go - ┣━ 📄 jsiicalc_SingletonString.go - ┣━ 📄 jsiicalc_SingletonStringEnum.go - ┣━ 📄 jsiicalc_SmellyStruct.go - ┣━ 📄 jsiicalc_SomeTypeJsii976.go - ┣━ 📄 jsiicalc_StableClass.go - ┣━ 📄 jsiicalc_StableEnum.go - ┣━ 📄 jsiicalc_StableStruct.go - ┣━ 📄 jsiicalc_StaticContext.go - ┣━ 📄 jsiicalc_StaticHelloChild.go - ┣━ 📄 jsiicalc_StaticHelloParent.go - ┣━ 📄 jsiicalc_Statics.go - ┣━ 📄 jsiicalc_StringEnum.go - ┣━ 📄 jsiicalc_StripInternal.go - ┣━ 📄 jsiicalc_StructA.go - ┣━ 📄 jsiicalc_StructB.go - ┣━ 📄 jsiicalc_StructParameterType.go - ┣━ 📄 jsiicalc_StructPassing.go - ┣━ 📄 jsiicalc_StructUnionConsumer.go - ┣━ 📄 jsiicalc_StructWithCollectionOfUnionts.go - ┣━ 📄 jsiicalc_StructWithEnum.go - ┣━ 📄 jsiicalc_StructWithJavaReservedWords.go - ┣━ 📄 jsiicalc_Sum.go - ┣━ 📄 jsiicalc_SupportsNiceJavaBuilder.go - ┣━ 📄 jsiicalc_SupportsNiceJavaBuilderProps.go - ┣━ 📄 jsiicalc_SupportsNiceJavaBuilderWithRequiredProps.go - ┣━ 📄 jsiicalc_SyncVirtualMethods.go - ┣━ 📄 jsiicalc_TestStructWithEnum.go - ┣━ 📄 jsiicalc_Thrower.go - ┣━ 📄 jsiicalc_TopLevelStruct.go - ┣━ 📄 jsiicalc_TwoMethodsWithSimilarCapitalization.go - ┣━ 📄 jsiicalc_UmaskCheck.go - ┣━ 📄 jsiicalc_UnaryOperation.go - ┣━ 📄 jsiicalc_UnionProperties.go - ┣━ 📄 jsiicalc_UpcasingReflectable.go - ┣━ 📄 jsiicalc_UseBundledDependency.go - ┣━ 📄 jsiicalc_UseCalcBase.go - ┣━ 📄 jsiicalc_UsesInterfaceWithProperties.go - ┣━ 📄 jsiicalc_VariadicInvoker.go - ┣━ 📄 jsiicalc_VariadicMethod.go - ┣━ 📄 jsiicalc_VariadicTypeUnion.go - ┣━ 📄 jsiicalc_VirtualMethodPlayground.go - ┣━ 📄 jsiicalc_VoidCallback.go - ┣━ 📄 jsiicalc_WithPrivatePropertyInConstructor.go - ┣━ 📄 jsiicalc.go - ┣━ 📄 LICENSE - ┣━ 📁 module2530 - ┃ ┣━ 📄 module2530_MyClass.go - ┃ ┗━ 📄 module2530.go - ┣━ 📁 module2617 - ┃ ┣━ 📄 module2617_OnlyStatics.go - ┃ ┗━ 📄 module2617.go - ┣━ 📁 module2647 - ┃ ┣━ 📁 internal - ┃ ┃ ┗━ 📄 types.go - ┃ ┣━ 📄 module2647_ExtendAndImplement.go - ┃ ┗━ 📄 module2647.go - ┣━ 📁 module2689 - ┃ ┣━ 📁 methods - ┃ ┃ ┣━ 📄 methods_MyClass.go - ┃ ┃ ┗━ 📄 methods.go - ┃ ┣━ 📁 props - ┃ ┃ ┣━ 📄 props_MyClass.go - ┃ ┃ ┗━ 📄 props.go - ┃ ┣━ 📁 retval - ┃ ┃ ┣━ 📄 retval_MyClass.go - ┃ ┃ ┗━ 📄 retval.go - ┃ ┗━ 📁 structs - ┃ ┣━ 📄 structs_MyStruct.go - ┃ ┗━ 📄 structs.go - ┣━ 📁 module2692 - ┃ ┣━ 📁 submodule1 - ┃ ┃ ┣━ 📄 submodule1_Bar.go - ┃ ┃ ┗━ 📄 submodule1.go - ┃ ┗━ 📁 submodule2 - ┃ ┣━ 📄 submodule2_Bar.go - ┃ ┣━ 📄 submodule2_Foo.go - ┃ ┗━ 📄 submodule2.go - ┣━ 📁 module2700 - ┃ ┣━ 📄 module2700_Base.go - ┃ ┣━ 📄 module2700_Derived.go - ┃ ┣━ 📄 module2700_IFoo.go - ┃ ┗━ 📄 module2700.go - ┣━ 📁 module2702 - ┃ ┣━ 📁 internal - ┃ ┃ ┗━ 📄 types.go - ┃ ┣━ 📄 module2702_Baz.go - ┃ ┣━ 📄 module2702_Class1.go - ┃ ┣━ 📄 module2702_Class2.go - ┃ ┣━ 📄 module2702_Class3.go - ┃ ┣━ 📄 module2702_Construct.go - ┃ ┣━ 📄 module2702_IBaz.go - ┃ ┣━ 📄 module2702_IConstruct.go - ┃ ┣━ 📄 module2702_IFoo.go - ┃ ┣━ 📄 module2702_IResource.go - ┃ ┣━ 📄 module2702_IVpc.go - ┃ ┣━ 📄 module2702_Resource.go - ┃ ┣━ 📄 module2702_Vpc.go - ┃ ┗━ 📄 module2702.go - ┣━ 📁 nodirect - ┃ ┣━ 📁 sub1 - ┃ ┃ ┣━ 📄 sub1_TypeFromSub1.go - ┃ ┃ ┗━ 📄 sub1.go - ┃ ┗━ 📁 sub2 - ┃ ┣━ 📄 sub2_TypeFromSub2.go - ┃ ┗━ 📄 sub2.go - ┣━ 📄 NOTICE - ┣━ 📁 onlystatic - ┃ ┣━ 📄 onlystatic_OnlyStaticMethods.go - ┃ ┗━ 📄 onlystatic.go - ┣━ 📁 pythonself - ┃ ┣━ 📄 pythonself_ClassWithSelf.go - ┃ ┣━ 📄 pythonself_ClassWithSelfKwarg.go - ┃ ┣━ 📄 pythonself_IInterfaceWithSelf.go - ┃ ┣━ 📄 pythonself_StructWithSelf.go - ┃ ┗━ 📄 pythonself.go - ┣━ 📄 README.md - ┣━ 📁 submodule - ┃ ┣━ 📁 backreferences - ┃ ┃ ┣━ 📄 backreferences_MyClassReference.go - ┃ ┃ ┗━ 📄 backreferences.go - ┃ ┣━ 📁 child - ┃ ┃ ┣━ 📄 child_Awesomeness.go - ┃ ┃ ┣━ 📄 child_Goodness.go - ┃ ┃ ┣━ 📄 child_InnerClass.go - ┃ ┃ ┣━ 📄 child_KwargsProps.go - ┃ ┃ ┣━ 📄 child_OuterClass.go - ┃ ┃ ┣━ 📄 child_SomeEnum.go - ┃ ┃ ┣━ 📄 child_SomeStruct.go - ┃ ┃ ┣━ 📄 child_Structure.go - ┃ ┃ ┗━ 📄 child.go - ┃ ┣━ 📁 internal - ┃ ┃ ┗━ 📄 types.go - ┃ ┣━ 📁 isolated - ┃ ┃ ┣━ 📄 isolated_Kwargs.go - ┃ ┃ ┣━ 📄 isolated.go - ┃ ┃ ┗━ 📄 README.md - ┃ ┣━ 📁 nestedsubmodule - ┃ ┃ ┣━ 📁 deeplynested - ┃ ┃ ┃ ┣━ 📄 deeplynested_INamespaced.go - ┃ ┃ ┃ ┗━ 📄 deeplynested.go - ┃ ┃ ┣━ 📁 internal - ┃ ┃ ┃ ┗━ 📄 types.go - ┃ ┃ ┣━ 📄 nestedsubmodule_Namespaced.go - ┃ ┃ ┗━ 📄 nestedsubmodule.go - ┃ ┣━ 📁 param - ┃ ┃ ┣━ 📄 param_SpecialParameter.go - ┃ ┃ ┗━ 📄 param.go - ┃ ┣━ 📄 README.md - ┃ ┣━ 📁 returnsparam - ┃ ┃ ┣━ 📄 returnsparam_ReturnsSpecialParameter.go - ┃ ┃ ┗━ 📄 returnsparam.go - ┃ ┣━ 📄 submodule_Default.go - ┃ ┣━ 📄 submodule_MyClass.go - ┃ ┗━ 📄 submodule.go - ┣━ 📁 union - ┃ ┣━ 📄 union_ConsumesUnion.go - ┃ ┣━ 📄 union_IResolvable.go - ┃ ┣━ 📄 union_Resolvable.go - ┃ ┗━ 📄 union.go - ┗━ 📄 version -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/LICENSE 1`] = ` - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. +func (j *jsiiProxy_AllTypes) StringProperty() *string { + var returns *string + _jsii_.Get( + j, + "stringProperty", + &returns, + ) + return returns +} - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. +func (j *jsiiProxy_AllTypes) UnionArrayProperty() *[]interface{} { + var returns *[]interface{} + _jsii_.Get( + j, + "unionArrayProperty", + &returns, + ) + return returns +} - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. +func (j *jsiiProxy_AllTypes) UnionMapProperty() *map[string]interface{} { + var returns *map[string]interface{} + _jsii_.Get( + j, + "unionMapProperty", + &returns, + ) + return returns +} - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. +func (j *jsiiProxy_AllTypes) UnionProperty() interface{} { + var returns interface{} + _jsii_.Get( + j, + "unionProperty", + &returns, + ) + return returns +} - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. +func (j *jsiiProxy_AllTypes) UnknownArrayProperty() *[]interface{} { + var returns *[]interface{} + _jsii_.Get( + j, + "unknownArrayProperty", + &returns, + ) + return returns +} - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). +func (j *jsiiProxy_AllTypes) UnknownMapProperty() *map[string]interface{} { + var returns *map[string]interface{} + _jsii_.Get( + j, + "unknownMapProperty", + &returns, + ) + return returns +} - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. +func (j *jsiiProxy_AllTypes) UnknownProperty() interface{} { + var returns interface{} + _jsii_.Get( + j, + "unknownProperty", + &returns, + ) + return returns +} - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. +func NewAllTypes() AllTypes { + _init_.Initialize() - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. + j := jsiiProxy_AllTypes{} - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. + _jsii_.Create( + "jsii-calc.AllTypes", + nil, // no parameters + &j, + ) - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: + return &j +} - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and +func NewAllTypes_Override(a AllTypes) { + _init_.Initialize() - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and + _jsii_.Create( + "jsii-calc.AllTypes", + nil, // no parameters + a, + ) +} - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and +func (j *jsiiProxy_AllTypes)SetAnyArrayProperty(val *[]interface{}) { + _jsii_.Set( + j, + "anyArrayProperty", + val, + ) +} - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. +func (j *jsiiProxy_AllTypes)SetAnyMapProperty(val *map[string]interface{}) { + _jsii_.Set( + j, + "anyMapProperty", + val, + ) +} - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. +func (j *jsiiProxy_AllTypes)SetAnyProperty(val interface{}) { + _jsii_.Set( + j, + "anyProperty", + val, + ) +} - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. +func (j *jsiiProxy_AllTypes)SetArrayProperty(val *[]*string) { + _jsii_.Set( + j, + "arrayProperty", + val, + ) +} - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. +func (j *jsiiProxy_AllTypes)SetBooleanProperty(val *bool) { + _jsii_.Set( + j, + "booleanProperty", + val, + ) +} - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. +func (j *jsiiProxy_AllTypes)SetDateProperty(val *time.Time) { + _jsii_.Set( + j, + "dateProperty", + val, + ) +} - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. +func (j *jsiiProxy_AllTypes)SetEnumProperty(val AllTypesEnum) { + _jsii_.Set( + j, + "enumProperty", + val, + ) +} - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. +func (j *jsiiProxy_AllTypes)SetJsonProperty(val *map[string]interface{}) { + _jsii_.Set( + j, + "jsonProperty", + val, + ) +} - END OF TERMS AND CONDITIONS +func (j *jsiiProxy_AllTypes)SetMapProperty(val *map[string]scopejsiicalclib.Number) { + _jsii_.Set( + j, + "mapProperty", + val, + ) +} - APPENDIX: How to apply the Apache License to your work. +func (j *jsiiProxy_AllTypes)SetNumberProperty(val *float64) { + _jsii_.Set( + j, + "numberProperty", + val, + ) +} - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. +func (j *jsiiProxy_AllTypes)SetOptionalEnumValue(val StringEnum) { + _jsii_.Set( + j, + "optionalEnumValue", + val, + ) +} - Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +func (j *jsiiProxy_AllTypes)SetStringProperty(val *string) { + _jsii_.Set( + j, + "stringProperty", + val, + ) +} - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at +func (j *jsiiProxy_AllTypes)SetUnionArrayProperty(val *[]interface{}) { + _jsii_.Set( + j, + "unionArrayProperty", + val, + ) +} - http://www.apache.org/licenses/LICENSE-2.0 +func (j *jsiiProxy_AllTypes)SetUnionMapProperty(val *map[string]interface{}) { + _jsii_.Set( + j, + "unionMapProperty", + val, + ) +} - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -`; +func (j *jsiiProxy_AllTypes)SetUnionProperty(val interface{}) { + _jsii_.Set( + j, + "unionProperty", + val, + ) +} -exports[`Generated code for "jsii-calc": /go/jsiicalc/NOTICE 1`] = ` -jsii -Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +func (j *jsiiProxy_AllTypes)SetUnknownArrayProperty(val *[]interface{}) { + _jsii_.Set( + j, + "unknownArrayProperty", + val, + ) +} -`; +func (j *jsiiProxy_AllTypes)SetUnknownMapProperty(val *map[string]interface{}) { + _jsii_.Set( + j, + "unknownMapProperty", + val, + ) +} -exports[`Generated code for "jsii-calc": /go/jsiicalc/README.md 1`] = ` -# jsii Calculator +func (j *jsiiProxy_AllTypes)SetUnknownProperty(val interface{}) { + _jsii_.Set( + j, + "unknownProperty", + val, + ) +} -This library is used to demonstrate and test the features of JSII +func (a *jsiiProxy_AllTypes) AnyIn(inp interface{}) { + _jsii_.InvokeVoid( + a, + "anyIn", + []interface{}{inp}, + ) +} -## How to use running sum API: +func (a *jsiiProxy_AllTypes) AnyOut() interface{} { + var returns interface{} -First, create a calculator: + _jsii_.Invoke( + a, + "anyOut", + nil, // no parameters + &returns, + ) -\`\`\`go -calculator := calc.NewCalculator() -\`\`\` + return returns +} -Then call some operations: +func (a *jsiiProxy_AllTypes) EnumMethod(value StringEnum) StringEnum { + var returns StringEnum -\`\`\`go -calculator.Add(jsii.Number(10)) -\`\`\` + _jsii_.Invoke( + a, + "enumMethod", + []interface{}{value}, + &returns, + ) -## Code Samples + return returns +} -\`\`\`go -/* This is totes a magic comment in here, just you wait! */ -foo := "bar" -\`\`\` `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/anonymous/anonymous.go 1`] = ` -package anonymous +exports[`Generated code for "jsii-calc": /go/jsiicalc/AllTypesEnum.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc -import ( - "reflect" - _jsii_ "github.com/aws/jsii-runtime-go/runtime" +type AllTypesEnum string + +const ( + AllTypesEnum_MY_ENUM_VALUE AllTypesEnum = "MY_ENUM_VALUE" + AllTypesEnum_YOUR_ENUM_VALUE AllTypesEnum = "YOUR_ENUM_VALUE" + AllTypesEnum_THIS_IS_GREAT AllTypesEnum = "THIS_IS_GREAT" ) -func init() { - _jsii_.RegisterInterface( - "jsii-calc.anonymous.IOptionA", - reflect.TypeOf((*IOptionA)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "doSomething", GoMethod: "DoSomething"}, - }, - func() interface{} { - return &jsiiProxy_IOptionA{} - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.anonymous.IOptionB", - reflect.TypeOf((*IOptionB)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "doSomethingElse", GoMethod: "DoSomethingElse"}, - }, - func() interface{} { - return &jsiiProxy_IOptionB{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.anonymous.UseOptions", - reflect.TypeOf((*UseOptions)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_UseOptions{} - }, - ) -} `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/anonymous/anonymous_IOptionA.go 1`] = ` -package anonymous +exports[`Generated code for "jsii-calc": /go/jsiicalc/AllowedMethodNames.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type IOptionA interface { - DoSomething() *string +type AllowedMethodNames interface { + GetBar(_p1 *string, _p2 *float64) + // getXxx() is not allowed (see negatives), but getXxx(a, ...) is okay. + GetFoo(withParam *string) *string + SetBar(_x *string, _y *float64, _z *bool) + // setFoo(x) is not allowed (see negatives), but setXxx(a, b, ...) is okay. + SetFoo(_x *string, _y *float64) } -// The jsii proxy for IOptionA -type jsiiProxy_IOptionA struct { +// The jsii proxy struct for AllowedMethodNames +type jsiiProxy_AllowedMethodNames struct { _ byte // padding } -func (i *jsiiProxy_IOptionA) DoSomething() *string { - var returns *string +func NewAllowedMethodNames() AllowedMethodNames { + _init_.Initialize() - _jsii_.Invoke( - i, - "doSomething", - nil, // no parameters - &returns, + j := jsiiProxy_AllowedMethodNames{} + + _jsii_.Create( + "jsii-calc.AllowedMethodNames", + nil, // no parameters + &j, ) - return returns + return &j } +func NewAllowedMethodNames_Override(a AllowedMethodNames) { + _init_.Initialize() -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/anonymous/anonymous_IOptionB.go 1`] = ` -package anonymous - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -type IOptionB interface { - DoSomethingElse() *string + _jsii_.Create( + "jsii-calc.AllowedMethodNames", + nil, // no parameters + a, + ) } -// The jsii proxy for IOptionB -type jsiiProxy_IOptionB struct { - _ byte // padding +func (a *jsiiProxy_AllowedMethodNames) GetBar(_p1 *string, _p2 *float64) { + _jsii_.InvokeVoid( + a, + "getBar", + []interface{}{_p1, _p2}, + ) } -func (i *jsiiProxy_IOptionB) DoSomethingElse() *string { +func (a *jsiiProxy_AllowedMethodNames) GetFoo(withParam *string) *string { var returns *string _jsii_.Invoke( - i, - "doSomethingElse", - nil, // no parameters + a, + "getFoo", + []interface{}{withParam}, &returns, ) return returns } +func (a *jsiiProxy_AllowedMethodNames) SetBar(_x *string, _y *float64, _z *bool) { + _jsii_.InvokeVoid( + a, + "setBar", + []interface{}{_x, _y, _z}, + ) +} + +func (a *jsiiProxy_AllowedMethodNames) SetFoo(_x *string, _y *float64) { + _jsii_.InvokeVoid( + a, + "setFoo", + []interface{}{_x, _y}, + ) +} + `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/anonymous/anonymous_UseOptions.go 1`] = ` -package anonymous +exports[`Generated code for "jsii-calc": /go/jsiicalc/AmbiguousParameters.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type UseOptions interface { +type AmbiguousParameters interface { + Props() *StructParameterType + Scope() Bell } -// The jsii proxy struct for UseOptions -type jsiiProxy_UseOptions struct { +// The jsii proxy struct for AmbiguousParameters +type jsiiProxy_AmbiguousParameters struct { _ byte // padding } -func UseOptions_Consume(option interface{}) *string { - _init_.Initialize() - - var returns *string - - _jsii_.StaticInvoke( - "jsii-calc.anonymous.UseOptions", - "consume", - []interface{}{option}, +func (j *jsiiProxy_AmbiguousParameters) Props() *StructParameterType { + var returns *StructParameterType + _jsii_.Get( + j, + "props", &returns, ) - return returns } -func UseOptions_PrivideAsAny(which *string) interface{} { - _init_.Initialize() - - var returns interface{} - - _jsii_.StaticInvoke( - "jsii-calc.anonymous.UseOptions", - "privideAsAny", - []interface{}{which}, +func (j *jsiiProxy_AmbiguousParameters) Scope() Bell { + var returns Bell + _jsii_.Get( + j, + "scope", &returns, ) - return returns } -func UseOptions_Provide(which *string) interface{} { + +func NewAmbiguousParameters(scope Bell, props *StructParameterType) AmbiguousParameters { _init_.Initialize() - var returns interface{} + j := jsiiProxy_AmbiguousParameters{} - _jsii_.StaticInvoke( - "jsii-calc.anonymous.UseOptions", - "provide", - []interface{}{which}, - &returns, + _jsii_.Create( + "jsii-calc.AmbiguousParameters", + []interface{}{scope, props}, + &j, ) - return returns + return &j } +func NewAmbiguousParameters_Override(a AmbiguousParameters, scope Bell, props *StructParameterType) { + _init_.Initialize() -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk16625/cdk16625.go 1`] = ` -package cdk16625 - -import ( - "reflect" - - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -func init() { - _jsii_.RegisterClass( - "jsii-calc.cdk16625.Cdk16625", - reflect.TypeOf((*Cdk16625)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "test", GoMethod: "Test"}, - _jsii_.MemberMethod{JsiiMethod: "unwrap", GoMethod: "Unwrap"}, - }, - func() interface{} { - return &jsiiProxy_Cdk16625{} - }, + _jsii_.Create( + "jsii-calc.AmbiguousParameters", + []interface{}{scope, props}, + a, ) } + `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk16625/cdk16625_Cdk16625.go 1`] = ` -package cdk16625 +exports[`Generated code for "jsii-calc": /go/jsiicalc/AnonymousImplementationProvider.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" - - "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3" ) -type Cdk16625 interface { - // Run this function to verify that everything is working as it should. - Test() - // 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). - Unwrap(gen jsiicalc.IRandomNumberGenerator) *float64 +type AnonymousImplementationProvider interface { + IAnonymousImplementationProvider + ProvideAsClass() Implementation + ProvideAsInterface() IAnonymouslyImplementMe } -// The jsii proxy struct for Cdk16625 -type jsiiProxy_Cdk16625 struct { - _ byte // padding +// The jsii proxy struct for AnonymousImplementationProvider +type jsiiProxy_AnonymousImplementationProvider struct { + jsiiProxy_IAnonymousImplementationProvider } -func NewCdk16625_Override(c Cdk16625) { +func NewAnonymousImplementationProvider() AnonymousImplementationProvider { _init_.Initialize() + j := jsiiProxy_AnonymousImplementationProvider{} + _jsii_.Create( - "jsii-calc.cdk16625.Cdk16625", + "jsii-calc.AnonymousImplementationProvider", nil, // no parameters - c, + &j, ) + + return &j } -func (c *jsiiProxy_Cdk16625) Test() { - _jsii_.InvokeVoid( - c, - "test", +func NewAnonymousImplementationProvider_Override(a AnonymousImplementationProvider) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.AnonymousImplementationProvider", nil, // no parameters + a, ) } -func (c *jsiiProxy_Cdk16625) Unwrap(gen jsiicalc.IRandomNumberGenerator) *float64 { - var returns *float64 +func (a *jsiiProxy_AnonymousImplementationProvider) ProvideAsClass() Implementation { + var returns Implementation _jsii_.Invoke( - c, - "unwrap", - []interface{}{gen}, + a, + "provideAsClass", + nil, // no parameters &returns, ) return returns } +func (a *jsiiProxy_AnonymousImplementationProvider) ProvideAsInterface() IAnonymouslyImplementMe { + var returns IAnonymouslyImplementMe -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk16625/donotimport/donotimport.go 1`] = ` -package donotimport - -import ( - "reflect" - - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -func init() { - _jsii_.RegisterClass( - "jsii-calc.cdk16625.donotimport.UnimportedSubmoduleType", - reflect.TypeOf((*UnimportedSubmoduleType)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "next", GoMethod: "Next"}, - }, - func() interface{} { - j := jsiiProxy_UnimportedSubmoduleType{} - _jsii_.InitJsiiProxy(&j.Type__jsiicalcIRandomNumberGenerator) - return &j - }, + _jsii_.Invoke( + a, + "provideAsInterface", + nil, // no parameters + &returns, ) + + return returns } + `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk16625/donotimport/donotimport_UnimportedSubmoduleType.go 1`] = ` -package donotimport +exports[`Generated code for "jsii-calc": /go/jsiicalc/AsyncVirtualMethods.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" - - "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3" - "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/cdk16625/donotimport/internal" ) -// This type demonstrates the ability to receive a callback argument that has a type from a submodule not explicitly imported in the user's code. -// -// This checks -// that all types available in the assembly can be resolved by the runtime -// library, regardless of whether they were explicitly referenced or not. -// See: https://github.com/aws/aws-cdk/issues/16625 -// -type UnimportedSubmoduleType interface { - jsiicalc.IRandomNumberGenerator - // Not quite random, but it'll do. +type AsyncVirtualMethods interface { + CallMe() *float64 + // Just calls "overrideMeToo". + CallMe2() *float64 + // This method calls the "callMe" async method indirectly, which will then invoke a virtual method. // - // Returns: 1337. - Next() *float64 + // This is a "double promise" situation, which + // means that callbacks are not going to be available immediate, but only + // after an "immediates" cycle. + CallMeDoublePromise() *float64 + DontOverrideMe() *float64 + OverrideMe(mult *float64) *float64 + OverrideMeToo() *float64 } -// The jsii proxy struct for UnimportedSubmoduleType -type jsiiProxy_UnimportedSubmoduleType struct { - internal.Type__jsiicalcIRandomNumberGenerator +// The jsii proxy struct for AsyncVirtualMethods +type jsiiProxy_AsyncVirtualMethods struct { + _ byte // padding } -func NewUnimportedSubmoduleType(value *float64) UnimportedSubmoduleType { +func NewAsyncVirtualMethods() AsyncVirtualMethods { _init_.Initialize() - j := jsiiProxy_UnimportedSubmoduleType{} + j := jsiiProxy_AsyncVirtualMethods{} _jsii_.Create( - "jsii-calc.cdk16625.donotimport.UnimportedSubmoduleType", - []interface{}{value}, + "jsii-calc.AsyncVirtualMethods", + nil, // no parameters &j, ) return &j } -func NewUnimportedSubmoduleType_Override(u UnimportedSubmoduleType, value *float64) { +func NewAsyncVirtualMethods_Override(a AsyncVirtualMethods) { _init_.Initialize() _jsii_.Create( - "jsii-calc.cdk16625.donotimport.UnimportedSubmoduleType", - []interface{}{value}, - u, + "jsii-calc.AsyncVirtualMethods", + nil, // no parameters + a, ) } -func (u *jsiiProxy_UnimportedSubmoduleType) Next() *float64 { +func (a *jsiiProxy_AsyncVirtualMethods) CallMe() *float64 { var returns *float64 _jsii_.Invoke( - u, - "next", + a, + "callMe", nil, // no parameters &returns, ) @@ -3515,391 +4124,216 @@ func (u *jsiiProxy_UnimportedSubmoduleType) Next() *float64 { return returns } +func (a *jsiiProxy_AsyncVirtualMethods) CallMe2() *float64 { + var returns *float64 -`; + _jsii_.Invoke( + a, + "callMe2", + nil, // no parameters + &returns, + ) -exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk16625/donotimport/internal/types.go 1`] = ` -package internal -import ( - "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3" -) -type Type__jsiicalcIRandomNumberGenerator = jsiicalc.IRandomNumberGenerator + return returns +} -`; +func (a *jsiiProxy_AsyncVirtualMethods) CallMeDoublePromise() *float64 { + var returns *float64 -exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk22369/cdk22369.go 1`] = ` -package cdk22369 + _jsii_.Invoke( + a, + "callMeDoublePromise", + nil, // no parameters + &returns, + ) -import ( - "reflect" + return returns +} - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) +func (a *jsiiProxy_AsyncVirtualMethods) DontOverrideMe() *float64 { + var returns *float64 -func init() { - _jsii_.RegisterClass( - "jsii-calc.cdk22369.AcceptsPath", - reflect.TypeOf((*AcceptsPath)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_AcceptsPath{} - }, + _jsii_.Invoke( + a, + "dontOverrideMe", + nil, // no parameters + &returns, ) - _jsii_.RegisterStruct( - "jsii-calc.cdk22369.AcceptsPathProps", - reflect.TypeOf((*AcceptsPathProps)(nil)).Elem(), + + return returns +} + +func (a *jsiiProxy_AsyncVirtualMethods) OverrideMe(mult *float64) *float64 { + var returns *float64 + + _jsii_.Invoke( + a, + "overrideMe", + []interface{}{mult}, + &returns, + ) + + return returns +} + +func (a *jsiiProxy_AsyncVirtualMethods) OverrideMeToo() *float64 { + var returns *float64 + + _jsii_.Invoke( + a, + "overrideMeToo", + nil, // no parameters + &returns, ) + + return returns } + `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk22369/cdk22369_AcceptsPath.go 1`] = ` -package cdk22369 +exports[`Generated code for "jsii-calc": /go/jsiicalc/AugmentableClass.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type AcceptsPath interface { +type AugmentableClass interface { + MethodOne() + MethodTwo() } -// The jsii proxy struct for AcceptsPath -type jsiiProxy_AcceptsPath struct { +// The jsii proxy struct for AugmentableClass +type jsiiProxy_AugmentableClass struct { _ byte // padding } -func NewAcceptsPath(props *AcceptsPathProps) AcceptsPath { +func NewAugmentableClass() AugmentableClass { _init_.Initialize() - j := jsiiProxy_AcceptsPath{} + j := jsiiProxy_AugmentableClass{} _jsii_.Create( - "jsii-calc.cdk22369.AcceptsPath", - []interface{}{props}, + "jsii-calc.AugmentableClass", + nil, // no parameters &j, ) return &j } -func NewAcceptsPath_Override(a AcceptsPath, props *AcceptsPathProps) { +func NewAugmentableClass_Override(a AugmentableClass) { _init_.Initialize() _jsii_.Create( - "jsii-calc.cdk22369.AcceptsPath", - []interface{}{props}, + "jsii-calc.AugmentableClass", + nil, // no parameters a, ) } - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk22369/cdk22369_AcceptsPathProps.go 1`] = ` -package cdk22369 - - -type AcceptsPathProps struct { - // A path that doesn't exist. - SourcePath *string \`field:"required" json:"sourcePath" yaml:"sourcePath"\` +func (a *jsiiProxy_AugmentableClass) MethodOne() { + _jsii_.InvokeVoid( + a, + "methodOne", + nil, // no parameters + ) } - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/composition/composition.go 1`] = ` -package composition - -import ( - "reflect" - - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -func init() { - _jsii_.RegisterClass( - "jsii-calc.composition.CompositeOperation", - reflect.TypeOf((*CompositeOperation)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "decorationPostfixes", GoGetter: "DecorationPostfixes"}, - _jsii_.MemberProperty{JsiiProperty: "decorationPrefixes", GoGetter: "DecorationPrefixes"}, - _jsii_.MemberProperty{JsiiProperty: "expression", GoGetter: "Expression"}, - _jsii_.MemberProperty{JsiiProperty: "stringStyle", GoGetter: "StringStyle"}, - _jsii_.MemberMethod{JsiiMethod: "toString", GoMethod: "ToString"}, - _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, - _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, - }, - func() interface{} { - j := jsiiProxy_CompositeOperation{} - _jsii_.InitJsiiProxy(&j.Type__scopejsiicalclibOperation) - return &j - }, - ) - _jsii_.RegisterEnum( - "jsii-calc.composition.CompositeOperation.CompositionStringStyle", - reflect.TypeOf((*CompositeOperation_CompositionStringStyle)(nil)).Elem(), - map[string]interface{}{ - "NORMAL": CompositeOperation_CompositionStringStyle_NORMAL, - "DECORATED": CompositeOperation_CompositionStringStyle_DECORATED, - }, +func (a *jsiiProxy_AugmentableClass) MethodTwo() { + _jsii_.InvokeVoid( + a, + "methodTwo", + nil, // no parameters ) } + `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/composition/composition_CompositeOperation.go 1`] = ` -package composition +exports[`Generated code for "jsii-calc": /go/jsiicalc/BaseClass.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" - - "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/composition/internal" - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ) -// Abstract operation composed from an expression of other operations. -type CompositeOperation interface { - scopejsiicalclib.Operation - // A set of postfixes to include in a decorated .toString(). - DecorationPostfixes() *[]*string - SetDecorationPostfixes(val *[]*string) - // A set of prefixes to include in a decorated .toString(). - DecorationPrefixes() *[]*string - SetDecorationPrefixes(val *[]*string) - // The expression that this operation consists of. - // - // Must be implemented by derived classes. - Expression() scopejsiicalclib.NumericValue - // The .toString() style. - StringStyle() CompositeOperation_CompositionStringStyle - SetStringStyle(val CompositeOperation_CompositionStringStyle) - // The value. - Value() *float64 - // String representation of the value. - ToString() *string - // Returns: the name of the class (to verify native type names are created for derived classes). - TypeName() interface{} +type BaseClass interface { + Property() *string + Method() *float64 } -// The jsii proxy struct for CompositeOperation -type jsiiProxy_CompositeOperation struct { - internal.Type__scopejsiicalclibOperation +// The jsii proxy struct for BaseClass +type jsiiProxy_BaseClass struct { + _ byte // padding } -func (j *jsiiProxy_CompositeOperation) DecorationPostfixes() *[]*string { - var returns *[]*string +func (j *jsiiProxy_BaseClass) Property() *string { + var returns *string _jsii_.Get( j, - "decorationPostfixes", + "property", &returns, ) return returns } -func (j *jsiiProxy_CompositeOperation) DecorationPrefixes() *[]*string { - var returns *[]*string - _jsii_.Get( - j, - "decorationPrefixes", + +func NewBaseClass_Override(b BaseClass) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.BaseClass", + nil, // no parameters + b, + ) +} + +func (b *jsiiProxy_BaseClass) Method() *float64 { + var returns *float64 + + _jsii_.Invoke( + b, + "method", + nil, // no parameters &returns, ) + return returns } -func (j *jsiiProxy_CompositeOperation) Expression() scopejsiicalclib.NumericValue { - var returns scopejsiicalclib.NumericValue - _jsii_.Get( - j, - "expression", - &returns, - ) - return returns -} - -func (j *jsiiProxy_CompositeOperation) StringStyle() CompositeOperation_CompositionStringStyle { - var returns CompositeOperation_CompositionStringStyle - _jsii_.Get( - j, - "stringStyle", - &returns, - ) - return returns -} - -func (j *jsiiProxy_CompositeOperation) Value() *float64 { - var returns *float64 - _jsii_.Get( - j, - "value", - &returns, - ) - return returns -} - - -func NewCompositeOperation_Override(c CompositeOperation) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.composition.CompositeOperation", - nil, // no parameters - c, - ) -} - -func (j *jsiiProxy_CompositeOperation)SetDecorationPostfixes(val *[]*string) { - _jsii_.Set( - j, - "decorationPostfixes", - val, - ) -} - -func (j *jsiiProxy_CompositeOperation)SetDecorationPrefixes(val *[]*string) { - _jsii_.Set( - j, - "decorationPrefixes", - val, - ) -} - -func (j *jsiiProxy_CompositeOperation)SetStringStyle(val CompositeOperation_CompositionStringStyle) { - _jsii_.Set( - j, - "stringStyle", - val, - ) -} - -func (c *jsiiProxy_CompositeOperation) ToString() *string { - var returns *string - - _jsii_.Invoke( - c, - "toString", - nil, // no parameters - &returns, - ) - - return returns -} - -func (c *jsiiProxy_CompositeOperation) TypeName() interface{} { - var returns interface{} - - _jsii_.Invoke( - c, - "typeName", - nil, // no parameters - &returns, - ) - - return returns -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/composition/composition_CompositeOperation_CompositionStringStyle.go 1`] = ` -package composition - - -// Style of .toString() output for CompositeOperation. -type CompositeOperation_CompositionStringStyle string - -const ( - // Normal string expression. - CompositeOperation_CompositionStringStyle_NORMAL CompositeOperation_CompositionStringStyle = "NORMAL" - // Decorated string expression. - CompositeOperation_CompositionStringStyle_DECORATED CompositeOperation_CompositionStringStyle = "DECORATED" -) - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/composition/internal/types.go 1`] = ` -package internal -import ( - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" -) -type Type__scopejsiicalclibOperation = scopejsiicalclib.Operation - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/derivedclasshasnoproperties/derivedclasshasnoproperties.go 1`] = ` -package derivedclasshasnoproperties - -import ( - "reflect" - - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -func init() { - _jsii_.RegisterClass( - "jsii-calc.DerivedClassHasNoProperties.Base", - reflect.TypeOf((*Base)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "prop", GoGetter: "Prop"}, - }, - func() interface{} { - return &jsiiProxy_Base{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.DerivedClassHasNoProperties.Derived", - reflect.TypeOf((*Derived)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "prop", GoGetter: "Prop"}, - }, - func() interface{} { - j := jsiiProxy_Derived{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_Base) - return &j - }, - ) -} `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/derivedclasshasnoproperties/derivedclasshasnoproperties_Base.go 1`] = ` -package derivedclasshasnoproperties +exports[`Generated code for "jsii-calc": /go/jsiicalc/BaseJsii976.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type Base interface { - Prop() *string - SetProp(val *string) +type BaseJsii976 interface { } -// The jsii proxy struct for Base -type jsiiProxy_Base struct { +// The jsii proxy struct for BaseJsii976 +type jsiiProxy_BaseJsii976 struct { _ byte // padding } -func (j *jsiiProxy_Base) Prop() *string { - var returns *string - _jsii_.Get( - j, - "prop", - &returns, - ) - return returns -} - - -func NewBase() Base { +func NewBaseJsii976() BaseJsii976 { _init_.Initialize() - j := jsiiProxy_Base{} + j := jsiiProxy_BaseJsii976{} _jsii_.Create( - "jsii-calc.DerivedClassHasNoProperties.Base", + "jsii-calc.BaseJsii976", nil, // no parameters &j, ) @@ -3907,64 +4341,58 @@ func NewBase() Base { return &j } -func NewBase_Override(b Base) { +func NewBaseJsii976_Override(b BaseJsii976) { _init_.Initialize() _jsii_.Create( - "jsii-calc.DerivedClassHasNoProperties.Base", + "jsii-calc.BaseJsii976", nil, // no parameters b, ) } -func (j *jsiiProxy_Base)SetProp(val *string) { - _jsii_.Set( - j, - "prop", - val, - ) -} - `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/derivedclasshasnoproperties/derivedclasshasnoproperties_Derived.go 1`] = ` -package derivedclasshasnoproperties +exports[`Generated code for "jsii-calc": /go/jsiicalc/Bell.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type Derived interface { - Base - Prop() *string - SetProp(val *string) +type Bell interface { + IBell + Rung() *bool + SetRung(val *bool) + Ring() } -// The jsii proxy struct for Derived -type jsiiProxy_Derived struct { - jsiiProxy_Base +// The jsii proxy struct for Bell +type jsiiProxy_Bell struct { + jsiiProxy_IBell } -func (j *jsiiProxy_Derived) Prop() *string { - var returns *string +func (j *jsiiProxy_Bell) Rung() *bool { + var returns *bool _jsii_.Get( j, - "prop", + "rung", &returns, ) return returns } -func NewDerived() Derived { +func NewBell() Bell { _init_.Initialize() - j := jsiiProxy_Derived{} + j := jsiiProxy_Bell{} _jsii_.Create( - "jsii-calc.DerivedClassHasNoProperties.Derived", + "jsii-calc.Bell", nil, // no parameters &j, ) @@ -3972,2871 +4400,2945 @@ func NewDerived() Derived { return &j } -func NewDerived_Override(d Derived) { +func NewBell_Override(b Bell) { _init_.Initialize() _jsii_.Create( - "jsii-calc.DerivedClassHasNoProperties.Derived", + "jsii-calc.Bell", nil, // no parameters - d, + b, ) } -func (j *jsiiProxy_Derived)SetProp(val *string) { +func (j *jsiiProxy_Bell)SetRung(val *bool) { _jsii_.Set( j, - "prop", + "rung", val, ) } - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/go.mod 1`] = ` -module github.com/aws/jsii/jsii-calc/go/jsiicalc/v3 - -go 1.18 - -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/scopejsiicalclib v0.0.0-devpreview - github.com/aws/jsii/jsii-calc/go/scopejsiicalcbaseofbase/v2 v2.1.1 // indirect -) - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/README.md 1`] = ` -Verifies homonymous forward references don't trip the Python type checker - -This has been an issue when stub functions were introduced to create a reliable source for type checking -information, which was reported in https://github.com/aws/jsii/issues/3818. - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/bar/bar.go 1`] = ` -package bar - -import ( - "reflect" - - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -func init() { - _jsii_.RegisterClass( - "jsii-calc.homonymousForwardReferences.bar.Consumer", - reflect.TypeOf((*Consumer)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_Consumer{} - }, - ) - _jsii_.RegisterStruct( - "jsii-calc.homonymousForwardReferences.bar.ConsumerProps", - reflect.TypeOf((*ConsumerProps)(nil)).Elem(), - ) - _jsii_.RegisterStruct( - "jsii-calc.homonymousForwardReferences.bar.Homonymous", - reflect.TypeOf((*Homonymous)(nil)).Elem(), +func (b *jsiiProxy_Bell) Ring() { + _jsii_.InvokeVoid( + b, + "ring", + nil, // no parameters ) } + `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/bar/bar_Consumer.go 1`] = ` -package bar +exports[`Generated code for "jsii-calc": /go/jsiicalc/BinaryOperation.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" + + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/internal" + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ) -type Consumer interface { +// Represents an operation with two operands. +type BinaryOperation interface { + scopejsiicalclib.Operation + scopejsiicalclib.IFriendly + // Left-hand side operand. + Lhs() scopejsiicalclib.NumericValue + // Right-hand side operand. + Rhs() scopejsiicalclib.NumericValue + // The value. + // Deprecated. + Value() *float64 + // Say hello! + Hello() *string + // String representation of the value. + // Deprecated. + ToString() *string + // Returns: the name of the class (to verify native type names are created for derived classes). + TypeName() interface{} } -// The jsii proxy struct for Consumer -type jsiiProxy_Consumer struct { - _ byte // padding +// The jsii proxy struct for BinaryOperation +type jsiiProxy_BinaryOperation struct { + internal.Type__scopejsiicalclibOperation + internal.Type__scopejsiicalclibIFriendly } -func Consumer_Consume(props *ConsumerProps) *Homonymous { - _init_.Initialize() - - var returns *Homonymous - - _jsii_.StaticInvoke( - "jsii-calc.homonymousForwardReferences.bar.Consumer", - "consume", - []interface{}{props}, +func (j *jsiiProxy_BinaryOperation) Lhs() scopejsiicalclib.NumericValue { + var returns scopejsiicalclib.NumericValue + _jsii_.Get( + j, + "lhs", &returns, ) - return returns } +func (j *jsiiProxy_BinaryOperation) Rhs() scopejsiicalclib.NumericValue { + var returns scopejsiicalclib.NumericValue + _jsii_.Get( + j, + "rhs", + &returns, + ) + return returns +} -`; +func (j *jsiiProxy_BinaryOperation) Value() *float64 { + var returns *float64 + _jsii_.Get( + j, + "value", + &returns, + ) + return returns +} -exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/bar/bar_ConsumerProps.go 1`] = ` -package bar +// Creates a BinaryOperation. +func NewBinaryOperation_Override(b BinaryOperation, lhs scopejsiicalclib.NumericValue, rhs scopejsiicalclib.NumericValue) { + _init_.Initialize() -type ConsumerProps struct { - Homonymous *Homonymous \`field:"required" json:"homonymous" yaml:"homonymous"\` + _jsii_.Create( + "jsii-calc.BinaryOperation", + []interface{}{lhs, rhs}, + b, + ) } +func (b *jsiiProxy_BinaryOperation) Hello() *string { + var returns *string -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/bar/bar_Homonymous.go 1`] = ` -package bar - + _jsii_.Invoke( + b, + "hello", + nil, // no parameters + &returns, + ) -type Homonymous struct { - NumericProperty *float64 \`field:"required" json:"numericProperty" yaml:"numericProperty"\` + return returns } +func (b *jsiiProxy_BinaryOperation) ToString() *string { + var returns *string -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/foo/foo.go 1`] = ` -package foo + _jsii_.Invoke( + b, + "toString", + nil, // no parameters + &returns, + ) -import ( - "reflect" + return returns +} - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) +func (b *jsiiProxy_BinaryOperation) TypeName() interface{} { + var returns interface{} -func init() { - _jsii_.RegisterClass( - "jsii-calc.homonymousForwardReferences.foo.Consumer", - reflect.TypeOf((*Consumer)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_Consumer{} - }, - ) - _jsii_.RegisterStruct( - "jsii-calc.homonymousForwardReferences.foo.ConsumerProps", - reflect.TypeOf((*ConsumerProps)(nil)).Elem(), - ) - _jsii_.RegisterStruct( - "jsii-calc.homonymousForwardReferences.foo.Homonymous", - reflect.TypeOf((*Homonymous)(nil)).Elem(), + _jsii_.Invoke( + b, + "typeName", + nil, // no parameters + &returns, ) + + return returns } + `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/foo/foo_Consumer.go 1`] = ` -package foo +exports[`Generated code for "jsii-calc": /go/jsiicalc/BurriedAnonymousObject.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type Consumer interface { +// See https://github.com/aws/aws-cdk/issues/7977. +type BurriedAnonymousObject interface { + Check() *bool + // Implement this method and have it return it's parameter. + // + // Returns: \`value\`. + GiveItBack(value interface{}) interface{} } -// The jsii proxy struct for Consumer -type jsiiProxy_Consumer struct { +// The jsii proxy struct for BurriedAnonymousObject +type jsiiProxy_BurriedAnonymousObject struct { _ byte // padding } -func Consumer_Consume(props *ConsumerProps) *Homonymous { +func NewBurriedAnonymousObject_Override(b BurriedAnonymousObject) { _init_.Initialize() - var returns *Homonymous - - _jsii_.StaticInvoke( - "jsii-calc.homonymousForwardReferences.foo.Consumer", - "consume", - []interface{}{props}, - &returns, + _jsii_.Create( + "jsii-calc.BurriedAnonymousObject", + nil, // no parameters + b, ) - - return returns } +func (b *jsiiProxy_BurriedAnonymousObject) Check() *bool { + var returns *bool -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/foo/foo_ConsumerProps.go 1`] = ` -package foo - + _jsii_.Invoke( + b, + "check", + nil, // no parameters + &returns, + ) -type ConsumerProps struct { - Homonymous *Homonymous \`field:"required" json:"homonymous" yaml:"homonymous"\` + return returns } +func (b *jsiiProxy_BurriedAnonymousObject) GiveItBack(value interface{}) interface{} { + var returns interface{} -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/foo/foo_Homonymous.go 1`] = ` -package foo - + _jsii_.Invoke( + b, + "giveItBack", + []interface{}{value}, + &returns, + ) -type Homonymous struct { - StringProperty *string \`field:"required" json:"stringProperty" yaml:"stringProperty"\` + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/interfaceinnamespaceincludesclasses/interfaceinnamespaceincludesclasses.go 1`] = ` -package interfaceinnamespaceincludesclasses - -import ( - "reflect" - - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -func init() { - _jsii_.RegisterClass( - "jsii-calc.InterfaceInNamespaceIncludesClasses.Foo", - reflect.TypeOf((*Foo)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "bar", GoGetter: "Bar"}, - }, - func() interface{} { - return &jsiiProxy_Foo{} - }, - ) - _jsii_.RegisterStruct( - "jsii-calc.InterfaceInNamespaceIncludesClasses.Hello", - reflect.TypeOf((*Hello)(nil)).Elem(), - ) -} - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/interfaceinnamespaceincludesclasses/interfaceinnamespaceincludesclasses_Foo.go 1`] = ` -package interfaceinnamespaceincludesclasses +exports[`Generated code for "jsii-calc": /go/jsiicalc/Calculator.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) -type Foo interface { - Bar() *string - SetBar(val *string) + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/composition" + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/internal" + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" +) + +// A calculator which maintains a current value and allows adding operations. +// +// Here's how you use it: +// +// \`\`\`ts +// const calculator = new calc.Calculator(); +// calculator.add(5); +// calculator.mul(3); +// console.log(calculator.expression.value); +// \`\`\` +// +// I will repeat this example again, but in an @example tag. +// +// Example: +// calculator := calc.NewCalculator() +// calculator.Add(jsii.Number(5)) +// calculator.Mul(jsii.Number(3)) +// fmt.Println(calculator.expression.Value) +// +type Calculator interface { + composition.CompositeOperation + // The current value. + Curr() scopejsiicalclib.NumericValue + SetCurr(val scopejsiicalclib.NumericValue) + // A set of postfixes to include in a decorated .toString(). + DecorationPostfixes() *[]*string + SetDecorationPostfixes(val *[]*string) + // A set of prefixes to include in a decorated .toString(). + DecorationPrefixes() *[]*string + SetDecorationPrefixes(val *[]*string) + // Returns the expression. + Expression() scopejsiicalclib.NumericValue + // The maximum value allows in this calculator. + MaxValue() *float64 + SetMaxValue(val *float64) + // A log of all operations. + OperationsLog() *[]scopejsiicalclib.NumericValue + // A map of per operation name of all operations performed. + OperationsMap() *map[string]*[]scopejsiicalclib.NumericValue + // The .toString() style. + StringStyle() composition.CompositeOperation_CompositionStringStyle + SetStringStyle(val composition.CompositeOperation_CompositionStringStyle) + // Example of a property that accepts a union of types. + UnionProperty() interface{} + SetUnionProperty(val interface{}) + // The value. + Value() *float64 + // Adds a number to the current value. + Add(value *float64) + // Multiplies the current value by a number. + Mul(value *float64) + // Negates the current value. + Neg() + // Raises the current value by a power. + Pow(value *float64) + // Returns teh value of the union property (if defined). + ReadUnionValue() *float64 + // String representation of the value. + ToString() *string + // Returns: the name of the class (to verify native type names are created for derived classes). + TypeName() interface{} } -// The jsii proxy struct for Foo -type jsiiProxy_Foo struct { - _ byte // padding +// The jsii proxy struct for Calculator +type jsiiProxy_Calculator struct { + internal.Type__compositionCompositeOperation } -func (j *jsiiProxy_Foo) Bar() *string { - var returns *string +func (j *jsiiProxy_Calculator) Curr() scopejsiicalclib.NumericValue { + var returns scopejsiicalclib.NumericValue _jsii_.Get( j, - "bar", + "curr", &returns, ) return returns } +func (j *jsiiProxy_Calculator) DecorationPostfixes() *[]*string { + var returns *[]*string + _jsii_.Get( + j, + "decorationPostfixes", + &returns, + ) + return returns +} -func NewFoo() Foo { +func (j *jsiiProxy_Calculator) DecorationPrefixes() *[]*string { + var returns *[]*string + _jsii_.Get( + j, + "decorationPrefixes", + &returns, + ) + return returns +} + +func (j *jsiiProxy_Calculator) Expression() scopejsiicalclib.NumericValue { + var returns scopejsiicalclib.NumericValue + _jsii_.Get( + j, + "expression", + &returns, + ) + return returns +} + +func (j *jsiiProxy_Calculator) MaxValue() *float64 { + var returns *float64 + _jsii_.Get( + j, + "maxValue", + &returns, + ) + return returns +} + +func (j *jsiiProxy_Calculator) OperationsLog() *[]scopejsiicalclib.NumericValue { + var returns *[]scopejsiicalclib.NumericValue + _jsii_.Get( + j, + "operationsLog", + &returns, + ) + return returns +} + +func (j *jsiiProxy_Calculator) OperationsMap() *map[string]*[]scopejsiicalclib.NumericValue { + var returns *map[string]*[]scopejsiicalclib.NumericValue + _jsii_.Get( + j, + "operationsMap", + &returns, + ) + return returns +} + +func (j *jsiiProxy_Calculator) StringStyle() composition.CompositeOperation_CompositionStringStyle { + var returns composition.CompositeOperation_CompositionStringStyle + _jsii_.Get( + j, + "stringStyle", + &returns, + ) + return returns +} + +func (j *jsiiProxy_Calculator) UnionProperty() interface{} { + var returns interface{} + _jsii_.Get( + j, + "unionProperty", + &returns, + ) + return returns +} + +func (j *jsiiProxy_Calculator) Value() *float64 { + var returns *float64 + _jsii_.Get( + j, + "value", + &returns, + ) + return returns +} + + +// Creates a Calculator object. +func NewCalculator(props *CalculatorProps) Calculator { _init_.Initialize() - j := jsiiProxy_Foo{} + j := jsiiProxy_Calculator{} _jsii_.Create( - "jsii-calc.InterfaceInNamespaceIncludesClasses.Foo", - nil, // no parameters + "jsii-calc.Calculator", + []interface{}{props}, &j, ) return &j } -func NewFoo_Override(f Foo) { +// Creates a Calculator object. +func NewCalculator_Override(c Calculator, props *CalculatorProps) { _init_.Initialize() _jsii_.Create( - "jsii-calc.InterfaceInNamespaceIncludesClasses.Foo", - nil, // no parameters - f, + "jsii-calc.Calculator", + []interface{}{props}, + c, ) } -func (j *jsiiProxy_Foo)SetBar(val *string) { +func (j *jsiiProxy_Calculator)SetCurr(val scopejsiicalclib.NumericValue) { _jsii_.Set( j, - "bar", + "curr", val, ) } +func (j *jsiiProxy_Calculator)SetDecorationPostfixes(val *[]*string) { + _jsii_.Set( + j, + "decorationPostfixes", + val, + ) +} -`; +func (j *jsiiProxy_Calculator)SetDecorationPrefixes(val *[]*string) { + _jsii_.Set( + j, + "decorationPrefixes", + val, + ) +} -exports[`Generated code for "jsii-calc": /go/jsiicalc/interfaceinnamespaceincludesclasses/interfaceinnamespaceincludesclasses_Hello.go 1`] = ` -package interfaceinnamespaceincludesclasses +func (j *jsiiProxy_Calculator)SetMaxValue(val *float64) { + _jsii_.Set( + j, + "maxValue", + val, + ) +} +func (j *jsiiProxy_Calculator)SetStringStyle(val composition.CompositeOperation_CompositionStringStyle) { + _jsii_.Set( + j, + "stringStyle", + val, + ) +} -type Hello struct { - Foo *float64 \`field:"required" json:"foo" yaml:"foo"\` +func (j *jsiiProxy_Calculator)SetUnionProperty(val interface{}) { + _jsii_.Set( + j, + "unionProperty", + val, + ) } +func (c *jsiiProxy_Calculator) Add(value *float64) { + _jsii_.InvokeVoid( + c, + "add", + []interface{}{value}, + ) +} -`; +func (c *jsiiProxy_Calculator) Mul(value *float64) { + _jsii_.InvokeVoid( + c, + "mul", + []interface{}{value}, + ) +} -exports[`Generated code for "jsii-calc": /go/jsiicalc/interfaceinnamespaceonlyinterface/interfaceinnamespaceonlyinterface.go 1`] = ` -package interfaceinnamespaceonlyinterface +func (c *jsiiProxy_Calculator) Neg() { + _jsii_.InvokeVoid( + c, + "neg", + nil, // no parameters + ) +} -import ( - "reflect" +func (c *jsiiProxy_Calculator) Pow(value *float64) { + _jsii_.InvokeVoid( + c, + "pow", + []interface{}{value}, + ) +} - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) +func (c *jsiiProxy_Calculator) ReadUnionValue() *float64 { + var returns *float64 -func init() { - _jsii_.RegisterStruct( - "jsii-calc.InterfaceInNamespaceOnlyInterface.Hello", - reflect.TypeOf((*Hello)(nil)).Elem(), + _jsii_.Invoke( + c, + "readUnionValue", + nil, // no parameters + &returns, ) -} -`; + return returns +} -exports[`Generated code for "jsii-calc": /go/jsiicalc/interfaceinnamespaceonlyinterface/interfaceinnamespaceonlyinterface_Hello.go 1`] = ` -package interfaceinnamespaceonlyinterface +func (c *jsiiProxy_Calculator) ToString() *string { + var returns *string + _jsii_.Invoke( + c, + "toString", + nil, // no parameters + &returns, + ) -type Hello struct { - Foo *float64 \`field:"required" json:"foo" yaml:"foo"\` + return returns } +func (c *jsiiProxy_Calculator) TypeName() interface{} { + var returns interface{} -`; + _jsii_.Invoke( + c, + "typeName", + nil, // no parameters + &returns, + ) + + return returns +} -exports[`Generated code for "jsii-calc": /go/jsiicalc/internal/types.go 1`] = ` -package internal -import ( - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" - "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/composition" - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib/customsubmodulename" -) -type Type__scopejsiicalclibOperation = scopejsiicalclib.Operation -type Type__scopejsiicalclibIFriendly = scopejsiicalclib.IFriendly -type Type__compositionCompositeOperation = composition.CompositeOperation -type Type__customsubmodulenameIReflectable = customsubmodulename.IReflectable `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsii/jsii.go 1`] = ` -// Package jsii contains the functionaility needed for jsii packages to -// initialize their dependencies and themselves. Users should never need to use this package -// directly. If you find you need to - please report a bug at -// https://github.com/aws/jsii/issues/new/choose -package jsii +exports[`Generated code for "jsii-calc": /go/jsiicalc/CalculatorProps.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc -import ( - _ "embed" - _jsii_ "github.com/aws/jsii-runtime-go/runtime" +// Properties for Calculator. +type CalculatorProps struct { + // The initial value of the calculator. + // + // NOTE: Any number works here, it's fine. + InitialValue *float64 \`field:"optional" json:"initialValue" yaml:"initialValue"\` + // The maximum value the calculator can store. + MaximumValue *float64 \`field:"optional" json:"maximumValue" yaml:"maximumValue"\` +} - jcb "github.com/aws/jsii/jsii-calc/go/jcb/jsii" - scopejsiicalclib "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib/jsii" -) -//go:embed jsii-calc-3.20.120.tgz -var tarball []byte +`; -// Initialize loads the necessary packages in the @jsii/kernel to support the enclosing module. -// The implementation is idempotent (and hence safe to be called over and over). -func Initialize() { - // Ensure all dependencies are initialized - jcb.Initialize() - scopejsiicalclib.Initialize() +exports[`Generated code for "jsii-calc": /go/jsiicalc/ChildStruct982.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc - // Load this library into the kernel - _jsii_.Load("jsii-calc", "3.20.120", tarball) + +type ChildStruct982 struct { + Foo *string \`field:"required" json:"foo" yaml:"foo"\` + Bar *float64 \`field:"required" json:"bar" yaml:"bar"\` } -`; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsii/jsii-calc-3.20.120.tgz 1`] = `go/jsiicalc/jsii/jsii-calc-3.20.120.tgz is a tarball`; +`; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsii3656/jsii3656.go 1`] = ` -package jsii3656 +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassThatImplementsTheInternalInterface.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc import ( - "reflect" - _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -func init() { - _jsii_.RegisterStruct( - "jsii-calc.jsii3656.ImplementMeOpts", - reflect.TypeOf((*ImplementMeOpts)(nil)).Elem(), - ) - _jsii_.RegisterClass( - "jsii-calc.jsii3656.OverrideMe", - reflect.TypeOf((*OverrideMe)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "implementMe", GoMethod: "ImplementMe"}, - }, - func() interface{} { - return &jsiiProxy_OverrideMe{} - }, - ) +type ClassThatImplementsTheInternalInterface interface { + INonInternalInterface + A() *string + SetA(val *string) + B() *string + SetB(val *string) + C() *string + SetC(val *string) + D() *string + SetD(val *string) } -`; +// The jsii proxy struct for ClassThatImplementsTheInternalInterface +type jsiiProxy_ClassThatImplementsTheInternalInterface struct { + jsiiProxy_INonInternalInterface +} -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsii3656/jsii3656_ImplementMeOpts.go 1`] = ` -package jsii3656 +func (j *jsiiProxy_ClassThatImplementsTheInternalInterface) A() *string { + var returns *string + _jsii_.Get( + j, + "a", + &returns, + ) + return returns +} +func (j *jsiiProxy_ClassThatImplementsTheInternalInterface) B() *string { + var returns *string + _jsii_.Get( + j, + "b", + &returns, + ) + return returns +} -type ImplementMeOpts struct { - Name *string \`field:"required" json:"name" yaml:"name"\` - Count *float64 \`field:"optional" json:"count" yaml:"count"\` +func (j *jsiiProxy_ClassThatImplementsTheInternalInterface) C() *string { + var returns *string + _jsii_.Get( + j, + "c", + &returns, + ) + return returns } +func (j *jsiiProxy_ClassThatImplementsTheInternalInterface) D() *string { + var returns *string + _jsii_.Get( + j, + "d", + &returns, + ) + return returns +} -`; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsii3656/jsii3656_OverrideMe.go 1`] = ` -package jsii3656 +func NewClassThatImplementsTheInternalInterface() ClassThatImplementsTheInternalInterface { + _init_.Initialize() -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) + j := jsiiProxy_ClassThatImplementsTheInternalInterface{} -type OverrideMe interface { - ImplementMe(opts *ImplementMeOpts) *bool -} + _jsii_.Create( + "jsii-calc.ClassThatImplementsTheInternalInterface", + nil, // no parameters + &j, + ) -// The jsii proxy struct for OverrideMe -type jsiiProxy_OverrideMe struct { - _ byte // padding + return &j } -func NewOverrideMe_Override(o OverrideMe) { +func NewClassThatImplementsTheInternalInterface_Override(c ClassThatImplementsTheInternalInterface) { _init_.Initialize() _jsii_.Create( - "jsii-calc.jsii3656.OverrideMe", + "jsii-calc.ClassThatImplementsTheInternalInterface", nil, // no parameters - o, + c, ) } -func OverrideMe_CallAbstract(receiver OverrideMe) *bool { - _init_.Initialize() - - var returns *bool - - _jsii_.StaticInvoke( - "jsii-calc.jsii3656.OverrideMe", - "callAbstract", - []interface{}{receiver}, - &returns, +func (j *jsiiProxy_ClassThatImplementsTheInternalInterface)SetA(val *string) { + _jsii_.Set( + j, + "a", + val, ) - - return returns } -func (o *jsiiProxy_OverrideMe) ImplementMe(opts *ImplementMeOpts) *bool { - var returns *bool +func (j *jsiiProxy_ClassThatImplementsTheInternalInterface)SetB(val *string) { + _jsii_.Set( + j, + "b", + val, + ) +} - _jsii_.Invoke( - o, - "implementMe", - []interface{}{opts}, - &returns, +func (j *jsiiProxy_ClassThatImplementsTheInternalInterface)SetC(val *string) { + _jsii_.Set( + j, + "c", + val, ) +} - return returns +func (j *jsiiProxy_ClassThatImplementsTheInternalInterface)SetD(val *string) { + _jsii_.Set( + j, + "d", + val, + ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassThatImplementsThePrivateInterface.go 1`] = ` +// A simple calcuator built on JSII. package jsiicalc import ( - "reflect" - _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -func init() { - _jsii_.RegisterClass( - "jsii-calc.AbstractClass", - reflect.TypeOf((*AbstractClass)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "abstractMethod", GoMethod: "AbstractMethod"}, - _jsii_.MemberProperty{JsiiProperty: "abstractProperty", GoGetter: "AbstractProperty"}, - _jsii_.MemberMethod{JsiiMethod: "nonAbstractMethod", GoMethod: "NonAbstractMethod"}, - _jsii_.MemberProperty{JsiiProperty: "propFromInterface", GoGetter: "PropFromInterface"}, - }, - func() interface{} { - j := jsiiProxy_AbstractClass{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_AbstractClassBase) - _jsii_.InitJsiiProxy(&j.jsiiProxy_IInterfaceImplementedByAbstractClass) - return &j - }, +type ClassThatImplementsThePrivateInterface interface { + INonInternalInterface + A() *string + SetA(val *string) + B() *string + SetB(val *string) + C() *string + SetC(val *string) + E() *string + SetE(val *string) +} + +// The jsii proxy struct for ClassThatImplementsThePrivateInterface +type jsiiProxy_ClassThatImplementsThePrivateInterface struct { + jsiiProxy_INonInternalInterface +} + +func (j *jsiiProxy_ClassThatImplementsThePrivateInterface) A() *string { + var returns *string + _jsii_.Get( + j, + "a", + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.AbstractClassBase", - reflect.TypeOf((*AbstractClassBase)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "abstractProperty", GoGetter: "AbstractProperty"}, - }, - func() interface{} { - return &jsiiProxy_AbstractClassBase{} - }, + return returns +} + +func (j *jsiiProxy_ClassThatImplementsThePrivateInterface) B() *string { + var returns *string + _jsii_.Get( + j, + "b", + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.AbstractClassReturner", - reflect.TypeOf((*AbstractClassReturner)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "giveMeAbstract", GoMethod: "GiveMeAbstract"}, - _jsii_.MemberMethod{JsiiMethod: "giveMeInterface", GoMethod: "GiveMeInterface"}, - _jsii_.MemberProperty{JsiiProperty: "returnAbstractFromProperty", GoGetter: "ReturnAbstractFromProperty"}, - }, - func() interface{} { - return &jsiiProxy_AbstractClassReturner{} - }, + return returns +} + +func (j *jsiiProxy_ClassThatImplementsThePrivateInterface) C() *string { + var returns *string + _jsii_.Get( + j, + "c", + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.AbstractSuite", - reflect.TypeOf((*AbstractSuite)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "property", GoGetter: "Property"}, - _jsii_.MemberMethod{JsiiMethod: "someMethod", GoMethod: "SomeMethod"}, - _jsii_.MemberMethod{JsiiMethod: "workItAll", GoMethod: "WorkItAll"}, - }, - func() interface{} { - return &jsiiProxy_AbstractSuite{} - }, + return returns +} + +func (j *jsiiProxy_ClassThatImplementsThePrivateInterface) E() *string { + var returns *string + _jsii_.Get( + j, + "e", + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.Add", - reflect.TypeOf((*Add)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, - _jsii_.MemberProperty{JsiiProperty: "lhs", GoGetter: "Lhs"}, - _jsii_.MemberProperty{JsiiProperty: "rhs", GoGetter: "Rhs"}, - _jsii_.MemberMethod{JsiiMethod: "toString", GoMethod: "ToString"}, - _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, - _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, - }, - func() interface{} { - j := jsiiProxy_Add{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_BinaryOperation) - return &j - }, + return returns +} + + +func NewClassThatImplementsThePrivateInterface() ClassThatImplementsThePrivateInterface { + _init_.Initialize() + + j := jsiiProxy_ClassThatImplementsThePrivateInterface{} + + _jsii_.Create( + "jsii-calc.ClassThatImplementsThePrivateInterface", + nil, // no parameters + &j, ) - _jsii_.RegisterClass( - "jsii-calc.AllTypes", - reflect.TypeOf((*AllTypes)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "anyArrayProperty", GoGetter: "AnyArrayProperty"}, - _jsii_.MemberMethod{JsiiMethod: "anyIn", GoMethod: "AnyIn"}, - _jsii_.MemberProperty{JsiiProperty: "anyMapProperty", GoGetter: "AnyMapProperty"}, - _jsii_.MemberMethod{JsiiMethod: "anyOut", GoMethod: "AnyOut"}, - _jsii_.MemberProperty{JsiiProperty: "anyProperty", GoGetter: "AnyProperty"}, - _jsii_.MemberProperty{JsiiProperty: "arrayProperty", GoGetter: "ArrayProperty"}, - _jsii_.MemberProperty{JsiiProperty: "booleanProperty", GoGetter: "BooleanProperty"}, - _jsii_.MemberProperty{JsiiProperty: "dateProperty", GoGetter: "DateProperty"}, - _jsii_.MemberMethod{JsiiMethod: "enumMethod", GoMethod: "EnumMethod"}, - _jsii_.MemberProperty{JsiiProperty: "enumProperty", GoGetter: "EnumProperty"}, - _jsii_.MemberProperty{JsiiProperty: "enumPropertyValue", GoGetter: "EnumPropertyValue"}, - _jsii_.MemberProperty{JsiiProperty: "jsonProperty", GoGetter: "JsonProperty"}, - _jsii_.MemberProperty{JsiiProperty: "mapProperty", GoGetter: "MapProperty"}, - _jsii_.MemberProperty{JsiiProperty: "numberProperty", GoGetter: "NumberProperty"}, - _jsii_.MemberProperty{JsiiProperty: "optionalEnumValue", GoGetter: "OptionalEnumValue"}, - _jsii_.MemberProperty{JsiiProperty: "stringProperty", GoGetter: "StringProperty"}, - _jsii_.MemberProperty{JsiiProperty: "unionArrayProperty", GoGetter: "UnionArrayProperty"}, - _jsii_.MemberProperty{JsiiProperty: "unionMapProperty", GoGetter: "UnionMapProperty"}, - _jsii_.MemberProperty{JsiiProperty: "unionProperty", GoGetter: "UnionProperty"}, - _jsii_.MemberProperty{JsiiProperty: "unknownArrayProperty", GoGetter: "UnknownArrayProperty"}, - _jsii_.MemberProperty{JsiiProperty: "unknownMapProperty", GoGetter: "UnknownMapProperty"}, - _jsii_.MemberProperty{JsiiProperty: "unknownProperty", GoGetter: "UnknownProperty"}, - }, - func() interface{} { - return &jsiiProxy_AllTypes{} - }, + + return &j +} + +func NewClassThatImplementsThePrivateInterface_Override(c ClassThatImplementsThePrivateInterface) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.ClassThatImplementsThePrivateInterface", + nil, // no parameters + c, ) - _jsii_.RegisterEnum( - "jsii-calc.AllTypesEnum", - reflect.TypeOf((*AllTypesEnum)(nil)).Elem(), - map[string]interface{}{ - "MY_ENUM_VALUE": AllTypesEnum_MY_ENUM_VALUE, - "YOUR_ENUM_VALUE": AllTypesEnum_YOUR_ENUM_VALUE, - "THIS_IS_GREAT": AllTypesEnum_THIS_IS_GREAT, - }, +} + +func (j *jsiiProxy_ClassThatImplementsThePrivateInterface)SetA(val *string) { + _jsii_.Set( + j, + "a", + val, ) - _jsii_.RegisterClass( - "jsii-calc.AllowedMethodNames", - reflect.TypeOf((*AllowedMethodNames)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "getBar", GoMethod: "GetBar"}, - _jsii_.MemberMethod{JsiiMethod: "getFoo", GoMethod: "GetFoo"}, - _jsii_.MemberMethod{JsiiMethod: "setBar", GoMethod: "SetBar"}, - _jsii_.MemberMethod{JsiiMethod: "setFoo", GoMethod: "SetFoo"}, - }, - func() interface{} { - return &jsiiProxy_AllowedMethodNames{} - }, +} + +func (j *jsiiProxy_ClassThatImplementsThePrivateInterface)SetB(val *string) { + _jsii_.Set( + j, + "b", + val, ) - _jsii_.RegisterClass( - "jsii-calc.AmbiguousParameters", - reflect.TypeOf((*AmbiguousParameters)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "props", GoGetter: "Props"}, - _jsii_.MemberProperty{JsiiProperty: "scope", GoGetter: "Scope"}, - }, - func() interface{} { - return &jsiiProxy_AmbiguousParameters{} - }, +} + +func (j *jsiiProxy_ClassThatImplementsThePrivateInterface)SetC(val *string) { + _jsii_.Set( + j, + "c", + val, ) - _jsii_.RegisterClass( - "jsii-calc.AnonymousImplementationProvider", - reflect.TypeOf((*AnonymousImplementationProvider)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "provideAsClass", GoMethod: "ProvideAsClass"}, - _jsii_.MemberMethod{JsiiMethod: "provideAsInterface", GoMethod: "ProvideAsInterface"}, - }, - func() interface{} { - j := jsiiProxy_AnonymousImplementationProvider{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_IAnonymousImplementationProvider) - return &j - }, +} + +func (j *jsiiProxy_ClassThatImplementsThePrivateInterface)SetE(val *string) { + _jsii_.Set( + j, + "e", + val, ) - _jsii_.RegisterClass( - "jsii-calc.AsyncVirtualMethods", - reflect.TypeOf((*AsyncVirtualMethods)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "callMe", GoMethod: "CallMe"}, - _jsii_.MemberMethod{JsiiMethod: "callMe2", GoMethod: "CallMe2"}, - _jsii_.MemberMethod{JsiiMethod: "callMeDoublePromise", GoMethod: "CallMeDoublePromise"}, - _jsii_.MemberMethod{JsiiMethod: "dontOverrideMe", GoMethod: "DontOverrideMe"}, - _jsii_.MemberMethod{JsiiMethod: "overrideMe", GoMethod: "OverrideMe"}, - _jsii_.MemberMethod{JsiiMethod: "overrideMeToo", GoMethod: "OverrideMeToo"}, - }, - func() interface{} { - return &jsiiProxy_AsyncVirtualMethods{} - }, +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassWithCollectionOfUnions.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +type ClassWithCollectionOfUnions interface { + UnionProperty() *[]*map[string]interface{} + SetUnionProperty(val *[]*map[string]interface{}) +} + +// The jsii proxy struct for ClassWithCollectionOfUnions +type jsiiProxy_ClassWithCollectionOfUnions struct { + _ byte // padding +} + +func (j *jsiiProxy_ClassWithCollectionOfUnions) UnionProperty() *[]*map[string]interface{} { + var returns *[]*map[string]interface{} + _jsii_.Get( + j, + "unionProperty", + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.AugmentableClass", - reflect.TypeOf((*AugmentableClass)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "methodOne", GoMethod: "MethodOne"}, - _jsii_.MemberMethod{JsiiMethod: "methodTwo", GoMethod: "MethodTwo"}, - }, - func() interface{} { - return &jsiiProxy_AugmentableClass{} - }, + return returns +} + + +func NewClassWithCollectionOfUnions(unionProperty *[]*map[string]interface{}) ClassWithCollectionOfUnions { + _init_.Initialize() + + j := jsiiProxy_ClassWithCollectionOfUnions{} + + _jsii_.Create( + "jsii-calc.ClassWithCollectionOfUnions", + []interface{}{unionProperty}, + &j, ) - _jsii_.RegisterClass( - "jsii-calc.BaseClass", - reflect.TypeOf((*BaseClass)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, - _jsii_.MemberProperty{JsiiProperty: "property", GoGetter: "Property"}, - }, - func() interface{} { - return &jsiiProxy_BaseClass{} - }, + + return &j +} + +func NewClassWithCollectionOfUnions_Override(c ClassWithCollectionOfUnions, unionProperty *[]*map[string]interface{}) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.ClassWithCollectionOfUnions", + []interface{}{unionProperty}, + c, ) - _jsii_.RegisterClass( - "jsii-calc.BaseJsii976", - reflect.TypeOf((*BaseJsii976)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_BaseJsii976{} - }, +} + +func (j *jsiiProxy_ClassWithCollectionOfUnions)SetUnionProperty(val *[]*map[string]interface{}) { + _jsii_.Set( + j, + "unionProperty", + val, ) - _jsii_.RegisterClass( - "jsii-calc.Bell", - reflect.TypeOf((*Bell)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "ring", GoMethod: "Ring"}, - _jsii_.MemberProperty{JsiiProperty: "rung", GoGetter: "Rung"}, - }, - func() interface{} { - j := jsiiProxy_Bell{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_IBell) - return &j - }, +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassWithCollections.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +type ClassWithCollections interface { + Array() *[]*string + SetArray(val *[]*string) + Map() *map[string]*string + SetMap(val *map[string]*string) +} + +// The jsii proxy struct for ClassWithCollections +type jsiiProxy_ClassWithCollections struct { + _ byte // padding +} + +func (j *jsiiProxy_ClassWithCollections) Array() *[]*string { + var returns *[]*string + _jsii_.Get( + j, + "array", + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.BinaryOperation", - reflect.TypeOf((*BinaryOperation)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, - _jsii_.MemberProperty{JsiiProperty: "lhs", GoGetter: "Lhs"}, - _jsii_.MemberProperty{JsiiProperty: "rhs", GoGetter: "Rhs"}, - _jsii_.MemberMethod{JsiiMethod: "toString", GoMethod: "ToString"}, - _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, - _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, - }, - func() interface{} { - j := jsiiProxy_BinaryOperation{} - _jsii_.InitJsiiProxy(&j.Type__scopejsiicalclibOperation) - _jsii_.InitJsiiProxy(&j.Type__scopejsiicalclibIFriendly) - return &j - }, + return returns +} + +func (j *jsiiProxy_ClassWithCollections) Map() *map[string]*string { + var returns *map[string]*string + _jsii_.Get( + j, + "map", + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.BurriedAnonymousObject", - reflect.TypeOf((*BurriedAnonymousObject)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "check", GoMethod: "Check"}, - _jsii_.MemberMethod{JsiiMethod: "giveItBack", GoMethod: "GiveItBack"}, - }, - func() interface{} { - return &jsiiProxy_BurriedAnonymousObject{} - }, + return returns +} + + +func NewClassWithCollections(map_ *map[string]*string, array *[]*string) ClassWithCollections { + _init_.Initialize() + + j := jsiiProxy_ClassWithCollections{} + + _jsii_.Create( + "jsii-calc.ClassWithCollections", + []interface{}{map_, array}, + &j, ) - _jsii_.RegisterClass( - "jsii-calc.Calculator", - reflect.TypeOf((*Calculator)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "add", GoMethod: "Add"}, - _jsii_.MemberProperty{JsiiProperty: "curr", GoGetter: "Curr"}, - _jsii_.MemberProperty{JsiiProperty: "decorationPostfixes", GoGetter: "DecorationPostfixes"}, - _jsii_.MemberProperty{JsiiProperty: "decorationPrefixes", GoGetter: "DecorationPrefixes"}, - _jsii_.MemberProperty{JsiiProperty: "expression", GoGetter: "Expression"}, - _jsii_.MemberProperty{JsiiProperty: "maxValue", GoGetter: "MaxValue"}, - _jsii_.MemberMethod{JsiiMethod: "mul", GoMethod: "Mul"}, - _jsii_.MemberMethod{JsiiMethod: "neg", GoMethod: "Neg"}, - _jsii_.MemberProperty{JsiiProperty: "operationsLog", GoGetter: "OperationsLog"}, - _jsii_.MemberProperty{JsiiProperty: "operationsMap", GoGetter: "OperationsMap"}, - _jsii_.MemberMethod{JsiiMethod: "pow", GoMethod: "Pow"}, - _jsii_.MemberMethod{JsiiMethod: "readUnionValue", GoMethod: "ReadUnionValue"}, - _jsii_.MemberProperty{JsiiProperty: "stringStyle", GoGetter: "StringStyle"}, - _jsii_.MemberMethod{JsiiMethod: "toString", GoMethod: "ToString"}, - _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, - _jsii_.MemberProperty{JsiiProperty: "unionProperty", GoGetter: "UnionProperty"}, - _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, - }, - func() interface{} { - j := jsiiProxy_Calculator{} - _jsii_.InitJsiiProxy(&j.Type__compositionCompositeOperation) - return &j - }, + + return &j +} + +func NewClassWithCollections_Override(c ClassWithCollections, map_ *map[string]*string, array *[]*string) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.ClassWithCollections", + []interface{}{map_, array}, + c, ) - _jsii_.RegisterStruct( - "jsii-calc.CalculatorProps", - reflect.TypeOf((*CalculatorProps)(nil)).Elem(), +} + +func (j *jsiiProxy_ClassWithCollections)SetArray(val *[]*string) { + _jsii_.Set( + j, + "array", + val, ) - _jsii_.RegisterStruct( - "jsii-calc.ChildStruct982", - reflect.TypeOf((*ChildStruct982)(nil)).Elem(), +} + +func (j *jsiiProxy_ClassWithCollections)SetMap(val *map[string]*string) { + _jsii_.Set( + j, + "map", + val, ) - _jsii_.RegisterClass( - "jsii-calc.ClassThatImplementsTheInternalInterface", - reflect.TypeOf((*ClassThatImplementsTheInternalInterface)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "a", GoGetter: "A"}, - _jsii_.MemberProperty{JsiiProperty: "b", GoGetter: "B"}, - _jsii_.MemberProperty{JsiiProperty: "c", GoGetter: "C"}, - _jsii_.MemberProperty{JsiiProperty: "d", GoGetter: "D"}, - }, - func() interface{} { - j := jsiiProxy_ClassThatImplementsTheInternalInterface{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_INonInternalInterface) - return &j - }, +} + +func ClassWithCollections_CreateAList() *[]*string { + _init_.Initialize() + + var returns *[]*string + + _jsii_.StaticInvoke( + "jsii-calc.ClassWithCollections", + "createAList", + nil, // no parameters + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.ClassThatImplementsThePrivateInterface", - reflect.TypeOf((*ClassThatImplementsThePrivateInterface)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "a", GoGetter: "A"}, - _jsii_.MemberProperty{JsiiProperty: "b", GoGetter: "B"}, - _jsii_.MemberProperty{JsiiProperty: "c", GoGetter: "C"}, - _jsii_.MemberProperty{JsiiProperty: "e", GoGetter: "E"}, - }, - func() interface{} { - j := jsiiProxy_ClassThatImplementsThePrivateInterface{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_INonInternalInterface) - return &j - }, - ) - _jsii_.RegisterClass( - "jsii-calc.ClassWithCollectionOfUnions", - reflect.TypeOf((*ClassWithCollectionOfUnions)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "unionProperty", GoGetter: "UnionProperty"}, - }, - func() interface{} { - return &jsiiProxy_ClassWithCollectionOfUnions{} - }, + + return returns +} + +func ClassWithCollections_CreateAMap() *map[string]*string { + _init_.Initialize() + + var returns *map[string]*string + + _jsii_.StaticInvoke( + "jsii-calc.ClassWithCollections", + "createAMap", + nil, // no parameters + &returns, ) - _jsii_.RegisterClass( + + return returns +} + +func ClassWithCollections_StaticArray() *[]*string { + _init_.Initialize() + var returns *[]*string + _jsii_.StaticGet( "jsii-calc.ClassWithCollections", - reflect.TypeOf((*ClassWithCollections)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "array", GoGetter: "Array"}, - _jsii_.MemberProperty{JsiiProperty: "map", GoGetter: "Map"}, - }, - func() interface{} { - return &jsiiProxy_ClassWithCollections{} - }, + "staticArray", + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.ClassWithContainerTypes", - reflect.TypeOf((*ClassWithContainerTypes)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "array", GoGetter: "Array"}, - _jsii_.MemberProperty{JsiiProperty: "obj", GoGetter: "Obj"}, - _jsii_.MemberProperty{JsiiProperty: "props", GoGetter: "Props"}, - _jsii_.MemberProperty{JsiiProperty: "record", GoGetter: "Record"}, - }, - func() interface{} { - return &jsiiProxy_ClassWithContainerTypes{} - }, + return returns +} + +func ClassWithCollections_SetStaticArray(val *[]*string) { + _init_.Initialize() + _jsii_.StaticSet( + "jsii-calc.ClassWithCollections", + "staticArray", + val, ) - _jsii_.RegisterClass( - "jsii-calc.ClassWithDocs", - reflect.TypeOf((*ClassWithDocs)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_ClassWithDocs{} - }, +} + +func ClassWithCollections_StaticMap() *map[string]*string { + _init_.Initialize() + var returns *map[string]*string + _jsii_.StaticGet( + "jsii-calc.ClassWithCollections", + "staticMap", + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.ClassWithJavaReservedWords", - reflect.TypeOf((*ClassWithJavaReservedWords)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "import", GoMethod: "Import"}, - _jsii_.MemberProperty{JsiiProperty: "int", GoGetter: "Int"}, - }, - func() interface{} { - return &jsiiProxy_ClassWithJavaReservedWords{} - }, + return returns +} + +func ClassWithCollections_SetStaticMap(val *map[string]*string) { + _init_.Initialize() + _jsii_.StaticSet( + "jsii-calc.ClassWithCollections", + "staticMap", + val, ) - _jsii_.RegisterClass( - "jsii-calc.ClassWithMutableObjectLiteralProperty", - reflect.TypeOf((*ClassWithMutableObjectLiteralProperty)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "mutableObject", GoGetter: "MutableObject"}, - }, - func() interface{} { - return &jsiiProxy_ClassWithMutableObjectLiteralProperty{} - }, +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassWithContainerTypes.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +type ClassWithContainerTypes interface { + Array() *[]*DummyObj + Obj() *map[string]*DummyObj + Props() *ContainerProps + Record() *map[string]*DummyObj +} + +// The jsii proxy struct for ClassWithContainerTypes +type jsiiProxy_ClassWithContainerTypes struct { + _ byte // padding +} + +func (j *jsiiProxy_ClassWithContainerTypes) Array() *[]*DummyObj { + var returns *[]*DummyObj + _jsii_.Get( + j, + "array", + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.ClassWithNestedUnion", - reflect.TypeOf((*ClassWithNestedUnion)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "unionProperty", GoGetter: "UnionProperty"}, - }, - func() interface{} { - return &jsiiProxy_ClassWithNestedUnion{} - }, + return returns +} + +func (j *jsiiProxy_ClassWithContainerTypes) Obj() *map[string]*DummyObj { + var returns *map[string]*DummyObj + _jsii_.Get( + j, + "obj", + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.ClassWithPrivateConstructorAndAutomaticProperties", - reflect.TypeOf((*ClassWithPrivateConstructorAndAutomaticProperties)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "readOnlyString", GoGetter: "ReadOnlyString"}, - _jsii_.MemberProperty{JsiiProperty: "readWriteString", GoGetter: "ReadWriteString"}, - }, - func() interface{} { - j := jsiiProxy_ClassWithPrivateConstructorAndAutomaticProperties{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_IInterfaceWithProperties) - return &j - }, + return returns +} + +func (j *jsiiProxy_ClassWithContainerTypes) Props() *ContainerProps { + var returns *ContainerProps + _jsii_.Get( + j, + "props", + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.ConfusingToJackson", - reflect.TypeOf((*ConfusingToJackson)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "unionProperty", GoGetter: "UnionProperty"}, - }, - func() interface{} { - return &jsiiProxy_ConfusingToJackson{} - }, + return returns +} + +func (j *jsiiProxy_ClassWithContainerTypes) Record() *map[string]*DummyObj { + var returns *map[string]*DummyObj + _jsii_.Get( + j, + "record", + &returns, ) - _jsii_.RegisterStruct( - "jsii-calc.ConfusingToJacksonStruct", - reflect.TypeOf((*ConfusingToJacksonStruct)(nil)).Elem(), + return returns +} + + +func NewClassWithContainerTypes(array *[]*DummyObj, record *map[string]*DummyObj, obj *map[string]*DummyObj, props *ContainerProps) ClassWithContainerTypes { + _init_.Initialize() + + j := jsiiProxy_ClassWithContainerTypes{} + + _jsii_.Create( + "jsii-calc.ClassWithContainerTypes", + []interface{}{array, record, obj, props}, + &j, ) - _jsii_.RegisterClass( - "jsii-calc.ConstructorPassesThisOut", - reflect.TypeOf((*ConstructorPassesThisOut)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_ConstructorPassesThisOut{} - }, + + return &j +} + +func NewClassWithContainerTypes_Override(c ClassWithContainerTypes, array *[]*DummyObj, record *map[string]*DummyObj, obj *map[string]*DummyObj, props *ContainerProps) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.ClassWithContainerTypes", + []interface{}{array, record, obj, props}, + c, ) - _jsii_.RegisterClass( - "jsii-calc.Constructors", - reflect.TypeOf((*Constructors)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_Constructors{} - }, +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassWithDocs.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +// This class has docs. +// +// The docs are great. They're a bunch of tags. +// +// Example: +// func anExample() { +// } +// +// See: https://aws.amazon.com/ +// +type ClassWithDocs interface { +} + +// The jsii proxy struct for ClassWithDocs +type jsiiProxy_ClassWithDocs struct { + _ byte // padding +} + +func NewClassWithDocs() ClassWithDocs { + _init_.Initialize() + + j := jsiiProxy_ClassWithDocs{} + + _jsii_.Create( + "jsii-calc.ClassWithDocs", + nil, // no parameters + &j, ) - _jsii_.RegisterClass( - "jsii-calc.ConsumePureInterface", - reflect.TypeOf((*ConsumePureInterface)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "workItBaby", GoMethod: "WorkItBaby"}, - }, - func() interface{} { - return &jsiiProxy_ConsumePureInterface{} - }, + + return &j +} + +func NewClassWithDocs_Override(c ClassWithDocs) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.ClassWithDocs", + nil, // no parameters + c, ) - _jsii_.RegisterClass( - "jsii-calc.ConsumerCanRingBell", - reflect.TypeOf((*ConsumerCanRingBell)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "implementedByObjectLiteral", GoMethod: "ImplementedByObjectLiteral"}, - _jsii_.MemberMethod{JsiiMethod: "implementedByPrivateClass", GoMethod: "ImplementedByPrivateClass"}, - _jsii_.MemberMethod{JsiiMethod: "implementedByPublicClass", GoMethod: "ImplementedByPublicClass"}, - _jsii_.MemberMethod{JsiiMethod: "whenTypedAsClass", GoMethod: "WhenTypedAsClass"}, - }, - func() interface{} { - return &jsiiProxy_ConsumerCanRingBell{} - }, +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassWithJavaReservedWords.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +type ClassWithJavaReservedWords interface { + Int() *string + Import(assert *string) *string +} + +// The jsii proxy struct for ClassWithJavaReservedWords +type jsiiProxy_ClassWithJavaReservedWords struct { + _ byte // padding +} + +func (j *jsiiProxy_ClassWithJavaReservedWords) Int() *string { + var returns *string + _jsii_.Get( + j, + "int", + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.ConsumersOfThisCrazyTypeSystem", - reflect.TypeOf((*ConsumersOfThisCrazyTypeSystem)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "consumeAnotherPublicInterface", GoMethod: "ConsumeAnotherPublicInterface"}, - _jsii_.MemberMethod{JsiiMethod: "consumeNonInternalInterface", GoMethod: "ConsumeNonInternalInterface"}, - }, - func() interface{} { - return &jsiiProxy_ConsumersOfThisCrazyTypeSystem{} - }, + return returns +} + + +func NewClassWithJavaReservedWords(int *string) ClassWithJavaReservedWords { + _init_.Initialize() + + j := jsiiProxy_ClassWithJavaReservedWords{} + + _jsii_.Create( + "jsii-calc.ClassWithJavaReservedWords", + []interface{}{int}, + &j, ) - _jsii_.RegisterStruct( - "jsii-calc.ContainerProps", - reflect.TypeOf((*ContainerProps)(nil)).Elem(), + + return &j +} + +func NewClassWithJavaReservedWords_Override(c ClassWithJavaReservedWords, int *string) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.ClassWithJavaReservedWords", + []interface{}{int}, + c, ) - _jsii_.RegisterClass( - "jsii-calc.DataRenderer", - reflect.TypeOf((*DataRenderer)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "render", GoMethod: "Render"}, - _jsii_.MemberMethod{JsiiMethod: "renderArbitrary", GoMethod: "RenderArbitrary"}, - _jsii_.MemberMethod{JsiiMethod: "renderMap", GoMethod: "RenderMap"}, - }, - func() interface{} { - return &jsiiProxy_DataRenderer{} - }, +} + +func (c *jsiiProxy_ClassWithJavaReservedWords) Import(assert *string) *string { + var returns *string + + _jsii_.Invoke( + c, + "import", + []interface{}{assert}, + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.Default", - reflect.TypeOf((*Default)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "pleaseCompile", GoMethod: "PleaseCompile"}, - }, - func() interface{} { - return &jsiiProxy_Default{} - }, + + return returns +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassWithMutableObjectLiteralProperty.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +type ClassWithMutableObjectLiteralProperty interface { + MutableObject() IMutableObjectLiteral + SetMutableObject(val IMutableObjectLiteral) +} + +// The jsii proxy struct for ClassWithMutableObjectLiteralProperty +type jsiiProxy_ClassWithMutableObjectLiteralProperty struct { + _ byte // padding +} + +func (j *jsiiProxy_ClassWithMutableObjectLiteralProperty) MutableObject() IMutableObjectLiteral { + var returns IMutableObjectLiteral + _jsii_.Get( + j, + "mutableObject", + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.DefaultedConstructorArgument", - reflect.TypeOf((*DefaultedConstructorArgument)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "arg1", GoGetter: "Arg1"}, - _jsii_.MemberProperty{JsiiProperty: "arg2", GoGetter: "Arg2"}, - _jsii_.MemberProperty{JsiiProperty: "arg3", GoGetter: "Arg3"}, - }, - func() interface{} { - return &jsiiProxy_DefaultedConstructorArgument{} - }, + return returns +} + + +func NewClassWithMutableObjectLiteralProperty() ClassWithMutableObjectLiteralProperty { + _init_.Initialize() + + j := jsiiProxy_ClassWithMutableObjectLiteralProperty{} + + _jsii_.Create( + "jsii-calc.ClassWithMutableObjectLiteralProperty", + nil, // no parameters + &j, ) - _jsii_.RegisterClass( - "jsii-calc.Demonstrate982", - reflect.TypeOf((*Demonstrate982)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_Demonstrate982{} - }, + + return &j +} + +func NewClassWithMutableObjectLiteralProperty_Override(c ClassWithMutableObjectLiteralProperty) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.ClassWithMutableObjectLiteralProperty", + nil, // no parameters + c, ) - _jsii_.RegisterClass( - "jsii-calc.DeprecatedClass", - reflect.TypeOf((*DeprecatedClass)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, - _jsii_.MemberProperty{JsiiProperty: "mutableProperty", GoGetter: "MutableProperty"}, - _jsii_.MemberProperty{JsiiProperty: "readonlyProperty", GoGetter: "ReadonlyProperty"}, - }, - func() interface{} { - return &jsiiProxy_DeprecatedClass{} - }, +} + +func (j *jsiiProxy_ClassWithMutableObjectLiteralProperty)SetMutableObject(val IMutableObjectLiteral) { + _jsii_.Set( + j, + "mutableObject", + val, ) - _jsii_.RegisterEnum( - "jsii-calc.DeprecatedEnum", - reflect.TypeOf((*DeprecatedEnum)(nil)).Elem(), - map[string]interface{}{ - "OPTION_A": DeprecatedEnum_OPTION_A, - "OPTION_B": DeprecatedEnum_OPTION_B, - }, - ) - _jsii_.RegisterStruct( - "jsii-calc.DeprecatedStruct", - reflect.TypeOf((*DeprecatedStruct)(nil)).Elem(), - ) - _jsii_.RegisterStruct( - "jsii-calc.DerivedStruct", - reflect.TypeOf((*DerivedStruct)(nil)).Elem(), +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassWithNestedUnion.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +type ClassWithNestedUnion interface { + UnionProperty() *[]interface{} + SetUnionProperty(val *[]interface{}) +} + +// The jsii proxy struct for ClassWithNestedUnion +type jsiiProxy_ClassWithNestedUnion struct { + _ byte // padding +} + +func (j *jsiiProxy_ClassWithNestedUnion) UnionProperty() *[]interface{} { + var returns *[]interface{} + _jsii_.Get( + j, + "unionProperty", + &returns, ) - _jsii_.RegisterStruct( - "jsii-calc.DiamondBottom", - reflect.TypeOf((*DiamondBottom)(nil)).Elem(), + return returns +} + + +func NewClassWithNestedUnion(unionProperty *[]interface{}) ClassWithNestedUnion { + _init_.Initialize() + + j := jsiiProxy_ClassWithNestedUnion{} + + _jsii_.Create( + "jsii-calc.ClassWithNestedUnion", + []interface{}{unionProperty}, + &j, ) - _jsii_.RegisterStruct( - "jsii-calc.DiamondInheritanceBaseLevelStruct", - reflect.TypeOf((*DiamondInheritanceBaseLevelStruct)(nil)).Elem(), + + return &j +} + +func NewClassWithNestedUnion_Override(c ClassWithNestedUnion, unionProperty *[]interface{}) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.ClassWithNestedUnion", + []interface{}{unionProperty}, + c, ) - _jsii_.RegisterStruct( - "jsii-calc.DiamondInheritanceFirstMidLevelStruct", - reflect.TypeOf((*DiamondInheritanceFirstMidLevelStruct)(nil)).Elem(), +} + +func (j *jsiiProxy_ClassWithNestedUnion)SetUnionProperty(val *[]interface{}) { + _jsii_.Set( + j, + "unionProperty", + val, ) - _jsii_.RegisterStruct( - "jsii-calc.DiamondInheritanceSecondMidLevelStruct", - reflect.TypeOf((*DiamondInheritanceSecondMidLevelStruct)(nil)).Elem(), +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassWithPrivateConstructorAndAutomaticProperties.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +// Class that implements interface properties automatically, but using a private constructor. +type ClassWithPrivateConstructorAndAutomaticProperties interface { + IInterfaceWithProperties + ReadOnlyString() *string + ReadWriteString() *string + SetReadWriteString(val *string) +} + +// The jsii proxy struct for ClassWithPrivateConstructorAndAutomaticProperties +type jsiiProxy_ClassWithPrivateConstructorAndAutomaticProperties struct { + jsiiProxy_IInterfaceWithProperties +} + +func (j *jsiiProxy_ClassWithPrivateConstructorAndAutomaticProperties) ReadOnlyString() *string { + var returns *string + _jsii_.Get( + j, + "readOnlyString", + &returns, ) - _jsii_.RegisterStruct( - "jsii-calc.DiamondInheritanceTopLevelStruct", - reflect.TypeOf((*DiamondInheritanceTopLevelStruct)(nil)).Elem(), + return returns +} + +func (j *jsiiProxy_ClassWithPrivateConstructorAndAutomaticProperties) ReadWriteString() *string { + var returns *string + _jsii_.Get( + j, + "readWriteString", + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.DisappointingCollectionSource", - reflect.TypeOf((*DisappointingCollectionSource)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_DisappointingCollectionSource{} - }, + return returns +} + + +func (j *jsiiProxy_ClassWithPrivateConstructorAndAutomaticProperties)SetReadWriteString(val *string) { + _jsii_.Set( + j, + "readWriteString", + val, ) - _jsii_.RegisterClass( - "jsii-calc.DoNotOverridePrivates", - reflect.TypeOf((*DoNotOverridePrivates)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "changePrivatePropertyValue", GoMethod: "ChangePrivatePropertyValue"}, - _jsii_.MemberMethod{JsiiMethod: "privateMethodValue", GoMethod: "PrivateMethodValue"}, - _jsii_.MemberMethod{JsiiMethod: "privatePropertyValue", GoMethod: "PrivatePropertyValue"}, - }, - func() interface{} { - return &jsiiProxy_DoNotOverridePrivates{} - }, +} + +func ClassWithPrivateConstructorAndAutomaticProperties_Create(readOnlyString *string, readWriteString *string) ClassWithPrivateConstructorAndAutomaticProperties { + _init_.Initialize() + + var returns ClassWithPrivateConstructorAndAutomaticProperties + + _jsii_.StaticInvoke( + "jsii-calc.ClassWithPrivateConstructorAndAutomaticProperties", + "create", + []interface{}{readOnlyString, readWriteString}, + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.DoNotRecognizeAnyAsOptional", - reflect.TypeOf((*DoNotRecognizeAnyAsOptional)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, - }, - func() interface{} { - return &jsiiProxy_DoNotRecognizeAnyAsOptional{} - }, + + return returns +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ConfusingToJackson.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +// This tries to confuse Jackson by having overloaded property setters. +// See: https://github.com/aws/aws-cdk/issues/4080 +// +type ConfusingToJackson interface { + UnionProperty() interface{} + SetUnionProperty(val interface{}) +} + +// The jsii proxy struct for ConfusingToJackson +type jsiiProxy_ConfusingToJackson struct { + _ byte // padding +} + +func (j *jsiiProxy_ConfusingToJackson) UnionProperty() interface{} { + var returns interface{} + _jsii_.Get( + j, + "unionProperty", + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.DocumentedClass", - reflect.TypeOf((*DocumentedClass)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "greet", GoMethod: "Greet"}, - _jsii_.MemberMethod{JsiiMethod: "hola", GoMethod: "Hola"}, - }, - func() interface{} { - return &jsiiProxy_DocumentedClass{} - }, + return returns +} + + +func (j *jsiiProxy_ConfusingToJackson)SetUnionProperty(val interface{}) { + _jsii_.Set( + j, + "unionProperty", + val, ) - _jsii_.RegisterClass( - "jsii-calc.DontComplainAboutVariadicAfterOptional", - reflect.TypeOf((*DontComplainAboutVariadicAfterOptional)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "optionalAndVariadic", GoMethod: "OptionalAndVariadic"}, - }, - func() interface{} { - return &jsiiProxy_DontComplainAboutVariadicAfterOptional{} - }, +} + +func ConfusingToJackson_MakeInstance() ConfusingToJackson { + _init_.Initialize() + + var returns ConfusingToJackson + + _jsii_.StaticInvoke( + "jsii-calc.ConfusingToJackson", + "makeInstance", + nil, // no parameters + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.DoubleTrouble", - reflect.TypeOf((*DoubleTrouble)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, - _jsii_.MemberMethod{JsiiMethod: "next", GoMethod: "Next"}, - }, - func() interface{} { - j := jsiiProxy_DoubleTrouble{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_IFriendlyRandomGenerator) - return &j - }, + + return returns +} + +func ConfusingToJackson_MakeStructInstance() *ConfusingToJacksonStruct { + _init_.Initialize() + + var returns *ConfusingToJacksonStruct + + _jsii_.StaticInvoke( + "jsii-calc.ConfusingToJackson", + "makeStructInstance", + nil, // no parameters + &returns, ) - _jsii_.RegisterStruct( - "jsii-calc.DummyObj", - reflect.TypeOf((*DummyObj)(nil)).Elem(), + + return returns +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ConfusingToJacksonStruct.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + + +type ConfusingToJacksonStruct struct { + UnionProperty interface{} \`field:"optional" json:"unionProperty" yaml:"unionProperty"\` +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ConstructorPassesThisOut.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +type ConstructorPassesThisOut interface { +} + +// The jsii proxy struct for ConstructorPassesThisOut +type jsiiProxy_ConstructorPassesThisOut struct { + _ byte // padding +} + +func NewConstructorPassesThisOut(consumer PartiallyInitializedThisConsumer) ConstructorPassesThisOut { + _init_.Initialize() + + j := jsiiProxy_ConstructorPassesThisOut{} + + _jsii_.Create( + "jsii-calc.ConstructorPassesThisOut", + []interface{}{consumer}, + &j, ) - _jsii_.RegisterClass( - "jsii-calc.DynamicPropertyBearer", - reflect.TypeOf((*DynamicPropertyBearer)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "dynamicProperty", GoGetter: "DynamicProperty"}, - _jsii_.MemberProperty{JsiiProperty: "valueStore", GoGetter: "ValueStore"}, - }, - func() interface{} { - return &jsiiProxy_DynamicPropertyBearer{} - }, + + return &j +} + +func NewConstructorPassesThisOut_Override(c ConstructorPassesThisOut, consumer PartiallyInitializedThisConsumer) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.ConstructorPassesThisOut", + []interface{}{consumer}, + c, ) - _jsii_.RegisterClass( - "jsii-calc.DynamicPropertyBearerChild", - reflect.TypeOf((*DynamicPropertyBearerChild)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "dynamicProperty", GoGetter: "DynamicProperty"}, - _jsii_.MemberProperty{JsiiProperty: "originalValue", GoGetter: "OriginalValue"}, - _jsii_.MemberMethod{JsiiMethod: "overrideValue", GoMethod: "OverrideValue"}, - _jsii_.MemberProperty{JsiiProperty: "valueStore", GoGetter: "ValueStore"}, - }, - func() interface{} { - j := jsiiProxy_DynamicPropertyBearerChild{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_DynamicPropertyBearer) - return &j - }, +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/Constructors.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +type Constructors interface { +} + +// The jsii proxy struct for Constructors +type jsiiProxy_Constructors struct { + _ byte // padding +} + +func NewConstructors() Constructors { + _init_.Initialize() + + j := jsiiProxy_Constructors{} + + _jsii_.Create( + "jsii-calc.Constructors", + nil, // no parameters + &j, ) - _jsii_.RegisterClass( - "jsii-calc.Entropy", - reflect.TypeOf((*Entropy)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "increase", GoMethod: "Increase"}, - _jsii_.MemberMethod{JsiiMethod: "repeat", GoMethod: "Repeat"}, - }, - func() interface{} { - return &jsiiProxy_Entropy{} - }, + + return &j +} + +func NewConstructors_Override(c Constructors) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.Constructors", + nil, // no parameters + c, ) - _jsii_.RegisterClass( - "jsii-calc.EnumDispenser", - reflect.TypeOf((*EnumDispenser)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_EnumDispenser{} - }, +} + +func Constructors_HiddenInterface() IPublicInterface { + _init_.Initialize() + + var returns IPublicInterface + + _jsii_.StaticInvoke( + "jsii-calc.Constructors", + "hiddenInterface", + nil, // no parameters + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.EraseUndefinedHashValues", - reflect.TypeOf((*EraseUndefinedHashValues)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_EraseUndefinedHashValues{} - }, + + return returns +} + +func Constructors_HiddenInterfaces() *[]IPublicInterface { + _init_.Initialize() + + var returns *[]IPublicInterface + + _jsii_.StaticInvoke( + "jsii-calc.Constructors", + "hiddenInterfaces", + nil, // no parameters + &returns, ) - _jsii_.RegisterStruct( - "jsii-calc.EraseUndefinedHashValuesOptions", - reflect.TypeOf((*EraseUndefinedHashValuesOptions)(nil)).Elem(), + + return returns +} + +func Constructors_HiddenSubInterfaces() *[]IPublicInterface { + _init_.Initialize() + + var returns *[]IPublicInterface + + _jsii_.StaticInvoke( + "jsii-calc.Constructors", + "hiddenSubInterfaces", + nil, // no parameters + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.ExperimentalClass", - reflect.TypeOf((*ExperimentalClass)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, - _jsii_.MemberProperty{JsiiProperty: "mutableProperty", GoGetter: "MutableProperty"}, - _jsii_.MemberProperty{JsiiProperty: "readonlyProperty", GoGetter: "ReadonlyProperty"}, - }, - func() interface{} { - return &jsiiProxy_ExperimentalClass{} - }, + + return returns +} + +func Constructors_MakeClass() PublicClass { + _init_.Initialize() + + var returns PublicClass + + _jsii_.StaticInvoke( + "jsii-calc.Constructors", + "makeClass", + nil, // no parameters + &returns, ) - _jsii_.RegisterEnum( - "jsii-calc.ExperimentalEnum", - reflect.TypeOf((*ExperimentalEnum)(nil)).Elem(), - map[string]interface{}{ - "OPTION_A": ExperimentalEnum_OPTION_A, - "OPTION_B": ExperimentalEnum_OPTION_B, - }, + + return returns +} + +func Constructors_MakeInterface() IPublicInterface { + _init_.Initialize() + + var returns IPublicInterface + + _jsii_.StaticInvoke( + "jsii-calc.Constructors", + "makeInterface", + nil, // no parameters + &returns, ) - _jsii_.RegisterStruct( - "jsii-calc.ExperimentalStruct", - reflect.TypeOf((*ExperimentalStruct)(nil)).Elem(), - ) - _jsii_.RegisterClass( - "jsii-calc.ExportedBaseClass", - reflect.TypeOf((*ExportedBaseClass)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "success", GoGetter: "Success"}, - }, - func() interface{} { - return &jsiiProxy_ExportedBaseClass{} - }, - ) - _jsii_.RegisterStruct( - "jsii-calc.ExtendsInternalInterface", - reflect.TypeOf((*ExtendsInternalInterface)(nil)).Elem(), + + return returns +} + +func Constructors_MakeInterface2() IPublicInterface2 { + _init_.Initialize() + + var returns IPublicInterface2 + + _jsii_.StaticInvoke( + "jsii-calc.Constructors", + "makeInterface2", + nil, // no parameters + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.ExternalClass", - reflect.TypeOf((*ExternalClass)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, - _jsii_.MemberProperty{JsiiProperty: "mutableProperty", GoGetter: "MutableProperty"}, - _jsii_.MemberProperty{JsiiProperty: "readonlyProperty", GoGetter: "ReadonlyProperty"}, - }, - func() interface{} { - return &jsiiProxy_ExternalClass{} - }, + + return returns +} + +func Constructors_MakeInterfaces() *[]IPublicInterface { + _init_.Initialize() + + var returns *[]IPublicInterface + + _jsii_.StaticInvoke( + "jsii-calc.Constructors", + "makeInterfaces", + nil, // no parameters + &returns, ) - _jsii_.RegisterEnum( - "jsii-calc.ExternalEnum", - reflect.TypeOf((*ExternalEnum)(nil)).Elem(), - map[string]interface{}{ - "OPTION_A": ExternalEnum_OPTION_A, - "OPTION_B": ExternalEnum_OPTION_B, - }, + + return returns +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ConsumePureInterface.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +type ConsumePureInterface interface { + WorkItBaby() *StructB +} + +// The jsii proxy struct for ConsumePureInterface +type jsiiProxy_ConsumePureInterface struct { + _ byte // padding +} + +func NewConsumePureInterface(delegate IStructReturningDelegate) ConsumePureInterface { + _init_.Initialize() + + j := jsiiProxy_ConsumePureInterface{} + + _jsii_.Create( + "jsii-calc.ConsumePureInterface", + []interface{}{delegate}, + &j, ) - _jsii_.RegisterStruct( - "jsii-calc.ExternalStruct", - reflect.TypeOf((*ExternalStruct)(nil)).Elem(), + + return &j +} + +func NewConsumePureInterface_Override(c ConsumePureInterface, delegate IStructReturningDelegate) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.ConsumePureInterface", + []interface{}{delegate}, + c, ) - _jsii_.RegisterClass( - "jsii-calc.FullCombo", - reflect.TypeOf((*FullCombo)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, - _jsii_.MemberProperty{JsiiProperty: "property", GoGetter: "Property"}, - }, - func() interface{} { - j := jsiiProxy_FullCombo{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_BaseClass) - _jsii_.InitJsiiProxy(&j.jsiiProxy_IIndirectlyImplemented) - return &j - }, +} + +func (c *jsiiProxy_ConsumePureInterface) WorkItBaby() *StructB { + var returns *StructB + + _jsii_.Invoke( + c, + "workItBaby", + nil, // no parameters + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.GiveMeStructs", - reflect.TypeOf((*GiveMeStructs)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "derivedToFirst", GoMethod: "DerivedToFirst"}, - _jsii_.MemberMethod{JsiiMethod: "readDerivedNonPrimitive", GoMethod: "ReadDerivedNonPrimitive"}, - _jsii_.MemberMethod{JsiiMethod: "readFirstNumber", GoMethod: "ReadFirstNumber"}, - _jsii_.MemberProperty{JsiiProperty: "structLiteral", GoGetter: "StructLiteral"}, - }, - func() interface{} { - return &jsiiProxy_GiveMeStructs{} - }, + + return returns +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ConsumerCanRingBell.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +// Test calling back to consumers that implement interfaces. +// +// Check that if a JSII consumer implements IConsumerWithInterfaceParam, they can call +// the method on the argument that they're passed... +type ConsumerCanRingBell interface { + // ...if the interface is implemented using an object literal. + // + // Returns whether the bell was rung. + ImplementedByObjectLiteral(ringer IBellRinger) *bool + // ...if the interface is implemented using a private class. + // + // Return whether the bell was rung. + ImplementedByPrivateClass(ringer IBellRinger) *bool + // ...if the interface is implemented using a public class. + // + // Return whether the bell was rung. + ImplementedByPublicClass(ringer IBellRinger) *bool + // If the parameter is a concrete class instead of an interface. + // + // Return whether the bell was rung. + WhenTypedAsClass(ringer IConcreteBellRinger) *bool +} + +// The jsii proxy struct for ConsumerCanRingBell +type jsiiProxy_ConsumerCanRingBell struct { + _ byte // padding +} + +func NewConsumerCanRingBell() ConsumerCanRingBell { + _init_.Initialize() + + j := jsiiProxy_ConsumerCanRingBell{} + + _jsii_.Create( + "jsii-calc.ConsumerCanRingBell", + nil, // no parameters + &j, ) - _jsii_.RegisterStruct( - "jsii-calc.Greetee", - reflect.TypeOf((*Greetee)(nil)).Elem(), + + return &j +} + +func NewConsumerCanRingBell_Override(c ConsumerCanRingBell) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.ConsumerCanRingBell", + nil, // no parameters + c, ) - _jsii_.RegisterClass( - "jsii-calc.GreetingAugmenter", - reflect.TypeOf((*GreetingAugmenter)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "betterGreeting", GoMethod: "BetterGreeting"}, - }, - func() interface{} { - return &jsiiProxy_GreetingAugmenter{} - }, +} + +// ...if the interface is implemented using an object literal. +// +// Returns whether the bell was rung. +func ConsumerCanRingBell_StaticImplementedByObjectLiteral(ringer IBellRinger) *bool { + _init_.Initialize() + + var returns *bool + + _jsii_.StaticInvoke( + "jsii-calc.ConsumerCanRingBell", + "staticImplementedByObjectLiteral", + []interface{}{ringer}, + &returns, ) - _jsii_.RegisterInterface( - "jsii-calc.IAnonymousImplementationProvider", - reflect.TypeOf((*IAnonymousImplementationProvider)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "provideAsClass", GoMethod: "ProvideAsClass"}, - _jsii_.MemberMethod{JsiiMethod: "provideAsInterface", GoMethod: "ProvideAsInterface"}, - }, - func() interface{} { - return &jsiiProxy_IAnonymousImplementationProvider{} - }, + + return returns +} + +// ...if the interface is implemented using a private class. +// +// Return whether the bell was rung. +func ConsumerCanRingBell_StaticImplementedByPrivateClass(ringer IBellRinger) *bool { + _init_.Initialize() + + var returns *bool + + _jsii_.StaticInvoke( + "jsii-calc.ConsumerCanRingBell", + "staticImplementedByPrivateClass", + []interface{}{ringer}, + &returns, ) - _jsii_.RegisterInterface( - "jsii-calc.IAnonymouslyImplementMe", - reflect.TypeOf((*IAnonymouslyImplementMe)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, - _jsii_.MemberMethod{JsiiMethod: "verb", GoMethod: "Verb"}, - }, - func() interface{} { - return &jsiiProxy_IAnonymouslyImplementMe{} - }, + + return returns +} + +// ...if the interface is implemented using a public class. +// +// Return whether the bell was rung. +func ConsumerCanRingBell_StaticImplementedByPublicClass(ringer IBellRinger) *bool { + _init_.Initialize() + + var returns *bool + + _jsii_.StaticInvoke( + "jsii-calc.ConsumerCanRingBell", + "staticImplementedByPublicClass", + []interface{}{ringer}, + &returns, ) - _jsii_.RegisterInterface( - "jsii-calc.IAnotherPublicInterface", - reflect.TypeOf((*IAnotherPublicInterface)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "a", GoGetter: "A"}, - }, - func() interface{} { - return &jsiiProxy_IAnotherPublicInterface{} - }, + + return returns +} + +// If the parameter is a concrete class instead of an interface. +// +// Return whether the bell was rung. +func ConsumerCanRingBell_StaticWhenTypedAsClass(ringer IConcreteBellRinger) *bool { + _init_.Initialize() + + var returns *bool + + _jsii_.StaticInvoke( + "jsii-calc.ConsumerCanRingBell", + "staticWhenTypedAsClass", + []interface{}{ringer}, + &returns, ) - _jsii_.RegisterInterface( - "jsii-calc.IBell", - reflect.TypeOf((*IBell)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "ring", GoMethod: "Ring"}, - }, - func() interface{} { - return &jsiiProxy_IBell{} - }, + + return returns +} + +func (c *jsiiProxy_ConsumerCanRingBell) ImplementedByObjectLiteral(ringer IBellRinger) *bool { + var returns *bool + + _jsii_.Invoke( + c, + "implementedByObjectLiteral", + []interface{}{ringer}, + &returns, ) - _jsii_.RegisterInterface( - "jsii-calc.IBellRinger", - reflect.TypeOf((*IBellRinger)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "yourTurn", GoMethod: "YourTurn"}, - }, - func() interface{} { - return &jsiiProxy_IBellRinger{} - }, + + return returns +} + +func (c *jsiiProxy_ConsumerCanRingBell) ImplementedByPrivateClass(ringer IBellRinger) *bool { + var returns *bool + + _jsii_.Invoke( + c, + "implementedByPrivateClass", + []interface{}{ringer}, + &returns, ) - _jsii_.RegisterInterface( - "jsii-calc.IConcreteBellRinger", - reflect.TypeOf((*IConcreteBellRinger)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "yourTurn", GoMethod: "YourTurn"}, - }, - func() interface{} { - return &jsiiProxy_IConcreteBellRinger{} - }, + + return returns +} + +func (c *jsiiProxy_ConsumerCanRingBell) ImplementedByPublicClass(ringer IBellRinger) *bool { + var returns *bool + + _jsii_.Invoke( + c, + "implementedByPublicClass", + []interface{}{ringer}, + &returns, ) - _jsii_.RegisterInterface( - "jsii-calc.IDeprecatedInterface", - reflect.TypeOf((*IDeprecatedInterface)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, - _jsii_.MemberProperty{JsiiProperty: "mutableProperty", GoGetter: "MutableProperty"}, - }, - func() interface{} { - return &jsiiProxy_IDeprecatedInterface{} - }, + + return returns +} + +func (c *jsiiProxy_ConsumerCanRingBell) WhenTypedAsClass(ringer IConcreteBellRinger) *bool { + var returns *bool + + _jsii_.Invoke( + c, + "whenTypedAsClass", + []interface{}{ringer}, + &returns, ) - _jsii_.RegisterInterface( - "jsii-calc.IExperimentalInterface", - reflect.TypeOf((*IExperimentalInterface)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, - _jsii_.MemberProperty{JsiiProperty: "mutableProperty", GoGetter: "MutableProperty"}, - }, - func() interface{} { - return &jsiiProxy_IExperimentalInterface{} - }, + + return returns +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ConsumersOfThisCrazyTypeSystem.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +type ConsumersOfThisCrazyTypeSystem interface { + ConsumeAnotherPublicInterface(obj IAnotherPublicInterface) *string + ConsumeNonInternalInterface(obj INonInternalInterface) interface{} +} + +// The jsii proxy struct for ConsumersOfThisCrazyTypeSystem +type jsiiProxy_ConsumersOfThisCrazyTypeSystem struct { + _ byte // padding +} + +func NewConsumersOfThisCrazyTypeSystem() ConsumersOfThisCrazyTypeSystem { + _init_.Initialize() + + j := jsiiProxy_ConsumersOfThisCrazyTypeSystem{} + + _jsii_.Create( + "jsii-calc.ConsumersOfThisCrazyTypeSystem", + nil, // no parameters + &j, ) - _jsii_.RegisterInterface( - "jsii-calc.IExtendsPrivateInterface", - reflect.TypeOf((*IExtendsPrivateInterface)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "moreThings", GoGetter: "MoreThings"}, - _jsii_.MemberProperty{JsiiProperty: "private", GoGetter: "Private"}, - }, - func() interface{} { - return &jsiiProxy_IExtendsPrivateInterface{} - }, + + return &j +} + +func NewConsumersOfThisCrazyTypeSystem_Override(c ConsumersOfThisCrazyTypeSystem) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.ConsumersOfThisCrazyTypeSystem", + nil, // no parameters + c, ) - _jsii_.RegisterInterface( - "jsii-calc.IExternalInterface", - reflect.TypeOf((*IExternalInterface)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, - _jsii_.MemberProperty{JsiiProperty: "mutableProperty", GoGetter: "MutableProperty"}, - }, - func() interface{} { - return &jsiiProxy_IExternalInterface{} - }, +} + +func (c *jsiiProxy_ConsumersOfThisCrazyTypeSystem) ConsumeAnotherPublicInterface(obj IAnotherPublicInterface) *string { + var returns *string + + _jsii_.Invoke( + c, + "consumeAnotherPublicInterface", + []interface{}{obj}, + &returns, ) - _jsii_.RegisterInterface( - "jsii-calc.IFriendlier", - reflect.TypeOf((*IFriendlier)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "farewell", GoMethod: "Farewell"}, - _jsii_.MemberMethod{JsiiMethod: "goodbye", GoMethod: "Goodbye"}, - _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, - }, - func() interface{} { - j := jsiiProxy_IFriendlier{} - _jsii_.InitJsiiProxy(&j.Type__scopejsiicalclibIFriendly) - return &j - }, + + return returns +} + +func (c *jsiiProxy_ConsumersOfThisCrazyTypeSystem) ConsumeNonInternalInterface(obj INonInternalInterface) interface{} { + var returns interface{} + + _jsii_.Invoke( + c, + "consumeNonInternalInterface", + []interface{}{obj}, + &returns, ) - _jsii_.RegisterInterface( - "jsii-calc.IFriendlyRandomGenerator", - reflect.TypeOf((*IFriendlyRandomGenerator)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, - _jsii_.MemberMethod{JsiiMethod: "next", GoMethod: "Next"}, - }, - func() interface{} { - j := jsiiProxy_IFriendlyRandomGenerator{} - _jsii_.InitJsiiProxy(&j.Type__scopejsiicalclibIFriendly) - _jsii_.InitJsiiProxy(&j.jsiiProxy_IRandomNumberGenerator) - return &j - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.IIndirectlyImplemented", - reflect.TypeOf((*IIndirectlyImplemented)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, - _jsii_.MemberProperty{JsiiProperty: "property", GoGetter: "Property"}, - }, - func() interface{} { - return &jsiiProxy_IIndirectlyImplemented{} - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.IInterfaceImplementedByAbstractClass", - reflect.TypeOf((*IInterfaceImplementedByAbstractClass)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "propFromInterface", GoGetter: "PropFromInterface"}, - }, - func() interface{} { - return &jsiiProxy_IInterfaceImplementedByAbstractClass{} - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.IInterfaceThatShouldNotBeADataType", - reflect.TypeOf((*IInterfaceThatShouldNotBeADataType)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "doThings", GoMethod: "DoThings"}, - _jsii_.MemberProperty{JsiiProperty: "otherValue", GoGetter: "OtherValue"}, - _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, - }, - func() interface{} { - j := jsiiProxy_IInterfaceThatShouldNotBeADataType{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_IInterfaceWithMethods) - return &j - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.IInterfaceWithInternal", - reflect.TypeOf((*IInterfaceWithInternal)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "visible", GoMethod: "Visible"}, - }, - func() interface{} { - return &jsiiProxy_IInterfaceWithInternal{} - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.IInterfaceWithMethods", - reflect.TypeOf((*IInterfaceWithMethods)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "doThings", GoMethod: "DoThings"}, - _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, - }, - func() interface{} { - return &jsiiProxy_IInterfaceWithMethods{} - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.IInterfaceWithOptionalMethodArguments", - reflect.TypeOf((*IInterfaceWithOptionalMethodArguments)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, - }, - func() interface{} { - return &jsiiProxy_IInterfaceWithOptionalMethodArguments{} - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.IInterfaceWithProperties", - reflect.TypeOf((*IInterfaceWithProperties)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "readOnlyString", GoGetter: "ReadOnlyString"}, - _jsii_.MemberProperty{JsiiProperty: "readWriteString", GoGetter: "ReadWriteString"}, - }, - func() interface{} { - return &jsiiProxy_IInterfaceWithProperties{} - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.IInterfaceWithPropertiesExtension", - reflect.TypeOf((*IInterfaceWithPropertiesExtension)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "foo", GoGetter: "Foo"}, - _jsii_.MemberProperty{JsiiProperty: "readOnlyString", GoGetter: "ReadOnlyString"}, - _jsii_.MemberProperty{JsiiProperty: "readWriteString", GoGetter: "ReadWriteString"}, - }, - func() interface{} { - j := jsiiProxy_IInterfaceWithPropertiesExtension{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_IInterfaceWithProperties) - return &j - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.IJSII417Derived", - reflect.TypeOf((*IJSII417Derived)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "bar", GoMethod: "Bar"}, - _jsii_.MemberMethod{JsiiMethod: "baz", GoMethod: "Baz"}, - _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, - _jsii_.MemberProperty{JsiiProperty: "hasRoot", GoGetter: "HasRoot"}, - _jsii_.MemberProperty{JsiiProperty: "property", GoGetter: "Property"}, - }, - func() interface{} { - j := jsiiProxy_IJSII417Derived{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_IJSII417PublicBaseOfBase) - return &j - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.IJSII417PublicBaseOfBase", - reflect.TypeOf((*IJSII417PublicBaseOfBase)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, - _jsii_.MemberProperty{JsiiProperty: "hasRoot", GoGetter: "HasRoot"}, - }, - func() interface{} { - return &jsiiProxy_IJSII417PublicBaseOfBase{} - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.IJavaReservedWordsInAnInterface", - reflect.TypeOf((*IJavaReservedWordsInAnInterface)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "abstract", GoMethod: "Abstract"}, - _jsii_.MemberMethod{JsiiMethod: "assert", GoMethod: "Assert"}, - _jsii_.MemberMethod{JsiiMethod: "boolean", GoMethod: "Boolean"}, - _jsii_.MemberMethod{JsiiMethod: "break", GoMethod: "Break"}, - _jsii_.MemberMethod{JsiiMethod: "byte", GoMethod: "Byte"}, - _jsii_.MemberMethod{JsiiMethod: "case", GoMethod: "Case"}, - _jsii_.MemberMethod{JsiiMethod: "catch", GoMethod: "Catch"}, - _jsii_.MemberMethod{JsiiMethod: "char", GoMethod: "Char"}, - _jsii_.MemberMethod{JsiiMethod: "class", GoMethod: "Class"}, - _jsii_.MemberMethod{JsiiMethod: "const", GoMethod: "Const"}, - _jsii_.MemberMethod{JsiiMethod: "continue", GoMethod: "Continue"}, - _jsii_.MemberMethod{JsiiMethod: "default", GoMethod: "Default"}, - _jsii_.MemberMethod{JsiiMethod: "do", GoMethod: "Do"}, - _jsii_.MemberMethod{JsiiMethod: "double", GoMethod: "Double"}, - _jsii_.MemberMethod{JsiiMethod: "else", GoMethod: "Else"}, - _jsii_.MemberMethod{JsiiMethod: "enum", GoMethod: "Enum"}, - _jsii_.MemberMethod{JsiiMethod: "extends", GoMethod: "Extends"}, - _jsii_.MemberMethod{JsiiMethod: "false", GoMethod: "False"}, - _jsii_.MemberMethod{JsiiMethod: "final", GoMethod: "Final"}, - _jsii_.MemberMethod{JsiiMethod: "finally", GoMethod: "Finally"}, - _jsii_.MemberMethod{JsiiMethod: "float", GoMethod: "Float"}, - _jsii_.MemberMethod{JsiiMethod: "for", GoMethod: "For"}, - _jsii_.MemberMethod{JsiiMethod: "goto", GoMethod: "Goto"}, - _jsii_.MemberMethod{JsiiMethod: "if", GoMethod: "If"}, - _jsii_.MemberMethod{JsiiMethod: "implements", GoMethod: "Implements"}, - _jsii_.MemberMethod{JsiiMethod: "import", GoMethod: "Import"}, - _jsii_.MemberMethod{JsiiMethod: "instanceof", GoMethod: "Instanceof"}, - _jsii_.MemberMethod{JsiiMethod: "int", GoMethod: "Int"}, - _jsii_.MemberMethod{JsiiMethod: "interface", GoMethod: "Interface"}, - _jsii_.MemberMethod{JsiiMethod: "long", GoMethod: "Long"}, - _jsii_.MemberMethod{JsiiMethod: "native", GoMethod: "Native"}, - _jsii_.MemberMethod{JsiiMethod: "null", GoMethod: "Null"}, - _jsii_.MemberMethod{JsiiMethod: "package", GoMethod: "Package"}, - _jsii_.MemberMethod{JsiiMethod: "private", GoMethod: "Private"}, - _jsii_.MemberMethod{JsiiMethod: "protected", GoMethod: "Protected"}, - _jsii_.MemberMethod{JsiiMethod: "public", GoMethod: "Public"}, - _jsii_.MemberMethod{JsiiMethod: "return", GoMethod: "Return"}, - _jsii_.MemberMethod{JsiiMethod: "short", GoMethod: "Short"}, - _jsii_.MemberMethod{JsiiMethod: "static", GoMethod: "Static"}, - _jsii_.MemberMethod{JsiiMethod: "strictfp", GoMethod: "Strictfp"}, - _jsii_.MemberMethod{JsiiMethod: "super", GoMethod: "Super"}, - _jsii_.MemberMethod{JsiiMethod: "switch", GoMethod: "Switch"}, - _jsii_.MemberMethod{JsiiMethod: "synchronized", GoMethod: "Synchronized"}, - _jsii_.MemberMethod{JsiiMethod: "this", GoMethod: "This"}, - _jsii_.MemberMethod{JsiiMethod: "throw", GoMethod: "Throw"}, - _jsii_.MemberMethod{JsiiMethod: "throws", GoMethod: "Throws"}, - _jsii_.MemberMethod{JsiiMethod: "transient", GoMethod: "Transient"}, - _jsii_.MemberMethod{JsiiMethod: "true", GoMethod: "True"}, - _jsii_.MemberMethod{JsiiMethod: "try", GoMethod: "Try"}, - _jsii_.MemberMethod{JsiiMethod: "void", GoMethod: "Void"}, - _jsii_.MemberMethod{JsiiMethod: "volatile", GoMethod: "Volatile"}, - _jsii_.MemberProperty{JsiiProperty: "while", GoGetter: "While"}, - }, - func() interface{} { - return &jsiiProxy_IJavaReservedWordsInAnInterface{} - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.IJsii487External", - reflect.TypeOf((*IJsii487External)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_IJsii487External{} - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.IJsii487External2", - reflect.TypeOf((*IJsii487External2)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_IJsii487External2{} - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.IJsii496", - reflect.TypeOf((*IJsii496)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_IJsii496{} - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.IMutableObjectLiteral", - reflect.TypeOf((*IMutableObjectLiteral)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, - }, - func() interface{} { - return &jsiiProxy_IMutableObjectLiteral{} - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.INonInternalInterface", - reflect.TypeOf((*INonInternalInterface)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "a", GoGetter: "A"}, - _jsii_.MemberProperty{JsiiProperty: "b", GoGetter: "B"}, - _jsii_.MemberProperty{JsiiProperty: "c", GoGetter: "C"}, - }, - func() interface{} { - j := jsiiProxy_INonInternalInterface{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_IAnotherPublicInterface) - return &j - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.IObjectWithProperty", - reflect.TypeOf((*IObjectWithProperty)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "property", GoGetter: "Property"}, - _jsii_.MemberMethod{JsiiMethod: "wasSet", GoMethod: "WasSet"}, - }, - func() interface{} { - return &jsiiProxy_IObjectWithProperty{} - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.IOptionalMethod", - reflect.TypeOf((*IOptionalMethod)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "optional", GoMethod: "Optional"}, - }, - func() interface{} { - return &jsiiProxy_IOptionalMethod{} - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.IPrivatelyImplemented", - reflect.TypeOf((*IPrivatelyImplemented)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "success", GoGetter: "Success"}, - }, - func() interface{} { - return &jsiiProxy_IPrivatelyImplemented{} - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.IPublicInterface", - reflect.TypeOf((*IPublicInterface)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "bye", GoMethod: "Bye"}, - }, - func() interface{} { - return &jsiiProxy_IPublicInterface{} - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.IPublicInterface2", - reflect.TypeOf((*IPublicInterface2)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "ciao", GoMethod: "Ciao"}, - }, - func() interface{} { - return &jsiiProxy_IPublicInterface2{} - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.IRandomNumberGenerator", - reflect.TypeOf((*IRandomNumberGenerator)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "next", GoMethod: "Next"}, - }, - func() interface{} { - return &jsiiProxy_IRandomNumberGenerator{} - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.IReturnJsii976", - reflect.TypeOf((*IReturnJsii976)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "foo", GoGetter: "Foo"}, - }, - func() interface{} { - return &jsiiProxy_IReturnJsii976{} - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.IReturnsNumber", - reflect.TypeOf((*IReturnsNumber)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "numberProp", GoGetter: "NumberProp"}, - _jsii_.MemberMethod{JsiiMethod: "obtainNumber", GoMethod: "ObtainNumber"}, - }, - func() interface{} { - return &jsiiProxy_IReturnsNumber{} - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.IStableInterface", - reflect.TypeOf((*IStableInterface)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, - _jsii_.MemberProperty{JsiiProperty: "mutableProperty", GoGetter: "MutableProperty"}, - }, - func() interface{} { - return &jsiiProxy_IStableInterface{} - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.IStructReturningDelegate", - reflect.TypeOf((*IStructReturningDelegate)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "returnStruct", GoMethod: "ReturnStruct"}, - }, - func() interface{} { - return &jsiiProxy_IStructReturningDelegate{} - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.IWallClock", - reflect.TypeOf((*IWallClock)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "iso8601Now", GoMethod: "Iso8601Now"}, - }, - func() interface{} { - return &jsiiProxy_IWallClock{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.ImplementInternalInterface", - reflect.TypeOf((*ImplementInternalInterface)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "prop", GoGetter: "Prop"}, - }, - func() interface{} { - return &jsiiProxy_ImplementInternalInterface{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.Implementation", - reflect.TypeOf((*Implementation)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, - }, - func() interface{} { - return &jsiiProxy_Implementation{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.ImplementsInterfaceWithInternal", - reflect.TypeOf((*ImplementsInterfaceWithInternal)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "visible", GoMethod: "Visible"}, - }, - func() interface{} { - j := jsiiProxy_ImplementsInterfaceWithInternal{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_IInterfaceWithInternal) - return &j - }, - ) - _jsii_.RegisterClass( - "jsii-calc.ImplementsInterfaceWithInternalSubclass", - reflect.TypeOf((*ImplementsInterfaceWithInternalSubclass)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "visible", GoMethod: "Visible"}, - }, - func() interface{} { - j := jsiiProxy_ImplementsInterfaceWithInternalSubclass{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_ImplementsInterfaceWithInternal) - return &j - }, - ) - _jsii_.RegisterClass( - "jsii-calc.ImplementsPrivateInterface", - reflect.TypeOf((*ImplementsPrivateInterface)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "private", GoGetter: "Private"}, - }, - func() interface{} { - return &jsiiProxy_ImplementsPrivateInterface{} - }, - ) - _jsii_.RegisterStruct( - "jsii-calc.ImplictBaseOfBase", - reflect.TypeOf((*ImplictBaseOfBase)(nil)).Elem(), - ) - _jsii_.RegisterClass( - "jsii-calc.InbetweenClass", - reflect.TypeOf((*InbetweenClass)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "ciao", GoMethod: "Ciao"}, - _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, - }, - func() interface{} { - j := jsiiProxy_InbetweenClass{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_PublicClass) - _jsii_.InitJsiiProxy(&j.jsiiProxy_IPublicInterface2) - return &j - }, - ) - _jsii_.RegisterClass( - "jsii-calc.InterfaceCollections", - reflect.TypeOf((*InterfaceCollections)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_InterfaceCollections{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.InterfacesMaker", - reflect.TypeOf((*InterfacesMaker)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_InterfacesMaker{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.Isomorphism", - reflect.TypeOf((*Isomorphism)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "myself", GoMethod: "Myself"}, - }, - func() interface{} { - return &jsiiProxy_Isomorphism{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.Issue2638", - reflect.TypeOf((*Issue2638)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_Issue2638{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.Issue2638B", - reflect.TypeOf((*Issue2638B)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_Issue2638B{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.JSII417Derived", - reflect.TypeOf((*JSII417Derived)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "bar", GoMethod: "Bar"}, - _jsii_.MemberMethod{JsiiMethod: "baz", GoMethod: "Baz"}, - _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, - _jsii_.MemberProperty{JsiiProperty: "hasRoot", GoGetter: "HasRoot"}, - _jsii_.MemberProperty{JsiiProperty: "property", GoGetter: "Property"}, - }, - func() interface{} { - j := jsiiProxy_JSII417Derived{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_JSII417PublicBaseOfBase) - return &j - }, - ) - _jsii_.RegisterClass( - "jsii-calc.JSII417PublicBaseOfBase", - reflect.TypeOf((*JSII417PublicBaseOfBase)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, - _jsii_.MemberProperty{JsiiProperty: "hasRoot", GoGetter: "HasRoot"}, - }, - func() interface{} { - return &jsiiProxy_JSII417PublicBaseOfBase{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.JSObjectLiteralForInterface", - reflect.TypeOf((*JSObjectLiteralForInterface)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "giveMeFriendly", GoMethod: "GiveMeFriendly"}, - _jsii_.MemberMethod{JsiiMethod: "giveMeFriendlyGenerator", GoMethod: "GiveMeFriendlyGenerator"}, - }, - func() interface{} { - return &jsiiProxy_JSObjectLiteralForInterface{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.JSObjectLiteralToNative", - reflect.TypeOf((*JSObjectLiteralToNative)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "returnLiteral", GoMethod: "ReturnLiteral"}, - }, - func() interface{} { - return &jsiiProxy_JSObjectLiteralToNative{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.JSObjectLiteralToNativeClass", - reflect.TypeOf((*JSObjectLiteralToNativeClass)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "propA", GoGetter: "PropA"}, - _jsii_.MemberProperty{JsiiProperty: "propB", GoGetter: "PropB"}, - }, - func() interface{} { - return &jsiiProxy_JSObjectLiteralToNativeClass{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.JavaReservedWords", - reflect.TypeOf((*JavaReservedWords)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "abstract", GoMethod: "Abstract"}, - _jsii_.MemberMethod{JsiiMethod: "assert", GoMethod: "Assert"}, - _jsii_.MemberMethod{JsiiMethod: "boolean", GoMethod: "Boolean"}, - _jsii_.MemberMethod{JsiiMethod: "break", GoMethod: "Break"}, - _jsii_.MemberMethod{JsiiMethod: "byte", GoMethod: "Byte"}, - _jsii_.MemberMethod{JsiiMethod: "case", GoMethod: "Case"}, - _jsii_.MemberMethod{JsiiMethod: "catch", GoMethod: "Catch"}, - _jsii_.MemberMethod{JsiiMethod: "char", GoMethod: "Char"}, - _jsii_.MemberMethod{JsiiMethod: "class", GoMethod: "Class"}, - _jsii_.MemberMethod{JsiiMethod: "const", GoMethod: "Const"}, - _jsii_.MemberMethod{JsiiMethod: "continue", GoMethod: "Continue"}, - _jsii_.MemberMethod{JsiiMethod: "default", GoMethod: "Default"}, - _jsii_.MemberMethod{JsiiMethod: "do", GoMethod: "Do"}, - _jsii_.MemberMethod{JsiiMethod: "double", GoMethod: "Double"}, - _jsii_.MemberMethod{JsiiMethod: "else", GoMethod: "Else"}, - _jsii_.MemberMethod{JsiiMethod: "enum", GoMethod: "Enum"}, - _jsii_.MemberMethod{JsiiMethod: "extends", GoMethod: "Extends"}, - _jsii_.MemberMethod{JsiiMethod: "false", GoMethod: "False"}, - _jsii_.MemberMethod{JsiiMethod: "final", GoMethod: "Final"}, - _jsii_.MemberMethod{JsiiMethod: "finally", GoMethod: "Finally"}, - _jsii_.MemberMethod{JsiiMethod: "float", GoMethod: "Float"}, - _jsii_.MemberMethod{JsiiMethod: "for", GoMethod: "For"}, - _jsii_.MemberMethod{JsiiMethod: "goto", GoMethod: "Goto"}, - _jsii_.MemberMethod{JsiiMethod: "if", GoMethod: "If"}, - _jsii_.MemberMethod{JsiiMethod: "implements", GoMethod: "Implements"}, - _jsii_.MemberMethod{JsiiMethod: "import", GoMethod: "Import"}, - _jsii_.MemberMethod{JsiiMethod: "instanceof", GoMethod: "Instanceof"}, - _jsii_.MemberMethod{JsiiMethod: "int", GoMethod: "Int"}, - _jsii_.MemberMethod{JsiiMethod: "interface", GoMethod: "Interface"}, - _jsii_.MemberMethod{JsiiMethod: "long", GoMethod: "Long"}, - _jsii_.MemberMethod{JsiiMethod: "native", GoMethod: "Native"}, - _jsii_.MemberMethod{JsiiMethod: "new", GoMethod: "New"}, - _jsii_.MemberMethod{JsiiMethod: "null", GoMethod: "Null"}, - _jsii_.MemberMethod{JsiiMethod: "package", GoMethod: "Package"}, - _jsii_.MemberMethod{JsiiMethod: "private", GoMethod: "Private"}, - _jsii_.MemberMethod{JsiiMethod: "protected", GoMethod: "Protected"}, - _jsii_.MemberMethod{JsiiMethod: "public", GoMethod: "Public"}, - _jsii_.MemberMethod{JsiiMethod: "return", GoMethod: "Return"}, - _jsii_.MemberMethod{JsiiMethod: "short", GoMethod: "Short"}, - _jsii_.MemberMethod{JsiiMethod: "static", GoMethod: "Static"}, - _jsii_.MemberMethod{JsiiMethod: "strictfp", GoMethod: "Strictfp"}, - _jsii_.MemberMethod{JsiiMethod: "super", GoMethod: "Super"}, - _jsii_.MemberMethod{JsiiMethod: "switch", GoMethod: "Switch"}, - _jsii_.MemberMethod{JsiiMethod: "synchronized", GoMethod: "Synchronized"}, - _jsii_.MemberMethod{JsiiMethod: "this", GoMethod: "This"}, - _jsii_.MemberMethod{JsiiMethod: "throw", GoMethod: "Throw"}, - _jsii_.MemberMethod{JsiiMethod: "throws", GoMethod: "Throws"}, - _jsii_.MemberMethod{JsiiMethod: "transient", GoMethod: "Transient"}, - _jsii_.MemberMethod{JsiiMethod: "true", GoMethod: "True"}, - _jsii_.MemberMethod{JsiiMethod: "try", GoMethod: "Try"}, - _jsii_.MemberMethod{JsiiMethod: "void", GoMethod: "Void"}, - _jsii_.MemberMethod{JsiiMethod: "volatile", GoMethod: "Volatile"}, - _jsii_.MemberProperty{JsiiProperty: "while", GoGetter: "While"}, - }, - func() interface{} { - return &jsiiProxy_JavaReservedWords{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.Jsii487Derived", - reflect.TypeOf((*Jsii487Derived)(nil)).Elem(), - nil, // no members - func() interface{} { - j := jsiiProxy_Jsii487Derived{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_IJsii487External) - _jsii_.InitJsiiProxy(&j.jsiiProxy_IJsii487External2) - return &j - }, - ) - _jsii_.RegisterClass( - "jsii-calc.Jsii496Derived", - reflect.TypeOf((*Jsii496Derived)(nil)).Elem(), - nil, // no members - func() interface{} { - j := jsiiProxy_Jsii496Derived{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_IJsii496) - return &j - }, - ) - _jsii_.RegisterClass( - "jsii-calc.JsiiAgent", - reflect.TypeOf((*JsiiAgent)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_JsiiAgent{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.JsonFormatter", - reflect.TypeOf((*JsonFormatter)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_JsonFormatter{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.LevelOne", - reflect.TypeOf((*LevelOne)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "props", GoGetter: "Props"}, - }, - func() interface{} { - return &jsiiProxy_LevelOne{} - }, - ) - _jsii_.RegisterStruct( - "jsii-calc.LevelOne.PropBooleanValue", - reflect.TypeOf((*LevelOne_PropBooleanValue)(nil)).Elem(), - ) - _jsii_.RegisterStruct( - "jsii-calc.LevelOne.PropProperty", - reflect.TypeOf((*LevelOne_PropProperty)(nil)).Elem(), - ) - _jsii_.RegisterStruct( - "jsii-calc.LevelOneProps", - reflect.TypeOf((*LevelOneProps)(nil)).Elem(), - ) - _jsii_.RegisterStruct( - "jsii-calc.LoadBalancedFargateServiceProps", - reflect.TypeOf((*LoadBalancedFargateServiceProps)(nil)).Elem(), - ) - _jsii_.RegisterClass( - "jsii-calc.MethodNamedProperty", - reflect.TypeOf((*MethodNamedProperty)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "elite", GoGetter: "Elite"}, - _jsii_.MemberMethod{JsiiMethod: "property", GoMethod: "Property"}, - }, - func() interface{} { - return &jsiiProxy_MethodNamedProperty{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.Multiply", - reflect.TypeOf((*Multiply)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "farewell", GoMethod: "Farewell"}, - _jsii_.MemberMethod{JsiiMethod: "goodbye", GoMethod: "Goodbye"}, - _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, - _jsii_.MemberProperty{JsiiProperty: "lhs", GoGetter: "Lhs"}, - _jsii_.MemberMethod{JsiiMethod: "next", GoMethod: "Next"}, - _jsii_.MemberProperty{JsiiProperty: "rhs", GoGetter: "Rhs"}, - _jsii_.MemberMethod{JsiiMethod: "toString", GoMethod: "ToString"}, - _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, - _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, - }, - func() interface{} { - j := jsiiProxy_Multiply{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_BinaryOperation) - _jsii_.InitJsiiProxy(&j.jsiiProxy_IFriendlier) - _jsii_.InitJsiiProxy(&j.jsiiProxy_IRandomNumberGenerator) - return &j - }, - ) - _jsii_.RegisterClass( - "jsii-calc.Negate", - reflect.TypeOf((*Negate)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "farewell", GoMethod: "Farewell"}, - _jsii_.MemberMethod{JsiiMethod: "goodbye", GoMethod: "Goodbye"}, - _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, - _jsii_.MemberProperty{JsiiProperty: "operand", GoGetter: "Operand"}, - _jsii_.MemberMethod{JsiiMethod: "toString", GoMethod: "ToString"}, - _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, - _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, - }, - func() interface{} { - j := jsiiProxy_Negate{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_UnaryOperation) - _jsii_.InitJsiiProxy(&j.jsiiProxy_IFriendlier) - return &j - }, - ) - _jsii_.RegisterClass( - "jsii-calc.NestedClassInstance", - reflect.TypeOf((*NestedClassInstance)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_NestedClassInstance{} - }, - ) - _jsii_.RegisterStruct( - "jsii-calc.NestedStruct", - reflect.TypeOf((*NestedStruct)(nil)).Elem(), - ) - _jsii_.RegisterClass( - "jsii-calc.NodeStandardLibrary", - reflect.TypeOf((*NodeStandardLibrary)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "cryptoSha256", GoMethod: "CryptoSha256"}, - _jsii_.MemberMethod{JsiiMethod: "fsReadFile", GoMethod: "FsReadFile"}, - _jsii_.MemberMethod{JsiiMethod: "fsReadFileSync", GoMethod: "FsReadFileSync"}, - _jsii_.MemberProperty{JsiiProperty: "osPlatform", GoGetter: "OsPlatform"}, - }, - func() interface{} { - return &jsiiProxy_NodeStandardLibrary{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.NullShouldBeTreatedAsUndefined", - reflect.TypeOf((*NullShouldBeTreatedAsUndefined)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "changeMeToUndefined", GoGetter: "ChangeMeToUndefined"}, - _jsii_.MemberMethod{JsiiMethod: "giveMeUndefined", GoMethod: "GiveMeUndefined"}, - _jsii_.MemberMethod{JsiiMethod: "giveMeUndefinedInsideAnObject", GoMethod: "GiveMeUndefinedInsideAnObject"}, - _jsii_.MemberMethod{JsiiMethod: "verifyPropertyIsUndefined", GoMethod: "VerifyPropertyIsUndefined"}, - }, - func() interface{} { - return &jsiiProxy_NullShouldBeTreatedAsUndefined{} - }, - ) - _jsii_.RegisterStruct( - "jsii-calc.NullShouldBeTreatedAsUndefinedData", - reflect.TypeOf((*NullShouldBeTreatedAsUndefinedData)(nil)).Elem(), - ) - _jsii_.RegisterClass( - "jsii-calc.NumberGenerator", - reflect.TypeOf((*NumberGenerator)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "generator", GoGetter: "Generator"}, - _jsii_.MemberMethod{JsiiMethod: "isSameGenerator", GoMethod: "IsSameGenerator"}, - _jsii_.MemberMethod{JsiiMethod: "nextTimes100", GoMethod: "NextTimes100"}, - }, - func() interface{} { - return &jsiiProxy_NumberGenerator{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.ObjectRefsInCollections", - reflect.TypeOf((*ObjectRefsInCollections)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "sumFromArray", GoMethod: "SumFromArray"}, - _jsii_.MemberMethod{JsiiMethod: "sumFromMap", GoMethod: "SumFromMap"}, - }, - func() interface{} { - return &jsiiProxy_ObjectRefsInCollections{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.ObjectWithPropertyProvider", - reflect.TypeOf((*ObjectWithPropertyProvider)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_ObjectWithPropertyProvider{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.Old", - reflect.TypeOf((*Old)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "doAThing", GoMethod: "DoAThing"}, - }, - func() interface{} { - return &jsiiProxy_Old{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.OptionalArgumentInvoker", - reflect.TypeOf((*OptionalArgumentInvoker)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "invokeWithOptional", GoMethod: "InvokeWithOptional"}, - _jsii_.MemberMethod{JsiiMethod: "invokeWithoutOptional", GoMethod: "InvokeWithoutOptional"}, - }, - func() interface{} { - return &jsiiProxy_OptionalArgumentInvoker{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.OptionalConstructorArgument", - reflect.TypeOf((*OptionalConstructorArgument)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "arg1", GoGetter: "Arg1"}, - _jsii_.MemberProperty{JsiiProperty: "arg2", GoGetter: "Arg2"}, - _jsii_.MemberProperty{JsiiProperty: "arg3", GoGetter: "Arg3"}, - }, - func() interface{} { - return &jsiiProxy_OptionalConstructorArgument{} - }, - ) - _jsii_.RegisterStruct( - "jsii-calc.OptionalStruct", - reflect.TypeOf((*OptionalStruct)(nil)).Elem(), - ) - _jsii_.RegisterClass( - "jsii-calc.OptionalStructConsumer", - reflect.TypeOf((*OptionalStructConsumer)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "fieldValue", GoGetter: "FieldValue"}, - _jsii_.MemberProperty{JsiiProperty: "parameterWasUndefined", GoGetter: "ParameterWasUndefined"}, - }, - func() interface{} { - return &jsiiProxy_OptionalStructConsumer{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.OverridableProtectedMember", - reflect.TypeOf((*OverridableProtectedMember)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "overrideMe", GoMethod: "OverrideMe"}, - _jsii_.MemberProperty{JsiiProperty: "overrideReadOnly", GoGetter: "OverrideReadOnly"}, - _jsii_.MemberProperty{JsiiProperty: "overrideReadWrite", GoGetter: "OverrideReadWrite"}, - _jsii_.MemberMethod{JsiiMethod: "switchModes", GoMethod: "SwitchModes"}, - _jsii_.MemberMethod{JsiiMethod: "valueFromProtected", GoMethod: "ValueFromProtected"}, - }, - func() interface{} { - return &jsiiProxy_OverridableProtectedMember{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.OverrideReturnsObject", - reflect.TypeOf((*OverrideReturnsObject)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "test", GoMethod: "Test"}, - }, - func() interface{} { - return &jsiiProxy_OverrideReturnsObject{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.ParamShadowsBuiltins", - reflect.TypeOf((*ParamShadowsBuiltins)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_ParamShadowsBuiltins{} - }, - ) - _jsii_.RegisterStruct( - "jsii-calc.ParamShadowsBuiltinsProps", - reflect.TypeOf((*ParamShadowsBuiltinsProps)(nil)).Elem(), - ) - _jsii_.RegisterClass( - "jsii-calc.ParamShadowsScope", - reflect.TypeOf((*ParamShadowsScope)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "useScope", GoMethod: "UseScope"}, - }, - func() interface{} { - return &jsiiProxy_ParamShadowsScope{} - }, - ) - _jsii_.RegisterStruct( - "jsii-calc.ParentStruct982", - reflect.TypeOf((*ParentStruct982)(nil)).Elem(), - ) - _jsii_.RegisterClass( - "jsii-calc.PartiallyInitializedThisConsumer", - reflect.TypeOf((*PartiallyInitializedThisConsumer)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "consumePartiallyInitializedThis", GoMethod: "ConsumePartiallyInitializedThis"}, - }, - func() interface{} { - return &jsiiProxy_PartiallyInitializedThisConsumer{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.Polymorphism", - reflect.TypeOf((*Polymorphism)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "sayHello", GoMethod: "SayHello"}, - }, - func() interface{} { - return &jsiiProxy_Polymorphism{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.Power", - reflect.TypeOf((*Power)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "base", GoGetter: "Base"}, - _jsii_.MemberProperty{JsiiProperty: "decorationPostfixes", GoGetter: "DecorationPostfixes"}, - _jsii_.MemberProperty{JsiiProperty: "decorationPrefixes", GoGetter: "DecorationPrefixes"}, - _jsii_.MemberProperty{JsiiProperty: "expression", GoGetter: "Expression"}, - _jsii_.MemberProperty{JsiiProperty: "pow", GoGetter: "Pow"}, - _jsii_.MemberProperty{JsiiProperty: "stringStyle", GoGetter: "StringStyle"}, - _jsii_.MemberMethod{JsiiMethod: "toString", GoMethod: "ToString"}, - _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, - _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, - }, - func() interface{} { - j := jsiiProxy_Power{} - _jsii_.InitJsiiProxy(&j.Type__compositionCompositeOperation) - return &j - }, - ) - _jsii_.RegisterClass( - "jsii-calc.PromiseNothing", - reflect.TypeOf((*PromiseNothing)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "instancePromiseIt", GoMethod: "InstancePromiseIt"}, - }, - func() interface{} { - return &jsiiProxy_PromiseNothing{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.PropertyNamedProperty", - reflect.TypeOf((*PropertyNamedProperty)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "property", GoGetter: "Property"}, - _jsii_.MemberProperty{JsiiProperty: "yetAnoterOne", GoGetter: "YetAnoterOne"}, - }, - func() interface{} { - return &jsiiProxy_PropertyNamedProperty{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.PublicClass", - reflect.TypeOf((*PublicClass)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, - }, - func() interface{} { - return &jsiiProxy_PublicClass{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.PythonReservedWords", - reflect.TypeOf((*PythonReservedWords)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "and", GoMethod: "And"}, - _jsii_.MemberMethod{JsiiMethod: "as", GoMethod: "As"}, - _jsii_.MemberMethod{JsiiMethod: "assert", GoMethod: "Assert"}, - _jsii_.MemberMethod{JsiiMethod: "async", GoMethod: "Async"}, - _jsii_.MemberMethod{JsiiMethod: "await", GoMethod: "Await"}, - _jsii_.MemberMethod{JsiiMethod: "break", GoMethod: "Break"}, - _jsii_.MemberMethod{JsiiMethod: "class", GoMethod: "Class"}, - _jsii_.MemberMethod{JsiiMethod: "continue", GoMethod: "Continue"}, - _jsii_.MemberMethod{JsiiMethod: "def", GoMethod: "Def"}, - _jsii_.MemberMethod{JsiiMethod: "del", GoMethod: "Del"}, - _jsii_.MemberMethod{JsiiMethod: "elif", GoMethod: "Elif"}, - _jsii_.MemberMethod{JsiiMethod: "else", GoMethod: "Else"}, - _jsii_.MemberMethod{JsiiMethod: "except", GoMethod: "Except"}, - _jsii_.MemberMethod{JsiiMethod: "finally", GoMethod: "Finally"}, - _jsii_.MemberMethod{JsiiMethod: "for", GoMethod: "For"}, - _jsii_.MemberMethod{JsiiMethod: "from", GoMethod: "From"}, - _jsii_.MemberMethod{JsiiMethod: "global", GoMethod: "Global"}, - _jsii_.MemberMethod{JsiiMethod: "if", GoMethod: "If"}, - _jsii_.MemberMethod{JsiiMethod: "import", GoMethod: "Import"}, - _jsii_.MemberMethod{JsiiMethod: "in", GoMethod: "In"}, - _jsii_.MemberMethod{JsiiMethod: "is", GoMethod: "Is"}, - _jsii_.MemberMethod{JsiiMethod: "lambda", GoMethod: "Lambda"}, - _jsii_.MemberMethod{JsiiMethod: "nonlocal", GoMethod: "Nonlocal"}, - _jsii_.MemberMethod{JsiiMethod: "not", GoMethod: "Not"}, - _jsii_.MemberMethod{JsiiMethod: "or", GoMethod: "Or"}, - _jsii_.MemberMethod{JsiiMethod: "pass", GoMethod: "Pass"}, - _jsii_.MemberMethod{JsiiMethod: "raise", GoMethod: "Raise"}, - _jsii_.MemberMethod{JsiiMethod: "return", GoMethod: "Return"}, - _jsii_.MemberMethod{JsiiMethod: "try", GoMethod: "Try"}, - _jsii_.MemberMethod{JsiiMethod: "while", GoMethod: "While"}, - _jsii_.MemberMethod{JsiiMethod: "with", GoMethod: "With"}, - _jsii_.MemberMethod{JsiiMethod: "yield", GoMethod: "Yield"}, - }, - func() interface{} { - return &jsiiProxy_PythonReservedWords{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.ReferenceEnumFromScopedPackage", - reflect.TypeOf((*ReferenceEnumFromScopedPackage)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "foo", GoGetter: "Foo"}, - _jsii_.MemberMethod{JsiiMethod: "loadFoo", GoMethod: "LoadFoo"}, - _jsii_.MemberMethod{JsiiMethod: "saveFoo", GoMethod: "SaveFoo"}, - }, - func() interface{} { - return &jsiiProxy_ReferenceEnumFromScopedPackage{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.ReturnsPrivateImplementationOfInterface", - reflect.TypeOf((*ReturnsPrivateImplementationOfInterface)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "privateImplementation", GoGetter: "PrivateImplementation"}, - }, - func() interface{} { - return &jsiiProxy_ReturnsPrivateImplementationOfInterface{} - }, - ) - _jsii_.RegisterStruct( - "jsii-calc.RootStruct", - reflect.TypeOf((*RootStruct)(nil)).Elem(), - ) - _jsii_.RegisterClass( - "jsii-calc.RootStructValidator", - reflect.TypeOf((*RootStructValidator)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_RootStructValidator{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.RuntimeTypeChecking", - reflect.TypeOf((*RuntimeTypeChecking)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "methodWithDefaultedArguments", GoMethod: "MethodWithDefaultedArguments"}, - _jsii_.MemberMethod{JsiiMethod: "methodWithOptionalAnyArgument", GoMethod: "MethodWithOptionalAnyArgument"}, - _jsii_.MemberMethod{JsiiMethod: "methodWithOptionalArguments", GoMethod: "MethodWithOptionalArguments"}, - }, - func() interface{} { - return &jsiiProxy_RuntimeTypeChecking{} - }, - ) - _jsii_.RegisterStruct( - "jsii-calc.SecondLevelStruct", - reflect.TypeOf((*SecondLevelStruct)(nil)).Elem(), - ) - _jsii_.RegisterClass( - "jsii-calc.SingleInstanceTwoTypes", - reflect.TypeOf((*SingleInstanceTwoTypes)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "interface1", GoMethod: "Interface1"}, - _jsii_.MemberMethod{JsiiMethod: "interface2", GoMethod: "Interface2"}, - }, - func() interface{} { - return &jsiiProxy_SingleInstanceTwoTypes{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.SingletonInt", - reflect.TypeOf((*SingletonInt)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "isSingletonInt", GoMethod: "IsSingletonInt"}, - }, - func() interface{} { - return &jsiiProxy_SingletonInt{} - }, - ) - _jsii_.RegisterEnum( - "jsii-calc.SingletonIntEnum", - reflect.TypeOf((*SingletonIntEnum)(nil)).Elem(), - map[string]interface{}{ - "SINGLETON_INT": SingletonIntEnum_SINGLETON_INT, - }, - ) - _jsii_.RegisterClass( - "jsii-calc.SingletonString", - reflect.TypeOf((*SingletonString)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "isSingletonString", GoMethod: "IsSingletonString"}, - }, - func() interface{} { - return &jsiiProxy_SingletonString{} - }, - ) - _jsii_.RegisterEnum( - "jsii-calc.SingletonStringEnum", - reflect.TypeOf((*SingletonStringEnum)(nil)).Elem(), - map[string]interface{}{ - "SINGLETON_STRING": SingletonStringEnum_SINGLETON_STRING, - }, - ) - _jsii_.RegisterStruct( - "jsii-calc.SmellyStruct", - reflect.TypeOf((*SmellyStruct)(nil)).Elem(), - ) - _jsii_.RegisterClass( - "jsii-calc.SomeTypeJsii976", - reflect.TypeOf((*SomeTypeJsii976)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_SomeTypeJsii976{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.StableClass", - reflect.TypeOf((*StableClass)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, - _jsii_.MemberProperty{JsiiProperty: "mutableProperty", GoGetter: "MutableProperty"}, - _jsii_.MemberProperty{JsiiProperty: "readonlyProperty", GoGetter: "ReadonlyProperty"}, - }, - func() interface{} { - return &jsiiProxy_StableClass{} - }, + + return returns +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ContainerProps.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + + +type ContainerProps struct { + ArrayProp *[]*DummyObj \`field:"required" json:"arrayProp" yaml:"arrayProp"\` + ObjProp *map[string]*DummyObj \`field:"required" json:"objProp" yaml:"objProp"\` + RecordProp *map[string]*DummyObj \`field:"required" json:"recordProp" yaml:"recordProp"\` +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/DataRenderer.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" + + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" +) + +// Verifies proper type handling through dynamic overrides. +type DataRenderer interface { + Render(data *scopejsiicalclib.MyFirstStruct) *string + RenderArbitrary(data *map[string]interface{}) *string + RenderMap(map_ *map[string]interface{}) *string +} + +// The jsii proxy struct for DataRenderer +type jsiiProxy_DataRenderer struct { + _ byte // padding +} + +func NewDataRenderer() DataRenderer { + _init_.Initialize() + + j := jsiiProxy_DataRenderer{} + + _jsii_.Create( + "jsii-calc.DataRenderer", + nil, // no parameters + &j, ) - _jsii_.RegisterEnum( - "jsii-calc.StableEnum", - reflect.TypeOf((*StableEnum)(nil)).Elem(), - map[string]interface{}{ - "OPTION_A": StableEnum_OPTION_A, - "OPTION_B": StableEnum_OPTION_B, - }, + + return &j +} + +func NewDataRenderer_Override(d DataRenderer) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.DataRenderer", + nil, // no parameters + d, ) - _jsii_.RegisterStruct( - "jsii-calc.StableStruct", - reflect.TypeOf((*StableStruct)(nil)).Elem(), +} + +func (d *jsiiProxy_DataRenderer) Render(data *scopejsiicalclib.MyFirstStruct) *string { + var returns *string + + _jsii_.Invoke( + d, + "render", + []interface{}{data}, + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.StaticContext", - reflect.TypeOf((*StaticContext)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_StaticContext{} - }, + + return returns +} + +func (d *jsiiProxy_DataRenderer) RenderArbitrary(data *map[string]interface{}) *string { + var returns *string + + _jsii_.Invoke( + d, + "renderArbitrary", + []interface{}{data}, + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.StaticHelloChild", - reflect.TypeOf((*StaticHelloChild)(nil)).Elem(), - nil, // no members - func() interface{} { - j := jsiiProxy_StaticHelloChild{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_StaticHelloParent) - return &j - }, + + return returns +} + +func (d *jsiiProxy_DataRenderer) RenderMap(map_ *map[string]interface{}) *string { + var returns *string + + _jsii_.Invoke( + d, + "renderMap", + []interface{}{map_}, + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.StaticHelloParent", - reflect.TypeOf((*StaticHelloParent)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_StaticHelloParent{} - }, + + return returns +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/Default.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +// A class named "Default". +// See: https://github.com/aws/jsii/issues/2637 +// +type Default interface { + PleaseCompile() +} + +// The jsii proxy struct for Default +type jsiiProxy_Default struct { + _ byte // padding +} + +func NewDefault() Default { + _init_.Initialize() + + j := jsiiProxy_Default{} + + _jsii_.Create( + "jsii-calc.Default", + nil, // no parameters + &j, ) - _jsii_.RegisterClass( - "jsii-calc.Statics", - reflect.TypeOf((*Statics)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "justMethod", GoMethod: "JustMethod"}, - _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, - }, - func() interface{} { - return &jsiiProxy_Statics{} - }, + + return &j +} + +func NewDefault_Override(d Default) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.Default", + nil, // no parameters + d, ) - _jsii_.RegisterEnum( - "jsii-calc.StringEnum", - reflect.TypeOf((*StringEnum)(nil)).Elem(), - map[string]interface{}{ - "A": StringEnum_A, - "B": StringEnum_B, - "C": StringEnum_C, - }, +} + +func (d *jsiiProxy_Default) PleaseCompile() { + _jsii_.InvokeVoid( + d, + "pleaseCompile", + nil, // no parameters ) - _jsii_.RegisterClass( - "jsii-calc.StripInternal", - reflect.TypeOf((*StripInternal)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "youSeeMe", GoGetter: "YouSeeMe"}, - }, - func() interface{} { - return &jsiiProxy_StripInternal{} - }, +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/DefaultedConstructorArgument.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + "time" + + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +type DefaultedConstructorArgument interface { + Arg1() *float64 + Arg2() *string + Arg3() *time.Time +} + +// The jsii proxy struct for DefaultedConstructorArgument +type jsiiProxy_DefaultedConstructorArgument struct { + _ byte // padding +} + +func (j *jsiiProxy_DefaultedConstructorArgument) Arg1() *float64 { + var returns *float64 + _jsii_.Get( + j, + "arg1", + &returns, ) - _jsii_.RegisterStruct( - "jsii-calc.StructA", - reflect.TypeOf((*StructA)(nil)).Elem(), + return returns +} + +func (j *jsiiProxy_DefaultedConstructorArgument) Arg2() *string { + var returns *string + _jsii_.Get( + j, + "arg2", + &returns, ) - _jsii_.RegisterStruct( - "jsii-calc.StructB", - reflect.TypeOf((*StructB)(nil)).Elem(), + return returns +} + +func (j *jsiiProxy_DefaultedConstructorArgument) Arg3() *time.Time { + var returns *time.Time + _jsii_.Get( + j, + "arg3", + &returns, ) - _jsii_.RegisterStruct( - "jsii-calc.StructParameterType", - reflect.TypeOf((*StructParameterType)(nil)).Elem(), + return returns +} + + +func NewDefaultedConstructorArgument(arg1 *float64, arg2 *string, arg3 *time.Time) DefaultedConstructorArgument { + _init_.Initialize() + + j := jsiiProxy_DefaultedConstructorArgument{} + + _jsii_.Create( + "jsii-calc.DefaultedConstructorArgument", + []interface{}{arg1, arg2, arg3}, + &j, ) - _jsii_.RegisterClass( - "jsii-calc.StructPassing", - reflect.TypeOf((*StructPassing)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_StructPassing{} - }, + + return &j +} + +func NewDefaultedConstructorArgument_Override(d DefaultedConstructorArgument, arg1 *float64, arg2 *string, arg3 *time.Time) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.DefaultedConstructorArgument", + []interface{}{arg1, arg2, arg3}, + d, ) - _jsii_.RegisterClass( - "jsii-calc.StructUnionConsumer", - reflect.TypeOf((*StructUnionConsumer)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_StructUnionConsumer{} - }, +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/Demonstrate982.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +// 1. +// +// call #takeThis() -> An ObjectRef will be provisioned for the value (it'll be re-used!) +// 2. call #takeThisToo() -> The ObjectRef from before will need to be down-cased to the ParentStruct982 type +type Demonstrate982 interface { +} + +// The jsii proxy struct for Demonstrate982 +type jsiiProxy_Demonstrate982 struct { + _ byte // padding +} + +func NewDemonstrate982() Demonstrate982 { + _init_.Initialize() + + j := jsiiProxy_Demonstrate982{} + + _jsii_.Create( + "jsii-calc.Demonstrate982", + nil, // no parameters + &j, ) - _jsii_.RegisterStruct( - "jsii-calc.StructWithCollectionOfUnionts", - reflect.TypeOf((*StructWithCollectionOfUnionts)(nil)).Elem(), + + return &j +} + +func NewDemonstrate982_Override(d Demonstrate982) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.Demonstrate982", + nil, // no parameters + d, ) - _jsii_.RegisterStruct( - "jsii-calc.StructWithEnum", - reflect.TypeOf((*StructWithEnum)(nil)).Elem(), +} + +// It's dangerous to go alone! +func Demonstrate982_TakeThis() *ChildStruct982 { + _init_.Initialize() + + var returns *ChildStruct982 + + _jsii_.StaticInvoke( + "jsii-calc.Demonstrate982", + "takeThis", + nil, // no parameters + &returns, ) - _jsii_.RegisterStruct( - "jsii-calc.StructWithJavaReservedWords", - reflect.TypeOf((*StructWithJavaReservedWords)(nil)).Elem(), + + return returns +} + +// It's dangerous to go alone! +func Demonstrate982_TakeThisToo() *ParentStruct982 { + _init_.Initialize() + + var returns *ParentStruct982 + + _jsii_.StaticInvoke( + "jsii-calc.Demonstrate982", + "takeThisToo", + nil, // no parameters + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.Sum", - reflect.TypeOf((*Sum)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "decorationPostfixes", GoGetter: "DecorationPostfixes"}, - _jsii_.MemberProperty{JsiiProperty: "decorationPrefixes", GoGetter: "DecorationPrefixes"}, - _jsii_.MemberProperty{JsiiProperty: "expression", GoGetter: "Expression"}, - _jsii_.MemberProperty{JsiiProperty: "parts", GoGetter: "Parts"}, - _jsii_.MemberProperty{JsiiProperty: "stringStyle", GoGetter: "StringStyle"}, - _jsii_.MemberMethod{JsiiMethod: "toString", GoMethod: "ToString"}, - _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, - _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, - }, - func() interface{} { - j := jsiiProxy_Sum{} - _jsii_.InitJsiiProxy(&j.Type__compositionCompositeOperation) - return &j - }, + + return returns +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/DeprecatedClass.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +// Deprecated: a pretty boring class. +type DeprecatedClass interface { + // Deprecated: shouldn't have been mutable. + MutableProperty() *float64 + // Deprecated: shouldn't have been mutable. + SetMutableProperty(val *float64) + // Deprecated: this is not always "wazoo", be ready to be disappointed. + ReadonlyProperty() *string + // Deprecated: it was a bad idea. + Method() +} + +// The jsii proxy struct for DeprecatedClass +type jsiiProxy_DeprecatedClass struct { + _ byte // padding +} + +func (j *jsiiProxy_DeprecatedClass) MutableProperty() *float64 { + var returns *float64 + _jsii_.Get( + j, + "mutableProperty", + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.SupportsNiceJavaBuilder", - reflect.TypeOf((*SupportsNiceJavaBuilder)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "bar", GoGetter: "Bar"}, - _jsii_.MemberProperty{JsiiProperty: "id", GoGetter: "Id"}, - _jsii_.MemberProperty{JsiiProperty: "propId", GoGetter: "PropId"}, - _jsii_.MemberProperty{JsiiProperty: "rest", GoGetter: "Rest"}, - }, - func() interface{} { - j := jsiiProxy_SupportsNiceJavaBuilder{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_SupportsNiceJavaBuilderWithRequiredProps) - return &j - }, + return returns +} + +func (j *jsiiProxy_DeprecatedClass) ReadonlyProperty() *string { + var returns *string + _jsii_.Get( + j, + "readonlyProperty", + &returns, ) - _jsii_.RegisterStruct( - "jsii-calc.SupportsNiceJavaBuilderProps", - reflect.TypeOf((*SupportsNiceJavaBuilderProps)(nil)).Elem(), + return returns +} + + +// Deprecated: this constructor is "just" okay. +func NewDeprecatedClass(readonlyString *string, mutableNumber *float64) DeprecatedClass { + _init_.Initialize() + + j := jsiiProxy_DeprecatedClass{} + + _jsii_.Create( + "jsii-calc.DeprecatedClass", + []interface{}{readonlyString, mutableNumber}, + &j, ) - _jsii_.RegisterClass( - "jsii-calc.SupportsNiceJavaBuilderWithRequiredProps", - reflect.TypeOf((*SupportsNiceJavaBuilderWithRequiredProps)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "bar", GoGetter: "Bar"}, - _jsii_.MemberProperty{JsiiProperty: "id", GoGetter: "Id"}, - _jsii_.MemberProperty{JsiiProperty: "propId", GoGetter: "PropId"}, - }, - func() interface{} { - return &jsiiProxy_SupportsNiceJavaBuilderWithRequiredProps{} - }, + + return &j +} + +// Deprecated: this constructor is "just" okay. +func NewDeprecatedClass_Override(d DeprecatedClass, readonlyString *string, mutableNumber *float64) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.DeprecatedClass", + []interface{}{readonlyString, mutableNumber}, + d, ) - _jsii_.RegisterClass( - "jsii-calc.SyncVirtualMethods", - reflect.TypeOf((*SyncVirtualMethods)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "a", GoGetter: "A"}, - _jsii_.MemberMethod{JsiiMethod: "callerIsAsync", GoMethod: "CallerIsAsync"}, - _jsii_.MemberMethod{JsiiMethod: "callerIsMethod", GoMethod: "CallerIsMethod"}, - _jsii_.MemberProperty{JsiiProperty: "callerIsProperty", GoGetter: "CallerIsProperty"}, - _jsii_.MemberMethod{JsiiMethod: "modifyOtherProperty", GoMethod: "ModifyOtherProperty"}, - _jsii_.MemberMethod{JsiiMethod: "modifyValueOfTheProperty", GoMethod: "ModifyValueOfTheProperty"}, - _jsii_.MemberProperty{JsiiProperty: "otherProperty", GoGetter: "OtherProperty"}, - _jsii_.MemberMethod{JsiiMethod: "readA", GoMethod: "ReadA"}, - _jsii_.MemberProperty{JsiiProperty: "readonlyProperty", GoGetter: "ReadonlyProperty"}, - _jsii_.MemberMethod{JsiiMethod: "retrieveOtherProperty", GoMethod: "RetrieveOtherProperty"}, - _jsii_.MemberMethod{JsiiMethod: "retrieveReadOnlyProperty", GoMethod: "RetrieveReadOnlyProperty"}, - _jsii_.MemberMethod{JsiiMethod: "retrieveValueOfTheProperty", GoMethod: "RetrieveValueOfTheProperty"}, - _jsii_.MemberProperty{JsiiProperty: "theProperty", GoGetter: "TheProperty"}, - _jsii_.MemberProperty{JsiiProperty: "valueOfOtherProperty", GoGetter: "ValueOfOtherProperty"}, - _jsii_.MemberMethod{JsiiMethod: "virtualMethod", GoMethod: "VirtualMethod"}, - _jsii_.MemberMethod{JsiiMethod: "writeA", GoMethod: "WriteA"}, - }, - func() interface{} { - return &jsiiProxy_SyncVirtualMethods{} - }, +} + +func (j *jsiiProxy_DeprecatedClass)SetMutableProperty(val *float64) { + _jsii_.Set( + j, + "mutableProperty", + val, ) - _jsii_.RegisterClass( - "jsii-calc.TestStructWithEnum", - reflect.TypeOf((*TestStructWithEnum)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "isStringEnumA", GoMethod: "IsStringEnumA"}, - _jsii_.MemberMethod{JsiiMethod: "isStringEnumB", GoMethod: "IsStringEnumB"}, - _jsii_.MemberProperty{JsiiProperty: "structWithFoo", GoGetter: "StructWithFoo"}, - _jsii_.MemberProperty{JsiiProperty: "structWithFooBar", GoGetter: "StructWithFooBar"}, - }, - func() interface{} { - return &jsiiProxy_TestStructWithEnum{} - }, +} + +func (d *jsiiProxy_DeprecatedClass) Method() { + _jsii_.InvokeVoid( + d, + "method", + nil, // no parameters + ) +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/DeprecatedEnum.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + + +// Deprecated: your deprecated selection of bad options. +type DeprecatedEnum string + +const ( + // Deprecated: option A is not great. + DeprecatedEnum_OPTION_A DeprecatedEnum = "OPTION_A" + // Deprecated: option B is kinda bad, too. + DeprecatedEnum_OPTION_B DeprecatedEnum = "OPTION_B" +) + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/DeprecatedStruct.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + + +// Deprecated: it just wraps a string. +type DeprecatedStruct struct { + // Deprecated: well, yeah. + ReadonlyProperty *string \`field:"required" json:"readonlyProperty" yaml:"readonlyProperty"\` +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/DerivedStruct.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + "time" + + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" +) + +// A struct which derives from another struct. +type DerivedStruct struct { + // An awesome number value. + // Deprecated. + Anumber *float64 \`field:"required" json:"anumber" yaml:"anumber"\` + // A string value. + // Deprecated. + Astring *string \`field:"required" json:"astring" yaml:"astring"\` + // Deprecated. + FirstOptional *[]*string \`field:"optional" json:"firstOptional" yaml:"firstOptional"\` + AnotherRequired *time.Time \`field:"required" json:"anotherRequired" yaml:"anotherRequired"\` + Bool *bool \`field:"required" json:"bool" yaml:"bool"\` + // An example of a non primitive property. + NonPrimitive DoubleTrouble \`field:"required" json:"nonPrimitive" yaml:"nonPrimitive"\` + // This is optional. + AnotherOptional *map[string]scopejsiicalclib.NumericValue \`field:"optional" json:"anotherOptional" yaml:"anotherOptional"\` + OptionalAny interface{} \`field:"optional" json:"optionalAny" yaml:"optionalAny"\` + OptionalArray *[]*string \`field:"optional" json:"optionalArray" yaml:"optionalArray"\` +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/DiamondBottom.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + "time" +) + +type DiamondBottom struct { + // Deprecated. + HoistedTop *string \`field:"optional" json:"hoistedTop" yaml:"hoistedTop"\` + // Deprecated. + Left *float64 \`field:"optional" json:"left" yaml:"left"\` + // Deprecated. + Right *bool \`field:"optional" json:"right" yaml:"right"\` + Bottom *time.Time \`field:"optional" json:"bottom" yaml:"bottom"\` +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/DiamondInheritanceBaseLevelStruct.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + + +type DiamondInheritanceBaseLevelStruct struct { + BaseLevelProperty *string \`field:"required" json:"baseLevelProperty" yaml:"baseLevelProperty"\` +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/DiamondInheritanceFirstMidLevelStruct.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + + +type DiamondInheritanceFirstMidLevelStruct struct { + BaseLevelProperty *string \`field:"required" json:"baseLevelProperty" yaml:"baseLevelProperty"\` + FirstMidLevelProperty *string \`field:"required" json:"firstMidLevelProperty" yaml:"firstMidLevelProperty"\` +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/DiamondInheritanceSecondMidLevelStruct.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + + +type DiamondInheritanceSecondMidLevelStruct struct { + BaseLevelProperty *string \`field:"required" json:"baseLevelProperty" yaml:"baseLevelProperty"\` + SecondMidLevelProperty *string \`field:"required" json:"secondMidLevelProperty" yaml:"secondMidLevelProperty"\` +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/DiamondInheritanceTopLevelStruct.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + + +type DiamondInheritanceTopLevelStruct struct { + BaseLevelProperty *string \`field:"required" json:"baseLevelProperty" yaml:"baseLevelProperty"\` + FirstMidLevelProperty *string \`field:"required" json:"firstMidLevelProperty" yaml:"firstMidLevelProperty"\` + SecondMidLevelProperty *string \`field:"required" json:"secondMidLevelProperty" yaml:"secondMidLevelProperty"\` + TopLevelProperty *string \`field:"required" json:"topLevelProperty" yaml:"topLevelProperty"\` +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/DisappointingCollectionSource.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +// Verifies that null/undefined can be returned for optional collections. +// +// This source of collections is disappointing - it'll always give you nothing :(. +type DisappointingCollectionSource interface { +} + +// The jsii proxy struct for DisappointingCollectionSource +type jsiiProxy_DisappointingCollectionSource struct { + _ byte // padding +} + +func DisappointingCollectionSource_MaybeList() *[]*string { + _init_.Initialize() + var returns *[]*string + _jsii_.StaticGet( + "jsii-calc.DisappointingCollectionSource", + "maybeList", + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.Thrower", - reflect.TypeOf((*Thrower)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "throwError", GoMethod: "ThrowError"}, - }, - func() interface{} { - return &jsiiProxy_Thrower{} - }, + return returns +} + +func DisappointingCollectionSource_MaybeMap() *map[string]*float64 { + _init_.Initialize() + var returns *map[string]*float64 + _jsii_.StaticGet( + "jsii-calc.DisappointingCollectionSource", + "maybeMap", + &returns, ) - _jsii_.RegisterStruct( - "jsii-calc.TopLevelStruct", - reflect.TypeOf((*TopLevelStruct)(nil)).Elem(), + return returns +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/DoNotOverridePrivates.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +type DoNotOverridePrivates interface { + ChangePrivatePropertyValue(newValue *string) + PrivateMethodValue() *string + PrivatePropertyValue() *string +} + +// The jsii proxy struct for DoNotOverridePrivates +type jsiiProxy_DoNotOverridePrivates struct { + _ byte // padding +} + +func NewDoNotOverridePrivates() DoNotOverridePrivates { + _init_.Initialize() + + j := jsiiProxy_DoNotOverridePrivates{} + + _jsii_.Create( + "jsii-calc.DoNotOverridePrivates", + nil, // no parameters + &j, ) - _jsii_.RegisterClass( - "jsii-calc.TwoMethodsWithSimilarCapitalization", - reflect.TypeOf((*TwoMethodsWithSimilarCapitalization)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "fooBar", GoGetter: "FooBar"}, - _jsii_.MemberProperty{JsiiProperty: "fooBAR", GoGetter: "FooBAR"}, - _jsii_.MemberMethod{JsiiMethod: "toIsoString", GoMethod: "ToIsoString"}, - _jsii_.MemberMethod{JsiiMethod: "toIsOString", GoMethod: "ToIsOString"}, - _jsii_.MemberMethod{JsiiMethod: "toISOString", GoMethod: "ToISOString"}, - }, - func() interface{} { - return &jsiiProxy_TwoMethodsWithSimilarCapitalization{} - }, + + return &j +} + +func NewDoNotOverridePrivates_Override(d DoNotOverridePrivates) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.DoNotOverridePrivates", + nil, // no parameters + d, ) - _jsii_.RegisterClass( - "jsii-calc.UmaskCheck", - reflect.TypeOf((*UmaskCheck)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_UmaskCheck{} - }, +} + +func (d *jsiiProxy_DoNotOverridePrivates) ChangePrivatePropertyValue(newValue *string) { + _jsii_.InvokeVoid( + d, + "changePrivatePropertyValue", + []interface{}{newValue}, ) - _jsii_.RegisterClass( - "jsii-calc.UnaryOperation", - reflect.TypeOf((*UnaryOperation)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "operand", GoGetter: "Operand"}, - _jsii_.MemberMethod{JsiiMethod: "toString", GoMethod: "ToString"}, - _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, - _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, - }, - func() interface{} { - j := jsiiProxy_UnaryOperation{} - _jsii_.InitJsiiProxy(&j.Type__scopejsiicalclibOperation) - return &j - }, +} + +func (d *jsiiProxy_DoNotOverridePrivates) PrivateMethodValue() *string { + var returns *string + + _jsii_.Invoke( + d, + "privateMethodValue", + nil, // no parameters + &returns, ) - _jsii_.RegisterStruct( - "jsii-calc.UnionProperties", - reflect.TypeOf((*UnionProperties)(nil)).Elem(), + + return returns +} + +func (d *jsiiProxy_DoNotOverridePrivates) PrivatePropertyValue() *string { + var returns *string + + _jsii_.Invoke( + d, + "privatePropertyValue", + nil, // no parameters + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.UpcasingReflectable", - reflect.TypeOf((*UpcasingReflectable)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "entries", GoGetter: "Entries"}, - }, - func() interface{} { - j := jsiiProxy_UpcasingReflectable{} - _jsii_.InitJsiiProxy(&j.Type__customsubmodulenameIReflectable) - return &j - }, + + return returns +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/DoNotRecognizeAnyAsOptional.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +// jsii#284: do not recognize "any" as an optional argument. +type DoNotRecognizeAnyAsOptional interface { + Method(_requiredAny interface{}, _optionalAny interface{}, _optionalString *string) +} + +// The jsii proxy struct for DoNotRecognizeAnyAsOptional +type jsiiProxy_DoNotRecognizeAnyAsOptional struct { + _ byte // padding +} + +func NewDoNotRecognizeAnyAsOptional() DoNotRecognizeAnyAsOptional { + _init_.Initialize() + + j := jsiiProxy_DoNotRecognizeAnyAsOptional{} + + _jsii_.Create( + "jsii-calc.DoNotRecognizeAnyAsOptional", + nil, // no parameters + &j, ) - _jsii_.RegisterClass( - "jsii-calc.UseBundledDependency", - reflect.TypeOf((*UseBundledDependency)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "value", GoMethod: "Value"}, - }, - func() interface{} { - return &jsiiProxy_UseBundledDependency{} - }, + + return &j +} + +func NewDoNotRecognizeAnyAsOptional_Override(d DoNotRecognizeAnyAsOptional) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.DoNotRecognizeAnyAsOptional", + nil, // no parameters + d, ) - _jsii_.RegisterClass( - "jsii-calc.UseCalcBase", - reflect.TypeOf((*UseCalcBase)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, - }, - func() interface{} { - return &jsiiProxy_UseCalcBase{} - }, +} + +func (d *jsiiProxy_DoNotRecognizeAnyAsOptional) Method(_requiredAny interface{}, _optionalAny interface{}, _optionalString *string) { + _jsii_.InvokeVoid( + d, + "method", + []interface{}{_requiredAny, _optionalAny, _optionalString}, ) - _jsii_.RegisterClass( - "jsii-calc.UsesInterfaceWithProperties", - reflect.TypeOf((*UsesInterfaceWithProperties)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "justRead", GoMethod: "JustRead"}, - _jsii_.MemberProperty{JsiiProperty: "obj", GoGetter: "Obj"}, - _jsii_.MemberMethod{JsiiMethod: "readStringAndNumber", GoMethod: "ReadStringAndNumber"}, - _jsii_.MemberMethod{JsiiMethod: "writeAndRead", GoMethod: "WriteAndRead"}, - }, - func() interface{} { - return &jsiiProxy_UsesInterfaceWithProperties{} - }, +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/DocumentedClass.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +// Here's the first line of the TSDoc comment. +// +// This is the meat of the TSDoc comment. It may contain +// multiple lines and multiple paragraphs. +// +// Multiple paragraphs are separated by an empty line. +// +// Example: +// x := 12 + 44 +// s1 := "string" +// s2 := "string \\nwith new newlines" // see https://github.com/aws/jsii/issues/2569 +// s3 := \`string +// with +// new lines\` +// +type DocumentedClass interface { + // Greet the indicated person. + // + // This will print out a friendly greeting intended for the indicated person. + // + // Returns: A number that everyone knows very well and represents the answer + // to the ultimate question. + Greet(greetee *Greetee) *float64 + // Say ¡Hola! + // Experimental. + Hola() +} + +// The jsii proxy struct for DocumentedClass +type jsiiProxy_DocumentedClass struct { + _ byte // padding +} + +func NewDocumentedClass() DocumentedClass { + _init_.Initialize() + + j := jsiiProxy_DocumentedClass{} + + _jsii_.Create( + "jsii-calc.DocumentedClass", + nil, // no parameters + &j, ) - _jsii_.RegisterClass( - "jsii-calc.VariadicInvoker", - reflect.TypeOf((*VariadicInvoker)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "asArray", GoMethod: "AsArray"}, - }, - func() interface{} { - return &jsiiProxy_VariadicInvoker{} - }, + + return &j +} + +func NewDocumentedClass_Override(d DocumentedClass) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.DocumentedClass", + nil, // no parameters + d, ) - _jsii_.RegisterClass( - "jsii-calc.VariadicMethod", - reflect.TypeOf((*VariadicMethod)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "asArray", GoMethod: "AsArray"}, - }, - func() interface{} { - return &jsiiProxy_VariadicMethod{} - }, +} + +func (d *jsiiProxy_DocumentedClass) Greet(greetee *Greetee) *float64 { + var returns *float64 + + _jsii_.Invoke( + d, + "greet", + []interface{}{greetee}, + &returns, ) - _jsii_.RegisterClass( - "jsii-calc.VariadicTypeUnion", - reflect.TypeOf((*VariadicTypeUnion)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "union", GoGetter: "Union"}, - }, - func() interface{} { - return &jsiiProxy_VariadicTypeUnion{} - }, + + return returns +} + +func (d *jsiiProxy_DocumentedClass) Hola() { + _jsii_.InvokeVoid( + d, + "hola", + nil, // no parameters ) - _jsii_.RegisterClass( - "jsii-calc.VirtualMethodPlayground", - reflect.TypeOf((*VirtualMethodPlayground)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "overrideMeAsync", GoMethod: "OverrideMeAsync"}, - _jsii_.MemberMethod{JsiiMethod: "overrideMeSync", GoMethod: "OverrideMeSync"}, - _jsii_.MemberMethod{JsiiMethod: "parallelSumAsync", GoMethod: "ParallelSumAsync"}, - _jsii_.MemberMethod{JsiiMethod: "serialSumAsync", GoMethod: "SerialSumAsync"}, - _jsii_.MemberMethod{JsiiMethod: "sumSync", GoMethod: "SumSync"}, - }, - func() interface{} { - return &jsiiProxy_VirtualMethodPlayground{} - }, +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/DontComplainAboutVariadicAfterOptional.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +type DontComplainAboutVariadicAfterOptional interface { + OptionalAndVariadic(optional *string, things ...*string) *string +} + +// The jsii proxy struct for DontComplainAboutVariadicAfterOptional +type jsiiProxy_DontComplainAboutVariadicAfterOptional struct { + _ byte // padding +} + +func NewDontComplainAboutVariadicAfterOptional() DontComplainAboutVariadicAfterOptional { + _init_.Initialize() + + j := jsiiProxy_DontComplainAboutVariadicAfterOptional{} + + _jsii_.Create( + "jsii-calc.DontComplainAboutVariadicAfterOptional", + nil, // no parameters + &j, ) - _jsii_.RegisterClass( - "jsii-calc.VoidCallback", - reflect.TypeOf((*VoidCallback)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "callMe", GoMethod: "CallMe"}, - _jsii_.MemberProperty{JsiiProperty: "methodWasCalled", GoGetter: "MethodWasCalled"}, - _jsii_.MemberMethod{JsiiMethod: "overrideMe", GoMethod: "OverrideMe"}, - }, - func() interface{} { - return &jsiiProxy_VoidCallback{} - }, + + return &j +} + +func NewDontComplainAboutVariadicAfterOptional_Override(d DontComplainAboutVariadicAfterOptional) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.DontComplainAboutVariadicAfterOptional", + nil, // no parameters + d, ) - _jsii_.RegisterClass( - "jsii-calc.WithPrivatePropertyInConstructor", - reflect.TypeOf((*WithPrivatePropertyInConstructor)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "success", GoGetter: "Success"}, - }, - func() interface{} { - return &jsiiProxy_WithPrivatePropertyInConstructor{} - }, +} + +func (d *jsiiProxy_DontComplainAboutVariadicAfterOptional) OptionalAndVariadic(optional *string, things ...*string) *string { + args := []interface{}{optional} + for _, a := range things { + args = append(args, a) + } + + var returns *string + + _jsii_.Invoke( + d, + "optionalAndVariadic", + args, + &returns, ) + + return returns } + `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AbstractClass.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/DoubleTrouble.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -6845,71 +7347,62 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type AbstractClass interface { - AbstractClassBase - IInterfaceImplementedByAbstractClass - AbstractProperty() *string - PropFromInterface() *string - AbstractMethod(name *string) *string - NonAbstractMethod() *float64 +type DoubleTrouble interface { + IFriendlyRandomGenerator + // Say hello! + Hello() *string + // Returns another random number. + Next() *float64 } -// The jsii proxy struct for AbstractClass -type jsiiProxy_AbstractClass struct { - jsiiProxy_AbstractClassBase - jsiiProxy_IInterfaceImplementedByAbstractClass +// The jsii proxy struct for DoubleTrouble +type jsiiProxy_DoubleTrouble struct { + jsiiProxy_IFriendlyRandomGenerator } -func (j *jsiiProxy_AbstractClass) AbstractProperty() *string { - var returns *string - _jsii_.Get( - j, - "abstractProperty", - &returns, - ) - return returns -} +func NewDoubleTrouble() DoubleTrouble { + _init_.Initialize() -func (j *jsiiProxy_AbstractClass) PropFromInterface() *string { - var returns *string - _jsii_.Get( - j, - "propFromInterface", - &returns, + j := jsiiProxy_DoubleTrouble{} + + _jsii_.Create( + "jsii-calc.DoubleTrouble", + nil, // no parameters + &j, ) - return returns -} + return &j +} -func NewAbstractClass_Override(a AbstractClass) { +func NewDoubleTrouble_Override(d DoubleTrouble) { _init_.Initialize() _jsii_.Create( - "jsii-calc.AbstractClass", + "jsii-calc.DoubleTrouble", nil, // no parameters - a, + d, ) } -func (a *jsiiProxy_AbstractClass) AbstractMethod(name *string) *string { +func (d *jsiiProxy_DoubleTrouble) Hello() *string { var returns *string _jsii_.Invoke( - a, - "abstractMethod", - []interface{}{name}, + d, + "hello", + nil, // no parameters &returns, ) return returns } -func (a *jsiiProxy_AbstractClass) NonAbstractMethod() *float64 { +func (d *jsiiProxy_DoubleTrouble) Next() *float64 { var returns *float64 _jsii_.Invoke( - a, - "nonAbstractMethod", + d, + "next", nil, // no parameters &returns, ) @@ -6920,7 +7413,19 @@ func (a *jsiiProxy_AbstractClass) NonAbstractMethod() *float64 { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AbstractClassBase.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/DummyObj.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + + +type DummyObj struct { + Example *string \`field:"required" json:"example" yaml:"example"\` +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/DynamicPropertyBearer.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -6929,40 +7434,84 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type AbstractClassBase interface { - AbstractProperty() *string +// Ensures we can override a dynamic property that was inherited. +type DynamicPropertyBearer interface { + DynamicProperty() *string + SetDynamicProperty(val *string) + ValueStore() *string + SetValueStore(val *string) } -// The jsii proxy struct for AbstractClassBase -type jsiiProxy_AbstractClassBase struct { +// The jsii proxy struct for DynamicPropertyBearer +type jsiiProxy_DynamicPropertyBearer struct { _ byte // padding } -func (j *jsiiProxy_AbstractClassBase) AbstractProperty() *string { +func (j *jsiiProxy_DynamicPropertyBearer) DynamicProperty() *string { var returns *string _jsii_.Get( j, - "abstractProperty", + "dynamicProperty", + &returns, + ) + return returns +} + +func (j *jsiiProxy_DynamicPropertyBearer) ValueStore() *string { + var returns *string + _jsii_.Get( + j, + "valueStore", &returns, ) return returns } -func NewAbstractClassBase_Override(a AbstractClassBase) { +func NewDynamicPropertyBearer(valueStore *string) DynamicPropertyBearer { _init_.Initialize() + j := jsiiProxy_DynamicPropertyBearer{} + _jsii_.Create( - "jsii-calc.AbstractClassBase", - nil, // no parameters - a, + "jsii-calc.DynamicPropertyBearer", + []interface{}{valueStore}, + &j, + ) + + return &j +} + +func NewDynamicPropertyBearer_Override(d DynamicPropertyBearer, valueStore *string) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.DynamicPropertyBearer", + []interface{}{valueStore}, + d, + ) +} + +func (j *jsiiProxy_DynamicPropertyBearer)SetDynamicProperty(val *string) { + _jsii_.Set( + j, + "dynamicProperty", + val, + ) +} + +func (j *jsiiProxy_DynamicPropertyBearer)SetValueStore(val *string) { + _jsii_.Set( + j, + "valueStore", + val, ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AbstractClassReturner.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/DynamicPropertyBearerChild.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -6971,72 +7520,102 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type AbstractClassReturner interface { - ReturnAbstractFromProperty() AbstractClassBase - GiveMeAbstract() AbstractClass - GiveMeInterface() IInterfaceImplementedByAbstractClass +type DynamicPropertyBearerChild interface { + DynamicPropertyBearer + DynamicProperty() *string + SetDynamicProperty(val *string) + OriginalValue() *string + ValueStore() *string + SetValueStore(val *string) + // Sets \`this.dynamicProperty\` to the new value, and returns the old value. + // + // Returns: the old value that was set. + OverrideValue(newValue *string) *string } -// The jsii proxy struct for AbstractClassReturner -type jsiiProxy_AbstractClassReturner struct { - _ byte // padding +// The jsii proxy struct for DynamicPropertyBearerChild +type jsiiProxy_DynamicPropertyBearerChild struct { + jsiiProxy_DynamicPropertyBearer } -func (j *jsiiProxy_AbstractClassReturner) ReturnAbstractFromProperty() AbstractClassBase { - var returns AbstractClassBase +func (j *jsiiProxy_DynamicPropertyBearerChild) DynamicProperty() *string { + var returns *string _jsii_.Get( j, - "returnAbstractFromProperty", + "dynamicProperty", &returns, ) return returns } +func (j *jsiiProxy_DynamicPropertyBearerChild) OriginalValue() *string { + var returns *string + _jsii_.Get( + j, + "originalValue", + &returns, + ) + return returns +} -func NewAbstractClassReturner() AbstractClassReturner { +func (j *jsiiProxy_DynamicPropertyBearerChild) ValueStore() *string { + var returns *string + _jsii_.Get( + j, + "valueStore", + &returns, + ) + return returns +} + + +func NewDynamicPropertyBearerChild(originalValue *string) DynamicPropertyBearerChild { _init_.Initialize() - j := jsiiProxy_AbstractClassReturner{} + j := jsiiProxy_DynamicPropertyBearerChild{} _jsii_.Create( - "jsii-calc.AbstractClassReturner", - nil, // no parameters + "jsii-calc.DynamicPropertyBearerChild", + []interface{}{originalValue}, &j, ) return &j } -func NewAbstractClassReturner_Override(a AbstractClassReturner) { +func NewDynamicPropertyBearerChild_Override(d DynamicPropertyBearerChild, originalValue *string) { _init_.Initialize() _jsii_.Create( - "jsii-calc.AbstractClassReturner", - nil, // no parameters - a, + "jsii-calc.DynamicPropertyBearerChild", + []interface{}{originalValue}, + d, ) } -func (a *jsiiProxy_AbstractClassReturner) GiveMeAbstract() AbstractClass { - var returns AbstractClass - - _jsii_.Invoke( - a, - "giveMeAbstract", - nil, // no parameters - &returns, +func (j *jsiiProxy_DynamicPropertyBearerChild)SetDynamicProperty(val *string) { + _jsii_.Set( + j, + "dynamicProperty", + val, ) +} - return returns +func (j *jsiiProxy_DynamicPropertyBearerChild)SetValueStore(val *string) { + _jsii_.Set( + j, + "valueStore", + val, + ) } -func (a *jsiiProxy_AbstractClassReturner) GiveMeInterface() IInterfaceImplementedByAbstractClass { - var returns IInterfaceImplementedByAbstractClass +func (d *jsiiProxy_DynamicPropertyBearerChild) OverrideValue(newValue *string) *string { + var returns *string _jsii_.Invoke( - a, - "giveMeInterface", - nil, // no parameters + d, + "overrideValue", + []interface{}{newValue}, &returns, ) @@ -7046,7 +7625,7 @@ func (a *jsiiProxy_AbstractClassReturner) GiveMeInterface() IInterfaceImplemente `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AbstractSuite.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/Entropy.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -7055,69 +7634,54 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// Ensures abstract members implementations correctly register overrides in various languages. -type AbstractSuite interface { - Property() *string - SetProperty(val *string) - SomeMethod(str *string) *string - // Sets \`seed\` to \`this.property\`, then calls \`someMethod\` with \`this.property\` and returns the result. - WorkItAll(seed *string) *string +// This class is used to validate that serialization and deserialization does not interpret ISO-8601-formatted timestampts to the native date/time object, as the jsii protocol has a $jsii$date wrapper for this purpose (node's JSON parsing does *NOT* detect dates automatically in this way, so host libraries should not either). +type Entropy interface { + // Increases entropy by consuming time from the clock (yes, this is a long shot, please don't judge). + // + // Returns: the time from the \`WallClock\`. + Increase() *string + // Implement this method such that it returns \`word\`. + // + // Returns: \`word\`. + Repeat(word *string) *string } -// The jsii proxy struct for AbstractSuite -type jsiiProxy_AbstractSuite struct { +// The jsii proxy struct for Entropy +type jsiiProxy_Entropy struct { _ byte // padding } -func (j *jsiiProxy_AbstractSuite) Property() *string { - var returns *string - _jsii_.Get( - j, - "property", - &returns, - ) - return returns -} - - -func NewAbstractSuite_Override(a AbstractSuite) { +// Creates a new instance of Entropy. +func NewEntropy_Override(e Entropy, clock IWallClock) { _init_.Initialize() _jsii_.Create( - "jsii-calc.AbstractSuite", - nil, // no parameters - a, - ) -} - -func (j *jsiiProxy_AbstractSuite)SetProperty(val *string) { - _jsii_.Set( - j, - "property", - val, + "jsii-calc.Entropy", + []interface{}{clock}, + e, ) } -func (a *jsiiProxy_AbstractSuite) SomeMethod(str *string) *string { +func (e *jsiiProxy_Entropy) Increase() *string { var returns *string _jsii_.Invoke( - a, - "someMethod", - []interface{}{str}, + e, + "increase", + nil, // no parameters &returns, ) return returns } -func (a *jsiiProxy_AbstractSuite) WorkItAll(seed *string) *string { +func (e *jsiiProxy_Entropy) Repeat(word *string) *string { var returns *string _jsii_.Invoke( - a, - "workItAll", - []interface{}{seed}, + e, + "repeat", + []interface{}{word}, &returns, ) @@ -7127,115 +7691,125 @@ func (a *jsiiProxy_AbstractSuite) WorkItAll(seed *string) *string { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Add.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/EnumDispenser.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" - - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ) -// The "+" binary operation. -type Add interface { - BinaryOperation - // Left-hand side operand. - Lhs() scopejsiicalclib.NumericValue - // Right-hand side operand. - Rhs() scopejsiicalclib.NumericValue - // The value. - Value() *float64 - // Say hello! - Hello() *string - // String representation of the value. - ToString() *string - // Returns: the name of the class (to verify native type names are created for derived classes). - TypeName() interface{} +type EnumDispenser interface { } -// The jsii proxy struct for Add -type jsiiProxy_Add struct { - jsiiProxy_BinaryOperation +// The jsii proxy struct for EnumDispenser +type jsiiProxy_EnumDispenser struct { + _ byte // padding } -func (j *jsiiProxy_Add) Lhs() scopejsiicalclib.NumericValue { - var returns scopejsiicalclib.NumericValue - _jsii_.Get( - j, - "lhs", +func EnumDispenser_RandomIntegerLikeEnum() AllTypesEnum { + _init_.Initialize() + + var returns AllTypesEnum + + _jsii_.StaticInvoke( + "jsii-calc.EnumDispenser", + "randomIntegerLikeEnum", + nil, // no parameters &returns, ) + return returns } -func (j *jsiiProxy_Add) Rhs() scopejsiicalclib.NumericValue { - var returns scopejsiicalclib.NumericValue - _jsii_.Get( - j, - "rhs", +func EnumDispenser_RandomStringLikeEnum() StringEnum { + _init_.Initialize() + + var returns StringEnum + + _jsii_.StaticInvoke( + "jsii-calc.EnumDispenser", + "randomStringLikeEnum", + nil, // no parameters &returns, ) + return returns } -func (j *jsiiProxy_Add) Value() *float64 { - var returns *float64 - _jsii_.Get( - j, - "value", - &returns, - ) - return returns + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/EraseUndefinedHashValues.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +type EraseUndefinedHashValues interface { } +// The jsii proxy struct for EraseUndefinedHashValues +type jsiiProxy_EraseUndefinedHashValues struct { + _ byte // padding +} -// Creates a BinaryOperation. -func NewAdd(lhs scopejsiicalclib.NumericValue, rhs scopejsiicalclib.NumericValue) Add { +func NewEraseUndefinedHashValues() EraseUndefinedHashValues { _init_.Initialize() - j := jsiiProxy_Add{} + j := jsiiProxy_EraseUndefinedHashValues{} _jsii_.Create( - "jsii-calc.Add", - []interface{}{lhs, rhs}, + "jsii-calc.EraseUndefinedHashValues", + nil, // no parameters &j, ) return &j } -// Creates a BinaryOperation. -func NewAdd_Override(a Add, lhs scopejsiicalclib.NumericValue, rhs scopejsiicalclib.NumericValue) { +func NewEraseUndefinedHashValues_Override(e EraseUndefinedHashValues) { _init_.Initialize() _jsii_.Create( - "jsii-calc.Add", - []interface{}{lhs, rhs}, - a, + "jsii-calc.EraseUndefinedHashValues", + nil, // no parameters + e, ) } -func (a *jsiiProxy_Add) Hello() *string { - var returns *string +// Returns \`true\` if \`key\` is defined in \`opts\`. +// +// 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() - _jsii_.Invoke( - a, - "hello", - nil, // no parameters + var returns *bool + + _jsii_.StaticInvoke( + "jsii-calc.EraseUndefinedHashValues", + "doesKeyExist", + []interface{}{opts, key}, &returns, ) return returns } -func (a *jsiiProxy_Add) ToString() *string { - var returns *string +// We expect "prop1" to be erased. +func EraseUndefinedHashValues_Prop1IsNull() *map[string]interface{} { + _init_.Initialize() - _jsii_.Invoke( - a, - "toString", + var returns *map[string]interface{} + + _jsii_.StaticInvoke( + "jsii-calc.EraseUndefinedHashValues", + "prop1IsNull", nil, // no parameters &returns, ) @@ -7243,12 +7817,15 @@ func (a *jsiiProxy_Add) ToString() *string { return returns } -func (a *jsiiProxy_Add) TypeName() interface{} { - var returns interface{} +// We expect "prop2" to be erased. +func EraseUndefinedHashValues_Prop2IsUndefined() *map[string]interface{} { + _init_.Initialize() - _jsii_.Invoke( - a, - "typeName", + var returns *map[string]interface{} + + _jsii_.StaticInvoke( + "jsii-calc.EraseUndefinedHashValues", + "prop2IsUndefined", nil, // no parameters &returns, ) @@ -7259,458 +7836,466 @@ func (a *jsiiProxy_Add) TypeName() interface{} { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AllTypes.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/EraseUndefinedHashValuesOptions.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc -import ( - "time" - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +type EraseUndefinedHashValuesOptions struct { + Option1 *string \`field:"optional" json:"option1" yaml:"option1"\` + Option2 *string \`field:"optional" json:"option2" yaml:"option2"\` +} - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" -) -// This class includes property for all types supported by jsii. -// -// The setters will validate -// that the value set is of the expected type and throw otherwise. -type AllTypes interface { - AnyArrayProperty() *[]interface{} - SetAnyArrayProperty(val *[]interface{}) - AnyMapProperty() *map[string]interface{} - SetAnyMapProperty(val *map[string]interface{}) - AnyProperty() interface{} - SetAnyProperty(val interface{}) - ArrayProperty() *[]*string - SetArrayProperty(val *[]*string) - BooleanProperty() *bool - SetBooleanProperty(val *bool) - DateProperty() *time.Time - SetDateProperty(val *time.Time) - EnumProperty() AllTypesEnum - SetEnumProperty(val AllTypesEnum) - EnumPropertyValue() *float64 - JsonProperty() *map[string]interface{} - SetJsonProperty(val *map[string]interface{}) - MapProperty() *map[string]scopejsiicalclib.Number - SetMapProperty(val *map[string]scopejsiicalclib.Number) - NumberProperty() *float64 - SetNumberProperty(val *float64) - OptionalEnumValue() StringEnum - SetOptionalEnumValue(val StringEnum) - StringProperty() *string - SetStringProperty(val *string) - UnionArrayProperty() *[]interface{} - SetUnionArrayProperty(val *[]interface{}) - UnionMapProperty() *map[string]interface{} - SetUnionMapProperty(val *map[string]interface{}) - UnionProperty() interface{} - SetUnionProperty(val interface{}) - UnknownArrayProperty() *[]interface{} - SetUnknownArrayProperty(val *[]interface{}) - UnknownMapProperty() *map[string]interface{} - SetUnknownMapProperty(val *map[string]interface{}) - UnknownProperty() interface{} - SetUnknownProperty(val interface{}) - AnyIn(inp interface{}) - AnyOut() interface{} - EnumMethod(value StringEnum) StringEnum +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ExperimentalClass.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +// Experimental. +type ExperimentalClass interface { + // Experimental. + MutableProperty() *float64 + // Experimental. + SetMutableProperty(val *float64) + // Experimental. + ReadonlyProperty() *string + // Experimental. + Method() } -// The jsii proxy struct for AllTypes -type jsiiProxy_AllTypes struct { +// The jsii proxy struct for ExperimentalClass +type jsiiProxy_ExperimentalClass struct { _ byte // padding } -func (j *jsiiProxy_AllTypes) AnyArrayProperty() *[]interface{} { - var returns *[]interface{} +func (j *jsiiProxy_ExperimentalClass) MutableProperty() *float64 { + var returns *float64 _jsii_.Get( j, - "anyArrayProperty", + "mutableProperty", &returns, ) return returns } -func (j *jsiiProxy_AllTypes) AnyMapProperty() *map[string]interface{} { - var returns *map[string]interface{} +func (j *jsiiProxy_ExperimentalClass) ReadonlyProperty() *string { + var returns *string _jsii_.Get( j, - "anyMapProperty", + "readonlyProperty", &returns, ) return returns } -func (j *jsiiProxy_AllTypes) AnyProperty() interface{} { - var returns interface{} - _jsii_.Get( - j, - "anyProperty", - &returns, - ) - return returns -} -func (j *jsiiProxy_AllTypes) ArrayProperty() *[]*string { - var returns *[]*string - _jsii_.Get( - j, - "arrayProperty", - &returns, - ) - return returns -} +// Experimental. +func NewExperimentalClass(readonlyString *string, mutableNumber *float64) ExperimentalClass { + _init_.Initialize() -func (j *jsiiProxy_AllTypes) BooleanProperty() *bool { - var returns *bool - _jsii_.Get( - j, - "booleanProperty", - &returns, + j := jsiiProxy_ExperimentalClass{} + + _jsii_.Create( + "jsii-calc.ExperimentalClass", + []interface{}{readonlyString, mutableNumber}, + &j, ) - return returns + + return &j } -func (j *jsiiProxy_AllTypes) DateProperty() *time.Time { - var returns *time.Time - _jsii_.Get( - j, - "dateProperty", - &returns, +// Experimental. +func NewExperimentalClass_Override(e ExperimentalClass, readonlyString *string, mutableNumber *float64) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.ExperimentalClass", + []interface{}{readonlyString, mutableNumber}, + e, ) - return returns } -func (j *jsiiProxy_AllTypes) EnumProperty() AllTypesEnum { - var returns AllTypesEnum - _jsii_.Get( +func (j *jsiiProxy_ExperimentalClass)SetMutableProperty(val *float64) { + _jsii_.Set( j, - "enumProperty", - &returns, + "mutableProperty", + val, ) - return returns } -func (j *jsiiProxy_AllTypes) EnumPropertyValue() *float64 { - var returns *float64 - _jsii_.Get( - j, - "enumPropertyValue", - &returns, +func (e *jsiiProxy_ExperimentalClass) Method() { + _jsii_.InvokeVoid( + e, + "method", + nil, // no parameters ) - return returns } -func (j *jsiiProxy_AllTypes) JsonProperty() *map[string]interface{} { - var returns *map[string]interface{} - _jsii_.Get( - j, - "jsonProperty", - &returns, - ) - return returns + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ExperimentalEnum.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + + +// Experimental. +type ExperimentalEnum string + +const ( + // Experimental. + ExperimentalEnum_OPTION_A ExperimentalEnum = "OPTION_A" + // Experimental. + ExperimentalEnum_OPTION_B ExperimentalEnum = "OPTION_B" +) + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ExperimentalStruct.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + + +// Experimental. +type ExperimentalStruct struct { + // Experimental. + ReadonlyProperty *string \`field:"required" json:"readonlyProperty" yaml:"readonlyProperty"\` } -func (j *jsiiProxy_AllTypes) MapProperty() *map[string]scopejsiicalclib.Number { - var returns *map[string]scopejsiicalclib.Number - _jsii_.Get( - j, - "mapProperty", - &returns, - ) - return returns + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ExportedBaseClass.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +type ExportedBaseClass interface { + Success() *bool } -func (j *jsiiProxy_AllTypes) NumberProperty() *float64 { - var returns *float64 - _jsii_.Get( - j, - "numberProperty", - &returns, - ) - return returns +// The jsii proxy struct for ExportedBaseClass +type jsiiProxy_ExportedBaseClass struct { + _ byte // padding } -func (j *jsiiProxy_AllTypes) OptionalEnumValue() StringEnum { - var returns StringEnum +func (j *jsiiProxy_ExportedBaseClass) Success() *bool { + var returns *bool _jsii_.Get( j, - "optionalEnumValue", + "success", &returns, ) return returns } -func (j *jsiiProxy_AllTypes) StringProperty() *string { - var returns *string - _jsii_.Get( - j, - "stringProperty", - &returns, + +func NewExportedBaseClass(success *bool) ExportedBaseClass { + _init_.Initialize() + + j := jsiiProxy_ExportedBaseClass{} + + _jsii_.Create( + "jsii-calc.ExportedBaseClass", + []interface{}{success}, + &j, ) - return returns + + return &j } -func (j *jsiiProxy_AllTypes) UnionArrayProperty() *[]interface{} { - var returns *[]interface{} - _jsii_.Get( - j, - "unionArrayProperty", - &returns, +func NewExportedBaseClass_Override(e ExportedBaseClass, success *bool) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.ExportedBaseClass", + []interface{}{success}, + e, ) - return returns } -func (j *jsiiProxy_AllTypes) UnionMapProperty() *map[string]interface{} { - var returns *map[string]interface{} - _jsii_.Get( - j, - "unionMapProperty", - &returns, - ) - return returns + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ExtendsInternalInterface.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + + +type ExtendsInternalInterface struct { + Boom *bool \`field:"required" json:"boom" yaml:"boom"\` + Prop *string \`field:"required" json:"prop" yaml:"prop"\` } -func (j *jsiiProxy_AllTypes) UnionProperty() interface{} { - var returns interface{} - _jsii_.Get( - j, - "unionProperty", - &returns, - ) - return returns + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ExternalClass.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +type ExternalClass interface { + MutableProperty() *float64 + SetMutableProperty(val *float64) + ReadonlyProperty() *string + Method() } -func (j *jsiiProxy_AllTypes) UnknownArrayProperty() *[]interface{} { - var returns *[]interface{} - _jsii_.Get( - j, - "unknownArrayProperty", - &returns, - ) - return returns +// The jsii proxy struct for ExternalClass +type jsiiProxy_ExternalClass struct { + _ byte // padding } -func (j *jsiiProxy_AllTypes) UnknownMapProperty() *map[string]interface{} { - var returns *map[string]interface{} +func (j *jsiiProxy_ExternalClass) MutableProperty() *float64 { + var returns *float64 _jsii_.Get( j, - "unknownMapProperty", + "mutableProperty", &returns, ) return returns } -func (j *jsiiProxy_AllTypes) UnknownProperty() interface{} { - var returns interface{} +func (j *jsiiProxy_ExternalClass) ReadonlyProperty() *string { + var returns *string _jsii_.Get( j, - "unknownProperty", + "readonlyProperty", &returns, ) return returns } -func NewAllTypes() AllTypes { +func NewExternalClass(readonlyString *string, mutableNumber *float64) ExternalClass { _init_.Initialize() - j := jsiiProxy_AllTypes{} + j := jsiiProxy_ExternalClass{} _jsii_.Create( - "jsii-calc.AllTypes", - nil, // no parameters + "jsii-calc.ExternalClass", + []interface{}{readonlyString, mutableNumber}, &j, ) return &j } -func NewAllTypes_Override(a AllTypes) { +func NewExternalClass_Override(e ExternalClass, readonlyString *string, mutableNumber *float64) { _init_.Initialize() _jsii_.Create( - "jsii-calc.AllTypes", - nil, // no parameters - a, + "jsii-calc.ExternalClass", + []interface{}{readonlyString, mutableNumber}, + e, ) } -func (j *jsiiProxy_AllTypes)SetAnyArrayProperty(val *[]interface{}) { +func (j *jsiiProxy_ExternalClass)SetMutableProperty(val *float64) { _jsii_.Set( j, - "anyArrayProperty", + "mutableProperty", val, ) } -func (j *jsiiProxy_AllTypes)SetAnyMapProperty(val *map[string]interface{}) { - _jsii_.Set( - j, - "anyMapProperty", - val, +func (e *jsiiProxy_ExternalClass) Method() { + _jsii_.InvokeVoid( + e, + "method", + nil, // no parameters ) } -func (j *jsiiProxy_AllTypes)SetAnyProperty(val interface{}) { - _jsii_.Set( - j, - "anyProperty", - val, - ) -} -func (j *jsiiProxy_AllTypes)SetArrayProperty(val *[]*string) { - _jsii_.Set( - j, - "arrayProperty", - val, - ) -} +`; -func (j *jsiiProxy_AllTypes)SetBooleanProperty(val *bool) { - _jsii_.Set( - j, - "booleanProperty", - val, - ) -} +exports[`Generated code for "jsii-calc": /go/jsiicalc/ExternalEnum.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc -func (j *jsiiProxy_AllTypes)SetDateProperty(val *time.Time) { - _jsii_.Set( - j, - "dateProperty", - val, - ) -} -func (j *jsiiProxy_AllTypes)SetEnumProperty(val AllTypesEnum) { - _jsii_.Set( - j, - "enumProperty", - val, - ) -} +type ExternalEnum string -func (j *jsiiProxy_AllTypes)SetJsonProperty(val *map[string]interface{}) { - _jsii_.Set( - j, - "jsonProperty", - val, - ) -} +const ( + ExternalEnum_OPTION_A ExternalEnum = "OPTION_A" + ExternalEnum_OPTION_B ExternalEnum = "OPTION_B" +) -func (j *jsiiProxy_AllTypes)SetMapProperty(val *map[string]scopejsiicalclib.Number) { - _jsii_.Set( - j, - "mapProperty", - val, - ) + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ExternalStruct.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + + +type ExternalStruct struct { + ReadonlyProperty *string \`field:"required" json:"readonlyProperty" yaml:"readonlyProperty"\` } -func (j *jsiiProxy_AllTypes)SetNumberProperty(val *float64) { - _jsii_.Set( - j, - "numberProperty", - val, - ) + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/FullCombo.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +type FullCombo interface { + BaseClass + IIndirectlyImplemented + Property() *string + Method() *float64 } -func (j *jsiiProxy_AllTypes)SetOptionalEnumValue(val StringEnum) { - _jsii_.Set( - j, - "optionalEnumValue", - val, - ) +// The jsii proxy struct for FullCombo +type jsiiProxy_FullCombo struct { + jsiiProxy_BaseClass + jsiiProxy_IIndirectlyImplemented } -func (j *jsiiProxy_AllTypes)SetStringProperty(val *string) { - _jsii_.Set( +func (j *jsiiProxy_FullCombo) Property() *string { + var returns *string + _jsii_.Get( j, - "stringProperty", - val, + "property", + &returns, ) + return returns } -func (j *jsiiProxy_AllTypes)SetUnionArrayProperty(val *[]interface{}) { - _jsii_.Set( - j, - "unionArrayProperty", - val, + +func (f *jsiiProxy_FullCombo) Method() *float64 { + var returns *float64 + + _jsii_.Invoke( + f, + "method", + nil, // no parameters + &returns, ) + + return returns } -func (j *jsiiProxy_AllTypes)SetUnionMapProperty(val *map[string]interface{}) { - _jsii_.Set( - j, - "unionMapProperty", - val, - ) + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/GiveMeStructs.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" + + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" +) + +type GiveMeStructs interface { + StructLiteral() *scopejsiicalclib.StructWithOnlyOptionals + // Accepts a struct of type DerivedStruct and returns a struct of type FirstStruct. + DerivedToFirst(derived *DerivedStruct) *scopejsiicalclib.MyFirstStruct + // Returns the boolean from a DerivedStruct struct. + ReadDerivedNonPrimitive(derived *DerivedStruct) DoubleTrouble + // Returns the "anumber" from a MyFirstStruct struct;. + ReadFirstNumber(first *scopejsiicalclib.MyFirstStruct) *float64 } -func (j *jsiiProxy_AllTypes)SetUnionProperty(val interface{}) { - _jsii_.Set( - j, - "unionProperty", - val, - ) +// The jsii proxy struct for GiveMeStructs +type jsiiProxy_GiveMeStructs struct { + _ byte // padding } -func (j *jsiiProxy_AllTypes)SetUnknownArrayProperty(val *[]interface{}) { - _jsii_.Set( +func (j *jsiiProxy_GiveMeStructs) StructLiteral() *scopejsiicalclib.StructWithOnlyOptionals { + var returns *scopejsiicalclib.StructWithOnlyOptionals + _jsii_.Get( j, - "unknownArrayProperty", - val, + "structLiteral", + &returns, ) + return returns } -func (j *jsiiProxy_AllTypes)SetUnknownMapProperty(val *map[string]interface{}) { - _jsii_.Set( - j, - "unknownMapProperty", - val, + +func NewGiveMeStructs() GiveMeStructs { + _init_.Initialize() + + j := jsiiProxy_GiveMeStructs{} + + _jsii_.Create( + "jsii-calc.GiveMeStructs", + nil, // no parameters + &j, ) + + return &j } -func (j *jsiiProxy_AllTypes)SetUnknownProperty(val interface{}) { - _jsii_.Set( - j, - "unknownProperty", - val, +func NewGiveMeStructs_Override(g GiveMeStructs) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.GiveMeStructs", + nil, // no parameters + g, ) } -func (a *jsiiProxy_AllTypes) AnyIn(inp interface{}) { - _jsii_.InvokeVoid( - a, - "anyIn", - []interface{}{inp}, +func (g *jsiiProxy_GiveMeStructs) DerivedToFirst(derived *DerivedStruct) *scopejsiicalclib.MyFirstStruct { + var returns *scopejsiicalclib.MyFirstStruct + + _jsii_.Invoke( + g, + "derivedToFirst", + []interface{}{derived}, + &returns, ) + + return returns } -func (a *jsiiProxy_AllTypes) AnyOut() interface{} { - var returns interface{} +func (g *jsiiProxy_GiveMeStructs) ReadDerivedNonPrimitive(derived *DerivedStruct) DoubleTrouble { + var returns DoubleTrouble _jsii_.Invoke( - a, - "anyOut", - nil, // no parameters + g, + "readDerivedNonPrimitive", + []interface{}{derived}, &returns, ) return returns } -func (a *jsiiProxy_AllTypes) EnumMethod(value StringEnum) StringEnum { - var returns StringEnum +func (g *jsiiProxy_GiveMeStructs) ReadFirstNumber(first *scopejsiicalclib.MyFirstStruct) *float64 { + var returns *float64 _jsii_.Invoke( - a, - "enumMethod", - []interface{}{value}, + g, + "readFirstNumber", + []interface{}{first}, &returns, ) @@ -7720,52 +8305,47 @@ func (a *jsiiProxy_AllTypes) EnumMethod(value StringEnum) StringEnum { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AllTypesEnum.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/Greetee.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc -type AllTypesEnum string - -const ( - AllTypesEnum_MY_ENUM_VALUE AllTypesEnum = "MY_ENUM_VALUE" - AllTypesEnum_YOUR_ENUM_VALUE AllTypesEnum = "YOUR_ENUM_VALUE" - AllTypesEnum_THIS_IS_GREAT AllTypesEnum = "THIS_IS_GREAT" -) +// These are some arguments you can pass to a method. +type Greetee struct { + // The name of the greetee. + Name *string \`field:"optional" json:"name" yaml:"name"\` +} `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AllowedMethodNames.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/GreetingAugmenter.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" + + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ) -type AllowedMethodNames interface { - GetBar(_p1 *string, _p2 *float64) - // getXxx() is not allowed (see negatives), but getXxx(a, ...) is okay. - GetFoo(withParam *string) *string - SetBar(_x *string, _y *float64, _z *bool) - // setFoo(x) is not allowed (see negatives), but setXxx(a, b, ...) is okay. - SetFoo(_x *string, _y *float64) +type GreetingAugmenter interface { + BetterGreeting(friendly scopejsiicalclib.IFriendly) *string } -// The jsii proxy struct for AllowedMethodNames -type jsiiProxy_AllowedMethodNames struct { +// The jsii proxy struct for GreetingAugmenter +type jsiiProxy_GreetingAugmenter struct { _ byte // padding } -func NewAllowedMethodNames() AllowedMethodNames { +func NewGreetingAugmenter() GreetingAugmenter { _init_.Initialize() - j := jsiiProxy_AllowedMethodNames{} + j := jsiiProxy_GreetingAugmenter{} _jsii_.Create( - "jsii-calc.AllowedMethodNames", + "jsii-calc.GreetingAugmenter", nil, // no parameters &j, ) @@ -7773,438 +8353,548 @@ func NewAllowedMethodNames() AllowedMethodNames { return &j } -func NewAllowedMethodNames_Override(a AllowedMethodNames) { +func NewGreetingAugmenter_Override(g GreetingAugmenter) { _init_.Initialize() _jsii_.Create( - "jsii-calc.AllowedMethodNames", + "jsii-calc.GreetingAugmenter", nil, // no parameters - a, - ) -} - -func (a *jsiiProxy_AllowedMethodNames) GetBar(_p1 *string, _p2 *float64) { - _jsii_.InvokeVoid( - a, - "getBar", - []interface{}{_p1, _p2}, + g, ) } -func (a *jsiiProxy_AllowedMethodNames) GetFoo(withParam *string) *string { +func (g *jsiiProxy_GreetingAugmenter) BetterGreeting(friendly scopejsiicalclib.IFriendly) *string { var returns *string _jsii_.Invoke( - a, - "getFoo", - []interface{}{withParam}, + g, + "betterGreeting", + []interface{}{friendly}, &returns, ) return returns } -func (a *jsiiProxy_AllowedMethodNames) SetBar(_x *string, _y *float64, _z *bool) { - _jsii_.InvokeVoid( - a, - "setBar", - []interface{}{_x, _y, _z}, + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/IAnonymousImplementationProvider.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +// We can return an anonymous interface implementation from an override without losing the interface declarations. +type IAnonymousImplementationProvider interface { + ProvideAsClass() Implementation + ProvideAsInterface() IAnonymouslyImplementMe +} + +// The jsii proxy for IAnonymousImplementationProvider +type jsiiProxy_IAnonymousImplementationProvider struct { + _ byte // padding +} + +func (i *jsiiProxy_IAnonymousImplementationProvider) ProvideAsClass() Implementation { + var returns Implementation + + _jsii_.Invoke( + i, + "provideAsClass", + nil, // no parameters + &returns, ) + + return returns } -func (a *jsiiProxy_AllowedMethodNames) SetFoo(_x *string, _y *float64) { - _jsii_.InvokeVoid( - a, - "setFoo", - []interface{}{_x, _y}, +func (i *jsiiProxy_IAnonymousImplementationProvider) ProvideAsInterface() IAnonymouslyImplementMe { + var returns IAnonymouslyImplementMe + + _jsii_.Invoke( + i, + "provideAsInterface", + nil, // no parameters + &returns, ) + + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AmbiguousParameters.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/IAnonymouslyImplementMe.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type AmbiguousParameters interface { - Props() *StructParameterType - Scope() Bell +type IAnonymouslyImplementMe interface { + Verb() *string + Value() *float64 } -// The jsii proxy struct for AmbiguousParameters -type jsiiProxy_AmbiguousParameters struct { +// The jsii proxy for IAnonymouslyImplementMe +type jsiiProxy_IAnonymouslyImplementMe struct { _ byte // padding } -func (j *jsiiProxy_AmbiguousParameters) Props() *StructParameterType { - var returns *StructParameterType - _jsii_.Get( - j, - "props", +func (i *jsiiProxy_IAnonymouslyImplementMe) Verb() *string { + var returns *string + + _jsii_.Invoke( + i, + "verb", + nil, // no parameters &returns, ) + return returns } -func (j *jsiiProxy_AmbiguousParameters) Scope() Bell { - var returns Bell +func (j *jsiiProxy_IAnonymouslyImplementMe) Value() *float64 { + var returns *float64 _jsii_.Get( j, - "scope", + "value", &returns, ) return returns } -func NewAmbiguousParameters(scope Bell, props *StructParameterType) AmbiguousParameters { - _init_.Initialize() +`; - j := jsiiProxy_AmbiguousParameters{} +exports[`Generated code for "jsii-calc": /go/jsiicalc/IAnotherPublicInterface.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc - _jsii_.Create( - "jsii-calc.AmbiguousParameters", - []interface{}{scope, props}, - &j, - ) +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) - return &j +type IAnotherPublicInterface interface { + A() *string + SetA(a *string) } -func NewAmbiguousParameters_Override(a AmbiguousParameters, scope Bell, props *StructParameterType) { - _init_.Initialize() +// The jsii proxy for IAnotherPublicInterface +type jsiiProxy_IAnotherPublicInterface struct { + _ byte // padding +} - _jsii_.Create( - "jsii-calc.AmbiguousParameters", - []interface{}{scope, props}, - a, +func (j *jsiiProxy_IAnotherPublicInterface) A() *string { + var returns *string + _jsii_.Get( + j, + "a", + &returns, + ) + return returns +} + +func (j *jsiiProxy_IAnotherPublicInterface)SetA(val *string) { + _jsii_.Set( + j, + "a", + val, ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AnonymousImplementationProvider.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/IBell.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type AnonymousImplementationProvider interface { - IAnonymousImplementationProvider - ProvideAsClass() Implementation - ProvideAsInterface() IAnonymouslyImplementMe +type IBell interface { + Ring() } -// The jsii proxy struct for AnonymousImplementationProvider -type jsiiProxy_AnonymousImplementationProvider struct { - jsiiProxy_IAnonymousImplementationProvider +// The jsii proxy for IBell +type jsiiProxy_IBell struct { + _ byte // padding } -func NewAnonymousImplementationProvider() AnonymousImplementationProvider { - _init_.Initialize() - - j := jsiiProxy_AnonymousImplementationProvider{} - - _jsii_.Create( - "jsii-calc.AnonymousImplementationProvider", +func (i *jsiiProxy_IBell) Ring() { + _jsii_.InvokeVoid( + i, + "ring", nil, // no parameters - &j, ) +} - return &j + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/IBellRinger.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +// Takes the object parameter as an interface. +type IBellRinger interface { + YourTurn(bell IBell) } -func NewAnonymousImplementationProvider_Override(a AnonymousImplementationProvider) { - _init_.Initialize() +// The jsii proxy for IBellRinger +type jsiiProxy_IBellRinger struct { + _ byte // padding +} - _jsii_.Create( - "jsii-calc.AnonymousImplementationProvider", - nil, // no parameters - a, +func (i *jsiiProxy_IBellRinger) YourTurn(bell IBell) { + _jsii_.InvokeVoid( + i, + "yourTurn", + []interface{}{bell}, ) } -func (a *jsiiProxy_AnonymousImplementationProvider) ProvideAsClass() Implementation { - var returns Implementation - _jsii_.Invoke( - a, - "provideAsClass", - nil, // no parameters - &returns, - ) +`; - return returns +exports[`Generated code for "jsii-calc": /go/jsiicalc/IConcreteBellRinger.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +// Takes the object parameter as a calss. +type IConcreteBellRinger interface { + YourTurn(bell Bell) } -func (a *jsiiProxy_AnonymousImplementationProvider) ProvideAsInterface() IAnonymouslyImplementMe { - var returns IAnonymouslyImplementMe +// The jsii proxy for IConcreteBellRinger +type jsiiProxy_IConcreteBellRinger struct { + _ byte // padding +} - _jsii_.Invoke( - a, - "provideAsInterface", - nil, // no parameters - &returns, +func (i *jsiiProxy_IConcreteBellRinger) YourTurn(bell Bell) { + _jsii_.InvokeVoid( + i, + "yourTurn", + []interface{}{bell}, ) - - return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AsyncVirtualMethods.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/IDeprecatedInterface.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type AsyncVirtualMethods interface { - CallMe() *float64 - // Just calls "overrideMeToo". - CallMe2() *float64 - // This method calls the "callMe" async method indirectly, which will then invoke a virtual method. - // - // This is a "double promise" situation, which - // means that callbacks are not going to be available immediate, but only - // after an "immediates" cycle. - CallMeDoublePromise() *float64 - DontOverrideMe() *float64 - OverrideMe(mult *float64) *float64 - OverrideMeToo() *float64 +// Deprecated: useless interface. +type IDeprecatedInterface interface { + // Deprecated: services no purpose. + Method() + // Deprecated: could be better. + MutableProperty() *float64 + // Deprecated: could be better. + SetMutableProperty(m *float64) } -// The jsii proxy struct for AsyncVirtualMethods -type jsiiProxy_AsyncVirtualMethods struct { +// The jsii proxy for IDeprecatedInterface +type jsiiProxy_IDeprecatedInterface struct { _ byte // padding } -func NewAsyncVirtualMethods() AsyncVirtualMethods { - _init_.Initialize() +func (i *jsiiProxy_IDeprecatedInterface) Method() { + _jsii_.InvokeVoid( + i, + "method", + nil, // no parameters + ) +} - j := jsiiProxy_AsyncVirtualMethods{} +func (j *jsiiProxy_IDeprecatedInterface) MutableProperty() *float64 { + var returns *float64 + _jsii_.Get( + j, + "mutableProperty", + &returns, + ) + return returns +} - _jsii_.Create( - "jsii-calc.AsyncVirtualMethods", - nil, // no parameters - &j, +func (j *jsiiProxy_IDeprecatedInterface)SetMutableProperty(val *float64) { + _jsii_.Set( + j, + "mutableProperty", + val, ) +} - return &j + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/IExperimentalInterface.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +// Experimental. +type IExperimentalInterface interface { + // Experimental. + Method() + // Experimental. + MutableProperty() *float64 + // Experimental. + SetMutableProperty(m *float64) } -func NewAsyncVirtualMethods_Override(a AsyncVirtualMethods) { - _init_.Initialize() +// The jsii proxy for IExperimentalInterface +type jsiiProxy_IExperimentalInterface struct { + _ byte // padding +} - _jsii_.Create( - "jsii-calc.AsyncVirtualMethods", +func (i *jsiiProxy_IExperimentalInterface) Method() { + _jsii_.InvokeVoid( + i, + "method", nil, // no parameters - a, ) } -func (a *jsiiProxy_AsyncVirtualMethods) CallMe() *float64 { +func (j *jsiiProxy_IExperimentalInterface) MutableProperty() *float64 { var returns *float64 - - _jsii_.Invoke( - a, - "callMe", - nil, // no parameters + _jsii_.Get( + j, + "mutableProperty", &returns, ) - return returns } -func (a *jsiiProxy_AsyncVirtualMethods) CallMe2() *float64 { - var returns *float64 - - _jsii_.Invoke( - a, - "callMe2", - nil, // no parameters - &returns, +func (j *jsiiProxy_IExperimentalInterface)SetMutableProperty(val *float64) { + _jsii_.Set( + j, + "mutableProperty", + val, ) +} - return returns + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/IExtendsPrivateInterface.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +type IExtendsPrivateInterface interface { + MoreThings() *[]*string + Private() *string + SetPrivate(p *string) } -func (a *jsiiProxy_AsyncVirtualMethods) CallMeDoublePromise() *float64 { - var returns *float64 +// The jsii proxy for IExtendsPrivateInterface +type jsiiProxy_IExtendsPrivateInterface struct { + _ byte // padding +} - _jsii_.Invoke( - a, - "callMeDoublePromise", - nil, // no parameters +func (j *jsiiProxy_IExtendsPrivateInterface) MoreThings() *[]*string { + var returns *[]*string + _jsii_.Get( + j, + "moreThings", &returns, ) - return returns } -func (a *jsiiProxy_AsyncVirtualMethods) DontOverrideMe() *float64 { - var returns *float64 - - _jsii_.Invoke( - a, - "dontOverrideMe", - nil, // no parameters +func (j *jsiiProxy_IExtendsPrivateInterface) Private() *string { + var returns *string + _jsii_.Get( + j, + "private", &returns, ) - return returns } -func (a *jsiiProxy_AsyncVirtualMethods) OverrideMe(mult *float64) *float64 { - var returns *float64 - - _jsii_.Invoke( - a, - "overrideMe", - []interface{}{mult}, - &returns, +func (j *jsiiProxy_IExtendsPrivateInterface)SetPrivate(val *string) { + _jsii_.Set( + j, + "private", + val, ) +} - return returns + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/IExternalInterface.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +type IExternalInterface interface { + Method() + MutableProperty() *float64 + SetMutableProperty(m *float64) } -func (a *jsiiProxy_AsyncVirtualMethods) OverrideMeToo() *float64 { - var returns *float64 +// The jsii proxy for IExternalInterface +type jsiiProxy_IExternalInterface struct { + _ byte // padding +} - _jsii_.Invoke( - a, - "overrideMeToo", +func (i *jsiiProxy_IExternalInterface) Method() { + _jsii_.InvokeVoid( + i, + "method", nil, // no parameters - &returns, ) +} +func (j *jsiiProxy_IExternalInterface) MutableProperty() *float64 { + var returns *float64 + _jsii_.Get( + j, + "mutableProperty", + &returns, + ) return returns } +func (j *jsiiProxy_IExternalInterface)SetMutableProperty(val *float64) { + _jsii_.Set( + j, + "mutableProperty", + val, + ) +} + `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_AugmentableClass.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/IFriendlier.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" + + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/internal" + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ) -type AugmentableClass interface { - MethodOne() - MethodTwo() +// Even friendlier classes can implement this interface. +type IFriendlier interface { + scopejsiicalclib.IFriendly + // Say farewell. + Farewell() *string + // Say goodbye. + // + // Returns: A goodbye blessing. + Goodbye() *string } -// The jsii proxy struct for AugmentableClass -type jsiiProxy_AugmentableClass struct { - _ byte // padding +// The jsii proxy for IFriendlier +type jsiiProxy_IFriendlier struct { + internal.Type__scopejsiicalclibIFriendly } -func NewAugmentableClass() AugmentableClass { - _init_.Initialize() - - j := jsiiProxy_AugmentableClass{} +func (i *jsiiProxy_IFriendlier) Farewell() *string { + var returns *string - _jsii_.Create( - "jsii-calc.AugmentableClass", + _jsii_.Invoke( + i, + "farewell", nil, // no parameters - &j, + &returns, ) - return &j + return returns } -func NewAugmentableClass_Override(a AugmentableClass) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.AugmentableClass", - nil, // no parameters - a, - ) -} +func (i *jsiiProxy_IFriendlier) Goodbye() *string { + var returns *string -func (a *jsiiProxy_AugmentableClass) MethodOne() { - _jsii_.InvokeVoid( - a, - "methodOne", + _jsii_.Invoke( + i, + "goodbye", nil, // no parameters + &returns, ) -} -func (a *jsiiProxy_AugmentableClass) MethodTwo() { - _jsii_.InvokeVoid( - a, - "methodTwo", - nil, // no parameters - ) + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_BaseClass.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/IFriendlyRandomGenerator.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" + + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/internal" + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ) -type BaseClass interface { - Property() *string - Method() *float64 +type IFriendlyRandomGenerator interface { + scopejsiicalclib.IFriendly + IRandomNumberGenerator } -// The jsii proxy struct for BaseClass -type jsiiProxy_BaseClass struct { - _ byte // padding +// The jsii proxy for IFriendlyRandomGenerator +type jsiiProxy_IFriendlyRandomGenerator struct { + internal.Type__scopejsiicalclibIFriendly + jsiiProxy_IRandomNumberGenerator } -func (j *jsiiProxy_BaseClass) Property() *string { +func (i *jsiiProxy_IFriendlyRandomGenerator) Hello() *string { var returns *string - _jsii_.Get( - j, - "property", - &returns, - ) - return returns -} - - -func NewBaseClass_Override(b BaseClass) { - _init_.Initialize() - _jsii_.Create( - "jsii-calc.BaseClass", + _jsii_.Invoke( + i, + "hello", nil, // no parameters - b, + &returns, ) + + return returns } -func (b *jsiiProxy_BaseClass) Method() *float64 { +func (i *jsiiProxy_IFriendlyRandomGenerator) Next() *float64 { var returns *float64 _jsii_.Invoke( - b, - "method", + i, + "next", nil, // no parameters &returns, ) @@ -8215,1092 +8905,1049 @@ func (b *jsiiProxy_BaseClass) Method() *float64 { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_BaseJsii976.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/IIndirectlyImplemented.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type BaseJsii976 interface { +type IIndirectlyImplemented interface { + Method() *float64 + Property() *string } -// The jsii proxy struct for BaseJsii976 -type jsiiProxy_BaseJsii976 struct { +// The jsii proxy for IIndirectlyImplemented +type jsiiProxy_IIndirectlyImplemented struct { _ byte // padding } -func NewBaseJsii976() BaseJsii976 { - _init_.Initialize() - - j := jsiiProxy_BaseJsii976{} +func (i *jsiiProxy_IIndirectlyImplemented) Method() *float64 { + var returns *float64 - _jsii_.Create( - "jsii-calc.BaseJsii976", + _jsii_.Invoke( + i, + "method", nil, // no parameters - &j, + &returns, ) - return &j + return returns } -func NewBaseJsii976_Override(b BaseJsii976) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.BaseJsii976", - nil, // no parameters - b, +func (j *jsiiProxy_IIndirectlyImplemented) Property() *string { + var returns *string + _jsii_.Get( + j, + "property", + &returns, ) + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Bell.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/IInterfaceImplementedByAbstractClass.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type Bell interface { - IBell - Rung() *bool - SetRung(val *bool) - Ring() +// awslabs/jsii#220 Abstract return type. +type IInterfaceImplementedByAbstractClass interface { + PropFromInterface() *string } -// The jsii proxy struct for Bell -type jsiiProxy_Bell struct { - jsiiProxy_IBell +// The jsii proxy for IInterfaceImplementedByAbstractClass +type jsiiProxy_IInterfaceImplementedByAbstractClass struct { + _ byte // padding } -func (j *jsiiProxy_Bell) Rung() *bool { - var returns *bool +func (j *jsiiProxy_IInterfaceImplementedByAbstractClass) PropFromInterface() *string { + var returns *string _jsii_.Get( j, - "rung", + "propFromInterface", &returns, ) return returns } -func NewBell() Bell { - _init_.Initialize() +`; - j := jsiiProxy_Bell{} +exports[`Generated code for "jsii-calc": /go/jsiicalc/IInterfaceThatShouldNotBeADataType.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc - _jsii_.Create( - "jsii-calc.Bell", - nil, // no parameters - &j, - ) +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) - return &j +// Even though this interface has only properties, it is disqualified from being a datatype because it inherits from an interface that is not a datatype. +type IInterfaceThatShouldNotBeADataType interface { + IInterfaceWithMethods + OtherValue() *string } -func NewBell_Override(b Bell) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.Bell", - nil, // no parameters - b, - ) +// The jsii proxy for IInterfaceThatShouldNotBeADataType +type jsiiProxy_IInterfaceThatShouldNotBeADataType struct { + jsiiProxy_IInterfaceWithMethods } -func (j *jsiiProxy_Bell)SetRung(val *bool) { - _jsii_.Set( +func (j *jsiiProxy_IInterfaceThatShouldNotBeADataType) OtherValue() *string { + var returns *string + _jsii_.Get( j, - "rung", - val, - ) -} - -func (b *jsiiProxy_Bell) Ring() { - _jsii_.InvokeVoid( - b, - "ring", - nil, // no parameters + "otherValue", + &returns, ) + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_BinaryOperation.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/IInterfaceWithInternal.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" - - "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/internal" - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ) -// Represents an operation with two operands. -type BinaryOperation interface { - scopejsiicalclib.Operation - scopejsiicalclib.IFriendly - // Left-hand side operand. - Lhs() scopejsiicalclib.NumericValue - // Right-hand side operand. - Rhs() scopejsiicalclib.NumericValue - // The value. - // Deprecated. - Value() *float64 - // Say hello! - Hello() *string - // String representation of the value. - // Deprecated. - ToString() *string - // Returns: the name of the class (to verify native type names are created for derived classes). - TypeName() interface{} +type IInterfaceWithInternal interface { + Visible() } -// The jsii proxy struct for BinaryOperation -type jsiiProxy_BinaryOperation struct { - internal.Type__scopejsiicalclibOperation - internal.Type__scopejsiicalclibIFriendly +// The jsii proxy for IInterfaceWithInternal +type jsiiProxy_IInterfaceWithInternal struct { + _ byte // padding } -func (j *jsiiProxy_BinaryOperation) Lhs() scopejsiicalclib.NumericValue { - var returns scopejsiicalclib.NumericValue - _jsii_.Get( - j, - "lhs", - &returns, +func (i *jsiiProxy_IInterfaceWithInternal) Visible() { + _jsii_.InvokeVoid( + i, + "visible", + nil, // no parameters ) - return returns } -func (j *jsiiProxy_BinaryOperation) Rhs() scopejsiicalclib.NumericValue { - var returns scopejsiicalclib.NumericValue - _jsii_.Get( - j, - "rhs", - &returns, - ) - return returns -} -func (j *jsiiProxy_BinaryOperation) Value() *float64 { - var returns *float64 - _jsii_.Get( - j, - "value", - &returns, - ) - return returns -} +`; +exports[`Generated code for "jsii-calc": /go/jsiicalc/IInterfaceWithMethods.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc -// Creates a BinaryOperation. -func NewBinaryOperation_Override(b BinaryOperation, lhs scopejsiicalclib.NumericValue, rhs scopejsiicalclib.NumericValue) { - _init_.Initialize() +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) - _jsii_.Create( - "jsii-calc.BinaryOperation", - []interface{}{lhs, rhs}, - b, - ) +type IInterfaceWithMethods interface { + DoThings() + Value() *string } -func (b *jsiiProxy_BinaryOperation) Hello() *string { - var returns *string - - _jsii_.Invoke( - b, - "hello", - nil, // no parameters - &returns, - ) - - return returns +// The jsii proxy for IInterfaceWithMethods +type jsiiProxy_IInterfaceWithMethods struct { + _ byte // padding } -func (b *jsiiProxy_BinaryOperation) ToString() *string { - var returns *string - - _jsii_.Invoke( - b, - "toString", +func (i *jsiiProxy_IInterfaceWithMethods) DoThings() { + _jsii_.InvokeVoid( + i, + "doThings", nil, // no parameters - &returns, ) - - return returns } -func (b *jsiiProxy_BinaryOperation) TypeName() interface{} { - var returns interface{} - - _jsii_.Invoke( - b, - "typeName", - nil, // no parameters +func (j *jsiiProxy_IInterfaceWithMethods) Value() *string { + var returns *string + _jsii_.Get( + j, + "value", &returns, ) - return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_BurriedAnonymousObject.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/IInterfaceWithOptionalMethodArguments.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// See https://github.com/aws/aws-cdk/issues/7977. -type BurriedAnonymousObject interface { - Check() *bool - // Implement this method and have it return it's parameter. - // - // Returns: \`value\`. - GiveItBack(value interface{}) interface{} +// awslabs/jsii#175 Interface proxies (and builders) do not respect optional arguments in methods. +type IInterfaceWithOptionalMethodArguments interface { + Hello(arg1 *string, arg2 *float64) } -// The jsii proxy struct for BurriedAnonymousObject -type jsiiProxy_BurriedAnonymousObject struct { +// The jsii proxy for IInterfaceWithOptionalMethodArguments +type jsiiProxy_IInterfaceWithOptionalMethodArguments struct { _ byte // padding } -func NewBurriedAnonymousObject_Override(b BurriedAnonymousObject) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.BurriedAnonymousObject", - nil, // no parameters - b, - ) -} - -func (b *jsiiProxy_BurriedAnonymousObject) Check() *bool { - var returns *bool - - _jsii_.Invoke( - b, - "check", - nil, // no parameters - &returns, - ) - - return returns -} - -func (b *jsiiProxy_BurriedAnonymousObject) GiveItBack(value interface{}) interface{} { - var returns interface{} - - _jsii_.Invoke( - b, - "giveItBack", - []interface{}{value}, - &returns, +func (i *jsiiProxy_IInterfaceWithOptionalMethodArguments) Hello(arg1 *string, arg2 *float64) { + _jsii_.InvokeVoid( + i, + "hello", + []interface{}{arg1, arg2}, ) - - return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Calculator.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/IInterfaceWithProperties.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" - - "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/composition" - "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/internal" - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ) -// A calculator which maintains a current value and allows adding operations. -// -// Here's how you use it: -// -// \`\`\`ts -// const calculator = new calc.Calculator(); -// calculator.add(5); -// calculator.mul(3); -// console.log(calculator.expression.value); -// \`\`\` -// -// I will repeat this example again, but in an @example tag. -// -// Example: -// calculator := calc.NewCalculator() -// calculator.Add(jsii.Number(5)) -// calculator.Mul(jsii.Number(3)) -// fmt.Println(calculator.expression.Value) -// -type Calculator interface { - composition.CompositeOperation - // The current value. - Curr() scopejsiicalclib.NumericValue - SetCurr(val scopejsiicalclib.NumericValue) - // A set of postfixes to include in a decorated .toString(). - DecorationPostfixes() *[]*string - SetDecorationPostfixes(val *[]*string) - // A set of prefixes to include in a decorated .toString(). - DecorationPrefixes() *[]*string - SetDecorationPrefixes(val *[]*string) - // Returns the expression. - Expression() scopejsiicalclib.NumericValue - // The maximum value allows in this calculator. - MaxValue() *float64 - SetMaxValue(val *float64) - // A log of all operations. - OperationsLog() *[]scopejsiicalclib.NumericValue - // A map of per operation name of all operations performed. - OperationsMap() *map[string]*[]scopejsiicalclib.NumericValue - // The .toString() style. - StringStyle() composition.CompositeOperation_CompositionStringStyle - SetStringStyle(val composition.CompositeOperation_CompositionStringStyle) - // Example of a property that accepts a union of types. - UnionProperty() interface{} - SetUnionProperty(val interface{}) - // The value. - Value() *float64 - // Adds a number to the current value. - Add(value *float64) - // Multiplies the current value by a number. - Mul(value *float64) - // Negates the current value. - Neg() - // Raises the current value by a power. - Pow(value *float64) - // Returns teh value of the union property (if defined). - ReadUnionValue() *float64 - // String representation of the value. - ToString() *string - // Returns: the name of the class (to verify native type names are created for derived classes). - TypeName() interface{} +type IInterfaceWithProperties interface { + ReadOnlyString() *string + ReadWriteString() *string + SetReadWriteString(r *string) } -// The jsii proxy struct for Calculator -type jsiiProxy_Calculator struct { - internal.Type__compositionCompositeOperation +// The jsii proxy for IInterfaceWithProperties +type jsiiProxy_IInterfaceWithProperties struct { + _ byte // padding } -func (j *jsiiProxy_Calculator) Curr() scopejsiicalclib.NumericValue { - var returns scopejsiicalclib.NumericValue +func (j *jsiiProxy_IInterfaceWithProperties) ReadOnlyString() *string { + var returns *string _jsii_.Get( j, - "curr", + "readOnlyString", &returns, ) return returns } -func (j *jsiiProxy_Calculator) DecorationPostfixes() *[]*string { - var returns *[]*string +func (j *jsiiProxy_IInterfaceWithProperties) ReadWriteString() *string { + var returns *string _jsii_.Get( j, - "decorationPostfixes", + "readWriteString", &returns, ) return returns } -func (j *jsiiProxy_Calculator) DecorationPrefixes() *[]*string { - var returns *[]*string - _jsii_.Get( +func (j *jsiiProxy_IInterfaceWithProperties)SetReadWriteString(val *string) { + _jsii_.Set( j, - "decorationPrefixes", - &returns, + "readWriteString", + val, ) - return returns } -func (j *jsiiProxy_Calculator) Expression() scopejsiicalclib.NumericValue { - var returns scopejsiicalclib.NumericValue - _jsii_.Get( - j, - "expression", - &returns, - ) - return returns + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/IInterfaceWithPropertiesExtension.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +type IInterfaceWithPropertiesExtension interface { + IInterfaceWithProperties + Foo() *float64 + SetFoo(f *float64) +} + +// The jsii proxy for IInterfaceWithPropertiesExtension +type jsiiProxy_IInterfaceWithPropertiesExtension struct { + jsiiProxy_IInterfaceWithProperties } -func (j *jsiiProxy_Calculator) MaxValue() *float64 { +func (j *jsiiProxy_IInterfaceWithPropertiesExtension) Foo() *float64 { var returns *float64 _jsii_.Get( j, - "maxValue", + "foo", &returns, ) return returns } -func (j *jsiiProxy_Calculator) OperationsLog() *[]scopejsiicalclib.NumericValue { - var returns *[]scopejsiicalclib.NumericValue - _jsii_.Get( +func (j *jsiiProxy_IInterfaceWithPropertiesExtension)SetFoo(val *float64) { + _jsii_.Set( j, - "operationsLog", - &returns, + "foo", + val, ) - return returns } -func (j *jsiiProxy_Calculator) OperationsMap() *map[string]*[]scopejsiicalclib.NumericValue { - var returns *map[string]*[]scopejsiicalclib.NumericValue - _jsii_.Get( - j, - "operationsMap", - &returns, + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/IJSII417Derived.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +type IJSII417Derived interface { + IJSII417PublicBaseOfBase + Bar() + Baz() + Property() *string +} + +// The jsii proxy for IJSII417Derived +type jsiiProxy_IJSII417Derived struct { + jsiiProxy_IJSII417PublicBaseOfBase +} + +func (i *jsiiProxy_IJSII417Derived) Bar() { + _jsii_.InvokeVoid( + i, + "bar", + nil, // no parameters ) - return returns } -func (j *jsiiProxy_Calculator) StringStyle() composition.CompositeOperation_CompositionStringStyle { - var returns composition.CompositeOperation_CompositionStringStyle - _jsii_.Get( - j, - "stringStyle", - &returns, +func (i *jsiiProxy_IJSII417Derived) Baz() { + _jsii_.InvokeVoid( + i, + "baz", + nil, // no parameters ) - return returns } -func (j *jsiiProxy_Calculator) UnionProperty() interface{} { - var returns interface{} +func (j *jsiiProxy_IJSII417Derived) Property() *string { + var returns *string _jsii_.Get( j, - "unionProperty", + "property", &returns, ) return returns } -func (j *jsiiProxy_Calculator) Value() *float64 { - var returns *float64 + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/IJSII417PublicBaseOfBase.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +type IJSII417PublicBaseOfBase interface { + Foo() + HasRoot() *bool +} + +// The jsii proxy for IJSII417PublicBaseOfBase +type jsiiProxy_IJSII417PublicBaseOfBase struct { + _ byte // padding +} + +func (i *jsiiProxy_IJSII417PublicBaseOfBase) Foo() { + _jsii_.InvokeVoid( + i, + "foo", + nil, // no parameters + ) +} + +func (j *jsiiProxy_IJSII417PublicBaseOfBase) HasRoot() *bool { + var returns *bool _jsii_.Get( j, - "value", + "hasRoot", &returns, ) return returns } -// Creates a Calculator object. -func NewCalculator(props *CalculatorProps) Calculator { - _init_.Initialize() +`; - j := jsiiProxy_Calculator{} +exports[`Generated code for "jsii-calc": /go/jsiicalc/IJavaReservedWordsInAnInterface.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc - _jsii_.Create( - "jsii-calc.Calculator", - []interface{}{props}, - &j, - ) +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) - return &j +type IJavaReservedWordsInAnInterface interface { + Abstract() + Assert() + Boolean() + Break() + Byte() + Case() + Catch() + Char() + Class() + Const() + Continue() + Default() + Do() + Double() + Else() + Enum() + Extends() + False() + Final() + Finally() + Float() + For() + Goto() + If() + Implements() + Import() + Instanceof() + Int() + Interface() + Long() + Native() + Null() + Package() + Private() + Protected() + Public() + Return() + Short() + Static() + Strictfp() + Super() + Switch() + Synchronized() + This() + Throw() + Throws() + Transient() + True() + Try() + Void() + Volatile() + While() *string } -// Creates a Calculator object. -func NewCalculator_Override(c Calculator, props *CalculatorProps) { - _init_.Initialize() +// The jsii proxy for IJavaReservedWordsInAnInterface +type jsiiProxy_IJavaReservedWordsInAnInterface struct { + _ byte // padding +} - _jsii_.Create( - "jsii-calc.Calculator", - []interface{}{props}, - c, +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Abstract() { + _jsii_.InvokeVoid( + i, + "abstract", + nil, // no parameters ) } -func (j *jsiiProxy_Calculator)SetCurr(val scopejsiicalclib.NumericValue) { - _jsii_.Set( - j, - "curr", - val, +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Assert() { + _jsii_.InvokeVoid( + i, + "assert", + nil, // no parameters ) } -func (j *jsiiProxy_Calculator)SetDecorationPostfixes(val *[]*string) { - _jsii_.Set( - j, - "decorationPostfixes", - val, +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Boolean() { + _jsii_.InvokeVoid( + i, + "boolean", + nil, // no parameters ) } -func (j *jsiiProxy_Calculator)SetDecorationPrefixes(val *[]*string) { - _jsii_.Set( - j, - "decorationPrefixes", - val, +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Break() { + _jsii_.InvokeVoid( + i, + "break", + nil, // no parameters ) } -func (j *jsiiProxy_Calculator)SetMaxValue(val *float64) { - _jsii_.Set( - j, - "maxValue", - val, +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Byte() { + _jsii_.InvokeVoid( + i, + "byte", + nil, // no parameters ) } -func (j *jsiiProxy_Calculator)SetStringStyle(val composition.CompositeOperation_CompositionStringStyle) { - _jsii_.Set( - j, - "stringStyle", - val, +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Case() { + _jsii_.InvokeVoid( + i, + "case", + nil, // no parameters ) } -func (j *jsiiProxy_Calculator)SetUnionProperty(val interface{}) { - _jsii_.Set( - j, - "unionProperty", - val, +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Catch() { + _jsii_.InvokeVoid( + i, + "catch", + nil, // no parameters ) } -func (c *jsiiProxy_Calculator) Add(value *float64) { +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Char() { _jsii_.InvokeVoid( - c, - "add", - []interface{}{value}, + i, + "char", + nil, // no parameters ) } -func (c *jsiiProxy_Calculator) Mul(value *float64) { +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Class() { _jsii_.InvokeVoid( - c, - "mul", - []interface{}{value}, + i, + "class", + nil, // no parameters ) } -func (c *jsiiProxy_Calculator) Neg() { +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Const() { _jsii_.InvokeVoid( - c, - "neg", + i, + "const", nil, // no parameters ) } -func (c *jsiiProxy_Calculator) Pow(value *float64) { +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Continue() { _jsii_.InvokeVoid( - c, - "pow", - []interface{}{value}, + i, + "continue", + nil, // no parameters ) } -func (c *jsiiProxy_Calculator) ReadUnionValue() *float64 { - var returns *float64 - - _jsii_.Invoke( - c, - "readUnionValue", +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Default() { + _jsii_.InvokeVoid( + i, + "default", nil, // no parameters - &returns, ) - - return returns } -func (c *jsiiProxy_Calculator) ToString() *string { - var returns *string - - _jsii_.Invoke( - c, - "toString", +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Do() { + _jsii_.InvokeVoid( + i, + "do", nil, // no parameters - &returns, ) - - return returns } -func (c *jsiiProxy_Calculator) TypeName() interface{} { - var returns interface{} - - _jsii_.Invoke( - c, - "typeName", +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Double() { + _jsii_.InvokeVoid( + i, + "double", nil, // no parameters - &returns, ) - - return returns } - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_CalculatorProps.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -// Properties for Calculator. -type CalculatorProps struct { - // The initial value of the calculator. - // - // NOTE: Any number works here, it's fine. - InitialValue *float64 \`field:"optional" json:"initialValue" yaml:"initialValue"\` - // The maximum value the calculator can store. - MaximumValue *float64 \`field:"optional" json:"maximumValue" yaml:"maximumValue"\` +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Else() { + _jsii_.InvokeVoid( + i, + "else", + nil, // no parameters + ) } +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Enum() { + _jsii_.InvokeVoid( + i, + "enum", + nil, // no parameters + ) +} -`; +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Extends() { + _jsii_.InvokeVoid( + i, + "extends", + nil, // no parameters + ) +} -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ChildStruct982.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) False() { + _jsii_.InvokeVoid( + i, + "false", + nil, // no parameters + ) +} +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Final() { + _jsii_.InvokeVoid( + i, + "final", + nil, // no parameters + ) +} -type ChildStruct982 struct { - Foo *string \`field:"required" json:"foo" yaml:"foo"\` - Bar *float64 \`field:"required" json:"bar" yaml:"bar"\` +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Finally() { + _jsii_.InvokeVoid( + i, + "finally", + nil, // no parameters + ) } +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Float() { + _jsii_.InvokeVoid( + i, + "float", + nil, // no parameters + ) +} -`; +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) For() { + _jsii_.InvokeVoid( + i, + "for", + nil, // no parameters + ) +} -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassThatImplementsTheInternalInterface.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Goto() { + _jsii_.InvokeVoid( + i, + "goto", + nil, // no parameters + ) +} -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) If() { + _jsii_.InvokeVoid( + i, + "if", + nil, // no parameters + ) +} -type ClassThatImplementsTheInternalInterface interface { - INonInternalInterface - A() *string - SetA(val *string) - B() *string - SetB(val *string) - C() *string - SetC(val *string) - D() *string - SetD(val *string) +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Implements() { + _jsii_.InvokeVoid( + i, + "implements", + nil, // no parameters + ) } -// The jsii proxy struct for ClassThatImplementsTheInternalInterface -type jsiiProxy_ClassThatImplementsTheInternalInterface struct { - jsiiProxy_INonInternalInterface +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Import() { + _jsii_.InvokeVoid( + i, + "import", + nil, // no parameters + ) } -func (j *jsiiProxy_ClassThatImplementsTheInternalInterface) A() *string { - var returns *string - _jsii_.Get( - j, - "a", - &returns, +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Instanceof() { + _jsii_.InvokeVoid( + i, + "instanceof", + nil, // no parameters ) - return returns } -func (j *jsiiProxy_ClassThatImplementsTheInternalInterface) B() *string { - var returns *string - _jsii_.Get( - j, - "b", - &returns, +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Int() { + _jsii_.InvokeVoid( + i, + "int", + nil, // no parameters ) - return returns } -func (j *jsiiProxy_ClassThatImplementsTheInternalInterface) C() *string { - var returns *string - _jsii_.Get( - j, - "c", - &returns, +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Interface() { + _jsii_.InvokeVoid( + i, + "interface", + nil, // no parameters ) - return returns } -func (j *jsiiProxy_ClassThatImplementsTheInternalInterface) D() *string { - var returns *string - _jsii_.Get( - j, - "d", - &returns, +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Long() { + _jsii_.InvokeVoid( + i, + "long", + nil, // no parameters ) - return returns } +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Native() { + _jsii_.InvokeVoid( + i, + "native", + nil, // no parameters + ) +} -func NewClassThatImplementsTheInternalInterface() ClassThatImplementsTheInternalInterface { - _init_.Initialize() +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Null() { + _jsii_.InvokeVoid( + i, + "null", + nil, // no parameters + ) +} - j := jsiiProxy_ClassThatImplementsTheInternalInterface{} +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Package() { + _jsii_.InvokeVoid( + i, + "package", + nil, // no parameters + ) +} - _jsii_.Create( - "jsii-calc.ClassThatImplementsTheInternalInterface", +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Private() { + _jsii_.InvokeVoid( + i, + "private", nil, // no parameters - &j, ) - - return &j } -func NewClassThatImplementsTheInternalInterface_Override(c ClassThatImplementsTheInternalInterface) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.ClassThatImplementsTheInternalInterface", +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Protected() { + _jsii_.InvokeVoid( + i, + "protected", nil, // no parameters - c, ) } -func (j *jsiiProxy_ClassThatImplementsTheInternalInterface)SetA(val *string) { - _jsii_.Set( - j, - "a", - val, +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Public() { + _jsii_.InvokeVoid( + i, + "public", + nil, // no parameters ) } -func (j *jsiiProxy_ClassThatImplementsTheInternalInterface)SetB(val *string) { - _jsii_.Set( - j, - "b", - val, +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Return() { + _jsii_.InvokeVoid( + i, + "return", + nil, // no parameters ) } -func (j *jsiiProxy_ClassThatImplementsTheInternalInterface)SetC(val *string) { - _jsii_.Set( - j, - "c", - val, +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Short() { + _jsii_.InvokeVoid( + i, + "short", + nil, // no parameters ) } -func (j *jsiiProxy_ClassThatImplementsTheInternalInterface)SetD(val *string) { - _jsii_.Set( - j, - "d", - val, +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Static() { + _jsii_.InvokeVoid( + i, + "static", + nil, // no parameters ) } - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassThatImplementsThePrivateInterface.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -type ClassThatImplementsThePrivateInterface interface { - INonInternalInterface - A() *string - SetA(val *string) - B() *string - SetB(val *string) - C() *string - SetC(val *string) - E() *string - SetE(val *string) +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Strictfp() { + _jsii_.InvokeVoid( + i, + "strictfp", + nil, // no parameters + ) } -// The jsii proxy struct for ClassThatImplementsThePrivateInterface -type jsiiProxy_ClassThatImplementsThePrivateInterface struct { - jsiiProxy_INonInternalInterface +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Super() { + _jsii_.InvokeVoid( + i, + "super", + nil, // no parameters + ) } -func (j *jsiiProxy_ClassThatImplementsThePrivateInterface) A() *string { - var returns *string - _jsii_.Get( - j, - "a", - &returns, +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Switch() { + _jsii_.InvokeVoid( + i, + "switch", + nil, // no parameters ) - return returns } -func (j *jsiiProxy_ClassThatImplementsThePrivateInterface) B() *string { - var returns *string - _jsii_.Get( - j, - "b", - &returns, +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Synchronized() { + _jsii_.InvokeVoid( + i, + "synchronized", + nil, // no parameters ) - return returns } -func (j *jsiiProxy_ClassThatImplementsThePrivateInterface) C() *string { - var returns *string - _jsii_.Get( - j, - "c", - &returns, +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) This() { + _jsii_.InvokeVoid( + i, + "this", + nil, // no parameters ) - return returns } -func (j *jsiiProxy_ClassThatImplementsThePrivateInterface) E() *string { - var returns *string - _jsii_.Get( - j, - "e", - &returns, +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Throw() { + _jsii_.InvokeVoid( + i, + "throw", + nil, // no parameters ) - return returns } - -func NewClassThatImplementsThePrivateInterface() ClassThatImplementsThePrivateInterface { - _init_.Initialize() - - j := jsiiProxy_ClassThatImplementsThePrivateInterface{} - - _jsii_.Create( - "jsii-calc.ClassThatImplementsThePrivateInterface", +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Throws() { + _jsii_.InvokeVoid( + i, + "throws", nil, // no parameters - &j, ) - - return &j } -func NewClassThatImplementsThePrivateInterface_Override(c ClassThatImplementsThePrivateInterface) { - _init_.Initialize() +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Transient() { + _jsii_.InvokeVoid( + i, + "transient", + nil, // no parameters + ) +} - _jsii_.Create( - "jsii-calc.ClassThatImplementsThePrivateInterface", +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) True() { + _jsii_.InvokeVoid( + i, + "true", nil, // no parameters - c, ) } -func (j *jsiiProxy_ClassThatImplementsThePrivateInterface)SetA(val *string) { - _jsii_.Set( - j, - "a", - val, +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Try() { + _jsii_.InvokeVoid( + i, + "try", + nil, // no parameters ) } -func (j *jsiiProxy_ClassThatImplementsThePrivateInterface)SetB(val *string) { - _jsii_.Set( - j, - "b", - val, +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Void() { + _jsii_.InvokeVoid( + i, + "void", + nil, // no parameters ) } -func (j *jsiiProxy_ClassThatImplementsThePrivateInterface)SetC(val *string) { - _jsii_.Set( - j, - "c", - val, +func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Volatile() { + _jsii_.InvokeVoid( + i, + "volatile", + nil, // no parameters ) } -func (j *jsiiProxy_ClassThatImplementsThePrivateInterface)SetE(val *string) { - _jsii_.Set( +func (j *jsiiProxy_IJavaReservedWordsInAnInterface) While() *string { + var returns *string + _jsii_.Get( j, - "e", - val, + "while", + &returns, ) + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithCollectionOfUnions.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/IJsii487External.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) -type ClassWithCollectionOfUnions interface { - UnionProperty() *[]*map[string]interface{} - SetUnionProperty(val *[]*map[string]interface{}) +type IJsii487External interface { } -// The jsii proxy struct for ClassWithCollectionOfUnions -type jsiiProxy_ClassWithCollectionOfUnions struct { +// The jsii proxy for IJsii487External +type jsiiProxy_IJsii487External struct { _ byte // padding } -func (j *jsiiProxy_ClassWithCollectionOfUnions) UnionProperty() *[]*map[string]interface{} { - var returns *[]*map[string]interface{} - _jsii_.Get( - j, - "unionProperty", - &returns, - ) - return returns -} +`; -func NewClassWithCollectionOfUnions(unionProperty *[]*map[string]interface{}) ClassWithCollectionOfUnions { - _init_.Initialize() +exports[`Generated code for "jsii-calc": /go/jsiicalc/IJsii487External2.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc - j := jsiiProxy_ClassWithCollectionOfUnions{} - _jsii_.Create( - "jsii-calc.ClassWithCollectionOfUnions", - []interface{}{unionProperty}, - &j, - ) +type IJsii487External2 interface { +} - return &j +// The jsii proxy for IJsii487External2 +type jsiiProxy_IJsii487External2 struct { + _ byte // padding } -func NewClassWithCollectionOfUnions_Override(c ClassWithCollectionOfUnions, unionProperty *[]*map[string]interface{}) { - _init_.Initialize() - _jsii_.Create( - "jsii-calc.ClassWithCollectionOfUnions", - []interface{}{unionProperty}, - c, - ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/IJsii496.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + + +type IJsii496 interface { } -func (j *jsiiProxy_ClassWithCollectionOfUnions)SetUnionProperty(val *[]*map[string]interface{}) { - _jsii_.Set( - j, - "unionProperty", - val, - ) +// The jsii proxy for IJsii496 +type jsiiProxy_IJsii496 struct { + _ byte // padding } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithCollections.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/IMutableObjectLiteral.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type ClassWithCollections interface { - Array() *[]*string - SetArray(val *[]*string) - Map() *map[string]*string - SetMap(val *map[string]*string) +type IMutableObjectLiteral interface { + Value() *string + SetValue(v *string) } -// The jsii proxy struct for ClassWithCollections -type jsiiProxy_ClassWithCollections struct { +// The jsii proxy for IMutableObjectLiteral +type jsiiProxy_IMutableObjectLiteral struct { _ byte // padding } -func (j *jsiiProxy_ClassWithCollections) Array() *[]*string { - var returns *[]*string +func (j *jsiiProxy_IMutableObjectLiteral) Value() *string { + var returns *string _jsii_.Get( j, - "array", + "value", &returns, ) return returns } -func (j *jsiiProxy_ClassWithCollections) Map() *map[string]*string { - var returns *map[string]*string - _jsii_.Get( +func (j *jsiiProxy_IMutableObjectLiteral)SetValue(val *string) { + _jsii_.Set( j, - "map", - &returns, + "value", + val, ) - return returns } -func NewClassWithCollections(map_ *map[string]*string, array *[]*string) ClassWithCollections { - _init_.Initialize() +`; - j := jsiiProxy_ClassWithCollections{} +exports[`Generated code for "jsii-calc": /go/jsiicalc/INonInternalInterface.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc - _jsii_.Create( - "jsii-calc.ClassWithCollections", - []interface{}{map_, array}, - &j, - ) +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) - return &j +type INonInternalInterface interface { + IAnotherPublicInterface + B() *string + SetB(b *string) + C() *string + SetC(c *string) } -func NewClassWithCollections_Override(c ClassWithCollections, map_ *map[string]*string, array *[]*string) { - _init_.Initialize() +// The jsii proxy for INonInternalInterface +type jsiiProxy_INonInternalInterface struct { + jsiiProxy_IAnotherPublicInterface +} - _jsii_.Create( - "jsii-calc.ClassWithCollections", - []interface{}{map_, array}, - c, +func (j *jsiiProxy_INonInternalInterface) B() *string { + var returns *string + _jsii_.Get( + j, + "b", + &returns, ) + return returns } -func (j *jsiiProxy_ClassWithCollections)SetArray(val *[]*string) { +func (j *jsiiProxy_INonInternalInterface)SetB(val *string) { _jsii_.Set( j, - "array", + "b", val, ) } -func (j *jsiiProxy_ClassWithCollections)SetMap(val *map[string]*string) { +func (j *jsiiProxy_INonInternalInterface) C() *string { + var returns *string + _jsii_.Get( + j, + "c", + &returns, + ) + return returns +} + +func (j *jsiiProxy_INonInternalInterface)SetC(val *string) { _jsii_.Set( j, - "map", + "c", val, ) } -func ClassWithCollections_CreateAList() *[]*string { - _init_.Initialize() - var returns *[]*string +`; - _jsii_.StaticInvoke( - "jsii-calc.ClassWithCollections", - "createAList", - nil, // no parameters - &returns, - ) +exports[`Generated code for "jsii-calc": /go/jsiicalc/IObjectWithProperty.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc - return returns +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +// Make sure that setters are properly called on objects with interfaces. +type IObjectWithProperty interface { + WasSet() *bool + Property() *string + SetProperty(p *string) } -func ClassWithCollections_CreateAMap() *map[string]*string { - _init_.Initialize() +// The jsii proxy for IObjectWithProperty +type jsiiProxy_IObjectWithProperty struct { + _ byte // padding +} - var returns *map[string]*string +func (i *jsiiProxy_IObjectWithProperty) WasSet() *bool { + var returns *bool - _jsii_.StaticInvoke( - "jsii-calc.ClassWithCollections", - "createAMap", + _jsii_.Invoke( + i, + "wasSet", nil, // no parameters &returns, ) @@ -9308,42 +9955,20 @@ func ClassWithCollections_CreateAMap() *map[string]*string { return returns } -func ClassWithCollections_StaticArray() *[]*string { - _init_.Initialize() - var returns *[]*string - _jsii_.StaticGet( - "jsii-calc.ClassWithCollections", - "staticArray", - &returns, - ) - return returns -} - -func ClassWithCollections_SetStaticArray(val *[]*string) { - _init_.Initialize() - _jsii_.StaticSet( - "jsii-calc.ClassWithCollections", - "staticArray", - val, - ) -} - -func ClassWithCollections_StaticMap() *map[string]*string { - _init_.Initialize() - var returns *map[string]*string - _jsii_.StaticGet( - "jsii-calc.ClassWithCollections", - "staticMap", +func (j *jsiiProxy_IObjectWithProperty) Property() *string { + var returns *string + _jsii_.Get( + j, + "property", &returns, ) return returns } -func ClassWithCollections_SetStaticMap(val *map[string]*string) { - _init_.Initialize() - _jsii_.StaticSet( - "jsii-calc.ClassWithCollections", - "staticMap", +func (j *jsiiProxy_IObjectWithProperty)SetProperty(val *string) { + _jsii_.Set( + j, + "property", val, ) } @@ -9351,210 +9976,164 @@ func ClassWithCollections_SetStaticMap(val *map[string]*string) { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithContainerTypes.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/IOptionalMethod.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type ClassWithContainerTypes interface { - Array() *[]*DummyObj - Obj() *map[string]*DummyObj - Props() *ContainerProps - Record() *map[string]*DummyObj +// Checks that optional result from interface method code generates correctly. +type IOptionalMethod interface { + Optional() *string } -// The jsii proxy struct for ClassWithContainerTypes -type jsiiProxy_ClassWithContainerTypes struct { +// The jsii proxy for IOptionalMethod +type jsiiProxy_IOptionalMethod struct { _ byte // padding } -func (j *jsiiProxy_ClassWithContainerTypes) Array() *[]*DummyObj { - var returns *[]*DummyObj - _jsii_.Get( - j, - "array", - &returns, - ) - return returns -} - -func (j *jsiiProxy_ClassWithContainerTypes) Obj() *map[string]*DummyObj { - var returns *map[string]*DummyObj - _jsii_.Get( - j, - "obj", - &returns, - ) - return returns -} +func (i *jsiiProxy_IOptionalMethod) Optional() *string { + var returns *string -func (j *jsiiProxy_ClassWithContainerTypes) Props() *ContainerProps { - var returns *ContainerProps - _jsii_.Get( - j, - "props", + _jsii_.Invoke( + i, + "optional", + nil, // no parameters &returns, ) - return returns -} -func (j *jsiiProxy_ClassWithContainerTypes) Record() *map[string]*DummyObj { - var returns *map[string]*DummyObj - _jsii_.Get( - j, - "record", - &returns, - ) return returns } -func NewClassWithContainerTypes(array *[]*DummyObj, record *map[string]*DummyObj, obj *map[string]*DummyObj, props *ContainerProps) ClassWithContainerTypes { - _init_.Initialize() +`; - j := jsiiProxy_ClassWithContainerTypes{} +exports[`Generated code for "jsii-calc": /go/jsiicalc/IPrivatelyImplemented.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc - _jsii_.Create( - "jsii-calc.ClassWithContainerTypes", - []interface{}{array, record, obj, props}, - &j, - ) +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) - return &j +type IPrivatelyImplemented interface { + Success() *bool } -func NewClassWithContainerTypes_Override(c ClassWithContainerTypes, array *[]*DummyObj, record *map[string]*DummyObj, obj *map[string]*DummyObj, props *ContainerProps) { - _init_.Initialize() +// The jsii proxy for IPrivatelyImplemented +type jsiiProxy_IPrivatelyImplemented struct { + _ byte // padding +} - _jsii_.Create( - "jsii-calc.ClassWithContainerTypes", - []interface{}{array, record, obj, props}, - c, +func (j *jsiiProxy_IPrivatelyImplemented) Success() *bool { + var returns *bool + _jsii_.Get( + j, + "success", + &returns, ) + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithDocs.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/IPublicInterface.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// This class has docs. -// -// The docs are great. They're a bunch of tags. -// -// Example: -// func anExample() { -// } -// -// See: https://aws.amazon.com/ -// -type ClassWithDocs interface { +type IPublicInterface interface { + Bye() *string } -// The jsii proxy struct for ClassWithDocs -type jsiiProxy_ClassWithDocs struct { +// The jsii proxy for IPublicInterface +type jsiiProxy_IPublicInterface struct { _ byte // padding } -func NewClassWithDocs() ClassWithDocs { - _init_.Initialize() - - j := jsiiProxy_ClassWithDocs{} +func (i *jsiiProxy_IPublicInterface) Bye() *string { + var returns *string - _jsii_.Create( - "jsii-calc.ClassWithDocs", + _jsii_.Invoke( + i, + "bye", nil, // no parameters - &j, + &returns, ) - return &j -} - -func NewClassWithDocs_Override(c ClassWithDocs) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.ClassWithDocs", - nil, // no parameters - c, - ) + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithJavaReservedWords.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/IPublicInterface2.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type ClassWithJavaReservedWords interface { - Int() *string - Import(assert *string) *string +type IPublicInterface2 interface { + Ciao() *string } -// The jsii proxy struct for ClassWithJavaReservedWords -type jsiiProxy_ClassWithJavaReservedWords struct { +// The jsii proxy for IPublicInterface2 +type jsiiProxy_IPublicInterface2 struct { _ byte // padding } -func (j *jsiiProxy_ClassWithJavaReservedWords) Int() *string { +func (i *jsiiProxy_IPublicInterface2) Ciao() *string { var returns *string - _jsii_.Get( - j, - "int", + + _jsii_.Invoke( + i, + "ciao", + nil, // no parameters &returns, ) + return returns } -func NewClassWithJavaReservedWords(int *string) ClassWithJavaReservedWords { - _init_.Initialize() +`; - j := jsiiProxy_ClassWithJavaReservedWords{} +exports[`Generated code for "jsii-calc": /go/jsiicalc/IRandomNumberGenerator.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc - _jsii_.Create( - "jsii-calc.ClassWithJavaReservedWords", - []interface{}{int}, - &j, - ) +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) - return &j +// Generates random numbers. +type IRandomNumberGenerator interface { + // Returns another random number. + // + // Returns: A random number. + Next() *float64 } -func NewClassWithJavaReservedWords_Override(c ClassWithJavaReservedWords, int *string) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.ClassWithJavaReservedWords", - []interface{}{int}, - c, - ) +// The jsii proxy for IRandomNumberGenerator +type jsiiProxy_IRandomNumberGenerator struct { + _ byte // padding } -func (c *jsiiProxy_ClassWithJavaReservedWords) Import(assert *string) *string { - var returns *string +func (i *jsiiProxy_IRandomNumberGenerator) Next() *float64 { + var returns *float64 _jsii_.Invoke( - c, - "import", - []interface{}{assert}, + i, + "next", + nil, // no parameters &returns, ) @@ -9564,129 +10143,124 @@ func (c *jsiiProxy_ClassWithJavaReservedWords) Import(assert *string) *string { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithMutableObjectLiteralProperty.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/IReturnJsii976.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type ClassWithMutableObjectLiteralProperty interface { - MutableObject() IMutableObjectLiteral - SetMutableObject(val IMutableObjectLiteral) +// Returns a subclass of a known class which implements an interface. +type IReturnJsii976 interface { + Foo() *float64 } -// The jsii proxy struct for ClassWithMutableObjectLiteralProperty -type jsiiProxy_ClassWithMutableObjectLiteralProperty struct { +// The jsii proxy for IReturnJsii976 +type jsiiProxy_IReturnJsii976 struct { _ byte // padding } -func (j *jsiiProxy_ClassWithMutableObjectLiteralProperty) MutableObject() IMutableObjectLiteral { - var returns IMutableObjectLiteral +func (j *jsiiProxy_IReturnJsii976) Foo() *float64 { + var returns *float64 _jsii_.Get( j, - "mutableObject", + "foo", &returns, ) return returns } -func NewClassWithMutableObjectLiteralProperty() ClassWithMutableObjectLiteralProperty { - _init_.Initialize() +`; - j := jsiiProxy_ClassWithMutableObjectLiteralProperty{} +exports[`Generated code for "jsii-calc": /go/jsiicalc/IReturnsNumber.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc - _jsii_.Create( - "jsii-calc.ClassWithMutableObjectLiteralProperty", - nil, // no parameters - &j, - ) +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" - return &j + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" +) + +type IReturnsNumber interface { + ObtainNumber() scopejsiicalclib.IDoublable + NumberProp() scopejsiicalclib.Number } -func NewClassWithMutableObjectLiteralProperty_Override(c ClassWithMutableObjectLiteralProperty) { - _init_.Initialize() +// The jsii proxy for IReturnsNumber +type jsiiProxy_IReturnsNumber struct { + _ byte // padding +} - _jsii_.Create( - "jsii-calc.ClassWithMutableObjectLiteralProperty", +func (i *jsiiProxy_IReturnsNumber) ObtainNumber() scopejsiicalclib.IDoublable { + var returns scopejsiicalclib.IDoublable + + _jsii_.Invoke( + i, + "obtainNumber", nil, // no parameters - c, + &returns, ) + + return returns } -func (j *jsiiProxy_ClassWithMutableObjectLiteralProperty)SetMutableObject(val IMutableObjectLiteral) { - _jsii_.Set( +func (j *jsiiProxy_IReturnsNumber) NumberProp() scopejsiicalclib.Number { + var returns scopejsiicalclib.Number + _jsii_.Get( j, - "mutableObject", - val, + "numberProp", + &returns, ) + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithNestedUnion.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/IStableInterface.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type ClassWithNestedUnion interface { - UnionProperty() *[]interface{} - SetUnionProperty(val *[]interface{}) +type IStableInterface interface { + Method() + MutableProperty() *float64 + SetMutableProperty(m *float64) } -// The jsii proxy struct for ClassWithNestedUnion -type jsiiProxy_ClassWithNestedUnion struct { +// The jsii proxy for IStableInterface +type jsiiProxy_IStableInterface struct { _ byte // padding } -func (j *jsiiProxy_ClassWithNestedUnion) UnionProperty() *[]interface{} { - var returns *[]interface{} +func (i *jsiiProxy_IStableInterface) Method() { + _jsii_.InvokeVoid( + i, + "method", + nil, // no parameters + ) +} + +func (j *jsiiProxy_IStableInterface) MutableProperty() *float64 { + var returns *float64 _jsii_.Get( j, - "unionProperty", + "mutableProperty", &returns, ) return returns } - -func NewClassWithNestedUnion(unionProperty *[]interface{}) ClassWithNestedUnion { - _init_.Initialize() - - j := jsiiProxy_ClassWithNestedUnion{} - - _jsii_.Create( - "jsii-calc.ClassWithNestedUnion", - []interface{}{unionProperty}, - &j, - ) - - return &j -} - -func NewClassWithNestedUnion_Override(c ClassWithNestedUnion, unionProperty *[]interface{}) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.ClassWithNestedUnion", - []interface{}{unionProperty}, - c, - ) -} - -func (j *jsiiProxy_ClassWithNestedUnion)SetUnionProperty(val *[]interface{}) { +func (j *jsiiProxy_IStableInterface)SetMutableProperty(val *float64) { _jsii_.Set( j, - "unionProperty", + "mutableProperty", val, ) } @@ -9694,66 +10268,66 @@ func (j *jsiiProxy_ClassWithNestedUnion)SetUnionProperty(val *[]interface{}) { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ClassWithPrivateConstructorAndAutomaticProperties.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/IStructReturningDelegate.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// Class that implements interface properties automatically, but using a private constructor. -type ClassWithPrivateConstructorAndAutomaticProperties interface { - IInterfaceWithProperties - ReadOnlyString() *string - ReadWriteString() *string - SetReadWriteString(val *string) +// Verifies that a "pure" implementation of an interface works correctly. +type IStructReturningDelegate interface { + ReturnStruct() *StructB } -// The jsii proxy struct for ClassWithPrivateConstructorAndAutomaticProperties -type jsiiProxy_ClassWithPrivateConstructorAndAutomaticProperties struct { - jsiiProxy_IInterfaceWithProperties +// The jsii proxy for IStructReturningDelegate +type jsiiProxy_IStructReturningDelegate struct { + _ byte // padding } -func (j *jsiiProxy_ClassWithPrivateConstructorAndAutomaticProperties) ReadOnlyString() *string { - var returns *string - _jsii_.Get( - j, - "readOnlyString", - &returns, - ) - return returns -} +func (i *jsiiProxy_IStructReturningDelegate) ReturnStruct() *StructB { + var returns *StructB -func (j *jsiiProxy_ClassWithPrivateConstructorAndAutomaticProperties) ReadWriteString() *string { - var returns *string - _jsii_.Get( - j, - "readWriteString", + _jsii_.Invoke( + i, + "returnStruct", + nil, // no parameters &returns, ) + return returns } -func (j *jsiiProxy_ClassWithPrivateConstructorAndAutomaticProperties)SetReadWriteString(val *string) { - _jsii_.Set( - j, - "readWriteString", - val, - ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/IWallClock.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +// Implement this interface. +type IWallClock interface { + // Returns the current time, formatted as an ISO-8601 string. + Iso8601Now() *string } -func ClassWithPrivateConstructorAndAutomaticProperties_Create(readOnlyString *string, readWriteString *string) ClassWithPrivateConstructorAndAutomaticProperties { - _init_.Initialize() +// The jsii proxy for IWallClock +type jsiiProxy_IWallClock struct { + _ byte // padding +} - var returns ClassWithPrivateConstructorAndAutomaticProperties +func (i *jsiiProxy_IWallClock) Iso8601Now() *string { + var returns *string - _jsii_.StaticInvoke( - "jsii-calc.ClassWithPrivateConstructorAndAutomaticProperties", - "create", - []interface{}{readOnlyString, readWriteString}, + _jsii_.Invoke( + i, + "iso8601Now", + nil, // no parameters &returns, ) @@ -9763,7 +10337,7 @@ func ClassWithPrivateConstructorAndAutomaticProperties_Create(readOnlyString *st `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ConfusingToJackson.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/ImplementInternalInterface.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -9772,84 +10346,63 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// This tries to confuse Jackson by having overloaded property setters. -// See: https://github.com/aws/aws-cdk/issues/4080 -// -type ConfusingToJackson interface { - UnionProperty() interface{} - SetUnionProperty(val interface{}) +type ImplementInternalInterface interface { + Prop() *string + SetProp(val *string) } -// The jsii proxy struct for ConfusingToJackson -type jsiiProxy_ConfusingToJackson struct { +// The jsii proxy struct for ImplementInternalInterface +type jsiiProxy_ImplementInternalInterface struct { _ byte // padding } -func (j *jsiiProxy_ConfusingToJackson) UnionProperty() interface{} { - var returns interface{} +func (j *jsiiProxy_ImplementInternalInterface) Prop() *string { + var returns *string _jsii_.Get( j, - "unionProperty", + "prop", &returns, ) return returns } -func (j *jsiiProxy_ConfusingToJackson)SetUnionProperty(val interface{}) { - _jsii_.Set( - j, - "unionProperty", - val, - ) -} - -func ConfusingToJackson_MakeInstance() ConfusingToJackson { +func NewImplementInternalInterface() ImplementInternalInterface { _init_.Initialize() - var returns ConfusingToJackson + j := jsiiProxy_ImplementInternalInterface{} - _jsii_.StaticInvoke( - "jsii-calc.ConfusingToJackson", - "makeInstance", + _jsii_.Create( + "jsii-calc.ImplementInternalInterface", nil, // no parameters - &returns, + &j, ) - return returns + return &j } -func ConfusingToJackson_MakeStructInstance() *ConfusingToJacksonStruct { +func NewImplementInternalInterface_Override(i ImplementInternalInterface) { _init_.Initialize() - var returns *ConfusingToJacksonStruct - - _jsii_.StaticInvoke( - "jsii-calc.ConfusingToJackson", - "makeStructInstance", + _jsii_.Create( + "jsii-calc.ImplementInternalInterface", nil, // no parameters - &returns, + i, ) - - return returns } - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ConfusingToJacksonStruct.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -type ConfusingToJacksonStruct struct { - UnionProperty interface{} \`field:"optional" json:"unionProperty" yaml:"unionProperty"\` +func (j *jsiiProxy_ImplementInternalInterface)SetProp(val *string) { + _jsii_.Set( + j, + "prop", + val, + ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ConstructorPassesThisOut.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/Implementation.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -9858,42 +10411,54 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type ConstructorPassesThisOut interface { +type Implementation interface { + Value() *float64 } -// The jsii proxy struct for ConstructorPassesThisOut -type jsiiProxy_ConstructorPassesThisOut struct { +// The jsii proxy struct for Implementation +type jsiiProxy_Implementation struct { _ byte // padding } -func NewConstructorPassesThisOut(consumer PartiallyInitializedThisConsumer) ConstructorPassesThisOut { +func (j *jsiiProxy_Implementation) Value() *float64 { + var returns *float64 + _jsii_.Get( + j, + "value", + &returns, + ) + return returns +} + + +func NewImplementation() Implementation { _init_.Initialize() - j := jsiiProxy_ConstructorPassesThisOut{} + j := jsiiProxy_Implementation{} _jsii_.Create( - "jsii-calc.ConstructorPassesThisOut", - []interface{}{consumer}, + "jsii-calc.Implementation", + nil, // no parameters &j, ) return &j } -func NewConstructorPassesThisOut_Override(c ConstructorPassesThisOut, consumer PartiallyInitializedThisConsumer) { +func NewImplementation_Override(i Implementation) { _init_.Initialize() _jsii_.Create( - "jsii-calc.ConstructorPassesThisOut", - []interface{}{consumer}, - c, + "jsii-calc.Implementation", + nil, // no parameters + i, ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Constructors.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/ImplementsInterfaceWithInternal.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -9902,21 +10467,23 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type Constructors interface { +type ImplementsInterfaceWithInternal interface { + IInterfaceWithInternal + Visible() } -// The jsii proxy struct for Constructors -type jsiiProxy_Constructors struct { - _ byte // padding +// The jsii proxy struct for ImplementsInterfaceWithInternal +type jsiiProxy_ImplementsInterfaceWithInternal struct { + jsiiProxy_IInterfaceWithInternal } -func NewConstructors() Constructors { +func NewImplementsInterfaceWithInternal() ImplementsInterfaceWithInternal { _init_.Initialize() - j := jsiiProxy_Constructors{} + j := jsiiProxy_ImplementsInterfaceWithInternal{} _jsii_.Create( - "jsii-calc.Constructors", + "jsii-calc.ImplementsInterfaceWithInternal", nil, // no parameters &j, ) @@ -9924,125 +10491,166 @@ func NewConstructors() Constructors { return &j } -func NewConstructors_Override(c Constructors) { +func NewImplementsInterfaceWithInternal_Override(i ImplementsInterfaceWithInternal) { _init_.Initialize() _jsii_.Create( - "jsii-calc.Constructors", + "jsii-calc.ImplementsInterfaceWithInternal", nil, // no parameters - c, + i, ) } -func Constructors_HiddenInterface() IPublicInterface { - _init_.Initialize() - - var returns IPublicInterface - - _jsii_.StaticInvoke( - "jsii-calc.Constructors", - "hiddenInterface", +func (i *jsiiProxy_ImplementsInterfaceWithInternal) Visible() { + _jsii_.InvokeVoid( + i, + "visible", nil, // no parameters - &returns, ) +} - return returns + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ImplementsInterfaceWithInternalSubclass.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +type ImplementsInterfaceWithInternalSubclass interface { + ImplementsInterfaceWithInternal + Visible() } -func Constructors_HiddenInterfaces() *[]IPublicInterface { +// The jsii proxy struct for ImplementsInterfaceWithInternalSubclass +type jsiiProxy_ImplementsInterfaceWithInternalSubclass struct { + jsiiProxy_ImplementsInterfaceWithInternal +} + +func NewImplementsInterfaceWithInternalSubclass() ImplementsInterfaceWithInternalSubclass { _init_.Initialize() - var returns *[]IPublicInterface + j := jsiiProxy_ImplementsInterfaceWithInternalSubclass{} - _jsii_.StaticInvoke( - "jsii-calc.Constructors", - "hiddenInterfaces", + _jsii_.Create( + "jsii-calc.ImplementsInterfaceWithInternalSubclass", nil, // no parameters - &returns, + &j, ) - return returns + return &j } -func Constructors_HiddenSubInterfaces() *[]IPublicInterface { +func NewImplementsInterfaceWithInternalSubclass_Override(i ImplementsInterfaceWithInternalSubclass) { _init_.Initialize() - var returns *[]IPublicInterface - - _jsii_.StaticInvoke( - "jsii-calc.Constructors", - "hiddenSubInterfaces", + _jsii_.Create( + "jsii-calc.ImplementsInterfaceWithInternalSubclass", nil, // no parameters - &returns, + i, ) +} - return returns +func (i *jsiiProxy_ImplementsInterfaceWithInternalSubclass) Visible() { + _jsii_.InvokeVoid( + i, + "visible", + nil, // no parameters + ) } -func Constructors_MakeClass() PublicClass { - _init_.Initialize() - var returns PublicClass +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ImplementsPrivateInterface.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +type ImplementsPrivateInterface interface { + Private() *string + SetPrivate(val *string) +} + +// The jsii proxy struct for ImplementsPrivateInterface +type jsiiProxy_ImplementsPrivateInterface struct { + _ byte // padding +} - _jsii_.StaticInvoke( - "jsii-calc.Constructors", - "makeClass", - nil, // no parameters +func (j *jsiiProxy_ImplementsPrivateInterface) Private() *string { + var returns *string + _jsii_.Get( + j, + "private", &returns, ) - return returns } -func Constructors_MakeInterface() IPublicInterface { + +func NewImplementsPrivateInterface() ImplementsPrivateInterface { _init_.Initialize() - var returns IPublicInterface + j := jsiiProxy_ImplementsPrivateInterface{} - _jsii_.StaticInvoke( - "jsii-calc.Constructors", - "makeInterface", + _jsii_.Create( + "jsii-calc.ImplementsPrivateInterface", nil, // no parameters - &returns, + &j, ) - return returns + return &j } -func Constructors_MakeInterface2() IPublicInterface2 { +func NewImplementsPrivateInterface_Override(i ImplementsPrivateInterface) { _init_.Initialize() - var returns IPublicInterface2 - - _jsii_.StaticInvoke( - "jsii-calc.Constructors", - "makeInterface2", + _jsii_.Create( + "jsii-calc.ImplementsPrivateInterface", nil, // no parameters - &returns, + i, ) +} - return returns +func (j *jsiiProxy_ImplementsPrivateInterface)SetPrivate(val *string) { + _jsii_.Set( + j, + "private", + val, + ) } -func Constructors_MakeInterfaces() *[]IPublicInterface { - _init_.Initialize() - var returns *[]IPublicInterface +`; - _jsii_.StaticInvoke( - "jsii-calc.Constructors", - "makeInterfaces", - nil, // no parameters - &returns, - ) +exports[`Generated code for "jsii-calc": /go/jsiicalc/ImplictBaseOfBase.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc - return returns +import ( + "time" + + "github.com/aws/jsii/jsii-calc/go/scopejsiicalcbaseofbase/v2" +) + +type ImplictBaseOfBase struct { + Foo scopejsiicalcbaseofbase.Very \`field:"required" json:"foo" yaml:"foo"\` + Bar *string \`field:"required" json:"bar" yaml:"bar"\` + Goo *time.Time \`field:"required" json:"goo" yaml:"goo"\` } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ConsumePureInterface.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/InbetweenClass.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -10051,45 +10659,49 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type ConsumePureInterface interface { - WorkItBaby() *StructB +type InbetweenClass interface { + PublicClass + IPublicInterface2 + Ciao() *string + Hello() } -// The jsii proxy struct for ConsumePureInterface -type jsiiProxy_ConsumePureInterface struct { - _ byte // padding +// The jsii proxy struct for InbetweenClass +type jsiiProxy_InbetweenClass struct { + jsiiProxy_PublicClass + jsiiProxy_IPublicInterface2 } -func NewConsumePureInterface(delegate IStructReturningDelegate) ConsumePureInterface { +func NewInbetweenClass() InbetweenClass { _init_.Initialize() - j := jsiiProxy_ConsumePureInterface{} + j := jsiiProxy_InbetweenClass{} _jsii_.Create( - "jsii-calc.ConsumePureInterface", - []interface{}{delegate}, + "jsii-calc.InbetweenClass", + nil, // no parameters &j, ) return &j } -func NewConsumePureInterface_Override(c ConsumePureInterface, delegate IStructReturningDelegate) { +func NewInbetweenClass_Override(i InbetweenClass) { _init_.Initialize() _jsii_.Create( - "jsii-calc.ConsumePureInterface", - []interface{}{delegate}, - c, + "jsii-calc.InbetweenClass", + nil, // no parameters + i, ) } -func (c *jsiiProxy_ConsumePureInterface) WorkItBaby() *StructB { - var returns *StructB +func (i *jsiiProxy_InbetweenClass) Ciao() *string { + var returns *string _jsii_.Invoke( - c, - "workItBaby", + i, + "ciao", nil, // no parameters &returns, ) @@ -10097,10 +10709,18 @@ func (c *jsiiProxy_ConsumePureInterface) WorkItBaby() *StructB { return returns } +func (i *jsiiProxy_InbetweenClass) Hello() { + _jsii_.InvokeVoid( + i, + "hello", + nil, // no parameters + ) +} + `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ConsumerCanRingBell.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/InterfaceCollections.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -10109,176 +10729,157 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// Test calling back to consumers that implement interfaces. +// Verifies that collections of interfaces or structs are correctly handled. // -// Check that if a JSII consumer implements IConsumerWithInterfaceParam, they can call -// the method on the argument that they're passed... -type ConsumerCanRingBell interface { - // ...if the interface is implemented using an object literal. - // - // Returns whether the bell was rung. - ImplementedByObjectLiteral(ringer IBellRinger) *bool - // ...if the interface is implemented using a private class. - // - // Return whether the bell was rung. - ImplementedByPrivateClass(ringer IBellRinger) *bool - // ...if the interface is implemented using a public class. - // - // Return whether the bell was rung. - ImplementedByPublicClass(ringer IBellRinger) *bool - // If the parameter is a concrete class instead of an interface. - // - // Return whether the bell was rung. - WhenTypedAsClass(ringer IConcreteBellRinger) *bool +// See: https://github.com/aws/jsii/issues/1196 +type InterfaceCollections interface { } -// The jsii proxy struct for ConsumerCanRingBell -type jsiiProxy_ConsumerCanRingBell struct { +// The jsii proxy struct for InterfaceCollections +type jsiiProxy_InterfaceCollections struct { _ byte // padding } -func NewConsumerCanRingBell() ConsumerCanRingBell { +func InterfaceCollections_ListOfInterfaces() *[]IBell { _init_.Initialize() - j := jsiiProxy_ConsumerCanRingBell{} + var returns *[]IBell - _jsii_.Create( - "jsii-calc.ConsumerCanRingBell", + _jsii_.StaticInvoke( + "jsii-calc.InterfaceCollections", + "listOfInterfaces", nil, // no parameters - &j, + &returns, ) - return &j + return returns } -func NewConsumerCanRingBell_Override(c ConsumerCanRingBell) { +func InterfaceCollections_ListOfStructs() *[]*StructA { _init_.Initialize() - _jsii_.Create( - "jsii-calc.ConsumerCanRingBell", + var returns *[]*StructA + + _jsii_.StaticInvoke( + "jsii-calc.InterfaceCollections", + "listOfStructs", nil, // no parameters - c, + &returns, ) + + return returns } -// ...if the interface is implemented using an object literal. -// -// Returns whether the bell was rung. -func ConsumerCanRingBell_StaticImplementedByObjectLiteral(ringer IBellRinger) *bool { +func InterfaceCollections_MapOfInterfaces() *map[string]IBell { _init_.Initialize() - var returns *bool + var returns *map[string]IBell _jsii_.StaticInvoke( - "jsii-calc.ConsumerCanRingBell", - "staticImplementedByObjectLiteral", - []interface{}{ringer}, + "jsii-calc.InterfaceCollections", + "mapOfInterfaces", + nil, // no parameters &returns, ) return returns } -// ...if the interface is implemented using a private class. -// -// Return whether the bell was rung. -func ConsumerCanRingBell_StaticImplementedByPrivateClass(ringer IBellRinger) *bool { +func InterfaceCollections_MapOfStructs() *map[string]*StructA { _init_.Initialize() - var returns *bool + var returns *map[string]*StructA _jsii_.StaticInvoke( - "jsii-calc.ConsumerCanRingBell", - "staticImplementedByPrivateClass", - []interface{}{ringer}, + "jsii-calc.InterfaceCollections", + "mapOfStructs", + nil, // no parameters &returns, ) return returns } -// ...if the interface is implemented using a public class. -// -// Return whether the bell was rung. -func ConsumerCanRingBell_StaticImplementedByPublicClass(ringer IBellRinger) *bool { - _init_.Initialize() - var returns *bool +`; - _jsii_.StaticInvoke( - "jsii-calc.ConsumerCanRingBell", - "staticImplementedByPublicClass", - []interface{}{ringer}, - &returns, - ) +exports[`Generated code for "jsii-calc": /go/jsiicalc/InterfacesMaker.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc - return returns +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" + + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" +) + +// We can return arrays of interfaces See aws/aws-cdk#2362. +type InterfacesMaker interface { } -// If the parameter is a concrete class instead of an interface. -// -// Return whether the bell was rung. -func ConsumerCanRingBell_StaticWhenTypedAsClass(ringer IConcreteBellRinger) *bool { +// The jsii proxy struct for InterfacesMaker +type jsiiProxy_InterfacesMaker struct { + _ byte // padding +} + +func InterfacesMaker_MakeInterfaces(count *float64) *[]scopejsiicalclib.IDoublable { _init_.Initialize() - var returns *bool + var returns *[]scopejsiicalclib.IDoublable _jsii_.StaticInvoke( - "jsii-calc.ConsumerCanRingBell", - "staticWhenTypedAsClass", - []interface{}{ringer}, + "jsii-calc.InterfacesMaker", + "makeInterfaces", + []interface{}{count}, &returns, ) return returns } -func (c *jsiiProxy_ConsumerCanRingBell) ImplementedByObjectLiteral(ringer IBellRinger) *bool { - var returns *bool - _jsii_.Invoke( - c, - "implementedByObjectLiteral", - []interface{}{ringer}, - &returns, - ) +`; - return returns -} +exports[`Generated code for "jsii-calc": /go/jsiicalc/Isomorphism.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc -func (c *jsiiProxy_ConsumerCanRingBell) ImplementedByPrivateClass(ringer IBellRinger) *bool { - var returns *bool +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) - _jsii_.Invoke( - c, - "implementedByPrivateClass", - []interface{}{ringer}, - &returns, - ) +// Checks the "same instance" isomorphism is preserved within the constructor. +// +// Create a subclass of this, and assert that \`this.myself()\` actually returns +// \`this\` from within the constructor. +type Isomorphism interface { + Myself() Isomorphism +} - return returns +// The jsii proxy struct for Isomorphism +type jsiiProxy_Isomorphism struct { + _ byte // padding } -func (c *jsiiProxy_ConsumerCanRingBell) ImplementedByPublicClass(ringer IBellRinger) *bool { - var returns *bool +func NewIsomorphism_Override(i Isomorphism) { + _init_.Initialize() - _jsii_.Invoke( - c, - "implementedByPublicClass", - []interface{}{ringer}, - &returns, + _jsii_.Create( + "jsii-calc.Isomorphism", + nil, // no parameters + i, ) - - return returns } -func (c *jsiiProxy_ConsumerCanRingBell) WhenTypedAsClass(ringer IConcreteBellRinger) *bool { - var returns *bool +func (i *jsiiProxy_Isomorphism) Myself() Isomorphism { + var returns Isomorphism _jsii_.Invoke( - c, - "whenTypedAsClass", - []interface{}{ringer}, + i, + "myself", + nil, // no parameters &returns, ) @@ -10288,7 +10889,7 @@ func (c *jsiiProxy_ConsumerCanRingBell) WhenTypedAsClass(ringer IConcreteBellRin `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ConsumersOfThisCrazyTypeSystem.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/Issue2638.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -10297,23 +10898,27 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type ConsumersOfThisCrazyTypeSystem interface { - ConsumeAnotherPublicInterface(obj IAnotherPublicInterface) *string - ConsumeNonInternalInterface(obj INonInternalInterface) interface{} +// Docstrings with period. +// See: https://github.com/aws/jsii/issues/2638 +// +type Issue2638 interface { } -// The jsii proxy struct for ConsumersOfThisCrazyTypeSystem -type jsiiProxy_ConsumersOfThisCrazyTypeSystem struct { +// The jsii proxy struct for Issue2638 +type jsiiProxy_Issue2638 struct { _ byte // padding } -func NewConsumersOfThisCrazyTypeSystem() ConsumersOfThisCrazyTypeSystem { +// First sentence. +// +// Second sentence. Third sentence. +func NewIssue2638() Issue2638 { _init_.Initialize() - j := jsiiProxy_ConsumersOfThisCrazyTypeSystem{} + j := jsiiProxy_Issue2638{} _jsii_.Create( - "jsii-calc.ConsumersOfThisCrazyTypeSystem", + "jsii-calc.Issue2638", nil, // no parameters &j, ) @@ -10321,149 +10926,177 @@ func NewConsumersOfThisCrazyTypeSystem() ConsumersOfThisCrazyTypeSystem { return &j } -func NewConsumersOfThisCrazyTypeSystem_Override(c ConsumersOfThisCrazyTypeSystem) { +// First sentence. +// +// Second sentence. Third sentence. +func NewIssue2638_Override(i Issue2638) { _init_.Initialize() _jsii_.Create( - "jsii-calc.ConsumersOfThisCrazyTypeSystem", + "jsii-calc.Issue2638", nil, // no parameters - c, + i, ) } -func (c *jsiiProxy_ConsumersOfThisCrazyTypeSystem) ConsumeAnotherPublicInterface(obj IAnotherPublicInterface) *string { - var returns *string - _jsii_.Invoke( - c, - "consumeAnotherPublicInterface", - []interface{}{obj}, - &returns, - ) +`; - return returns -} +exports[`Generated code for "jsii-calc": /go/jsiicalc/Issue2638B.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc -func (c *jsiiProxy_ConsumersOfThisCrazyTypeSystem) ConsumeNonInternalInterface(obj INonInternalInterface) interface{} { - var returns interface{} +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) - _jsii_.Invoke( - c, - "consumeNonInternalInterface", - []interface{}{obj}, - &returns, - ) +type Issue2638B interface { +} - return returns +// The jsii proxy struct for Issue2638B +type jsiiProxy_Issue2638B struct { + _ byte // padding } +func NewIssue2638B() Issue2638B { + _init_.Initialize() -`; + j := jsiiProxy_Issue2638B{} -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ContainerProps.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc + _jsii_.Create( + "jsii-calc.Issue2638B", + nil, // no parameters + &j, + ) + return &j +} -type ContainerProps struct { - ArrayProp *[]*DummyObj \`field:"required" json:"arrayProp" yaml:"arrayProp"\` - ObjProp *map[string]*DummyObj \`field:"required" json:"objProp" yaml:"objProp"\` - RecordProp *map[string]*DummyObj \`field:"required" json:"recordProp" yaml:"recordProp"\` +func NewIssue2638B_Override(i Issue2638B) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.Issue2638B", + nil, // no parameters + i, + ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DataRenderer.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/JSII417Derived.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" - - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ) -// Verifies proper type handling through dynamic overrides. -type DataRenderer interface { - Render(data *scopejsiicalclib.MyFirstStruct) *string - RenderArbitrary(data *map[string]interface{}) *string - RenderMap(map_ *map[string]interface{}) *string +type JSII417Derived interface { + JSII417PublicBaseOfBase + HasRoot() *bool + Property() *string + Bar() + Baz() + Foo() } -// The jsii proxy struct for DataRenderer -type jsiiProxy_DataRenderer struct { - _ byte // padding +// The jsii proxy struct for JSII417Derived +type jsiiProxy_JSII417Derived struct { + jsiiProxy_JSII417PublicBaseOfBase } -func NewDataRenderer() DataRenderer { +func (j *jsiiProxy_JSII417Derived) HasRoot() *bool { + var returns *bool + _jsii_.Get( + j, + "hasRoot", + &returns, + ) + return returns +} + +func (j *jsiiProxy_JSII417Derived) Property() *string { + var returns *string + _jsii_.Get( + j, + "property", + &returns, + ) + return returns +} + + +func NewJSII417Derived(property *string) JSII417Derived { _init_.Initialize() - j := jsiiProxy_DataRenderer{} + j := jsiiProxy_JSII417Derived{} _jsii_.Create( - "jsii-calc.DataRenderer", - nil, // no parameters + "jsii-calc.JSII417Derived", + []interface{}{property}, &j, ) return &j } -func NewDataRenderer_Override(d DataRenderer) { +func NewJSII417Derived_Override(j JSII417Derived, property *string) { _init_.Initialize() _jsii_.Create( - "jsii-calc.DataRenderer", - nil, // no parameters - d, + "jsii-calc.JSII417Derived", + []interface{}{property}, + j, ) } -func (d *jsiiProxy_DataRenderer) Render(data *scopejsiicalclib.MyFirstStruct) *string { - var returns *string +func JSII417Derived_MakeInstance() JSII417PublicBaseOfBase { + _init_.Initialize() - _jsii_.Invoke( - d, - "render", - []interface{}{data}, + var returns JSII417PublicBaseOfBase + + _jsii_.StaticInvoke( + "jsii-calc.JSII417Derived", + "makeInstance", + nil, // no parameters &returns, ) return returns } -func (d *jsiiProxy_DataRenderer) RenderArbitrary(data *map[string]interface{}) *string { - var returns *string - - _jsii_.Invoke( - d, - "renderArbitrary", - []interface{}{data}, - &returns, +func (j *jsiiProxy_JSII417Derived) Bar() { + _jsii_.InvokeVoid( + j, + "bar", + nil, // no parameters ) - - return returns } -func (d *jsiiProxy_DataRenderer) RenderMap(map_ *map[string]interface{}) *string { - var returns *string - - _jsii_.Invoke( - d, - "renderMap", - []interface{}{map_}, - &returns, +func (j *jsiiProxy_JSII417Derived) Baz() { + _jsii_.InvokeVoid( + j, + "baz", + nil, // no parameters ) +} - return returns +func (j *jsiiProxy_JSII417Derived) Foo() { + _jsii_.InvokeVoid( + j, + "foo", + nil, // no parameters + ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Default.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/JSII417PublicBaseOfBase.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -10472,25 +11105,34 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// A class named "Default". -// See: https://github.com/aws/jsii/issues/2637 -// -type Default interface { - PleaseCompile() +type JSII417PublicBaseOfBase interface { + HasRoot() *bool + Foo() +} + +// The jsii proxy struct for JSII417PublicBaseOfBase +type jsiiProxy_JSII417PublicBaseOfBase struct { + _ byte // padding +} + +func (j *jsiiProxy_JSII417PublicBaseOfBase) HasRoot() *bool { + var returns *bool + _jsii_.Get( + j, + "hasRoot", + &returns, + ) + return returns } -// The jsii proxy struct for Default -type jsiiProxy_Default struct { - _ byte // padding -} -func NewDefault() Default { +func NewJSII417PublicBaseOfBase() JSII417PublicBaseOfBase { _init_.Initialize() - j := jsiiProxy_Default{} + j := jsiiProxy_JSII417PublicBaseOfBase{} _jsii_.Create( - "jsii-calc.Default", + "jsii-calc.JSII417PublicBaseOfBase", nil, // no parameters &j, ) @@ -10498,20 +11140,35 @@ func NewDefault() Default { return &j } -func NewDefault_Override(d Default) { +func NewJSII417PublicBaseOfBase_Override(j JSII417PublicBaseOfBase) { _init_.Initialize() _jsii_.Create( - "jsii-calc.Default", + "jsii-calc.JSII417PublicBaseOfBase", nil, // no parameters - d, + j, ) } -func (d *jsiiProxy_Default) PleaseCompile() { +func JSII417PublicBaseOfBase_MakeInstance() JSII417PublicBaseOfBase { + _init_.Initialize() + + var returns JSII417PublicBaseOfBase + + _jsii_.StaticInvoke( + "jsii-calc.JSII417PublicBaseOfBase", + "makeInstance", + nil, // no parameters + &returns, + ) + + return returns +} + +func (j *jsiiProxy_JSII417PublicBaseOfBase) Foo() { _jsii_.InvokeVoid( - d, - "pleaseCompile", + j, + "foo", nil, // no parameters ) } @@ -10519,87 +11176,81 @@ func (d *jsiiProxy_Default) PleaseCompile() { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DefaultedConstructorArgument.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/JSObjectLiteralForInterface.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( - "time" - _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" + + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ) -type DefaultedConstructorArgument interface { - Arg1() *float64 - Arg2() *string - Arg3() *time.Time +type JSObjectLiteralForInterface interface { + GiveMeFriendly() scopejsiicalclib.IFriendly + GiveMeFriendlyGenerator() IFriendlyRandomGenerator } -// The jsii proxy struct for DefaultedConstructorArgument -type jsiiProxy_DefaultedConstructorArgument struct { +// The jsii proxy struct for JSObjectLiteralForInterface +type jsiiProxy_JSObjectLiteralForInterface struct { _ byte // padding } -func (j *jsiiProxy_DefaultedConstructorArgument) Arg1() *float64 { - var returns *float64 - _jsii_.Get( - j, - "arg1", - &returns, +func NewJSObjectLiteralForInterface() JSObjectLiteralForInterface { + _init_.Initialize() + + j := jsiiProxy_JSObjectLiteralForInterface{} + + _jsii_.Create( + "jsii-calc.JSObjectLiteralForInterface", + nil, // no parameters + &j, ) - return returns + + return &j } -func (j *jsiiProxy_DefaultedConstructorArgument) Arg2() *string { - var returns *string - _jsii_.Get( +func NewJSObjectLiteralForInterface_Override(j JSObjectLiteralForInterface) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.JSObjectLiteralForInterface", + nil, // no parameters j, - "arg2", - &returns, ) - return returns } -func (j *jsiiProxy_DefaultedConstructorArgument) Arg3() *time.Time { - var returns *time.Time - _jsii_.Get( +func (j *jsiiProxy_JSObjectLiteralForInterface) GiveMeFriendly() scopejsiicalclib.IFriendly { + var returns scopejsiicalclib.IFriendly + + _jsii_.Invoke( j, - "arg3", + "giveMeFriendly", + nil, // no parameters &returns, ) + return returns } +func (j *jsiiProxy_JSObjectLiteralForInterface) GiveMeFriendlyGenerator() IFriendlyRandomGenerator { + var returns IFriendlyRandomGenerator -func NewDefaultedConstructorArgument(arg1 *float64, arg2 *string, arg3 *time.Time) DefaultedConstructorArgument { - _init_.Initialize() - - j := jsiiProxy_DefaultedConstructorArgument{} - - _jsii_.Create( - "jsii-calc.DefaultedConstructorArgument", - []interface{}{arg1, arg2, arg3}, - &j, + _jsii_.Invoke( + j, + "giveMeFriendlyGenerator", + nil, // no parameters + &returns, ) - return &j -} - -func NewDefaultedConstructorArgument_Override(d DefaultedConstructorArgument, arg1 *float64, arg2 *string, arg3 *time.Time) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.DefaultedConstructorArgument", - []interface{}{arg1, arg2, arg3}, - d, - ) + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Demonstrate982.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/JSObjectLiteralToNative.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -10608,25 +11259,22 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// 1. -// -// call #takeThis() -> An ObjectRef will be provisioned for the value (it'll be re-used!) -// 2. call #takeThisToo() -> The ObjectRef from before will need to be down-cased to the ParentStruct982 type -type Demonstrate982 interface { +type JSObjectLiteralToNative interface { + ReturnLiteral() JSObjectLiteralToNativeClass } -// The jsii proxy struct for Demonstrate982 -type jsiiProxy_Demonstrate982 struct { +// The jsii proxy struct for JSObjectLiteralToNative +type jsiiProxy_JSObjectLiteralToNative struct { _ byte // padding } -func NewDemonstrate982() Demonstrate982 { +func NewJSObjectLiteralToNative() JSObjectLiteralToNative { _init_.Initialize() - j := jsiiProxy_Demonstrate982{} + j := jsiiProxy_JSObjectLiteralToNative{} _jsii_.Create( - "jsii-calc.Demonstrate982", + "jsii-calc.JSObjectLiteralToNative", nil, // no parameters &j, ) @@ -10634,41 +11282,22 @@ func NewDemonstrate982() Demonstrate982 { return &j } -func NewDemonstrate982_Override(d Demonstrate982) { +func NewJSObjectLiteralToNative_Override(j JSObjectLiteralToNative) { _init_.Initialize() _jsii_.Create( - "jsii-calc.Demonstrate982", - nil, // no parameters - d, - ) -} - -// It's dangerous to go alone! -func Demonstrate982_TakeThis() *ChildStruct982 { - _init_.Initialize() - - var returns *ChildStruct982 - - _jsii_.StaticInvoke( - "jsii-calc.Demonstrate982", - "takeThis", + "jsii-calc.JSObjectLiteralToNative", nil, // no parameters - &returns, + j, ) - - return returns } -// It's dangerous to go alone! -func Demonstrate982_TakeThisToo() *ParentStruct982 { - _init_.Initialize() - - var returns *ParentStruct982 +func (j *jsiiProxy_JSObjectLiteralToNative) ReturnLiteral() JSObjectLiteralToNativeClass { + var returns JSObjectLiteralToNativeClass - _jsii_.StaticInvoke( - "jsii-calc.Demonstrate982", - "takeThisToo", + _jsii_.Invoke( + j, + "returnLiteral", nil, // no parameters &returns, ) @@ -10679,7 +11308,7 @@ func Demonstrate982_TakeThisToo() *ParentStruct982 { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DeprecatedClass.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/JSObjectLiteralToNativeClass.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -10688,562 +11317,616 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// Deprecated: a pretty boring class. -type DeprecatedClass interface { - // Deprecated: shouldn't have been mutable. - MutableProperty() *float64 - // Deprecated: shouldn't have been mutable. - SetMutableProperty(val *float64) - // Deprecated: this is not always "wazoo", be ready to be disappointed. - ReadonlyProperty() *string - // Deprecated: it was a bad idea. - Method() +type JSObjectLiteralToNativeClass interface { + PropA() *string + SetPropA(val *string) + PropB() *float64 + SetPropB(val *float64) } -// The jsii proxy struct for DeprecatedClass -type jsiiProxy_DeprecatedClass struct { +// The jsii proxy struct for JSObjectLiteralToNativeClass +type jsiiProxy_JSObjectLiteralToNativeClass struct { _ byte // padding } -func (j *jsiiProxy_DeprecatedClass) MutableProperty() *float64 { - var returns *float64 +func (j *jsiiProxy_JSObjectLiteralToNativeClass) PropA() *string { + var returns *string _jsii_.Get( j, - "mutableProperty", + "propA", &returns, ) return returns } -func (j *jsiiProxy_DeprecatedClass) ReadonlyProperty() *string { - var returns *string +func (j *jsiiProxy_JSObjectLiteralToNativeClass) PropB() *float64 { + var returns *float64 _jsii_.Get( j, - "readonlyProperty", + "propB", &returns, ) return returns } -// Deprecated: this constructor is "just" okay. -func NewDeprecatedClass(readonlyString *string, mutableNumber *float64) DeprecatedClass { +func NewJSObjectLiteralToNativeClass() JSObjectLiteralToNativeClass { _init_.Initialize() - j := jsiiProxy_DeprecatedClass{} + j := jsiiProxy_JSObjectLiteralToNativeClass{} _jsii_.Create( - "jsii-calc.DeprecatedClass", - []interface{}{readonlyString, mutableNumber}, + "jsii-calc.JSObjectLiteralToNativeClass", + nil, // no parameters &j, ) return &j } -// Deprecated: this constructor is "just" okay. -func NewDeprecatedClass_Override(d DeprecatedClass, readonlyString *string, mutableNumber *float64) { +func NewJSObjectLiteralToNativeClass_Override(j JSObjectLiteralToNativeClass) { _init_.Initialize() _jsii_.Create( - "jsii-calc.DeprecatedClass", - []interface{}{readonlyString, mutableNumber}, - d, + "jsii-calc.JSObjectLiteralToNativeClass", + nil, // no parameters + j, ) } -func (j *jsiiProxy_DeprecatedClass)SetMutableProperty(val *float64) { +func (j *jsiiProxy_JSObjectLiteralToNativeClass)SetPropA(val *string) { _jsii_.Set( j, - "mutableProperty", + "propA", val, ) } -func (d *jsiiProxy_DeprecatedClass) Method() { - _jsii_.InvokeVoid( - d, - "method", - nil, // no parameters +func (j *jsiiProxy_JSObjectLiteralToNativeClass)SetPropB(val *float64) { + _jsii_.Set( + j, + "propB", + val, ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DeprecatedEnum.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -// Deprecated: your deprecated selection of bad options. -type DeprecatedEnum string - -const ( - // Deprecated: option A is not great. - DeprecatedEnum_OPTION_A DeprecatedEnum = "OPTION_A" - // Deprecated: option B is kinda bad, too. - DeprecatedEnum_OPTION_B DeprecatedEnum = "OPTION_B" -) - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DeprecatedStruct.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -// Deprecated: it just wraps a string. -type DeprecatedStruct struct { - // Deprecated: well, yeah. - ReadonlyProperty *string \`field:"required" json:"readonlyProperty" yaml:"readonlyProperty"\` -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DerivedStruct.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/JavaReservedWords.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( - "time" - - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// A struct which derives from another struct. -type DerivedStruct struct { - // An awesome number value. - // Deprecated. - Anumber *float64 \`field:"required" json:"anumber" yaml:"anumber"\` - // A string value. - // Deprecated. - Astring *string \`field:"required" json:"astring" yaml:"astring"\` - // Deprecated. - FirstOptional *[]*string \`field:"optional" json:"firstOptional" yaml:"firstOptional"\` - AnotherRequired *time.Time \`field:"required" json:"anotherRequired" yaml:"anotherRequired"\` - Bool *bool \`field:"required" json:"bool" yaml:"bool"\` - // An example of a non primitive property. - NonPrimitive DoubleTrouble \`field:"required" json:"nonPrimitive" yaml:"nonPrimitive"\` - // This is optional. - AnotherOptional *map[string]scopejsiicalclib.NumericValue \`field:"optional" json:"anotherOptional" yaml:"anotherOptional"\` - OptionalAny interface{} \`field:"optional" json:"optionalAny" yaml:"optionalAny"\` - OptionalArray *[]*string \`field:"optional" json:"optionalArray" yaml:"optionalArray"\` +type JavaReservedWords interface { + While() *string + SetWhile(val *string) + Abstract() + Assert() + Boolean() + Break() + Byte() + Case() + Catch() + Char() + Class() + Const() + Continue() + Default() + Do() + Double() + Else() + Enum() + Extends() + False() + Final() + Finally() + Float() + For() + Goto() + If() + Implements() + Import() + Instanceof() + Int() + Interface() + Long() + Native() + New() + Null() + Package() + Private() + Protected() + Public() + Return() + Short() + Static() + Strictfp() + Super() + Switch() + Synchronized() + This() + Throw() + Throws() + Transient() + True() + Try() + Void() + Volatile() } - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DiamondBottom.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - "time" -) - -type DiamondBottom struct { - // Deprecated. - HoistedTop *string \`field:"optional" json:"hoistedTop" yaml:"hoistedTop"\` - // Deprecated. - Left *float64 \`field:"optional" json:"left" yaml:"left"\` - // Deprecated. - Right *bool \`field:"optional" json:"right" yaml:"right"\` - Bottom *time.Time \`field:"optional" json:"bottom" yaml:"bottom"\` +// The jsii proxy struct for JavaReservedWords +type jsiiProxy_JavaReservedWords struct { + _ byte // padding } - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DiamondInheritanceBaseLevelStruct.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -type DiamondInheritanceBaseLevelStruct struct { - BaseLevelProperty *string \`field:"required" json:"baseLevelProperty" yaml:"baseLevelProperty"\` +func (j *jsiiProxy_JavaReservedWords) While() *string { + var returns *string + _jsii_.Get( + j, + "while", + &returns, + ) + return returns } -`; +func NewJavaReservedWords() JavaReservedWords { + _init_.Initialize() -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DiamondInheritanceFirstMidLevelStruct.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc + j := jsiiProxy_JavaReservedWords{} + _jsii_.Create( + "jsii-calc.JavaReservedWords", + nil, // no parameters + &j, + ) -type DiamondInheritanceFirstMidLevelStruct struct { - BaseLevelProperty *string \`field:"required" json:"baseLevelProperty" yaml:"baseLevelProperty"\` - FirstMidLevelProperty *string \`field:"required" json:"firstMidLevelProperty" yaml:"firstMidLevelProperty"\` + return &j } +func NewJavaReservedWords_Override(j JavaReservedWords) { + _init_.Initialize() -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DiamondInheritanceSecondMidLevelStruct.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -type DiamondInheritanceSecondMidLevelStruct struct { - BaseLevelProperty *string \`field:"required" json:"baseLevelProperty" yaml:"baseLevelProperty"\` - SecondMidLevelProperty *string \`field:"required" json:"secondMidLevelProperty" yaml:"secondMidLevelProperty"\` + _jsii_.Create( + "jsii-calc.JavaReservedWords", + nil, // no parameters + j, + ) } +func (j *jsiiProxy_JavaReservedWords)SetWhile(val *string) { + _jsii_.Set( + j, + "while", + val, + ) +} -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DiamondInheritanceTopLevelStruct.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - +func (j *jsiiProxy_JavaReservedWords) Abstract() { + _jsii_.InvokeVoid( + j, + "abstract", + nil, // no parameters + ) +} -type DiamondInheritanceTopLevelStruct struct { - BaseLevelProperty *string \`field:"required" json:"baseLevelProperty" yaml:"baseLevelProperty"\` - FirstMidLevelProperty *string \`field:"required" json:"firstMidLevelProperty" yaml:"firstMidLevelProperty"\` - SecondMidLevelProperty *string \`field:"required" json:"secondMidLevelProperty" yaml:"secondMidLevelProperty"\` - TopLevelProperty *string \`field:"required" json:"topLevelProperty" yaml:"topLevelProperty"\` +func (j *jsiiProxy_JavaReservedWords) Assert() { + _jsii_.InvokeVoid( + j, + "assert", + nil, // no parameters + ) } +func (j *jsiiProxy_JavaReservedWords) Boolean() { + _jsii_.InvokeVoid( + j, + "boolean", + nil, // no parameters + ) +} -`; +func (j *jsiiProxy_JavaReservedWords) Break() { + _jsii_.InvokeVoid( + j, + "break", + nil, // no parameters + ) +} -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DisappointingCollectionSource.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc +func (j *jsiiProxy_JavaReservedWords) Byte() { + _jsii_.InvokeVoid( + j, + "byte", + nil, // no parameters + ) +} -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) +func (j *jsiiProxy_JavaReservedWords) Case() { + _jsii_.InvokeVoid( + j, + "case", + nil, // no parameters + ) +} -// Verifies that null/undefined can be returned for optional collections. -// -// This source of collections is disappointing - it'll always give you nothing :(. -type DisappointingCollectionSource interface { +func (j *jsiiProxy_JavaReservedWords) Catch() { + _jsii_.InvokeVoid( + j, + "catch", + nil, // no parameters + ) } -// The jsii proxy struct for DisappointingCollectionSource -type jsiiProxy_DisappointingCollectionSource struct { - _ byte // padding +func (j *jsiiProxy_JavaReservedWords) Char() { + _jsii_.InvokeVoid( + j, + "char", + nil, // no parameters + ) } -func DisappointingCollectionSource_MaybeList() *[]*string { - _init_.Initialize() - var returns *[]*string - _jsii_.StaticGet( - "jsii-calc.DisappointingCollectionSource", - "maybeList", - &returns, +func (j *jsiiProxy_JavaReservedWords) Class() { + _jsii_.InvokeVoid( + j, + "class", + nil, // no parameters ) - return returns } -func DisappointingCollectionSource_MaybeMap() *map[string]*float64 { - _init_.Initialize() - var returns *map[string]*float64 - _jsii_.StaticGet( - "jsii-calc.DisappointingCollectionSource", - "maybeMap", - &returns, +func (j *jsiiProxy_JavaReservedWords) Const() { + _jsii_.InvokeVoid( + j, + "const", + nil, // no parameters ) - return returns } - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DoNotOverridePrivates.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -type DoNotOverridePrivates interface { - ChangePrivatePropertyValue(newValue *string) - PrivateMethodValue() *string - PrivatePropertyValue() *string +func (j *jsiiProxy_JavaReservedWords) Continue() { + _jsii_.InvokeVoid( + j, + "continue", + nil, // no parameters + ) } -// The jsii proxy struct for DoNotOverridePrivates -type jsiiProxy_DoNotOverridePrivates struct { - _ byte // padding +func (j *jsiiProxy_JavaReservedWords) Default() { + _jsii_.InvokeVoid( + j, + "default", + nil, // no parameters + ) } -func NewDoNotOverridePrivates() DoNotOverridePrivates { - _init_.Initialize() - - j := jsiiProxy_DoNotOverridePrivates{} - - _jsii_.Create( - "jsii-calc.DoNotOverridePrivates", +func (j *jsiiProxy_JavaReservedWords) Do() { + _jsii_.InvokeVoid( + j, + "do", nil, // no parameters - &j, ) - - return &j } -func NewDoNotOverridePrivates_Override(d DoNotOverridePrivates) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.DoNotOverridePrivates", +func (j *jsiiProxy_JavaReservedWords) Double() { + _jsii_.InvokeVoid( + j, + "double", nil, // no parameters - d, ) } -func (d *jsiiProxy_DoNotOverridePrivates) ChangePrivatePropertyValue(newValue *string) { +func (j *jsiiProxy_JavaReservedWords) Else() { _jsii_.InvokeVoid( - d, - "changePrivatePropertyValue", - []interface{}{newValue}, + j, + "else", + nil, // no parameters ) } -func (d *jsiiProxy_DoNotOverridePrivates) PrivateMethodValue() *string { - var returns *string - - _jsii_.Invoke( - d, - "privateMethodValue", +func (j *jsiiProxy_JavaReservedWords) Enum() { + _jsii_.InvokeVoid( + j, + "enum", nil, // no parameters - &returns, ) - - return returns } -func (d *jsiiProxy_DoNotOverridePrivates) PrivatePropertyValue() *string { - var returns *string - - _jsii_.Invoke( - d, - "privatePropertyValue", +func (j *jsiiProxy_JavaReservedWords) Extends() { + _jsii_.InvokeVoid( + j, + "extends", nil, // no parameters - &returns, ) - - return returns } - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DoNotRecognizeAnyAsOptional.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -// jsii#284: do not recognize "any" as an optional argument. -type DoNotRecognizeAnyAsOptional interface { - Method(_requiredAny interface{}, _optionalAny interface{}, _optionalString *string) +func (j *jsiiProxy_JavaReservedWords) False() { + _jsii_.InvokeVoid( + j, + "false", + nil, // no parameters + ) } -// The jsii proxy struct for DoNotRecognizeAnyAsOptional -type jsiiProxy_DoNotRecognizeAnyAsOptional struct { - _ byte // padding +func (j *jsiiProxy_JavaReservedWords) Final() { + _jsii_.InvokeVoid( + j, + "final", + nil, // no parameters + ) } -func NewDoNotRecognizeAnyAsOptional() DoNotRecognizeAnyAsOptional { - _init_.Initialize() - - j := jsiiProxy_DoNotRecognizeAnyAsOptional{} - - _jsii_.Create( - "jsii-calc.DoNotRecognizeAnyAsOptional", +func (j *jsiiProxy_JavaReservedWords) Finally() { + _jsii_.InvokeVoid( + j, + "finally", nil, // no parameters - &j, ) - - return &j } -func NewDoNotRecognizeAnyAsOptional_Override(d DoNotRecognizeAnyAsOptional) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.DoNotRecognizeAnyAsOptional", +func (j *jsiiProxy_JavaReservedWords) Float() { + _jsii_.InvokeVoid( + j, + "float", nil, // no parameters - d, ) } -func (d *jsiiProxy_DoNotRecognizeAnyAsOptional) Method(_requiredAny interface{}, _optionalAny interface{}, _optionalString *string) { +func (j *jsiiProxy_JavaReservedWords) For() { _jsii_.InvokeVoid( - d, - "method", - []interface{}{_requiredAny, _optionalAny, _optionalString}, + j, + "for", + nil, // no parameters ) } +func (j *jsiiProxy_JavaReservedWords) Goto() { + _jsii_.InvokeVoid( + j, + "goto", + nil, // no parameters + ) +} -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DocumentedClass.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) +func (j *jsiiProxy_JavaReservedWords) If() { + _jsii_.InvokeVoid( + j, + "if", + nil, // no parameters + ) +} -// Here's the first line of the TSDoc comment. -// -// This is the meat of the TSDoc comment. It may contain -// multiple lines and multiple paragraphs. -// -// Multiple paragraphs are separated by an empty line. -// -// Example: -// x := 12 + 44 -// s1 := "string" -// s2 := "string \\nwith new newlines" // see https://github.com/aws/jsii/issues/2569 -// s3 := \`string -// with -// new lines\` -// -type DocumentedClass interface { - // Greet the indicated person. - // - // This will print out a friendly greeting intended for the indicated person. - // - // Returns: A number that everyone knows very well and represents the answer - // to the ultimate question. - Greet(greetee *Greetee) *float64 - // Say ¡Hola! - // Experimental. - Hola() +func (j *jsiiProxy_JavaReservedWords) Implements() { + _jsii_.InvokeVoid( + j, + "implements", + nil, // no parameters + ) } -// The jsii proxy struct for DocumentedClass -type jsiiProxy_DocumentedClass struct { - _ byte // padding +func (j *jsiiProxy_JavaReservedWords) Import() { + _jsii_.InvokeVoid( + j, + "import", + nil, // no parameters + ) } -func NewDocumentedClass() DocumentedClass { - _init_.Initialize() +func (j *jsiiProxy_JavaReservedWords) Instanceof() { + _jsii_.InvokeVoid( + j, + "instanceof", + nil, // no parameters + ) +} - j := jsiiProxy_DocumentedClass{} +func (j *jsiiProxy_JavaReservedWords) Int() { + _jsii_.InvokeVoid( + j, + "int", + nil, // no parameters + ) +} - _jsii_.Create( - "jsii-calc.DocumentedClass", +func (j *jsiiProxy_JavaReservedWords) Interface() { + _jsii_.InvokeVoid( + j, + "interface", nil, // no parameters - &j, ) +} - return &j +func (j *jsiiProxy_JavaReservedWords) Long() { + _jsii_.InvokeVoid( + j, + "long", + nil, // no parameters + ) } -func NewDocumentedClass_Override(d DocumentedClass) { - _init_.Initialize() +func (j *jsiiProxy_JavaReservedWords) Native() { + _jsii_.InvokeVoid( + j, + "native", + nil, // no parameters + ) +} - _jsii_.Create( - "jsii-calc.DocumentedClass", +func (j *jsiiProxy_JavaReservedWords) New() { + _jsii_.InvokeVoid( + j, + "new", nil, // no parameters - d, ) } -func (d *jsiiProxy_DocumentedClass) Greet(greetee *Greetee) *float64 { - var returns *float64 +func (j *jsiiProxy_JavaReservedWords) Null() { + _jsii_.InvokeVoid( + j, + "null", + nil, // no parameters + ) +} - _jsii_.Invoke( - d, - "greet", - []interface{}{greetee}, - &returns, +func (j *jsiiProxy_JavaReservedWords) Package() { + _jsii_.InvokeVoid( + j, + "package", + nil, // no parameters ) +} - return returns +func (j *jsiiProxy_JavaReservedWords) Private() { + _jsii_.InvokeVoid( + j, + "private", + nil, // no parameters + ) } -func (d *jsiiProxy_DocumentedClass) Hola() { +func (j *jsiiProxy_JavaReservedWords) Protected() { _jsii_.InvokeVoid( - d, - "hola", + j, + "protected", nil, // no parameters ) } +func (j *jsiiProxy_JavaReservedWords) Public() { + _jsii_.InvokeVoid( + j, + "public", + nil, // no parameters + ) +} -`; +func (j *jsiiProxy_JavaReservedWords) Return() { + _jsii_.InvokeVoid( + j, + "return", + nil, // no parameters + ) +} -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DontComplainAboutVariadicAfterOptional.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc +func (j *jsiiProxy_JavaReservedWords) Short() { + _jsii_.InvokeVoid( + j, + "short", + nil, // no parameters + ) +} -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) +func (j *jsiiProxy_JavaReservedWords) Static() { + _jsii_.InvokeVoid( + j, + "static", + nil, // no parameters + ) +} -type DontComplainAboutVariadicAfterOptional interface { - OptionalAndVariadic(optional *string, things ...*string) *string +func (j *jsiiProxy_JavaReservedWords) Strictfp() { + _jsii_.InvokeVoid( + j, + "strictfp", + nil, // no parameters + ) } -// The jsii proxy struct for DontComplainAboutVariadicAfterOptional -type jsiiProxy_DontComplainAboutVariadicAfterOptional struct { - _ byte // padding +func (j *jsiiProxy_JavaReservedWords) Super() { + _jsii_.InvokeVoid( + j, + "super", + nil, // no parameters + ) } -func NewDontComplainAboutVariadicAfterOptional() DontComplainAboutVariadicAfterOptional { - _init_.Initialize() +func (j *jsiiProxy_JavaReservedWords) Switch() { + _jsii_.InvokeVoid( + j, + "switch", + nil, // no parameters + ) +} - j := jsiiProxy_DontComplainAboutVariadicAfterOptional{} +func (j *jsiiProxy_JavaReservedWords) Synchronized() { + _jsii_.InvokeVoid( + j, + "synchronized", + nil, // no parameters + ) +} - _jsii_.Create( - "jsii-calc.DontComplainAboutVariadicAfterOptional", +func (j *jsiiProxy_JavaReservedWords) This() { + _jsii_.InvokeVoid( + j, + "this", nil, // no parameters - &j, ) +} - return &j +func (j *jsiiProxy_JavaReservedWords) Throw() { + _jsii_.InvokeVoid( + j, + "throw", + nil, // no parameters + ) } -func NewDontComplainAboutVariadicAfterOptional_Override(d DontComplainAboutVariadicAfterOptional) { - _init_.Initialize() +func (j *jsiiProxy_JavaReservedWords) Throws() { + _jsii_.InvokeVoid( + j, + "throws", + nil, // no parameters + ) +} - _jsii_.Create( - "jsii-calc.DontComplainAboutVariadicAfterOptional", +func (j *jsiiProxy_JavaReservedWords) Transient() { + _jsii_.InvokeVoid( + j, + "transient", nil, // no parameters - d, ) } -func (d *jsiiProxy_DontComplainAboutVariadicAfterOptional) OptionalAndVariadic(optional *string, things ...*string) *string { - args := []interface{}{optional} - for _, a := range things { - args = append(args, a) - } +func (j *jsiiProxy_JavaReservedWords) True() { + _jsii_.InvokeVoid( + j, + "true", + nil, // no parameters + ) +} - var returns *string +func (j *jsiiProxy_JavaReservedWords) Try() { + _jsii_.InvokeVoid( + j, + "try", + nil, // no parameters + ) +} - _jsii_.Invoke( - d, - "optionalAndVariadic", - args, - &returns, +func (j *jsiiProxy_JavaReservedWords) Void() { + _jsii_.InvokeVoid( + j, + "void", + nil, // no parameters ) +} - return returns +func (j *jsiiProxy_JavaReservedWords) Volatile() { + _jsii_.InvokeVoid( + j, + "volatile", + nil, // no parameters + ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DoubleTrouble.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/Jsii487Derived.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -11252,85 +11935,45 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type DoubleTrouble interface { - IFriendlyRandomGenerator - // Say hello! - Hello() *string - // Returns another random number. - Next() *float64 +type Jsii487Derived interface { + IJsii487External + IJsii487External2 } -// The jsii proxy struct for DoubleTrouble -type jsiiProxy_DoubleTrouble struct { - jsiiProxy_IFriendlyRandomGenerator +// The jsii proxy struct for Jsii487Derived +type jsiiProxy_Jsii487Derived struct { + jsiiProxy_IJsii487External + jsiiProxy_IJsii487External2 } -func NewDoubleTrouble() DoubleTrouble { +func NewJsii487Derived() Jsii487Derived { _init_.Initialize() - j := jsiiProxy_DoubleTrouble{} - - _jsii_.Create( - "jsii-calc.DoubleTrouble", - nil, // no parameters - &j, - ) - - return &j -} - -func NewDoubleTrouble_Override(d DoubleTrouble) { - _init_.Initialize() + j := jsiiProxy_Jsii487Derived{} _jsii_.Create( - "jsii-calc.DoubleTrouble", - nil, // no parameters - d, - ) -} - -func (d *jsiiProxy_DoubleTrouble) Hello() *string { - var returns *string - - _jsii_.Invoke( - d, - "hello", - nil, // no parameters - &returns, - ) - - return returns -} - -func (d *jsiiProxy_DoubleTrouble) Next() *float64 { - var returns *float64 - - _jsii_.Invoke( - d, - "next", + "jsii-calc.Jsii487Derived", nil, // no parameters - &returns, - ) - - return returns -} - - -`; + &j, + ) -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DummyObj.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc + return &j +} +func NewJsii487Derived_Override(j Jsii487Derived) { + _init_.Initialize() -type DummyObj struct { - Example *string \`field:"required" json:"example" yaml:"example"\` + _jsii_.Create( + "jsii-calc.Jsii487Derived", + nil, // no parameters + j, + ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DynamicPropertyBearer.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/Jsii496Derived.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -11339,84 +11982,43 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// Ensures we can override a dynamic property that was inherited. -type DynamicPropertyBearer interface { - DynamicProperty() *string - SetDynamicProperty(val *string) - ValueStore() *string - SetValueStore(val *string) -} - -// The jsii proxy struct for DynamicPropertyBearer -type jsiiProxy_DynamicPropertyBearer struct { - _ byte // padding -} - -func (j *jsiiProxy_DynamicPropertyBearer) DynamicProperty() *string { - var returns *string - _jsii_.Get( - j, - "dynamicProperty", - &returns, - ) - return returns +type Jsii496Derived interface { + IJsii496 } -func (j *jsiiProxy_DynamicPropertyBearer) ValueStore() *string { - var returns *string - _jsii_.Get( - j, - "valueStore", - &returns, - ) - return returns +// The jsii proxy struct for Jsii496Derived +type jsiiProxy_Jsii496Derived struct { + jsiiProxy_IJsii496 } - -func NewDynamicPropertyBearer(valueStore *string) DynamicPropertyBearer { +func NewJsii496Derived() Jsii496Derived { _init_.Initialize() - j := jsiiProxy_DynamicPropertyBearer{} + j := jsiiProxy_Jsii496Derived{} _jsii_.Create( - "jsii-calc.DynamicPropertyBearer", - []interface{}{valueStore}, + "jsii-calc.Jsii496Derived", + nil, // no parameters &j, ) return &j } -func NewDynamicPropertyBearer_Override(d DynamicPropertyBearer, valueStore *string) { +func NewJsii496Derived_Override(j Jsii496Derived) { _init_.Initialize() _jsii_.Create( - "jsii-calc.DynamicPropertyBearer", - []interface{}{valueStore}, - d, - ) -} - -func (j *jsiiProxy_DynamicPropertyBearer)SetDynamicProperty(val *string) { - _jsii_.Set( - j, - "dynamicProperty", - val, - ) -} - -func (j *jsiiProxy_DynamicPropertyBearer)SetValueStore(val *string) { - _jsii_.Set( + "jsii-calc.Jsii496Derived", + nil, // no parameters j, - "valueStore", - val, ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_DynamicPropertyBearerChild.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/JsiiAgent.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -11425,112 +12027,54 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type DynamicPropertyBearerChild interface { - DynamicPropertyBearer - DynamicProperty() *string - SetDynamicProperty(val *string) - OriginalValue() *string - ValueStore() *string - SetValueStore(val *string) - // Sets \`this.dynamicProperty\` to the new value, and returns the old value. - // - // Returns: the old value that was set. - OverrideValue(newValue *string) *string -} - -// The jsii proxy struct for DynamicPropertyBearerChild -type jsiiProxy_DynamicPropertyBearerChild struct { - jsiiProxy_DynamicPropertyBearer -} - -func (j *jsiiProxy_DynamicPropertyBearerChild) DynamicProperty() *string { - var returns *string - _jsii_.Get( - j, - "dynamicProperty", - &returns, - ) - return returns -} - -func (j *jsiiProxy_DynamicPropertyBearerChild) OriginalValue() *string { - var returns *string - _jsii_.Get( - j, - "originalValue", - &returns, - ) - return returns +// Host runtime version should be set via JSII_AGENT. +type JsiiAgent interface { } -func (j *jsiiProxy_DynamicPropertyBearerChild) ValueStore() *string { - var returns *string - _jsii_.Get( - j, - "valueStore", - &returns, - ) - return returns +// The jsii proxy struct for JsiiAgent +type jsiiProxy_JsiiAgent struct { + _ byte // padding } - -func NewDynamicPropertyBearerChild(originalValue *string) DynamicPropertyBearerChild { +func NewJsiiAgent() JsiiAgent { _init_.Initialize() - j := jsiiProxy_DynamicPropertyBearerChild{} + j := jsiiProxy_JsiiAgent{} _jsii_.Create( - "jsii-calc.DynamicPropertyBearerChild", - []interface{}{originalValue}, + "jsii-calc.JsiiAgent", + nil, // no parameters &j, ) return &j } -func NewDynamicPropertyBearerChild_Override(d DynamicPropertyBearerChild, originalValue *string) { +func NewJsiiAgent_Override(j JsiiAgent) { _init_.Initialize() _jsii_.Create( - "jsii-calc.DynamicPropertyBearerChild", - []interface{}{originalValue}, - d, - ) -} - -func (j *jsiiProxy_DynamicPropertyBearerChild)SetDynamicProperty(val *string) { - _jsii_.Set( - j, - "dynamicProperty", - val, - ) -} - -func (j *jsiiProxy_DynamicPropertyBearerChild)SetValueStore(val *string) { - _jsii_.Set( + "jsii-calc.JsiiAgent", + nil, // no parameters j, - "valueStore", - val, ) } -func (d *jsiiProxy_DynamicPropertyBearerChild) OverrideValue(newValue *string) *string { +func JsiiAgent_Value() *string { + _init_.Initialize() var returns *string - - _jsii_.Invoke( - d, - "overrideValue", - []interface{}{newValue}, + _jsii_.StaticGet( + "jsii-calc.JsiiAgent", + "value", &returns, ) - return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Entropy.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/JsonFormatter.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -11539,40 +12083,40 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// This class is used to validate that serialization and deserialization does not interpret ISO-8601-formatted timestampts to the native date/time object, as the jsii protocol has a $jsii$date wrapper for this purpose (node's JSON parsing does *NOT* detect dates automatically in this way, so host libraries should not either). -type Entropy interface { - // Increases entropy by consuming time from the clock (yes, this is a long shot, please don't judge). - // - // Returns: the time from the \`WallClock\`. - Increase() *string - // Implement this method such that it returns \`word\`. - // - // Returns: \`word\`. - Repeat(word *string) *string +// Make sure structs are un-decorated on the way in. +// See: https://github.com/aws/aws-cdk/issues/5066 +// +type JsonFormatter interface { } -// The jsii proxy struct for Entropy -type jsiiProxy_Entropy struct { +// The jsii proxy struct for JsonFormatter +type jsiiProxy_JsonFormatter struct { _ byte // padding } -// Creates a new instance of Entropy. -func NewEntropy_Override(e Entropy, clock IWallClock) { +func JsonFormatter_AnyArray() interface{} { _init_.Initialize() - _jsii_.Create( - "jsii-calc.Entropy", - []interface{}{clock}, - e, + var returns interface{} + + _jsii_.StaticInvoke( + "jsii-calc.JsonFormatter", + "anyArray", + nil, // no parameters + &returns, ) + + return returns } -func (e *jsiiProxy_Entropy) Increase() *string { - var returns *string +func JsonFormatter_AnyBooleanFalse() interface{} { + _init_.Initialize() - _jsii_.Invoke( - e, - "increase", + var returns interface{} + + _jsii_.StaticInvoke( + "jsii-calc.JsonFormatter", + "anyBooleanFalse", nil, // no parameters &returns, ) @@ -11580,47 +12124,59 @@ func (e *jsiiProxy_Entropy) Increase() *string { return returns } -func (e *jsiiProxy_Entropy) Repeat(word *string) *string { - var returns *string +func JsonFormatter_AnyBooleanTrue() interface{} { + _init_.Initialize() - _jsii_.Invoke( - e, - "repeat", - []interface{}{word}, + var returns interface{} + + _jsii_.StaticInvoke( + "jsii-calc.JsonFormatter", + "anyBooleanTrue", + nil, // no parameters &returns, ) return returns } +func JsonFormatter_AnyDate() interface{} { + _init_.Initialize() -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_EnumDispenser.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc + var returns interface{} -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) + _jsii_.StaticInvoke( + "jsii-calc.JsonFormatter", + "anyDate", + nil, // no parameters + &returns, + ) -type EnumDispenser interface { + return returns } -// The jsii proxy struct for EnumDispenser -type jsiiProxy_EnumDispenser struct { - _ byte // padding +func JsonFormatter_AnyEmptyString() interface{} { + _init_.Initialize() + + var returns interface{} + + _jsii_.StaticInvoke( + "jsii-calc.JsonFormatter", + "anyEmptyString", + nil, // no parameters + &returns, + ) + + return returns } -func EnumDispenser_RandomIntegerLikeEnum() AllTypesEnum { +func JsonFormatter_AnyFunction() interface{} { _init_.Initialize() - var returns AllTypesEnum + var returns interface{} _jsii_.StaticInvoke( - "jsii-calc.EnumDispenser", - "randomIntegerLikeEnum", + "jsii-calc.JsonFormatter", + "anyFunction", nil, // no parameters &returns, ) @@ -11628,14 +12184,14 @@ func EnumDispenser_RandomIntegerLikeEnum() AllTypesEnum { return returns } -func EnumDispenser_RandomStringLikeEnum() StringEnum { +func JsonFormatter_AnyHash() interface{} { _init_.Initialize() - var returns StringEnum + var returns interface{} _jsii_.StaticInvoke( - "jsii-calc.EnumDispenser", - "randomStringLikeEnum", + "jsii-calc.JsonFormatter", + "anyHash", nil, // no parameters &returns, ) @@ -11643,118 +12199,320 @@ func EnumDispenser_RandomStringLikeEnum() StringEnum { return returns } +func JsonFormatter_AnyNull() interface{} { + _init_.Initialize() -`; + var returns interface{} -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_EraseUndefinedHashValues.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc + _jsii_.StaticInvoke( + "jsii-calc.JsonFormatter", + "anyNull", + nil, // no parameters + &returns, + ) -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) + return returns +} -type EraseUndefinedHashValues interface { +func JsonFormatter_AnyNumber() interface{} { + _init_.Initialize() + + var returns interface{} + + _jsii_.StaticInvoke( + "jsii-calc.JsonFormatter", + "anyNumber", + nil, // no parameters + &returns, + ) + + return returns } -// The jsii proxy struct for EraseUndefinedHashValues -type jsiiProxy_EraseUndefinedHashValues struct { - _ byte // padding +func JsonFormatter_AnyRef() interface{} { + _init_.Initialize() + + var returns interface{} + + _jsii_.StaticInvoke( + "jsii-calc.JsonFormatter", + "anyRef", + nil, // no parameters + &returns, + ) + + return returns } -func NewEraseUndefinedHashValues() EraseUndefinedHashValues { +func JsonFormatter_AnyString() interface{} { _init_.Initialize() - j := jsiiProxy_EraseUndefinedHashValues{} + var returns interface{} - _jsii_.Create( - "jsii-calc.EraseUndefinedHashValues", + _jsii_.StaticInvoke( + "jsii-calc.JsonFormatter", + "anyString", nil, // no parameters - &j, + &returns, ) - return &j + return returns } -func NewEraseUndefinedHashValues_Override(e EraseUndefinedHashValues) { +func JsonFormatter_AnyUndefined() interface{} { _init_.Initialize() - _jsii_.Create( - "jsii-calc.EraseUndefinedHashValues", + var returns interface{} + + _jsii_.StaticInvoke( + "jsii-calc.JsonFormatter", + "anyUndefined", nil, // no parameters - e, + &returns, ) + + return returns } -// Returns \`true\` if \`key\` is defined in \`opts\`. -// -// 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 { +func JsonFormatter_AnyZero() interface{} { _init_.Initialize() - var returns *bool + var returns interface{} _jsii_.StaticInvoke( - "jsii-calc.EraseUndefinedHashValues", - "doesKeyExist", - []interface{}{opts, key}, + "jsii-calc.JsonFormatter", + "anyZero", + nil, // no parameters &returns, ) return returns } -// We expect "prop1" to be erased. -func EraseUndefinedHashValues_Prop1IsNull() *map[string]interface{} { +func JsonFormatter_Stringify(value interface{}) *string { _init_.Initialize() - var returns *map[string]interface{} + var returns *string + + _jsii_.StaticInvoke( + "jsii-calc.JsonFormatter", + "stringify", + []interface{}{value}, + &returns, + ) + + return returns +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/LICENSE 1`] = ` + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. - _jsii_.StaticInvoke( - "jsii-calc.EraseUndefinedHashValues", - "prop1IsNull", - nil, // no parameters - &returns, - ) + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. - return returns -} + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. -// We expect "prop2" to be erased. -func EraseUndefinedHashValues_Prop2IsUndefined() *map[string]interface{} { - _init_.Initialize() + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. - var returns *map[string]interface{} + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. - _jsii_.StaticInvoke( - "jsii-calc.EraseUndefinedHashValues", - "prop2IsUndefined", - nil, // no parameters - &returns, - ) + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. - return returns -} + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + END OF TERMS AND CONDITIONS -`; + APPENDIX: How to apply the Apache License to your work. -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_EraseUndefinedHashValuesOptions.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. -type EraseUndefinedHashValuesOptions struct { - Option1 *string \`field:"optional" json:"option1" yaml:"option1"\` - Option2 *string \`field:"optional" json:"option2" yaml:"option2"\` -} + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ExperimentalClass.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/LevelOne.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -11763,122 +12521,139 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// Experimental. -type ExperimentalClass interface { - // Experimental. - MutableProperty() *float64 - // Experimental. - SetMutableProperty(val *float64) - // Experimental. - ReadonlyProperty() *string - // Experimental. - Method() +// Validates that nested classes get correct code generation for the occasional forward reference. +type LevelOne interface { + Props() *LevelOneProps } -// The jsii proxy struct for ExperimentalClass -type jsiiProxy_ExperimentalClass struct { +// The jsii proxy struct for LevelOne +type jsiiProxy_LevelOne struct { _ byte // padding } -func (j *jsiiProxy_ExperimentalClass) MutableProperty() *float64 { - var returns *float64 - _jsii_.Get( - j, - "mutableProperty", - &returns, - ) - return returns -} - -func (j *jsiiProxy_ExperimentalClass) ReadonlyProperty() *string { - var returns *string +func (j *jsiiProxy_LevelOne) Props() *LevelOneProps { + var returns *LevelOneProps _jsii_.Get( j, - "readonlyProperty", + "props", &returns, ) return returns } -// Experimental. -func NewExperimentalClass(readonlyString *string, mutableNumber *float64) ExperimentalClass { +func NewLevelOne(props *LevelOneProps) LevelOne { _init_.Initialize() - j := jsiiProxy_ExperimentalClass{} + j := jsiiProxy_LevelOne{} _jsii_.Create( - "jsii-calc.ExperimentalClass", - []interface{}{readonlyString, mutableNumber}, + "jsii-calc.LevelOne", + []interface{}{props}, &j, ) return &j } -// Experimental. -func NewExperimentalClass_Override(e ExperimentalClass, readonlyString *string, mutableNumber *float64) { +func NewLevelOne_Override(l LevelOne, props *LevelOneProps) { _init_.Initialize() _jsii_.Create( - "jsii-calc.ExperimentalClass", - []interface{}{readonlyString, mutableNumber}, - e, + "jsii-calc.LevelOne", + []interface{}{props}, + l, ) } -func (j *jsiiProxy_ExperimentalClass)SetMutableProperty(val *float64) { - _jsii_.Set( - j, - "mutableProperty", - val, - ) -} -func (e *jsiiProxy_ExperimentalClass) Method() { - _jsii_.InvokeVoid( - e, - "method", - nil, // no parameters - ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/LevelOne_PropBooleanValue.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + + +type LevelOne_PropBooleanValue struct { + Value *bool \`field:"required" json:"value" yaml:"value"\` } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ExperimentalEnum.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/LevelOne_PropProperty.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc -// Experimental. -type ExperimentalEnum string +type LevelOne_PropProperty struct { + Prop *LevelOne_PropBooleanValue \`field:"required" json:"prop" yaml:"prop"\` +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/LevelOneProps.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc -const ( - // Experimental. - ExperimentalEnum_OPTION_A ExperimentalEnum = "OPTION_A" - // Experimental. - ExperimentalEnum_OPTION_B ExperimentalEnum = "OPTION_B" -) + +type LevelOneProps struct { + Prop *LevelOne_PropProperty \`field:"required" json:"prop" yaml:"prop"\` +} `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ExperimentalStruct.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/LoadBalancedFargateServiceProps.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc -// Experimental. -type ExperimentalStruct struct { - // Experimental. - ReadonlyProperty *string \`field:"required" json:"readonlyProperty" yaml:"readonlyProperty"\` +// jsii#298: show default values in sphinx documentation, and respect newlines. +type LoadBalancedFargateServiceProps struct { + // The container port of the application load balancer attached to your Fargate service. + // + // Corresponds to container port mapping. + ContainerPort *float64 \`field:"optional" json:"containerPort" yaml:"containerPort"\` + // 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. + Cpu *string \`field:"optional" json:"cpu" yaml:"cpu"\` + // 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. + MemoryMiB *string \`field:"optional" json:"memoryMiB" yaml:"memoryMiB"\` + // Determines whether the Application Load Balancer will be internet-facing. + PublicLoadBalancer *bool \`field:"optional" json:"publicLoadBalancer" yaml:"publicLoadBalancer"\` + // Determines whether your Fargate Service will be assigned a public IP address. + PublicTasks *bool \`field:"optional" json:"publicTasks" yaml:"publicTasks"\` } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ExportedBaseClass.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/MethodNamedProperty.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -11887,216 +12662,238 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type ExportedBaseClass interface { - Success() *bool +type MethodNamedProperty interface { + Elite() *float64 + Property() *string } -// The jsii proxy struct for ExportedBaseClass -type jsiiProxy_ExportedBaseClass struct { +// The jsii proxy struct for MethodNamedProperty +type jsiiProxy_MethodNamedProperty struct { _ byte // padding } -func (j *jsiiProxy_ExportedBaseClass) Success() *bool { - var returns *bool +func (j *jsiiProxy_MethodNamedProperty) Elite() *float64 { + var returns *float64 _jsii_.Get( j, - "success", + "elite", &returns, ) return returns } -func NewExportedBaseClass(success *bool) ExportedBaseClass { +func NewMethodNamedProperty() MethodNamedProperty { _init_.Initialize() - j := jsiiProxy_ExportedBaseClass{} + j := jsiiProxy_MethodNamedProperty{} _jsii_.Create( - "jsii-calc.ExportedBaseClass", - []interface{}{success}, + "jsii-calc.MethodNamedProperty", + nil, // no parameters &j, ) return &j } -func NewExportedBaseClass_Override(e ExportedBaseClass, success *bool) { +func NewMethodNamedProperty_Override(m MethodNamedProperty) { _init_.Initialize() _jsii_.Create( - "jsii-calc.ExportedBaseClass", - []interface{}{success}, - e, + "jsii-calc.MethodNamedProperty", + nil, // no parameters + m, ) } +func (m *jsiiProxy_MethodNamedProperty) Property() *string { + var returns *string -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ExtendsInternalInterface.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - + _jsii_.Invoke( + m, + "property", + nil, // no parameters + &returns, + ) -type ExtendsInternalInterface struct { - Boom *bool \`field:"required" json:"boom" yaml:"boom"\` - Prop *string \`field:"required" json:"prop" yaml:"prop"\` + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ExternalClass.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/Multiply.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" + + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ) -type ExternalClass interface { - MutableProperty() *float64 - SetMutableProperty(val *float64) - ReadonlyProperty() *string - Method() +// The "*" binary operation. +type Multiply interface { + BinaryOperation + IFriendlier + IRandomNumberGenerator + // Left-hand side operand. + Lhs() scopejsiicalclib.NumericValue + // Right-hand side operand. + Rhs() scopejsiicalclib.NumericValue + // The value. + Value() *float64 + // Say farewell. + Farewell() *string + // Say goodbye. + Goodbye() *string + // Say hello! + Hello() *string + // Returns another random number. + Next() *float64 + // String representation of the value. + ToString() *string + // Returns: the name of the class (to verify native type names are created for derived classes). + TypeName() interface{} } -// The jsii proxy struct for ExternalClass -type jsiiProxy_ExternalClass struct { - _ byte // padding +// The jsii proxy struct for Multiply +type jsiiProxy_Multiply struct { + jsiiProxy_BinaryOperation + jsiiProxy_IFriendlier + jsiiProxy_IRandomNumberGenerator } -func (j *jsiiProxy_ExternalClass) MutableProperty() *float64 { - var returns *float64 +func (j *jsiiProxy_Multiply) Lhs() scopejsiicalclib.NumericValue { + var returns scopejsiicalclib.NumericValue _jsii_.Get( j, - "mutableProperty", + "lhs", &returns, ) return returns } -func (j *jsiiProxy_ExternalClass) ReadonlyProperty() *string { - var returns *string +func (j *jsiiProxy_Multiply) Rhs() scopejsiicalclib.NumericValue { + var returns scopejsiicalclib.NumericValue _jsii_.Get( j, - "readonlyProperty", + "rhs", + &returns, + ) + return returns +} + +func (j *jsiiProxy_Multiply) Value() *float64 { + var returns *float64 + _jsii_.Get( + j, + "value", &returns, ) return returns } -func NewExternalClass(readonlyString *string, mutableNumber *float64) ExternalClass { +// Creates a BinaryOperation. +func NewMultiply(lhs scopejsiicalclib.NumericValue, rhs scopejsiicalclib.NumericValue) Multiply { _init_.Initialize() - j := jsiiProxy_ExternalClass{} + j := jsiiProxy_Multiply{} _jsii_.Create( - "jsii-calc.ExternalClass", - []interface{}{readonlyString, mutableNumber}, + "jsii-calc.Multiply", + []interface{}{lhs, rhs}, &j, ) return &j } -func NewExternalClass_Override(e ExternalClass, readonlyString *string, mutableNumber *float64) { +// Creates a BinaryOperation. +func NewMultiply_Override(m Multiply, lhs scopejsiicalclib.NumericValue, rhs scopejsiicalclib.NumericValue) { _init_.Initialize() _jsii_.Create( - "jsii-calc.ExternalClass", - []interface{}{readonlyString, mutableNumber}, - e, + "jsii-calc.Multiply", + []interface{}{lhs, rhs}, + m, ) } -func (j *jsiiProxy_ExternalClass)SetMutableProperty(val *float64) { - _jsii_.Set( - j, - "mutableProperty", - val, - ) -} +func (m *jsiiProxy_Multiply) Farewell() *string { + var returns *string -func (e *jsiiProxy_ExternalClass) Method() { - _jsii_.InvokeVoid( - e, - "method", + _jsii_.Invoke( + m, + "farewell", nil, // no parameters + &returns, ) -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ExternalEnum.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -type ExternalEnum string - -const ( - ExternalEnum_OPTION_A ExternalEnum = "OPTION_A" - ExternalEnum_OPTION_B ExternalEnum = "OPTION_B" -) + return returns +} -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ExternalStruct.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc +func (m *jsiiProxy_Multiply) Goodbye() *string { + var returns *string + _jsii_.Invoke( + m, + "goodbye", + nil, // no parameters + &returns, + ) -type ExternalStruct struct { - ReadonlyProperty *string \`field:"required" json:"readonlyProperty" yaml:"readonlyProperty"\` + return returns } +func (m *jsiiProxy_Multiply) Hello() *string { + var returns *string -`; + _jsii_.Invoke( + m, + "hello", + nil, // no parameters + &returns, + ) -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_FullCombo.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc + return returns +} -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) +func (m *jsiiProxy_Multiply) Next() *float64 { + var returns *float64 -type FullCombo interface { - BaseClass - IIndirectlyImplemented - Property() *string - Method() *float64 -} + _jsii_.Invoke( + m, + "next", + nil, // no parameters + &returns, + ) -// The jsii proxy struct for FullCombo -type jsiiProxy_FullCombo struct { - jsiiProxy_BaseClass - jsiiProxy_IIndirectlyImplemented + return returns } -func (j *jsiiProxy_FullCombo) Property() *string { +func (m *jsiiProxy_Multiply) ToString() *string { var returns *string - _jsii_.Get( - j, - "property", + + _jsii_.Invoke( + m, + "toString", + nil, // no parameters &returns, ) + return returns } - -func (f *jsiiProxy_FullCombo) Method() *float64 { - var returns *float64 +func (m *jsiiProxy_Multiply) TypeName() interface{} { + var returns interface{} _jsii_.Invoke( - f, - "method", + m, + "typeName", nil, // no parameters &returns, ) @@ -12107,7 +12904,13 @@ func (f *jsiiProxy_FullCombo) Method() *float64 { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_GiveMeStructs.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/NOTICE 1`] = ` +jsii +Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/Negate.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -12118,113 +12921,145 @@ import ( "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ) -type GiveMeStructs interface { - StructLiteral() *scopejsiicalclib.StructWithOnlyOptionals - // Accepts a struct of type DerivedStruct and returns a struct of type FirstStruct. - DerivedToFirst(derived *DerivedStruct) *scopejsiicalclib.MyFirstStruct - // Returns the boolean from a DerivedStruct struct. - ReadDerivedNonPrimitive(derived *DerivedStruct) DoubleTrouble - // Returns the "anumber" from a MyFirstStruct struct;. - ReadFirstNumber(first *scopejsiicalclib.MyFirstStruct) *float64 +// The negation operation ("-value"). +type Negate interface { + UnaryOperation + IFriendlier + Operand() scopejsiicalclib.NumericValue + // The value. + Value() *float64 + // Say farewell. + Farewell() *string + // Say goodbye. + Goodbye() *string + // Say hello! + Hello() *string + // String representation of the value. + ToString() *string + // Returns: the name of the class (to verify native type names are created for derived classes). + TypeName() interface{} } -// The jsii proxy struct for GiveMeStructs -type jsiiProxy_GiveMeStructs struct { - _ byte // padding +// The jsii proxy struct for Negate +type jsiiProxy_Negate struct { + jsiiProxy_UnaryOperation + jsiiProxy_IFriendlier } -func (j *jsiiProxy_GiveMeStructs) StructLiteral() *scopejsiicalclib.StructWithOnlyOptionals { - var returns *scopejsiicalclib.StructWithOnlyOptionals +func (j *jsiiProxy_Negate) Operand() scopejsiicalclib.NumericValue { + var returns scopejsiicalclib.NumericValue + _jsii_.Get( + j, + "operand", + &returns, + ) + return returns +} + +func (j *jsiiProxy_Negate) Value() *float64 { + var returns *float64 _jsii_.Get( j, - "structLiteral", + "value", &returns, ) return returns } -func NewGiveMeStructs() GiveMeStructs { +func NewNegate(operand scopejsiicalclib.NumericValue) Negate { _init_.Initialize() - j := jsiiProxy_GiveMeStructs{} + j := jsiiProxy_Negate{} _jsii_.Create( - "jsii-calc.GiveMeStructs", - nil, // no parameters + "jsii-calc.Negate", + []interface{}{operand}, &j, ) return &j } -func NewGiveMeStructs_Override(g GiveMeStructs) { +func NewNegate_Override(n Negate, operand scopejsiicalclib.NumericValue) { _init_.Initialize() _jsii_.Create( - "jsii-calc.GiveMeStructs", - nil, // no parameters - g, + "jsii-calc.Negate", + []interface{}{operand}, + n, ) } -func (g *jsiiProxy_GiveMeStructs) DerivedToFirst(derived *DerivedStruct) *scopejsiicalclib.MyFirstStruct { - var returns *scopejsiicalclib.MyFirstStruct +func (n *jsiiProxy_Negate) Farewell() *string { + var returns *string _jsii_.Invoke( - g, - "derivedToFirst", - []interface{}{derived}, + n, + "farewell", + nil, // no parameters &returns, ) return returns } -func (g *jsiiProxy_GiveMeStructs) ReadDerivedNonPrimitive(derived *DerivedStruct) DoubleTrouble { - var returns DoubleTrouble +func (n *jsiiProxy_Negate) Goodbye() *string { + var returns *string _jsii_.Invoke( - g, - "readDerivedNonPrimitive", - []interface{}{derived}, + n, + "goodbye", + nil, // no parameters &returns, ) return returns } -func (g *jsiiProxy_GiveMeStructs) ReadFirstNumber(first *scopejsiicalclib.MyFirstStruct) *float64 { - var returns *float64 +func (n *jsiiProxy_Negate) Hello() *string { + var returns *string _jsii_.Invoke( - g, - "readFirstNumber", - []interface{}{first}, + n, + "hello", + nil, // no parameters &returns, ) return returns } +func (n *jsiiProxy_Negate) ToString() *string { + var returns *string -`; + _jsii_.Invoke( + n, + "toString", + nil, // no parameters + &returns, + ) -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Greetee.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc + return returns +} +func (n *jsiiProxy_Negate) TypeName() interface{} { + var returns interface{} -// These are some arguments you can pass to a method. -type Greetee struct { - // The name of the greetee. - Name *string \`field:"optional" json:"name" yaml:"name"\` + _jsii_.Invoke( + n, + "typeName", + nil, // no parameters + &returns, + ) + + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_GreetingAugmenter.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/NestedClassInstance.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -12232,130 +13067,134 @@ import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib/customsubmodulename" ) -type GreetingAugmenter interface { - BetterGreeting(friendly scopejsiicalclib.IFriendly) *string +type NestedClassInstance interface { } -// The jsii proxy struct for GreetingAugmenter -type jsiiProxy_GreetingAugmenter struct { +// The jsii proxy struct for NestedClassInstance +type jsiiProxy_NestedClassInstance struct { _ byte // padding } -func NewGreetingAugmenter() GreetingAugmenter { +func NestedClassInstance_MakeInstance() customsubmodulename.NestingClass_NestedClass { _init_.Initialize() - j := jsiiProxy_GreetingAugmenter{} + var returns customsubmodulename.NestingClass_NestedClass - _jsii_.Create( - "jsii-calc.GreetingAugmenter", + _jsii_.StaticInvoke( + "jsii-calc.NestedClassInstance", + "makeInstance", nil, // no parameters - &j, + &returns, ) - return &j + return returns } -func NewGreetingAugmenter_Override(g GreetingAugmenter) { - _init_.Initialize() - _jsii_.Create( - "jsii-calc.GreetingAugmenter", - nil, // no parameters - g, - ) -} +`; -func (g *jsiiProxy_GreetingAugmenter) BetterGreeting(friendly scopejsiicalclib.IFriendly) *string { - var returns *string +exports[`Generated code for "jsii-calc": /go/jsiicalc/NestedStruct.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc - _jsii_.Invoke( - g, - "betterGreeting", - []interface{}{friendly}, - &returns, - ) - return returns +type NestedStruct struct { + // When provided, must be > 0. + NumberProp *float64 \`field:"required" json:"numberProp" yaml:"numberProp"\` } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IAnonymousImplementationProvider.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/NodeStandardLibrary.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// We can return an anonymous interface implementation from an override without losing the interface declarations. -type IAnonymousImplementationProvider interface { - ProvideAsClass() Implementation - ProvideAsInterface() IAnonymouslyImplementMe +// Test fixture to verify that jsii modules can use the node standard library. +type NodeStandardLibrary interface { + // Returns the current os.platform() from the "os" node module. + OsPlatform() *string + // Uses node.js "crypto" module to calculate sha256 of a string. + // + // Returns: "6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50". + CryptoSha256() *string + // Reads a local resource file (resource.txt) asynchronously. + // + // Returns: "Hello, resource!" + FsReadFile() *string + // Sync version of fsReadFile. + // + // Returns: "Hello, resource! SYNC!" + FsReadFileSync() *string } -// The jsii proxy for IAnonymousImplementationProvider -type jsiiProxy_IAnonymousImplementationProvider struct { +// The jsii proxy struct for NodeStandardLibrary +type jsiiProxy_NodeStandardLibrary struct { _ byte // padding } -func (i *jsiiProxy_IAnonymousImplementationProvider) ProvideAsClass() Implementation { - var returns Implementation - - _jsii_.Invoke( - i, - "provideAsClass", - nil, // no parameters +func (j *jsiiProxy_NodeStandardLibrary) OsPlatform() *string { + var returns *string + _jsii_.Get( + j, + "osPlatform", &returns, ) - return returns } -func (i *jsiiProxy_IAnonymousImplementationProvider) ProvideAsInterface() IAnonymouslyImplementMe { - var returns IAnonymouslyImplementMe - _jsii_.Invoke( - i, - "provideAsInterface", +func NewNodeStandardLibrary() NodeStandardLibrary { + _init_.Initialize() + + j := jsiiProxy_NodeStandardLibrary{} + + _jsii_.Create( + "jsii-calc.NodeStandardLibrary", nil, // no parameters - &returns, + &j, ) - return returns + return &j } +func NewNodeStandardLibrary_Override(n NodeStandardLibrary) { + _init_.Initialize() -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IAnonymouslyImplementMe.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc + _jsii_.Create( + "jsii-calc.NodeStandardLibrary", + nil, // no parameters + n, + ) +} -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) +func (n *jsiiProxy_NodeStandardLibrary) CryptoSha256() *string { + var returns *string -type IAnonymouslyImplementMe interface { - Verb() *string - Value() *float64 -} + _jsii_.Invoke( + n, + "cryptoSha256", + nil, // no parameters + &returns, + ) -// The jsii proxy for IAnonymouslyImplementMe -type jsiiProxy_IAnonymouslyImplementMe struct { - _ byte // padding + return returns } -func (i *jsiiProxy_IAnonymouslyImplementMe) Verb() *string { +func (n *jsiiProxy_NodeStandardLibrary) FsReadFile() *string { var returns *string _jsii_.Invoke( - i, - "verb", + n, + "fsReadFile", nil, // no parameters &returns, ) @@ -12363,1922 +13202,1814 @@ func (i *jsiiProxy_IAnonymouslyImplementMe) Verb() *string { return returns } -func (j *jsiiProxy_IAnonymouslyImplementMe) Value() *float64 { - var returns *float64 - _jsii_.Get( - j, - "value", +func (n *jsiiProxy_NodeStandardLibrary) FsReadFileSync() *string { + var returns *string + + _jsii_.Invoke( + n, + "fsReadFileSync", + nil, // no parameters &returns, ) + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IAnotherPublicInterface.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/NullShouldBeTreatedAsUndefined.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type IAnotherPublicInterface interface { - A() *string - SetA(a *string) +// jsii#282, aws-cdk#157: null should be treated as "undefined". +type NullShouldBeTreatedAsUndefined interface { + ChangeMeToUndefined() *string + SetChangeMeToUndefined(val *string) + GiveMeUndefined(value interface{}) + GiveMeUndefinedInsideAnObject(input *NullShouldBeTreatedAsUndefinedData) + VerifyPropertyIsUndefined() } -// The jsii proxy for IAnotherPublicInterface -type jsiiProxy_IAnotherPublicInterface struct { +// The jsii proxy struct for NullShouldBeTreatedAsUndefined +type jsiiProxy_NullShouldBeTreatedAsUndefined struct { _ byte // padding } -func (j *jsiiProxy_IAnotherPublicInterface) A() *string { +func (j *jsiiProxy_NullShouldBeTreatedAsUndefined) ChangeMeToUndefined() *string { var returns *string _jsii_.Get( j, - "a", + "changeMeToUndefined", &returns, ) return returns } -func (j *jsiiProxy_IAnotherPublicInterface)SetA(val *string) { - _jsii_.Set( - j, - "a", - val, - ) -} - -`; +func NewNullShouldBeTreatedAsUndefined(_param1 *string, optional interface{}) NullShouldBeTreatedAsUndefined { + _init_.Initialize() -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IBell.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc + j := jsiiProxy_NullShouldBeTreatedAsUndefined{} -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) + _jsii_.Create( + "jsii-calc.NullShouldBeTreatedAsUndefined", + []interface{}{_param1, optional}, + &j, + ) -type IBell interface { - Ring() + return &j } -// The jsii proxy for IBell -type jsiiProxy_IBell struct { - _ byte // padding -} +func NewNullShouldBeTreatedAsUndefined_Override(n NullShouldBeTreatedAsUndefined, _param1 *string, optional interface{}) { + _init_.Initialize() -func (i *jsiiProxy_IBell) Ring() { - _jsii_.InvokeVoid( - i, - "ring", - nil, // no parameters + _jsii_.Create( + "jsii-calc.NullShouldBeTreatedAsUndefined", + []interface{}{_param1, optional}, + n, ) } +func (j *jsiiProxy_NullShouldBeTreatedAsUndefined)SetChangeMeToUndefined(val *string) { + _jsii_.Set( + j, + "changeMeToUndefined", + val, + ) +} -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IBellRinger.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -// Takes the object parameter as an interface. -type IBellRinger interface { - YourTurn(bell IBell) +func (n *jsiiProxy_NullShouldBeTreatedAsUndefined) GiveMeUndefined(value interface{}) { + _jsii_.InvokeVoid( + n, + "giveMeUndefined", + []interface{}{value}, + ) } -// The jsii proxy for IBellRinger -type jsiiProxy_IBellRinger struct { - _ byte // padding +func (n *jsiiProxy_NullShouldBeTreatedAsUndefined) GiveMeUndefinedInsideAnObject(input *NullShouldBeTreatedAsUndefinedData) { + _jsii_.InvokeVoid( + n, + "giveMeUndefinedInsideAnObject", + []interface{}{input}, + ) } -func (i *jsiiProxy_IBellRinger) YourTurn(bell IBell) { +func (n *jsiiProxy_NullShouldBeTreatedAsUndefined) VerifyPropertyIsUndefined() { _jsii_.InvokeVoid( - i, - "yourTurn", - []interface{}{bell}, + n, + "verifyPropertyIsUndefined", + nil, // no parameters ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IConcreteBellRinger.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/NullShouldBeTreatedAsUndefinedData.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -// Takes the object parameter as a calss. -type IConcreteBellRinger interface { - YourTurn(bell Bell) -} - -// The jsii proxy for IConcreteBellRinger -type jsiiProxy_IConcreteBellRinger struct { - _ byte // padding -} -func (i *jsiiProxy_IConcreteBellRinger) YourTurn(bell Bell) { - _jsii_.InvokeVoid( - i, - "yourTurn", - []interface{}{bell}, - ) +type NullShouldBeTreatedAsUndefinedData struct { + ArrayWithThreeElementsAndUndefinedAsSecondArgument *[]interface{} \`field:"required" json:"arrayWithThreeElementsAndUndefinedAsSecondArgument" yaml:"arrayWithThreeElementsAndUndefinedAsSecondArgument"\` + ThisShouldBeUndefined interface{} \`field:"optional" json:"thisShouldBeUndefined" yaml:"thisShouldBeUndefined"\` } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IDeprecatedInterface.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/NumberGenerator.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// Deprecated: useless interface. -type IDeprecatedInterface interface { - // Deprecated: services no purpose. - Method() - // Deprecated: could be better. - MutableProperty() *float64 - // Deprecated: could be better. - SetMutableProperty(m *float64) +// This allows us to test that a reference can be stored for objects that implement interfaces. +type NumberGenerator interface { + Generator() IRandomNumberGenerator + SetGenerator(val IRandomNumberGenerator) + IsSameGenerator(gen IRandomNumberGenerator) *bool + NextTimes100() *float64 } -// The jsii proxy for IDeprecatedInterface -type jsiiProxy_IDeprecatedInterface struct { +// The jsii proxy struct for NumberGenerator +type jsiiProxy_NumberGenerator struct { _ byte // padding } -func (i *jsiiProxy_IDeprecatedInterface) Method() { - _jsii_.InvokeVoid( - i, - "method", - nil, // no parameters - ) -} - -func (j *jsiiProxy_IDeprecatedInterface) MutableProperty() *float64 { - var returns *float64 +func (j *jsiiProxy_NumberGenerator) Generator() IRandomNumberGenerator { + var returns IRandomNumberGenerator _jsii_.Get( j, - "mutableProperty", + "generator", &returns, ) return returns } -func (j *jsiiProxy_IDeprecatedInterface)SetMutableProperty(val *float64) { - _jsii_.Set( - j, - "mutableProperty", - val, - ) -} - -`; +func NewNumberGenerator(generator IRandomNumberGenerator) NumberGenerator { + _init_.Initialize() -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IExperimentalInterface.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc + j := jsiiProxy_NumberGenerator{} -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) + _jsii_.Create( + "jsii-calc.NumberGenerator", + []interface{}{generator}, + &j, + ) -// Experimental. -type IExperimentalInterface interface { - // Experimental. - Method() - // Experimental. - MutableProperty() *float64 - // Experimental. - SetMutableProperty(m *float64) + return &j } -// The jsii proxy for IExperimentalInterface -type jsiiProxy_IExperimentalInterface struct { - _ byte // padding -} +func NewNumberGenerator_Override(n NumberGenerator, generator IRandomNumberGenerator) { + _init_.Initialize() -func (i *jsiiProxy_IExperimentalInterface) Method() { - _jsii_.InvokeVoid( - i, - "method", - nil, // no parameters + _jsii_.Create( + "jsii-calc.NumberGenerator", + []interface{}{generator}, + n, ) } -func (j *jsiiProxy_IExperimentalInterface) MutableProperty() *float64 { - var returns *float64 - _jsii_.Get( +func (j *jsiiProxy_NumberGenerator)SetGenerator(val IRandomNumberGenerator) { + _jsii_.Set( j, - "mutableProperty", + "generator", + val, + ) +} + +func (n *jsiiProxy_NumberGenerator) IsSameGenerator(gen IRandomNumberGenerator) *bool { + var returns *bool + + _jsii_.Invoke( + n, + "isSameGenerator", + []interface{}{gen}, &returns, ) + return returns } -func (j *jsiiProxy_IExperimentalInterface)SetMutableProperty(val *float64) { - _jsii_.Set( - j, - "mutableProperty", - val, +func (n *jsiiProxy_NumberGenerator) NextTimes100() *float64 { + var returns *float64 + + _jsii_.Invoke( + n, + "nextTimes100", + nil, // no parameters + &returns, ) + + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IExtendsPrivateInterface.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/ObjectRefsInCollections.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" + + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ) -type IExtendsPrivateInterface interface { - MoreThings() *[]*string - Private() *string - SetPrivate(p *string) +// Verify that object references can be passed inside collections. +type ObjectRefsInCollections interface { + // Returns the sum of all values. + SumFromArray(values *[]scopejsiicalclib.NumericValue) *float64 + // Returns the sum of all values in a map. + SumFromMap(values *map[string]scopejsiicalclib.NumericValue) *float64 } -// The jsii proxy for IExtendsPrivateInterface -type jsiiProxy_IExtendsPrivateInterface struct { +// The jsii proxy struct for ObjectRefsInCollections +type jsiiProxy_ObjectRefsInCollections struct { _ byte // padding } -func (j *jsiiProxy_IExtendsPrivateInterface) MoreThings() *[]*string { - var returns *[]*string - _jsii_.Get( - j, - "moreThings", - &returns, +func NewObjectRefsInCollections() ObjectRefsInCollections { + _init_.Initialize() + + j := jsiiProxy_ObjectRefsInCollections{} + + _jsii_.Create( + "jsii-calc.ObjectRefsInCollections", + nil, // no parameters + &j, ) - return returns + + return &j } -func (j *jsiiProxy_IExtendsPrivateInterface) Private() *string { - var returns *string - _jsii_.Get( - j, - "private", +func NewObjectRefsInCollections_Override(o ObjectRefsInCollections) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.ObjectRefsInCollections", + nil, // no parameters + o, + ) +} + +func (o *jsiiProxy_ObjectRefsInCollections) SumFromArray(values *[]scopejsiicalclib.NumericValue) *float64 { + var returns *float64 + + _jsii_.Invoke( + o, + "sumFromArray", + []interface{}{values}, &returns, ) + return returns } -func (j *jsiiProxy_IExtendsPrivateInterface)SetPrivate(val *string) { - _jsii_.Set( - j, - "private", - val, +func (o *jsiiProxy_ObjectRefsInCollections) SumFromMap(values *map[string]scopejsiicalclib.NumericValue) *float64 { + var returns *float64 + + _jsii_.Invoke( + o, + "sumFromMap", + []interface{}{values}, + &returns, ) + + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IExternalInterface.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/ObjectWithPropertyProvider.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type IExternalInterface interface { - Method() - MutableProperty() *float64 - SetMutableProperty(m *float64) +type ObjectWithPropertyProvider interface { } -// The jsii proxy for IExternalInterface -type jsiiProxy_IExternalInterface struct { +// The jsii proxy struct for ObjectWithPropertyProvider +type jsiiProxy_ObjectWithPropertyProvider struct { _ byte // padding } -func (i *jsiiProxy_IExternalInterface) Method() { - _jsii_.InvokeVoid( - i, - "method", - nil, // no parameters - ) -} +func ObjectWithPropertyProvider_Provide() IObjectWithProperty { + _init_.Initialize() -func (j *jsiiProxy_IExternalInterface) MutableProperty() *float64 { - var returns *float64 - _jsii_.Get( - j, - "mutableProperty", + var returns IObjectWithProperty + + _jsii_.StaticInvoke( + "jsii-calc.ObjectWithPropertyProvider", + "provide", + nil, // no parameters &returns, ) - return returns -} -func (j *jsiiProxy_IExternalInterface)SetMutableProperty(val *float64) { - _jsii_.Set( - j, - "mutableProperty", - val, - ) + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IFriendlier.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/Old.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" - - "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/internal" - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// Even friendlier classes can implement this interface. -type IFriendlier interface { - scopejsiicalclib.IFriendly - // Say farewell. - Farewell() *string - // Say goodbye. - // - // Returns: A goodbye blessing. - Goodbye() *string +// Old class. +// Deprecated: Use the new class or the old class whatever you want because +// whatever you like is always the best. +type Old interface { + // Doo wop that thing. + // Deprecated: Use the new class or the old class whatever you want because + // whatever you like is always the best. + DoAThing() } -// The jsii proxy for IFriendlier -type jsiiProxy_IFriendlier struct { - internal.Type__scopejsiicalclibIFriendly +// The jsii proxy struct for Old +type jsiiProxy_Old struct { + _ byte // padding } -func (i *jsiiProxy_IFriendlier) Farewell() *string { - var returns *string +// Deprecated: Use the new class or the old class whatever you want because +// whatever you like is always the best. +func NewOld() Old { + _init_.Initialize() - _jsii_.Invoke( - i, - "farewell", + j := jsiiProxy_Old{} + + _jsii_.Create( + "jsii-calc.Old", nil, // no parameters - &returns, + &j, ) - return returns + return &j } -func (i *jsiiProxy_IFriendlier) Goodbye() *string { - var returns *string +// Deprecated: Use the new class or the old class whatever you want because +// whatever you like is always the best. +func NewOld_Override(o Old) { + _init_.Initialize() - _jsii_.Invoke( - i, - "goodbye", + _jsii_.Create( + "jsii-calc.Old", nil, // no parameters - &returns, + o, ) +} - return returns +func (o *jsiiProxy_Old) DoAThing() { + _jsii_.InvokeVoid( + o, + "doAThing", + nil, // no parameters + ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IFriendlyRandomGenerator.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/OptionalArgumentInvoker.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" - - "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/internal" - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type IFriendlyRandomGenerator interface { - scopejsiicalclib.IFriendly - IRandomNumberGenerator +type OptionalArgumentInvoker interface { + InvokeWithOptional() + InvokeWithoutOptional() } -// The jsii proxy for IFriendlyRandomGenerator -type jsiiProxy_IFriendlyRandomGenerator struct { - internal.Type__scopejsiicalclibIFriendly - jsiiProxy_IRandomNumberGenerator +// The jsii proxy struct for OptionalArgumentInvoker +type jsiiProxy_OptionalArgumentInvoker struct { + _ byte // padding } -func (i *jsiiProxy_IFriendlyRandomGenerator) Hello() *string { - var returns *string +func NewOptionalArgumentInvoker(delegate IInterfaceWithOptionalMethodArguments) OptionalArgumentInvoker { + _init_.Initialize() - _jsii_.Invoke( - i, - "hello", - nil, // no parameters - &returns, + j := jsiiProxy_OptionalArgumentInvoker{} + + _jsii_.Create( + "jsii-calc.OptionalArgumentInvoker", + []interface{}{delegate}, + &j, ) - return returns + return &j } -func (i *jsiiProxy_IFriendlyRandomGenerator) Next() *float64 { - var returns *float64 +func NewOptionalArgumentInvoker_Override(o OptionalArgumentInvoker, delegate IInterfaceWithOptionalMethodArguments) { + _init_.Initialize() - _jsii_.Invoke( - i, - "next", + _jsii_.Create( + "jsii-calc.OptionalArgumentInvoker", + []interface{}{delegate}, + o, + ) +} + +func (o *jsiiProxy_OptionalArgumentInvoker) InvokeWithOptional() { + _jsii_.InvokeVoid( + o, + "invokeWithOptional", nil, // no parameters - &returns, ) +} - return returns +func (o *jsiiProxy_OptionalArgumentInvoker) InvokeWithoutOptional() { + _jsii_.InvokeVoid( + o, + "invokeWithoutOptional", + nil, // no parameters + ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IIndirectlyImplemented.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/OptionalConstructorArgument.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( + "time" + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type IIndirectlyImplemented interface { - Method() *float64 - Property() *string +type OptionalConstructorArgument interface { + Arg1() *float64 + Arg2() *string + Arg3() *time.Time } -// The jsii proxy for IIndirectlyImplemented -type jsiiProxy_IIndirectlyImplemented struct { +// The jsii proxy struct for OptionalConstructorArgument +type jsiiProxy_OptionalConstructorArgument struct { _ byte // padding } -func (i *jsiiProxy_IIndirectlyImplemented) Method() *float64 { +func (j *jsiiProxy_OptionalConstructorArgument) Arg1() *float64 { var returns *float64 - - _jsii_.Invoke( - i, - "method", - nil, // no parameters + _jsii_.Get( + j, + "arg1", &returns, ) - return returns } -func (j *jsiiProxy_IIndirectlyImplemented) Property() *string { +func (j *jsiiProxy_OptionalConstructorArgument) Arg2() *string { var returns *string _jsii_.Get( j, - "property", + "arg2", &returns, ) return returns } - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IInterfaceImplementedByAbstractClass.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -// awslabs/jsii#220 Abstract return type. -type IInterfaceImplementedByAbstractClass interface { - PropFromInterface() *string -} - -// The jsii proxy for IInterfaceImplementedByAbstractClass -type jsiiProxy_IInterfaceImplementedByAbstractClass struct { - _ byte // padding -} - -func (j *jsiiProxy_IInterfaceImplementedByAbstractClass) PropFromInterface() *string { - var returns *string +func (j *jsiiProxy_OptionalConstructorArgument) Arg3() *time.Time { + var returns *time.Time _jsii_.Get( j, - "propFromInterface", + "arg3", &returns, ) return returns } -`; +func NewOptionalConstructorArgument(arg1 *float64, arg2 *string, arg3 *time.Time) OptionalConstructorArgument { + _init_.Initialize() -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IInterfaceThatShouldNotBeADataType.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc + j := jsiiProxy_OptionalConstructorArgument{} -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) + _jsii_.Create( + "jsii-calc.OptionalConstructorArgument", + []interface{}{arg1, arg2, arg3}, + &j, + ) -// Even though this interface has only properties, it is disqualified from being a datatype because it inherits from an interface that is not a datatype. -type IInterfaceThatShouldNotBeADataType interface { - IInterfaceWithMethods - OtherValue() *string + return &j } -// The jsii proxy for IInterfaceThatShouldNotBeADataType -type jsiiProxy_IInterfaceThatShouldNotBeADataType struct { - jsiiProxy_IInterfaceWithMethods -} +func NewOptionalConstructorArgument_Override(o OptionalConstructorArgument, arg1 *float64, arg2 *string, arg3 *time.Time) { + _init_.Initialize() -func (j *jsiiProxy_IInterfaceThatShouldNotBeADataType) OtherValue() *string { - var returns *string - _jsii_.Get( - j, - "otherValue", - &returns, + _jsii_.Create( + "jsii-calc.OptionalConstructorArgument", + []interface{}{arg1, arg2, arg3}, + o, ) - return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IInterfaceWithInternal.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/OptionalStruct.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -type IInterfaceWithInternal interface { - Visible() -} - -// The jsii proxy for IInterfaceWithInternal -type jsiiProxy_IInterfaceWithInternal struct { - _ byte // padding -} -func (i *jsiiProxy_IInterfaceWithInternal) Visible() { - _jsii_.InvokeVoid( - i, - "visible", - nil, // no parameters - ) +type OptionalStruct struct { + Field *string \`field:"optional" json:"field" yaml:"field"\` } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IInterfaceWithMethods.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/OptionalStructConsumer.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type IInterfaceWithMethods interface { - DoThings() - Value() *string +type OptionalStructConsumer interface { + FieldValue() *string + ParameterWasUndefined() *bool } -// The jsii proxy for IInterfaceWithMethods -type jsiiProxy_IInterfaceWithMethods struct { +// The jsii proxy struct for OptionalStructConsumer +type jsiiProxy_OptionalStructConsumer struct { _ byte // padding } -func (i *jsiiProxy_IInterfaceWithMethods) DoThings() { - _jsii_.InvokeVoid( - i, - "doThings", - nil, // no parameters +func (j *jsiiProxy_OptionalStructConsumer) FieldValue() *string { + var returns *string + _jsii_.Get( + j, + "fieldValue", + &returns, ) + return returns } -func (j *jsiiProxy_IInterfaceWithMethods) Value() *string { - var returns *string +func (j *jsiiProxy_OptionalStructConsumer) ParameterWasUndefined() *bool { + var returns *bool _jsii_.Get( j, - "value", + "parameterWasUndefined", &returns, ) return returns } -`; +func NewOptionalStructConsumer(optionalStruct *OptionalStruct) OptionalStructConsumer { + _init_.Initialize() -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IInterfaceWithOptionalMethodArguments.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc + j := jsiiProxy_OptionalStructConsumer{} -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) + _jsii_.Create( + "jsii-calc.OptionalStructConsumer", + []interface{}{optionalStruct}, + &j, + ) -// awslabs/jsii#175 Interface proxies (and builders) do not respect optional arguments in methods. -type IInterfaceWithOptionalMethodArguments interface { - Hello(arg1 *string, arg2 *float64) + return &j } -// The jsii proxy for IInterfaceWithOptionalMethodArguments -type jsiiProxy_IInterfaceWithOptionalMethodArguments struct { - _ byte // padding -} +func NewOptionalStructConsumer_Override(o OptionalStructConsumer, optionalStruct *OptionalStruct) { + _init_.Initialize() -func (i *jsiiProxy_IInterfaceWithOptionalMethodArguments) Hello(arg1 *string, arg2 *float64) { - _jsii_.InvokeVoid( - i, - "hello", - []interface{}{arg1, arg2}, + _jsii_.Create( + "jsii-calc.OptionalStructConsumer", + []interface{}{optionalStruct}, + o, ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IInterfaceWithProperties.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/OverridableProtectedMember.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type IInterfaceWithProperties interface { - ReadOnlyString() *string - ReadWriteString() *string - SetReadWriteString(r *string) +// See: https://github.com/aws/jsii/issues/903 +// +type OverridableProtectedMember interface { + OverrideReadOnly() *string + OverrideReadWrite() *string + SetOverrideReadWrite(val *string) + OverrideMe() *string + SwitchModes() + ValueFromProtected() *string } -// The jsii proxy for IInterfaceWithProperties -type jsiiProxy_IInterfaceWithProperties struct { +// The jsii proxy struct for OverridableProtectedMember +type jsiiProxy_OverridableProtectedMember struct { _ byte // padding } -func (j *jsiiProxy_IInterfaceWithProperties) ReadOnlyString() *string { +func (j *jsiiProxy_OverridableProtectedMember) OverrideReadOnly() *string { var returns *string _jsii_.Get( j, - "readOnlyString", + "overrideReadOnly", &returns, ) return returns } -func (j *jsiiProxy_IInterfaceWithProperties) ReadWriteString() *string { +func (j *jsiiProxy_OverridableProtectedMember) OverrideReadWrite() *string { var returns *string _jsii_.Get( j, - "readWriteString", + "overrideReadWrite", &returns, ) return returns } -func (j *jsiiProxy_IInterfaceWithProperties)SetReadWriteString(val *string) { - _jsii_.Set( - j, - "readWriteString", - val, - ) -} - -`; +func NewOverridableProtectedMember() OverridableProtectedMember { + _init_.Initialize() -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IInterfaceWithPropertiesExtension.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc + j := jsiiProxy_OverridableProtectedMember{} -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) + _jsii_.Create( + "jsii-calc.OverridableProtectedMember", + nil, // no parameters + &j, + ) -type IInterfaceWithPropertiesExtension interface { - IInterfaceWithProperties - Foo() *float64 - SetFoo(f *float64) + return &j } -// The jsii proxy for IInterfaceWithPropertiesExtension -type jsiiProxy_IInterfaceWithPropertiesExtension struct { - jsiiProxy_IInterfaceWithProperties +func NewOverridableProtectedMember_Override(o OverridableProtectedMember) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.OverridableProtectedMember", + nil, // no parameters + o, + ) } -func (j *jsiiProxy_IInterfaceWithPropertiesExtension) Foo() *float64 { - var returns *float64 - _jsii_.Get( +func (j *jsiiProxy_OverridableProtectedMember)SetOverrideReadWrite(val *string) { + _jsii_.Set( j, - "foo", + "overrideReadWrite", + val, + ) +} + +func (o *jsiiProxy_OverridableProtectedMember) OverrideMe() *string { + var returns *string + + _jsii_.Invoke( + o, + "overrideMe", + nil, // no parameters &returns, ) + return returns } -func (j *jsiiProxy_IInterfaceWithPropertiesExtension)SetFoo(val *float64) { - _jsii_.Set( - j, - "foo", - val, +func (o *jsiiProxy_OverridableProtectedMember) SwitchModes() { + _jsii_.InvokeVoid( + o, + "switchModes", + nil, // no parameters + ) +} + +func (o *jsiiProxy_OverridableProtectedMember) ValueFromProtected() *string { + var returns *string + + _jsii_.Invoke( + o, + "valueFromProtected", + nil, // no parameters + &returns, ) + + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IJSII417Derived.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/OverrideReturnsObject.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type IJSII417Derived interface { - IJSII417PublicBaseOfBase - Bar() - Baz() - Property() *string +type OverrideReturnsObject interface { + Test(obj IReturnsNumber) *float64 } -// The jsii proxy for IJSII417Derived -type jsiiProxy_IJSII417Derived struct { - jsiiProxy_IJSII417PublicBaseOfBase +// The jsii proxy struct for OverrideReturnsObject +type jsiiProxy_OverrideReturnsObject struct { + _ byte // padding } -func (i *jsiiProxy_IJSII417Derived) Bar() { - _jsii_.InvokeVoid( - i, - "bar", +func NewOverrideReturnsObject() OverrideReturnsObject { + _init_.Initialize() + + j := jsiiProxy_OverrideReturnsObject{} + + _jsii_.Create( + "jsii-calc.OverrideReturnsObject", nil, // no parameters + &j, ) + + return &j } -func (i *jsiiProxy_IJSII417Derived) Baz() { - _jsii_.InvokeVoid( - i, - "baz", +func NewOverrideReturnsObject_Override(o OverrideReturnsObject) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.OverrideReturnsObject", nil, // no parameters + o, ) } -func (j *jsiiProxy_IJSII417Derived) Property() *string { - var returns *string - _jsii_.Get( - j, - "property", +func (o *jsiiProxy_OverrideReturnsObject) Test(obj IReturnsNumber) *float64 { + var returns *float64 + + _jsii_.Invoke( + o, + "test", + []interface{}{obj}, &returns, ) + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IJSII417PublicBaseOfBase.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/ParamShadowsBuiltins.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type IJSII417PublicBaseOfBase interface { - Foo() - HasRoot() *bool +// Validate that parameters named "str" or "builtins" do not shadow the actual type names in Python. +type ParamShadowsBuiltins interface { } -// The jsii proxy for IJSII417PublicBaseOfBase -type jsiiProxy_IJSII417PublicBaseOfBase struct { +// The jsii proxy struct for ParamShadowsBuiltins +type jsiiProxy_ParamShadowsBuiltins struct { _ byte // padding } -func (i *jsiiProxy_IJSII417PublicBaseOfBase) Foo() { - _jsii_.InvokeVoid( - i, - "foo", - nil, // no parameters +func NewParamShadowsBuiltins(builtins *string, str *string, props *ParamShadowsBuiltinsProps) ParamShadowsBuiltins { + _init_.Initialize() + + j := jsiiProxy_ParamShadowsBuiltins{} + + _jsii_.Create( + "jsii-calc.ParamShadowsBuiltins", + []interface{}{builtins, str, props}, + &j, ) + + return &j } -func (j *jsiiProxy_IJSII417PublicBaseOfBase) HasRoot() *bool { - var returns *bool - _jsii_.Get( - j, - "hasRoot", - &returns, +func NewParamShadowsBuiltins_Override(p ParamShadowsBuiltins, builtins *string, str *string, props *ParamShadowsBuiltinsProps) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.ParamShadowsBuiltins", + []interface{}{builtins, str, props}, + p, ) - return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IJavaReservedWordsInAnInterface.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/ParamShadowsBuiltinsProps.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + + +type ParamShadowsBuiltinsProps struct { + BooleanProperty *bool \`field:"required" json:"booleanProperty" yaml:"booleanProperty"\` + StringProperty *string \`field:"required" json:"stringProperty" yaml:"stringProperty"\` + StructProperty *StructA \`field:"required" json:"structProperty" yaml:"structProperty"\` +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ParamShadowsScope.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" + + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ) -type IJavaReservedWordsInAnInterface interface { - Abstract() - Assert() - Boolean() - Break() - Byte() - Case() - Catch() - Char() - Class() - Const() - Continue() - Default() - Do() - Double() - Else() - Enum() - Extends() - False() - Final() - Finally() - Float() - For() - Goto() - If() - Implements() - Import() - Instanceof() - Int() - Interface() - Long() - Native() - Null() - Package() - Private() - Protected() - Public() - Return() - Short() - Static() - Strictfp() - Super() - Switch() - Synchronized() - This() - Throw() - Throws() - Transient() - True() - Try() - Void() - Volatile() - While() *string +// Validate that namespaces being shadowed by local variables does not cause type checking issues. +// See: https://github.com/aws/aws-cdk/issues/22975 +// +type ParamShadowsScope interface { + UseScope(scope scopejsiicalclib.Number) scopejsiicalclib.Number } -// The jsii proxy for IJavaReservedWordsInAnInterface -type jsiiProxy_IJavaReservedWordsInAnInterface struct { +// The jsii proxy struct for ParamShadowsScope +type jsiiProxy_ParamShadowsScope struct { _ byte // padding } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Abstract() { - _jsii_.InvokeVoid( - i, - "abstract", - nil, // no parameters - ) -} +func NewParamShadowsScope() ParamShadowsScope { + _init_.Initialize() -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Assert() { - _jsii_.InvokeVoid( - i, - "assert", - nil, // no parameters - ) -} + j := jsiiProxy_ParamShadowsScope{} -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Boolean() { - _jsii_.InvokeVoid( - i, - "boolean", + _jsii_.Create( + "jsii-calc.ParamShadowsScope", nil, // no parameters + &j, ) -} -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Break() { - _jsii_.InvokeVoid( - i, - "break", - nil, // no parameters - ) + return &j } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Byte() { - _jsii_.InvokeVoid( - i, - "byte", - nil, // no parameters - ) -} +func NewParamShadowsScope_Override(p ParamShadowsScope) { + _init_.Initialize() -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Case() { - _jsii_.InvokeVoid( - i, - "case", + _jsii_.Create( + "jsii-calc.ParamShadowsScope", nil, // no parameters + p, ) } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Catch() { - _jsii_.InvokeVoid( - i, - "catch", - nil, // no parameters - ) -} +func (p *jsiiProxy_ParamShadowsScope) UseScope(scope scopejsiicalclib.Number) scopejsiicalclib.Number { + var returns scopejsiicalclib.Number -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Char() { - _jsii_.InvokeVoid( - i, - "char", - nil, // no parameters + _jsii_.Invoke( + p, + "useScope", + []interface{}{scope}, + &returns, ) -} -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Class() { - _jsii_.InvokeVoid( - i, - "class", - nil, // no parameters - ) + return returns } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Const() { - _jsii_.InvokeVoid( - i, - "const", - nil, // no parameters - ) -} -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Continue() { - _jsii_.InvokeVoid( - i, - "continue", - nil, // no parameters - ) -} +`; -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Default() { - _jsii_.InvokeVoid( - i, - "default", - nil, // no parameters - ) -} +exports[`Generated code for "jsii-calc": /go/jsiicalc/ParentStruct982.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Do() { - _jsii_.InvokeVoid( - i, - "do", - nil, // no parameters - ) -} -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Double() { - _jsii_.InvokeVoid( - i, - "double", - nil, // no parameters - ) +// https://github.com/aws/jsii/issues/982. +type ParentStruct982 struct { + Foo *string \`field:"required" json:"foo" yaml:"foo"\` } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Else() { - _jsii_.InvokeVoid( - i, - "else", - nil, // no parameters - ) -} -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Enum() { - _jsii_.InvokeVoid( - i, - "enum", - nil, // no parameters - ) -} +`; -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Extends() { - _jsii_.InvokeVoid( - i, - "extends", - nil, // no parameters - ) -} +exports[`Generated code for "jsii-calc": /go/jsiicalc/PartiallyInitializedThisConsumer.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) False() { - _jsii_.InvokeVoid( - i, - "false", - nil, // no parameters - ) -} +import ( + "time" -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Final() { - _jsii_.InvokeVoid( - i, - "final", - nil, // no parameters - ) -} + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Finally() { - _jsii_.InvokeVoid( - i, - "finally", - nil, // no parameters - ) +type PartiallyInitializedThisConsumer interface { + ConsumePartiallyInitializedThis(obj ConstructorPassesThisOut, dt *time.Time, ev AllTypesEnum) *string } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Float() { - _jsii_.InvokeVoid( - i, - "float", - nil, // no parameters - ) +// The jsii proxy struct for PartiallyInitializedThisConsumer +type jsiiProxy_PartiallyInitializedThisConsumer struct { + _ byte // padding } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) For() { - _jsii_.InvokeVoid( - i, - "for", - nil, // no parameters - ) -} +func NewPartiallyInitializedThisConsumer_Override(p PartiallyInitializedThisConsumer) { + _init_.Initialize() -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Goto() { - _jsii_.InvokeVoid( - i, - "goto", + _jsii_.Create( + "jsii-calc.PartiallyInitializedThisConsumer", nil, // no parameters + p, ) } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) If() { - _jsii_.InvokeVoid( - i, - "if", - nil, // no parameters - ) -} +func (p *jsiiProxy_PartiallyInitializedThisConsumer) ConsumePartiallyInitializedThis(obj ConstructorPassesThisOut, dt *time.Time, ev AllTypesEnum) *string { + var returns *string -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Implements() { - _jsii_.InvokeVoid( - i, - "implements", - nil, // no parameters + _jsii_.Invoke( + p, + "consumePartiallyInitializedThis", + []interface{}{obj, dt, ev}, + &returns, ) -} -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Import() { - _jsii_.InvokeVoid( - i, - "import", - nil, // no parameters - ) + return returns } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Instanceof() { - _jsii_.InvokeVoid( - i, - "instanceof", - nil, // no parameters - ) -} -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Int() { - _jsii_.InvokeVoid( - i, - "int", - nil, // no parameters - ) -} +`; -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Interface() { - _jsii_.InvokeVoid( - i, - "interface", - nil, // no parameters - ) -} +exports[`Generated code for "jsii-calc": /go/jsiicalc/Polymorphism.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Long() { - _jsii_.InvokeVoid( - i, - "long", - nil, // no parameters - ) -} +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Native() { - _jsii_.InvokeVoid( - i, - "native", - nil, // no parameters - ) -} + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" +) -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Null() { - _jsii_.InvokeVoid( - i, - "null", - nil, // no parameters - ) +type Polymorphism interface { + SayHello(friendly scopejsiicalclib.IFriendly) *string } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Package() { - _jsii_.InvokeVoid( - i, - "package", - nil, // no parameters - ) +// The jsii proxy struct for Polymorphism +type jsiiProxy_Polymorphism struct { + _ byte // padding } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Private() { - _jsii_.InvokeVoid( - i, - "private", - nil, // no parameters - ) -} +func NewPolymorphism() Polymorphism { + _init_.Initialize() -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Protected() { - _jsii_.InvokeVoid( - i, - "protected", + j := jsiiProxy_Polymorphism{} + + _jsii_.Create( + "jsii-calc.Polymorphism", nil, // no parameters + &j, ) + + return &j } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Public() { - _jsii_.InvokeVoid( - i, - "public", +func NewPolymorphism_Override(p Polymorphism) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.Polymorphism", nil, // no parameters + p, ) } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Return() { - _jsii_.InvokeVoid( - i, - "return", - nil, // no parameters +func (p *jsiiProxy_Polymorphism) SayHello(friendly scopejsiicalclib.IFriendly) *string { + var returns *string + + _jsii_.Invoke( + p, + "sayHello", + []interface{}{friendly}, + &returns, ) + + return returns } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Short() { - _jsii_.InvokeVoid( - i, - "short", - nil, // no parameters - ) + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/Power.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" + + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/composition" + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/internal" + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" +) + +// The power operation. +type Power interface { + composition.CompositeOperation + // The base of the power. + Base() scopejsiicalclib.NumericValue + // A set of postfixes to include in a decorated .toString(). + DecorationPostfixes() *[]*string + SetDecorationPostfixes(val *[]*string) + // A set of prefixes to include in a decorated .toString(). + DecorationPrefixes() *[]*string + SetDecorationPrefixes(val *[]*string) + // The expression that this operation consists of. + // + // Must be implemented by derived classes. + Expression() scopejsiicalclib.NumericValue + // The number of times to multiply. + Pow() scopejsiicalclib.NumericValue + // The .toString() style. + StringStyle() composition.CompositeOperation_CompositionStringStyle + SetStringStyle(val composition.CompositeOperation_CompositionStringStyle) + // The value. + Value() *float64 + // String representation of the value. + ToString() *string + // Returns: the name of the class (to verify native type names are created for derived classes). + TypeName() interface{} } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Static() { - _jsii_.InvokeVoid( - i, - "static", - nil, // no parameters - ) +// The jsii proxy struct for Power +type jsiiProxy_Power struct { + internal.Type__compositionCompositeOperation } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Strictfp() { - _jsii_.InvokeVoid( - i, - "strictfp", - nil, // no parameters +func (j *jsiiProxy_Power) Base() scopejsiicalclib.NumericValue { + var returns scopejsiicalclib.NumericValue + _jsii_.Get( + j, + "base", + &returns, ) + return returns } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Super() { - _jsii_.InvokeVoid( - i, - "super", - nil, // no parameters +func (j *jsiiProxy_Power) DecorationPostfixes() *[]*string { + var returns *[]*string + _jsii_.Get( + j, + "decorationPostfixes", + &returns, ) + return returns } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Switch() { - _jsii_.InvokeVoid( - i, - "switch", - nil, // no parameters +func (j *jsiiProxy_Power) DecorationPrefixes() *[]*string { + var returns *[]*string + _jsii_.Get( + j, + "decorationPrefixes", + &returns, ) + return returns } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Synchronized() { - _jsii_.InvokeVoid( - i, - "synchronized", - nil, // no parameters +func (j *jsiiProxy_Power) Expression() scopejsiicalclib.NumericValue { + var returns scopejsiicalclib.NumericValue + _jsii_.Get( + j, + "expression", + &returns, ) + return returns } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) This() { - _jsii_.InvokeVoid( - i, - "this", - nil, // no parameters +func (j *jsiiProxy_Power) Pow() scopejsiicalclib.NumericValue { + var returns scopejsiicalclib.NumericValue + _jsii_.Get( + j, + "pow", + &returns, ) + return returns } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Throw() { - _jsii_.InvokeVoid( - i, - "throw", - nil, // no parameters +func (j *jsiiProxy_Power) StringStyle() composition.CompositeOperation_CompositionStringStyle { + var returns composition.CompositeOperation_CompositionStringStyle + _jsii_.Get( + j, + "stringStyle", + &returns, ) + return returns } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Throws() { - _jsii_.InvokeVoid( - i, - "throws", - nil, // no parameters +func (j *jsiiProxy_Power) Value() *float64 { + var returns *float64 + _jsii_.Get( + j, + "value", + &returns, ) + return returns } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Transient() { - _jsii_.InvokeVoid( - i, - "transient", - nil, // no parameters + +// Creates a Power operation. +func NewPower(base scopejsiicalclib.NumericValue, pow scopejsiicalclib.NumericValue) Power { + _init_.Initialize() + + j := jsiiProxy_Power{} + + _jsii_.Create( + "jsii-calc.Power", + []interface{}{base, pow}, + &j, ) + + return &j } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) True() { - _jsii_.InvokeVoid( - i, - "true", - nil, // no parameters +// Creates a Power operation. +func NewPower_Override(p Power, base scopejsiicalclib.NumericValue, pow scopejsiicalclib.NumericValue) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.Power", + []interface{}{base, pow}, + p, ) } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Try() { - _jsii_.InvokeVoid( - i, - "try", - nil, // no parameters +func (j *jsiiProxy_Power)SetDecorationPostfixes(val *[]*string) { + _jsii_.Set( + j, + "decorationPostfixes", + val, ) } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Void() { - _jsii_.InvokeVoid( - i, - "void", - nil, // no parameters +func (j *jsiiProxy_Power)SetDecorationPrefixes(val *[]*string) { + _jsii_.Set( + j, + "decorationPrefixes", + val, ) } -func (i *jsiiProxy_IJavaReservedWordsInAnInterface) Volatile() { - _jsii_.InvokeVoid( - i, - "volatile", - nil, // no parameters +func (j *jsiiProxy_Power)SetStringStyle(val composition.CompositeOperation_CompositionStringStyle) { + _jsii_.Set( + j, + "stringStyle", + val, ) } -func (j *jsiiProxy_IJavaReservedWordsInAnInterface) While() *string { +func (p *jsiiProxy_Power) ToString() *string { var returns *string - _jsii_.Get( - j, - "while", + + _jsii_.Invoke( + p, + "toString", + nil, // no parameters &returns, ) + return returns } +func (p *jsiiProxy_Power) TypeName() interface{} { + var returns interface{} -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IJsii487External.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -type IJsii487External interface { -} + _jsii_.Invoke( + p, + "typeName", + nil, // no parameters + &returns, + ) -// The jsii proxy for IJsii487External -type jsiiProxy_IJsii487External struct { - _ byte // padding + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IJsii487External2.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/PromiseNothing.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) -type IJsii487External2 interface { +type PromiseNothing interface { + InstancePromiseIt() } -// The jsii proxy for IJsii487External2 -type jsiiProxy_IJsii487External2 struct { +// The jsii proxy struct for PromiseNothing +type jsiiProxy_PromiseNothing struct { _ byte // padding } +func NewPromiseNothing() PromiseNothing { + _init_.Initialize() -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IJsii496.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - + j := jsiiProxy_PromiseNothing{} -type IJsii496 interface { -} + _jsii_.Create( + "jsii-calc.PromiseNothing", + nil, // no parameters + &j, + ) -// The jsii proxy for IJsii496 -type jsiiProxy_IJsii496 struct { - _ byte // padding + return &j } +func NewPromiseNothing_Override(p PromiseNothing) { + _init_.Initialize() -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IMutableObjectLiteral.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -type IMutableObjectLiteral interface { - Value() *string - SetValue(v *string) + _jsii_.Create( + "jsii-calc.PromiseNothing", + nil, // no parameters + p, + ) } -// The jsii proxy for IMutableObjectLiteral -type jsiiProxy_IMutableObjectLiteral struct { - _ byte // padding -} +func PromiseNothing_PromiseIt() { + _init_.Initialize() -func (j *jsiiProxy_IMutableObjectLiteral) Value() *string { - var returns *string - _jsii_.Get( - j, - "value", - &returns, + _jsii_.StaticInvokeVoid( + "jsii-calc.PromiseNothing", + "promiseIt", + nil, // no parameters ) - return returns } -func (j *jsiiProxy_IMutableObjectLiteral)SetValue(val *string) { - _jsii_.Set( - j, - "value", - val, +func (p *jsiiProxy_PromiseNothing) InstancePromiseIt() { + _jsii_.InvokeVoid( + p, + "instancePromiseIt", + nil, // no parameters ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_INonInternalInterface.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/PropertyNamedProperty.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type INonInternalInterface interface { - IAnotherPublicInterface - B() *string - SetB(b *string) - C() *string - SetC(c *string) +// Reproduction for https://github.com/aws/jsii/issues/1113 Where a method or property named "property" would result in impossible to load Python code. +type PropertyNamedProperty interface { + Property() *string + YetAnoterOne() *bool } -// The jsii proxy for INonInternalInterface -type jsiiProxy_INonInternalInterface struct { - jsiiProxy_IAnotherPublicInterface +// The jsii proxy struct for PropertyNamedProperty +type jsiiProxy_PropertyNamedProperty struct { + _ byte // padding } -func (j *jsiiProxy_INonInternalInterface) B() *string { +func (j *jsiiProxy_PropertyNamedProperty) Property() *string { var returns *string _jsii_.Get( j, - "b", + "property", &returns, ) return returns } -func (j *jsiiProxy_INonInternalInterface)SetB(val *string) { - _jsii_.Set( - j, - "b", - val, - ) -} - -func (j *jsiiProxy_INonInternalInterface) C() *string { - var returns *string +func (j *jsiiProxy_PropertyNamedProperty) YetAnoterOne() *bool { + var returns *bool _jsii_.Get( j, - "c", + "yetAnoterOne", &returns, ) return returns } -func (j *jsiiProxy_INonInternalInterface)SetC(val *string) { - _jsii_.Set( - j, - "c", - val, + +func NewPropertyNamedProperty() PropertyNamedProperty { + _init_.Initialize() + + j := jsiiProxy_PropertyNamedProperty{} + + _jsii_.Create( + "jsii-calc.PropertyNamedProperty", + nil, // no parameters + &j, + ) + + return &j +} + +func NewPropertyNamedProperty_Override(p PropertyNamedProperty) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.PropertyNamedProperty", + nil, // no parameters + p, ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IObjectWithProperty.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/PublicClass.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// Make sure that setters are properly called on objects with interfaces. -type IObjectWithProperty interface { - WasSet() *bool - Property() *string - SetProperty(p *string) +type PublicClass interface { + Hello() } -// The jsii proxy for IObjectWithProperty -type jsiiProxy_IObjectWithProperty struct { +// The jsii proxy struct for PublicClass +type jsiiProxy_PublicClass struct { _ byte // padding } -func (i *jsiiProxy_IObjectWithProperty) WasSet() *bool { - var returns *bool +func NewPublicClass() PublicClass { + _init_.Initialize() - _jsii_.Invoke( - i, - "wasSet", + j := jsiiProxy_PublicClass{} + + _jsii_.Create( + "jsii-calc.PublicClass", nil, // no parameters - &returns, + &j, ) - return returns + return &j } -func (j *jsiiProxy_IObjectWithProperty) Property() *string { - var returns *string - _jsii_.Get( - j, - "property", - &returns, +func NewPublicClass_Override(p PublicClass) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.PublicClass", + nil, // no parameters + p, ) - return returns } -func (j *jsiiProxy_IObjectWithProperty)SetProperty(val *string) { - _jsii_.Set( - j, - "property", - val, +func (p *jsiiProxy_PublicClass) Hello() { + _jsii_.InvokeVoid( + p, + "hello", + nil, // no parameters ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IOptionalMethod.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/PythonReservedWords.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// Checks that optional result from interface method code generates correctly. -type IOptionalMethod interface { - Optional() *string +type PythonReservedWords interface { + And() + As() + Assert() + Async() + Await() + Break() + Class() + Continue() + Def() + Del() + Elif() + Else() + Except() + Finally() + For() + From() + Global() + If() + Import() + In() + Is() + Lambda() + Nonlocal() + Not() + Or() + Pass() + Raise() + Return() + Try() + While() + With() + Yield() } -// The jsii proxy for IOptionalMethod -type jsiiProxy_IOptionalMethod struct { +// The jsii proxy struct for PythonReservedWords +type jsiiProxy_PythonReservedWords struct { _ byte // padding } -func (i *jsiiProxy_IOptionalMethod) Optional() *string { - var returns *string +func NewPythonReservedWords() PythonReservedWords { + _init_.Initialize() - _jsii_.Invoke( - i, - "optional", + j := jsiiProxy_PythonReservedWords{} + + _jsii_.Create( + "jsii-calc.PythonReservedWords", nil, // no parameters - &returns, + &j, ) - return returns + return &j } +func NewPythonReservedWords_Override(p PythonReservedWords) { + _init_.Initialize() -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IPrivatelyImplemented.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc + _jsii_.Create( + "jsii-calc.PythonReservedWords", + nil, // no parameters + p, + ) +} -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) +func (p *jsiiProxy_PythonReservedWords) And() { + _jsii_.InvokeVoid( + p, + "and", + nil, // no parameters + ) +} -type IPrivatelyImplemented interface { - Success() *bool +func (p *jsiiProxy_PythonReservedWords) As() { + _jsii_.InvokeVoid( + p, + "as", + nil, // no parameters + ) } -// The jsii proxy for IPrivatelyImplemented -type jsiiProxy_IPrivatelyImplemented struct { - _ byte // padding +func (p *jsiiProxy_PythonReservedWords) Assert() { + _jsii_.InvokeVoid( + p, + "assert", + nil, // no parameters + ) } -func (j *jsiiProxy_IPrivatelyImplemented) Success() *bool { - var returns *bool - _jsii_.Get( - j, - "success", - &returns, +func (p *jsiiProxy_PythonReservedWords) Async() { + _jsii_.InvokeVoid( + p, + "async", + nil, // no parameters ) - return returns } +func (p *jsiiProxy_PythonReservedWords) Await() { + _jsii_.InvokeVoid( + p, + "await", + nil, // no parameters + ) +} -`; +func (p *jsiiProxy_PythonReservedWords) Break() { + _jsii_.InvokeVoid( + p, + "break", + nil, // no parameters + ) +} -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IPublicInterface.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc +func (p *jsiiProxy_PythonReservedWords) Class() { + _jsii_.InvokeVoid( + p, + "class", + nil, // no parameters + ) +} -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) +func (p *jsiiProxy_PythonReservedWords) Continue() { + _jsii_.InvokeVoid( + p, + "continue", + nil, // no parameters + ) +} -type IPublicInterface interface { - Bye() *string +func (p *jsiiProxy_PythonReservedWords) Def() { + _jsii_.InvokeVoid( + p, + "def", + nil, // no parameters + ) } -// The jsii proxy for IPublicInterface -type jsiiProxy_IPublicInterface struct { - _ byte // padding +func (p *jsiiProxy_PythonReservedWords) Del() { + _jsii_.InvokeVoid( + p, + "del", + nil, // no parameters + ) } -func (i *jsiiProxy_IPublicInterface) Bye() *string { - var returns *string - - _jsii_.Invoke( - i, - "bye", +func (p *jsiiProxy_PythonReservedWords) Elif() { + _jsii_.InvokeVoid( + p, + "elif", nil, // no parameters - &returns, ) - - return returns } - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IPublicInterface2.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -type IPublicInterface2 interface { - Ciao() *string +func (p *jsiiProxy_PythonReservedWords) Else() { + _jsii_.InvokeVoid( + p, + "else", + nil, // no parameters + ) } -// The jsii proxy for IPublicInterface2 -type jsiiProxy_IPublicInterface2 struct { - _ byte // padding +func (p *jsiiProxy_PythonReservedWords) Except() { + _jsii_.InvokeVoid( + p, + "except", + nil, // no parameters + ) } -func (i *jsiiProxy_IPublicInterface2) Ciao() *string { - var returns *string - - _jsii_.Invoke( - i, - "ciao", +func (p *jsiiProxy_PythonReservedWords) Finally() { + _jsii_.InvokeVoid( + p, + "finally", nil, // no parameters - &returns, ) - - return returns } - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IRandomNumberGenerator.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -// Generates random numbers. -type IRandomNumberGenerator interface { - // Returns another random number. - // - // Returns: A random number. - Next() *float64 +func (p *jsiiProxy_PythonReservedWords) For() { + _jsii_.InvokeVoid( + p, + "for", + nil, // no parameters + ) } -// The jsii proxy for IRandomNumberGenerator -type jsiiProxy_IRandomNumberGenerator struct { - _ byte // padding +func (p *jsiiProxy_PythonReservedWords) From() { + _jsii_.InvokeVoid( + p, + "from", + nil, // no parameters + ) } -func (i *jsiiProxy_IRandomNumberGenerator) Next() *float64 { - var returns *float64 - - _jsii_.Invoke( - i, - "next", +func (p *jsiiProxy_PythonReservedWords) Global() { + _jsii_.InvokeVoid( + p, + "global", nil, // no parameters - &returns, ) - - return returns } - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IReturnJsii976.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -// Returns a subclass of a known class which implements an interface. -type IReturnJsii976 interface { - Foo() *float64 +func (p *jsiiProxy_PythonReservedWords) If() { + _jsii_.InvokeVoid( + p, + "if", + nil, // no parameters + ) } -// The jsii proxy for IReturnJsii976 -type jsiiProxy_IReturnJsii976 struct { - _ byte // padding +func (p *jsiiProxy_PythonReservedWords) Import() { + _jsii_.InvokeVoid( + p, + "import", + nil, // no parameters + ) } -func (j *jsiiProxy_IReturnJsii976) Foo() *float64 { - var returns *float64 - _jsii_.Get( - j, - "foo", - &returns, +func (p *jsiiProxy_PythonReservedWords) In() { + _jsii_.InvokeVoid( + p, + "in", + nil, // no parameters ) - return returns } - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IReturnsNumber.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" -) - -type IReturnsNumber interface { - ObtainNumber() scopejsiicalclib.IDoublable - NumberProp() scopejsiicalclib.Number +func (p *jsiiProxy_PythonReservedWords) Is() { + _jsii_.InvokeVoid( + p, + "is", + nil, // no parameters + ) } -// The jsii proxy for IReturnsNumber -type jsiiProxy_IReturnsNumber struct { - _ byte // padding +func (p *jsiiProxy_PythonReservedWords) Lambda() { + _jsii_.InvokeVoid( + p, + "lambda", + nil, // no parameters + ) } -func (i *jsiiProxy_IReturnsNumber) ObtainNumber() scopejsiicalclib.IDoublable { - var returns scopejsiicalclib.IDoublable - - _jsii_.Invoke( - i, - "obtainNumber", +func (p *jsiiProxy_PythonReservedWords) Nonlocal() { + _jsii_.InvokeVoid( + p, + "nonlocal", nil, // no parameters - &returns, ) - - return returns } -func (j *jsiiProxy_IReturnsNumber) NumberProp() scopejsiicalclib.Number { - var returns scopejsiicalclib.Number - _jsii_.Get( - j, - "numberProp", - &returns, +func (p *jsiiProxy_PythonReservedWords) Not() { + _jsii_.InvokeVoid( + p, + "not", + nil, // no parameters ) - return returns } - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IStableInterface.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -type IStableInterface interface { - Method() - MutableProperty() *float64 - SetMutableProperty(m *float64) +func (p *jsiiProxy_PythonReservedWords) Or() { + _jsii_.InvokeVoid( + p, + "or", + nil, // no parameters + ) } -// The jsii proxy for IStableInterface -type jsiiProxy_IStableInterface struct { - _ byte // padding +func (p *jsiiProxy_PythonReservedWords) Pass() { + _jsii_.InvokeVoid( + p, + "pass", + nil, // no parameters + ) } -func (i *jsiiProxy_IStableInterface) Method() { +func (p *jsiiProxy_PythonReservedWords) Raise() { _jsii_.InvokeVoid( - i, - "method", + p, + "raise", nil, // no parameters ) } -func (j *jsiiProxy_IStableInterface) MutableProperty() *float64 { - var returns *float64 - _jsii_.Get( - j, - "mutableProperty", - &returns, +func (p *jsiiProxy_PythonReservedWords) Return() { + _jsii_.InvokeVoid( + p, + "return", + nil, // no parameters ) - return returns } -func (j *jsiiProxy_IStableInterface)SetMutableProperty(val *float64) { - _jsii_.Set( - j, - "mutableProperty", - val, +func (p *jsiiProxy_PythonReservedWords) Try() { + _jsii_.InvokeVoid( + p, + "try", + nil, // no parameters ) } - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IStructReturningDelegate.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -// Verifies that a "pure" implementation of an interface works correctly. -type IStructReturningDelegate interface { - ReturnStruct() *StructB +func (p *jsiiProxy_PythonReservedWords) While() { + _jsii_.InvokeVoid( + p, + "while", + nil, // no parameters + ) } -// The jsii proxy for IStructReturningDelegate -type jsiiProxy_IStructReturningDelegate struct { - _ byte // padding +func (p *jsiiProxy_PythonReservedWords) With() { + _jsii_.InvokeVoid( + p, + "with", + nil, // no parameters + ) } -func (i *jsiiProxy_IStructReturningDelegate) ReturnStruct() *StructB { - var returns *StructB - - _jsii_.Invoke( - i, - "returnStruct", +func (p *jsiiProxy_PythonReservedWords) Yield() { + _jsii_.InvokeVoid( + p, + "yield", nil, // no parameters - &returns, ) - - return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_IWallClock.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc +exports[`Generated code for "jsii-calc": /go/jsiicalc/README.md 1`] = ` +# jsii Calculator -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) +This library is used to demonstrate and test the features of JSII -// Implement this interface. -type IWallClock interface { - // Returns the current time, formatted as an ISO-8601 string. - Iso8601Now() *string -} +## How to use running sum API: -// The jsii proxy for IWallClock -type jsiiProxy_IWallClock struct { - _ byte // padding -} +First, create a calculator: -func (i *jsiiProxy_IWallClock) Iso8601Now() *string { - var returns *string +\`\`\`go +calculator := calc.NewCalculator() +\`\`\` - _jsii_.Invoke( - i, - "iso8601Now", - nil, // no parameters - &returns, - ) +Then call some operations: - return returns -} +\`\`\`go +calculator.Add(jsii.Number(10)) +\`\`\` + +## Code Samples +\`\`\`go +/* This is totes a magic comment in here, just you wait! */ +foo := "bar" +\`\`\` `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ImplementInternalInterface.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/ReferenceEnumFromScopedPackage.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" + + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ) -type ImplementInternalInterface interface { - Prop() *string - SetProp(val *string) +// See awslabs/jsii#138. +type ReferenceEnumFromScopedPackage interface { + Foo() scopejsiicalclib.EnumFromScopedModule + SetFoo(val scopejsiicalclib.EnumFromScopedModule) + LoadFoo() scopejsiicalclib.EnumFromScopedModule + SaveFoo(value scopejsiicalclib.EnumFromScopedModule) } -// The jsii proxy struct for ImplementInternalInterface -type jsiiProxy_ImplementInternalInterface struct { +// The jsii proxy struct for ReferenceEnumFromScopedPackage +type jsiiProxy_ReferenceEnumFromScopedPackage struct { _ byte // padding } -func (j *jsiiProxy_ImplementInternalInterface) Prop() *string { - var returns *string +func (j *jsiiProxy_ReferenceEnumFromScopedPackage) Foo() scopejsiicalclib.EnumFromScopedModule { + var returns scopejsiicalclib.EnumFromScopedModule _jsii_.Get( j, - "prop", + "foo", &returns, ) return returns } -func NewImplementInternalInterface() ImplementInternalInterface { +func NewReferenceEnumFromScopedPackage() ReferenceEnumFromScopedPackage { _init_.Initialize() - j := jsiiProxy_ImplementInternalInterface{} + j := jsiiProxy_ReferenceEnumFromScopedPackage{} _jsii_.Create( - "jsii-calc.ImplementInternalInterface", + "jsii-calc.ReferenceEnumFromScopedPackage", nil, // no parameters &j, ) @@ -14286,28 +15017,49 @@ func NewImplementInternalInterface() ImplementInternalInterface { return &j } -func NewImplementInternalInterface_Override(i ImplementInternalInterface) { +func NewReferenceEnumFromScopedPackage_Override(r ReferenceEnumFromScopedPackage) { _init_.Initialize() _jsii_.Create( - "jsii-calc.ImplementInternalInterface", + "jsii-calc.ReferenceEnumFromScopedPackage", nil, // no parameters - i, + r, ) } -func (j *jsiiProxy_ImplementInternalInterface)SetProp(val *string) { +func (j *jsiiProxy_ReferenceEnumFromScopedPackage)SetFoo(val scopejsiicalclib.EnumFromScopedModule) { _jsii_.Set( j, - "prop", + "foo", val, ) } +func (r *jsiiProxy_ReferenceEnumFromScopedPackage) LoadFoo() scopejsiicalclib.EnumFromScopedModule { + var returns scopejsiicalclib.EnumFromScopedModule + + _jsii_.Invoke( + r, + "loadFoo", + nil, // no parameters + &returns, + ) + + return returns +} + +func (r *jsiiProxy_ReferenceEnumFromScopedPackage) SaveFoo(value scopejsiicalclib.EnumFromScopedModule) { + _jsii_.InvokeVoid( + r, + "saveFoo", + []interface{}{value}, + ) +} + `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Implementation.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/ReturnsPrivateImplementationOfInterface.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -14316,33 +15068,38 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type Implementation interface { - Value() *float64 +// Helps ensure the JSII kernel & runtime cooperate correctly when an un-exported instance of a class is returned with a declared type that is an exported interface, and the instance inherits from an exported class. +// +// Returns: an instance of an un-exported class that extends \`ExportedBaseClass\`, declared as \`IPrivatelyImplemented\`. +// See: https://github.com/aws/jsii/issues/320 +// +type ReturnsPrivateImplementationOfInterface interface { + PrivateImplementation() IPrivatelyImplemented } -// The jsii proxy struct for Implementation -type jsiiProxy_Implementation struct { +// The jsii proxy struct for ReturnsPrivateImplementationOfInterface +type jsiiProxy_ReturnsPrivateImplementationOfInterface struct { _ byte // padding } -func (j *jsiiProxy_Implementation) Value() *float64 { - var returns *float64 +func (j *jsiiProxy_ReturnsPrivateImplementationOfInterface) PrivateImplementation() IPrivatelyImplemented { + var returns IPrivatelyImplemented _jsii_.Get( j, - "value", + "privateImplementation", &returns, ) return returns } -func NewImplementation() Implementation { +func NewReturnsPrivateImplementationOfInterface() ReturnsPrivateImplementationOfInterface { _init_.Initialize() - j := jsiiProxy_Implementation{} + j := jsiiProxy_ReturnsPrivateImplementationOfInterface{} _jsii_.Create( - "jsii-calc.Implementation", + "jsii-calc.ReturnsPrivateImplementationOfInterface", nil, // no parameters &j, ) @@ -14350,74 +15107,38 @@ func NewImplementation() Implementation { return &j } -func NewImplementation_Override(i Implementation) { +func NewReturnsPrivateImplementationOfInterface_Override(r ReturnsPrivateImplementationOfInterface) { _init_.Initialize() _jsii_.Create( - "jsii-calc.Implementation", + "jsii-calc.ReturnsPrivateImplementationOfInterface", nil, // no parameters - i, + r, ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ImplementsInterfaceWithInternal.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/RootStruct.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -type ImplementsInterfaceWithInternal interface { - IInterfaceWithInternal - Visible() -} - -// The jsii proxy struct for ImplementsInterfaceWithInternal -type jsiiProxy_ImplementsInterfaceWithInternal struct { - jsiiProxy_IInterfaceWithInternal -} - -func NewImplementsInterfaceWithInternal() ImplementsInterfaceWithInternal { - _init_.Initialize() - - j := jsiiProxy_ImplementsInterfaceWithInternal{} - - _jsii_.Create( - "jsii-calc.ImplementsInterfaceWithInternal", - nil, // no parameters - &j, - ) - - return &j -} - -func NewImplementsInterfaceWithInternal_Override(i ImplementsInterfaceWithInternal) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.ImplementsInterfaceWithInternal", - nil, // no parameters - i, - ) -} -func (i *jsiiProxy_ImplementsInterfaceWithInternal) Visible() { - _jsii_.InvokeVoid( - i, - "visible", - nil, // no parameters - ) +// This is here to check that we can pass a nested struct into a kwargs by specifying it as an in-line dictionary. +// +// This is cheating with the (current) declared types, but this is the "more +// idiomatic" way for Pythonists. +type RootStruct struct { + // May not be empty. + StringProp *string \`field:"required" json:"stringProp" yaml:"stringProp"\` + NestedStruct *NestedStruct \`field:"optional" json:"nestedStruct" yaml:"nestedStruct"\` } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ImplementsInterfaceWithInternalSubclass.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/RootStructValidator.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -14426,88 +15147,57 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type ImplementsInterfaceWithInternalSubclass interface { - ImplementsInterfaceWithInternal - Visible() -} - -// The jsii proxy struct for ImplementsInterfaceWithInternalSubclass -type jsiiProxy_ImplementsInterfaceWithInternalSubclass struct { - jsiiProxy_ImplementsInterfaceWithInternal +type RootStructValidator interface { } -func NewImplementsInterfaceWithInternalSubclass() ImplementsInterfaceWithInternalSubclass { - _init_.Initialize() - - j := jsiiProxy_ImplementsInterfaceWithInternalSubclass{} - - _jsii_.Create( - "jsii-calc.ImplementsInterfaceWithInternalSubclass", - nil, // no parameters - &j, - ) - - return &j +// The jsii proxy struct for RootStructValidator +type jsiiProxy_RootStructValidator struct { + _ byte // padding } -func NewImplementsInterfaceWithInternalSubclass_Override(i ImplementsInterfaceWithInternalSubclass) { +func RootStructValidator_Validate(struct_ *RootStruct) { _init_.Initialize() - _jsii_.Create( - "jsii-calc.ImplementsInterfaceWithInternalSubclass", - nil, // no parameters - i, - ) -} - -func (i *jsiiProxy_ImplementsInterfaceWithInternalSubclass) Visible() { - _jsii_.InvokeVoid( - i, - "visible", - nil, // no parameters + _jsii_.StaticInvokeVoid( + "jsii-calc.RootStructValidator", + "validate", + []interface{}{struct_}, ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ImplementsPrivateInterface.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/RuntimeTypeChecking.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( + "time" + _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type ImplementsPrivateInterface interface { - Private() *string - SetPrivate(val *string) +type RuntimeTypeChecking interface { + MethodWithDefaultedArguments(arg1 *float64, arg2 *string, arg3 *time.Time) + MethodWithOptionalAnyArgument(arg interface{}) + // Used to verify verification of number of method arguments. + MethodWithOptionalArguments(arg1 *float64, arg2 *string, arg3 *time.Time) } -// The jsii proxy struct for ImplementsPrivateInterface -type jsiiProxy_ImplementsPrivateInterface struct { +// The jsii proxy struct for RuntimeTypeChecking +type jsiiProxy_RuntimeTypeChecking struct { _ byte // padding } -func (j *jsiiProxy_ImplementsPrivateInterface) Private() *string { - var returns *string - _jsii_.Get( - j, - "private", - &returns, - ) - return returns -} - - -func NewImplementsPrivateInterface() ImplementsPrivateInterface { +func NewRuntimeTypeChecking() RuntimeTypeChecking { _init_.Initialize() - j := jsiiProxy_ImplementsPrivateInterface{} + j := jsiiProxy_RuntimeTypeChecking{} _jsii_.Create( - "jsii-calc.ImplementsPrivateInterface", + "jsii-calc.RuntimeTypeChecking", nil, // no parameters &j, ) @@ -14515,47 +15205,59 @@ func NewImplementsPrivateInterface() ImplementsPrivateInterface { return &j } -func NewImplementsPrivateInterface_Override(i ImplementsPrivateInterface) { +func NewRuntimeTypeChecking_Override(r RuntimeTypeChecking) { _init_.Initialize() _jsii_.Create( - "jsii-calc.ImplementsPrivateInterface", + "jsii-calc.RuntimeTypeChecking", nil, // no parameters - i, + r, ) } -func (j *jsiiProxy_ImplementsPrivateInterface)SetPrivate(val *string) { - _jsii_.Set( - j, - "private", - val, +func (r *jsiiProxy_RuntimeTypeChecking) MethodWithDefaultedArguments(arg1 *float64, arg2 *string, arg3 *time.Time) { + _jsii_.InvokeVoid( + r, + "methodWithDefaultedArguments", + []interface{}{arg1, arg2, arg3}, + ) +} + +func (r *jsiiProxy_RuntimeTypeChecking) MethodWithOptionalAnyArgument(arg interface{}) { + _jsii_.InvokeVoid( + r, + "methodWithOptionalAnyArgument", + []interface{}{arg}, + ) +} + +func (r *jsiiProxy_RuntimeTypeChecking) MethodWithOptionalArguments(arg1 *float64, arg2 *string, arg3 *time.Time) { + _jsii_.InvokeVoid( + r, + "methodWithOptionalArguments", + []interface{}{arg1, arg2, arg3}, ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ImplictBaseOfBase.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/SecondLevelStruct.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc -import ( - "time" - - "github.com/aws/jsii/jsii-calc/go/scopejsiicalcbaseofbase/v2" -) -type ImplictBaseOfBase struct { - Foo scopejsiicalcbaseofbase.Very \`field:"required" json:"foo" yaml:"foo"\` - Bar *string \`field:"required" json:"bar" yaml:"bar"\` - Goo *time.Time \`field:"required" json:"goo" yaml:"goo"\` +type SecondLevelStruct struct { + // It's long and required. + DeeperRequiredProp *string \`field:"required" json:"deeperRequiredProp" yaml:"deeperRequiredProp"\` + // It's long, but you'll almost never pass it. + DeeperOptionalProp *string \`field:"optional" json:"deeperOptionalProp" yaml:"deeperOptionalProp"\` } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_InbetweenClass.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/SingleInstanceTwoTypes.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -14564,26 +15266,28 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type InbetweenClass interface { - PublicClass - IPublicInterface2 - Ciao() *string - Hello() +// Test that a single instance can be returned under two different FQNs. +// +// JSII clients can instantiate 2 different strongly-typed wrappers for the same +// object. Unfortunately, this will break object equality, but if we didn't do +// this it would break runtime type checks in the JVM or CLR. +type SingleInstanceTwoTypes interface { + Interface1() InbetweenClass + Interface2() IPublicInterface } -// The jsii proxy struct for InbetweenClass -type jsiiProxy_InbetweenClass struct { - jsiiProxy_PublicClass - jsiiProxy_IPublicInterface2 +// The jsii proxy struct for SingleInstanceTwoTypes +type jsiiProxy_SingleInstanceTwoTypes struct { + _ byte // padding } -func NewInbetweenClass() InbetweenClass { +func NewSingleInstanceTwoTypes() SingleInstanceTwoTypes { _init_.Initialize() - j := jsiiProxy_InbetweenClass{} + j := jsiiProxy_SingleInstanceTwoTypes{} _jsii_.Create( - "jsii-calc.InbetweenClass", + "jsii-calc.SingleInstanceTwoTypes", nil, // no parameters &j, ) @@ -14591,22 +15295,22 @@ func NewInbetweenClass() InbetweenClass { return &j } -func NewInbetweenClass_Override(i InbetweenClass) { +func NewSingleInstanceTwoTypes_Override(s SingleInstanceTwoTypes) { _init_.Initialize() _jsii_.Create( - "jsii-calc.InbetweenClass", + "jsii-calc.SingleInstanceTwoTypes", nil, // no parameters - i, + s, ) } -func (i *jsiiProxy_InbetweenClass) Ciao() *string { - var returns *string +func (s *jsiiProxy_SingleInstanceTwoTypes) Interface1() InbetweenClass { + var returns InbetweenClass _jsii_.Invoke( - i, - "ciao", + s, + "interface1", nil, // no parameters &returns, ) @@ -14614,129 +15318,101 @@ func (i *jsiiProxy_InbetweenClass) Ciao() *string { return returns } -func (i *jsiiProxy_InbetweenClass) Hello() { - _jsii_.InvokeVoid( - i, - "hello", +func (s *jsiiProxy_SingleInstanceTwoTypes) Interface2() IPublicInterface { + var returns IPublicInterface + + _jsii_.Invoke( + s, + "interface2", nil, // no parameters + &returns, ) + + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_InterfaceCollections.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/SingletonInt.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// Verifies that collections of interfaces or structs are correctly handled. +// Verifies that singleton enums are handled correctly. // -// See: https://github.com/aws/jsii/issues/1196 -type InterfaceCollections interface { +// https://github.com/aws/jsii/issues/231 +type SingletonInt interface { + IsSingletonInt(value *float64) *bool } -// The jsii proxy struct for InterfaceCollections -type jsiiProxy_InterfaceCollections struct { +// The jsii proxy struct for SingletonInt +type jsiiProxy_SingletonInt struct { _ byte // padding } -func InterfaceCollections_ListOfInterfaces() *[]IBell { - _init_.Initialize() - - var returns *[]IBell - - _jsii_.StaticInvoke( - "jsii-calc.InterfaceCollections", - "listOfInterfaces", - nil, // no parameters - &returns, - ) - - return returns -} - -func InterfaceCollections_ListOfStructs() *[]*StructA { - _init_.Initialize() - - var returns *[]*StructA +func (s *jsiiProxy_SingletonInt) IsSingletonInt(value *float64) *bool { + var returns *bool - _jsii_.StaticInvoke( - "jsii-calc.InterfaceCollections", - "listOfStructs", - nil, // no parameters + _jsii_.Invoke( + s, + "isSingletonInt", + []interface{}{value}, &returns, ) return returns } -func InterfaceCollections_MapOfInterfaces() *map[string]IBell { - _init_.Initialize() - - var returns *map[string]IBell - - _jsii_.StaticInvoke( - "jsii-calc.InterfaceCollections", - "mapOfInterfaces", - nil, // no parameters - &returns, - ) - return returns -} +`; -func InterfaceCollections_MapOfStructs() *map[string]*StructA { - _init_.Initialize() +exports[`Generated code for "jsii-calc": /go/jsiicalc/SingletonIntEnum.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc - var returns *map[string]*StructA - _jsii_.StaticInvoke( - "jsii-calc.InterfaceCollections", - "mapOfStructs", - nil, // no parameters - &returns, - ) +// A singleton integer. +type SingletonIntEnum string - return returns -} +const ( + // Elite! + SingletonIntEnum_SINGLETON_INT SingletonIntEnum = "SINGLETON_INT" +) `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_InterfacesMaker.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/SingletonString.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" - - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ) -// We can return arrays of interfaces See aws/aws-cdk#2362. -type InterfacesMaker interface { +// Verifies that singleton enums are handled correctly. +// +// https://github.com/aws/jsii/issues/231 +type SingletonString interface { + IsSingletonString(value *string) *bool } -// The jsii proxy struct for InterfacesMaker -type jsiiProxy_InterfacesMaker struct { +// The jsii proxy struct for SingletonString +type jsiiProxy_SingletonString struct { _ byte // padding } -func InterfacesMaker_MakeInterfaces(count *float64) *[]scopejsiicalclib.IDoublable { - _init_.Initialize() - - var returns *[]scopejsiicalclib.IDoublable +func (s *jsiiProxy_SingletonString) IsSingletonString(value *string) *bool { + var returns *bool - _jsii_.StaticInvoke( - "jsii-calc.InterfacesMaker", - "makeInterfaces", - []interface{}{count}, + _jsii_.Invoke( + s, + "isSingletonString", + []interface{}{value}, &returns, ) @@ -14746,55 +15422,36 @@ func InterfacesMaker_MakeInterfaces(count *float64) *[]scopejsiicalclib.IDoublab `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Isomorphism.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/SingletonStringEnum.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) -// Checks the "same instance" isomorphism is preserved within the constructor. -// -// Create a subclass of this, and assert that \`this.myself()\` actually returns -// \`this\` from within the constructor. -type Isomorphism interface { - Myself() Isomorphism -} +// A singleton string. +type SingletonStringEnum string -// The jsii proxy struct for Isomorphism -type jsiiProxy_Isomorphism struct { - _ byte // padding -} +const ( + // 1337. + SingletonStringEnum_SINGLETON_STRING SingletonStringEnum = "SINGLETON_STRING" +) -func NewIsomorphism_Override(i Isomorphism) { - _init_.Initialize() - _jsii_.Create( - "jsii-calc.Isomorphism", - nil, // no parameters - i, - ) -} +`; -func (i *jsiiProxy_Isomorphism) Myself() Isomorphism { - var returns Isomorphism +exports[`Generated code for "jsii-calc": /go/jsiicalc/SmellyStruct.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc - _jsii_.Invoke( - i, - "myself", - nil, // no parameters - &returns, - ) - return returns +type SmellyStruct struct { + Property *string \`field:"required" json:"property" yaml:"property"\` + YetAnoterOne *bool \`field:"required" json:"yetAnoterOne" yaml:"yetAnoterOne"\` } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Issue2638.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/SomeTypeJsii976.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -14803,27 +15460,21 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// Docstrings with period. -// See: https://github.com/aws/jsii/issues/2638 -// -type Issue2638 interface { +type SomeTypeJsii976 interface { } -// The jsii proxy struct for Issue2638 -type jsiiProxy_Issue2638 struct { +// The jsii proxy struct for SomeTypeJsii976 +type jsiiProxy_SomeTypeJsii976 struct { _ byte // padding } -// First sentence. -// -// Second sentence. Third sentence. -func NewIssue2638() Issue2638 { +func NewSomeTypeJsii976() SomeTypeJsii976 { _init_.Initialize() - j := jsiiProxy_Issue2638{} + j := jsiiProxy_SomeTypeJsii976{} _jsii_.Create( - "jsii-calc.Issue2638", + "jsii-calc.SomeTypeJsii976", nil, // no parameters &j, ) @@ -14831,67 +15482,50 @@ func NewIssue2638() Issue2638 { return &j } -// First sentence. -// -// Second sentence. Third sentence. -func NewIssue2638_Override(i Issue2638) { +func NewSomeTypeJsii976_Override(s SomeTypeJsii976) { _init_.Initialize() _jsii_.Create( - "jsii-calc.Issue2638", + "jsii-calc.SomeTypeJsii976", nil, // no parameters - i, + s, ) } - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Issue2638B.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -type Issue2638B interface { -} - -// The jsii proxy struct for Issue2638B -type jsiiProxy_Issue2638B struct { - _ byte // padding -} - -func NewIssue2638B() Issue2638B { +func SomeTypeJsii976_ReturnAnonymous() interface{} { _init_.Initialize() - j := jsiiProxy_Issue2638B{} + var returns interface{} - _jsii_.Create( - "jsii-calc.Issue2638B", + _jsii_.StaticInvoke( + "jsii-calc.SomeTypeJsii976", + "returnAnonymous", nil, // no parameters - &j, + &returns, ) - return &j + return returns } -func NewIssue2638B_Override(i Issue2638B) { +func SomeTypeJsii976_ReturnReturn() IReturnJsii976 { _init_.Initialize() - _jsii_.Create( - "jsii-calc.Issue2638B", + var returns IReturnJsii976 + + _jsii_.StaticInvoke( + "jsii-calc.SomeTypeJsii976", + "returnReturn", nil, // no parameters - i, + &returns, ) + + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_JSII417Derived.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/StableClass.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -14900,108 +15534,110 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type JSII417Derived interface { - JSII417PublicBaseOfBase - HasRoot() *bool - Property() *string - Bar() - Baz() - Foo() +type StableClass interface { + MutableProperty() *float64 + SetMutableProperty(val *float64) + ReadonlyProperty() *string + Method() } -// The jsii proxy struct for JSII417Derived -type jsiiProxy_JSII417Derived struct { - jsiiProxy_JSII417PublicBaseOfBase +// The jsii proxy struct for StableClass +type jsiiProxy_StableClass struct { + _ byte // padding } -func (j *jsiiProxy_JSII417Derived) HasRoot() *bool { - var returns *bool +func (j *jsiiProxy_StableClass) MutableProperty() *float64 { + var returns *float64 _jsii_.Get( j, - "hasRoot", + "mutableProperty", &returns, ) return returns } -func (j *jsiiProxy_JSII417Derived) Property() *string { +func (j *jsiiProxy_StableClass) ReadonlyProperty() *string { var returns *string _jsii_.Get( j, - "property", + "readonlyProperty", &returns, ) return returns } -func NewJSII417Derived(property *string) JSII417Derived { +func NewStableClass(readonlyString *string, mutableNumber *float64) StableClass { _init_.Initialize() - j := jsiiProxy_JSII417Derived{} + j := jsiiProxy_StableClass{} _jsii_.Create( - "jsii-calc.JSII417Derived", - []interface{}{property}, + "jsii-calc.StableClass", + []interface{}{readonlyString, mutableNumber}, &j, ) return &j } -func NewJSII417Derived_Override(j JSII417Derived, property *string) { +func NewStableClass_Override(s StableClass, readonlyString *string, mutableNumber *float64) { _init_.Initialize() _jsii_.Create( - "jsii-calc.JSII417Derived", - []interface{}{property}, - j, - ) -} - -func JSII417Derived_MakeInstance() JSII417PublicBaseOfBase { - _init_.Initialize() - - var returns JSII417PublicBaseOfBase - - _jsii_.StaticInvoke( - "jsii-calc.JSII417Derived", - "makeInstance", - nil, // no parameters - &returns, + "jsii-calc.StableClass", + []interface{}{readonlyString, mutableNumber}, + s, ) - - return returns } -func (j *jsiiProxy_JSII417Derived) Bar() { - _jsii_.InvokeVoid( +func (j *jsiiProxy_StableClass)SetMutableProperty(val *float64) { + _jsii_.Set( j, - "bar", - nil, // no parameters + "mutableProperty", + val, ) } -func (j *jsiiProxy_JSII417Derived) Baz() { +func (s *jsiiProxy_StableClass) Method() { _jsii_.InvokeVoid( - j, - "baz", + s, + "method", nil, // no parameters ) } -func (j *jsiiProxy_JSII417Derived) Foo() { - _jsii_.InvokeVoid( - j, - "foo", - nil, // no parameters - ) + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/StableEnum.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + + +type StableEnum string + +const ( + StableEnum_OPTION_A StableEnum = "OPTION_A" + StableEnum_OPTION_B StableEnum = "OPTION_B" +) + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/StableStruct.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + + +type StableStruct struct { + ReadonlyProperty *string \`field:"required" json:"readonlyProperty" yaml:"readonlyProperty"\` } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_JSII417PublicBaseOfBase.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/StaticContext.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -15010,105 +15646,126 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type JSII417PublicBaseOfBase interface { - HasRoot() *bool - Foo() +// This is used to validate the ability to use \`this\` from within a static context. +// +// https://github.com/awslabs/aws-cdk/issues/2304 +type StaticContext interface { } -// The jsii proxy struct for JSII417PublicBaseOfBase -type jsiiProxy_JSII417PublicBaseOfBase struct { +// The jsii proxy struct for StaticContext +type jsiiProxy_StaticContext struct { _ byte // padding } -func (j *jsiiProxy_JSII417PublicBaseOfBase) HasRoot() *bool { +func StaticContext_CanAccessStaticContext() *bool { + _init_.Initialize() + var returns *bool - _jsii_.Get( - j, - "hasRoot", + + _jsii_.StaticInvoke( + "jsii-calc.StaticContext", + "canAccessStaticContext", + nil, // no parameters &returns, ) + return returns } +func StaticContext_StaticVariable() *bool { + _init_.Initialize() + var returns *bool + _jsii_.StaticGet( + "jsii-calc.StaticContext", + "staticVariable", + &returns, + ) + return returns +} -func NewJSII417PublicBaseOfBase() JSII417PublicBaseOfBase { +func StaticContext_SetStaticVariable(val *bool) { _init_.Initialize() + _jsii_.StaticSet( + "jsii-calc.StaticContext", + "staticVariable", + val, + ) +} - j := jsiiProxy_JSII417PublicBaseOfBase{} - _jsii_.Create( - "jsii-calc.JSII417PublicBaseOfBase", - nil, // no parameters - &j, - ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/StaticHelloChild.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +type StaticHelloChild interface { + StaticHelloParent +} - return &j +// The jsii proxy struct for StaticHelloChild +type jsiiProxy_StaticHelloChild struct { + jsiiProxy_StaticHelloParent } -func NewJSII417PublicBaseOfBase_Override(j JSII417PublicBaseOfBase) { +func StaticHelloChild_Method() { _init_.Initialize() - _jsii_.Create( - "jsii-calc.JSII417PublicBaseOfBase", + _jsii_.StaticInvokeVoid( + "jsii-calc.StaticHelloChild", + "method", nil, // no parameters - j, ) } -func JSII417PublicBaseOfBase_MakeInstance() JSII417PublicBaseOfBase { +func StaticHelloChild_Property() *float64 { _init_.Initialize() - - var returns JSII417PublicBaseOfBase - - _jsii_.StaticInvoke( - "jsii-calc.JSII417PublicBaseOfBase", - "makeInstance", - nil, // no parameters + var returns *float64 + _jsii_.StaticGet( + "jsii-calc.StaticHelloChild", + "property", &returns, ) - return returns } -func (j *jsiiProxy_JSII417PublicBaseOfBase) Foo() { - _jsii_.InvokeVoid( - j, - "foo", - nil, // no parameters - ) -} - `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_JSObjectLiteralForInterface.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/StaticHelloParent.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" - - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ) -type JSObjectLiteralForInterface interface { - GiveMeFriendly() scopejsiicalclib.IFriendly - GiveMeFriendlyGenerator() IFriendlyRandomGenerator +// Static methods that override parent class are technically overrides (the inheritance of statics is part of the ES6 specification), but certain other languages such as Java do not carry statics in the inheritance chain at all, so they cannot be overridden, only hidden. +// +// The difference is fairly minor (for typical use-cases, the end result is the +// same), however this has implications on what the generated code should look +// like. +type StaticHelloParent interface { } -// The jsii proxy struct for JSObjectLiteralForInterface -type jsiiProxy_JSObjectLiteralForInterface struct { +// The jsii proxy struct for StaticHelloParent +type jsiiProxy_StaticHelloParent struct { _ byte // padding } -func NewJSObjectLiteralForInterface() JSObjectLiteralForInterface { +func NewStaticHelloParent() StaticHelloParent { _init_.Initialize() - j := jsiiProxy_JSObjectLiteralForInterface{} + j := jsiiProxy_StaticHelloParent{} _jsii_.Create( - "jsii-calc.JSObjectLiteralForInterface", + "jsii-calc.StaticHelloParent", nil, // no parameters &j, ) @@ -15116,46 +15773,41 @@ func NewJSObjectLiteralForInterface() JSObjectLiteralForInterface { return &j } -func NewJSObjectLiteralForInterface_Override(j JSObjectLiteralForInterface) { +func NewStaticHelloParent_Override(s StaticHelloParent) { _init_.Initialize() _jsii_.Create( - "jsii-calc.JSObjectLiteralForInterface", + "jsii-calc.StaticHelloParent", nil, // no parameters - j, + s, ) } -func (j *jsiiProxy_JSObjectLiteralForInterface) GiveMeFriendly() scopejsiicalclib.IFriendly { - var returns scopejsiicalclib.IFriendly +func StaticHelloParent_Method() { + _init_.Initialize() - _jsii_.Invoke( - j, - "giveMeFriendly", + _jsii_.StaticInvokeVoid( + "jsii-calc.StaticHelloParent", + "method", nil, // no parameters - &returns, ) - - return returns } -func (j *jsiiProxy_JSObjectLiteralForInterface) GiveMeFriendlyGenerator() IFriendlyRandomGenerator { - var returns IFriendlyRandomGenerator - - _jsii_.Invoke( - j, - "giveMeFriendlyGenerator", - nil, // no parameters +func StaticHelloParent_Property() *float64 { + _init_.Initialize() + var returns *float64 + _jsii_.StaticGet( + "jsii-calc.StaticHelloParent", + "property", &returns, ) - return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_JSObjectLiteralToNative.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/Statics.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -15164,141 +15816,184 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type JSObjectLiteralToNative interface { - ReturnLiteral() JSObjectLiteralToNativeClass +type Statics interface { + Value() *string + JustMethod() *string } -// The jsii proxy struct for JSObjectLiteralToNative -type jsiiProxy_JSObjectLiteralToNative struct { +// The jsii proxy struct for Statics +type jsiiProxy_Statics struct { _ byte // padding } -func NewJSObjectLiteralToNative() JSObjectLiteralToNative { +func (j *jsiiProxy_Statics) Value() *string { + var returns *string + _jsii_.Get( + j, + "value", + &returns, + ) + return returns +} + + +func NewStatics(value *string) Statics { _init_.Initialize() - j := jsiiProxy_JSObjectLiteralToNative{} + j := jsiiProxy_Statics{} _jsii_.Create( - "jsii-calc.JSObjectLiteralToNative", - nil, // no parameters + "jsii-calc.Statics", + []interface{}{value}, &j, ) return &j } -func NewJSObjectLiteralToNative_Override(j JSObjectLiteralToNative) { +func NewStatics_Override(s Statics, value *string) { _init_.Initialize() _jsii_.Create( - "jsii-calc.JSObjectLiteralToNative", - nil, // no parameters - j, + "jsii-calc.Statics", + []interface{}{value}, + s, ) } -func (j *jsiiProxy_JSObjectLiteralToNative) ReturnLiteral() JSObjectLiteralToNativeClass { - var returns JSObjectLiteralToNativeClass +// Jsdocs for static method. +func Statics_StaticMethod(name *string) *string { + _init_.Initialize() - _jsii_.Invoke( - j, - "returnLiteral", - nil, // no parameters + var returns *string + + _jsii_.StaticInvoke( + "jsii-calc.Statics", + "staticMethod", + []interface{}{name}, &returns, ) return returns } - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_JSObjectLiteralToNativeClass.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -type JSObjectLiteralToNativeClass interface { - PropA() *string - SetPropA(val *string) - PropB() *float64 - SetPropB(val *float64) +func Statics_BAR() *float64 { + _init_.Initialize() + var returns *float64 + _jsii_.StaticGet( + "jsii-calc.Statics", + "BAR", + &returns, + ) + return returns } -// The jsii proxy struct for JSObjectLiteralToNativeClass -type jsiiProxy_JSObjectLiteralToNativeClass struct { - _ byte // padding +func Statics_ConstObj() DoubleTrouble { + _init_.Initialize() + var returns DoubleTrouble + _jsii_.StaticGet( + "jsii-calc.Statics", + "ConstObj", + &returns, + ) + return returns } -func (j *jsiiProxy_JSObjectLiteralToNativeClass) PropA() *string { +func Statics_Foo() *string { + _init_.Initialize() var returns *string - _jsii_.Get( - j, - "propA", + _jsii_.StaticGet( + "jsii-calc.Statics", + "Foo", &returns, ) return returns } -func (j *jsiiProxy_JSObjectLiteralToNativeClass) PropB() *float64 { - var returns *float64 - _jsii_.Get( - j, - "propB", +func Statics_Instance() Statics { + _init_.Initialize() + var returns Statics + _jsii_.StaticGet( + "jsii-calc.Statics", + "instance", &returns, ) return returns } - -func NewJSObjectLiteralToNativeClass() JSObjectLiteralToNativeClass { +func Statics_SetInstance(val Statics) { _init_.Initialize() - - j := jsiiProxy_JSObjectLiteralToNativeClass{} - - _jsii_.Create( - "jsii-calc.JSObjectLiteralToNativeClass", - nil, // no parameters - &j, + _jsii_.StaticSet( + "jsii-calc.Statics", + "instance", + val, ) - - return &j } -func NewJSObjectLiteralToNativeClass_Override(j JSObjectLiteralToNativeClass) { +func Statics_NonConstStatic() *float64 { _init_.Initialize() - - _jsii_.Create( - "jsii-calc.JSObjectLiteralToNativeClass", - nil, // no parameters - j, + var returns *float64 + _jsii_.StaticGet( + "jsii-calc.Statics", + "nonConstStatic", + &returns, ) + return returns } -func (j *jsiiProxy_JSObjectLiteralToNativeClass)SetPropA(val *string) { - _jsii_.Set( - j, - "propA", +func Statics_SetNonConstStatic(val *float64) { + _init_.Initialize() + _jsii_.StaticSet( + "jsii-calc.Statics", + "nonConstStatic", val, ) } -func (j *jsiiProxy_JSObjectLiteralToNativeClass)SetPropB(val *float64) { - _jsii_.Set( - j, - "propB", - val, +func Statics_ZooBar() *map[string]*string { + _init_.Initialize() + var returns *map[string]*string + _jsii_.StaticGet( + "jsii-calc.Statics", + "zooBar", + &returns, + ) + return returns +} + +func (s *jsiiProxy_Statics) JustMethod() *string { + var returns *string + + _jsii_.Invoke( + s, + "justMethod", + nil, // no parameters + &returns, ) + + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_JavaReservedWords.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/StringEnum.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + + +type StringEnum string + +const ( + StringEnum_A StringEnum = "A" + StringEnum_B StringEnum = "B" + StringEnum_C StringEnum = "C" +) + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/StripInternal.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -15307,86 +16002,34 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type JavaReservedWords interface { - While() *string - SetWhile(val *string) - Abstract() - Assert() - Boolean() - Break() - Byte() - Case() - Catch() - Char() - Class() - Const() - Continue() - Default() - Do() - Double() - Else() - Enum() - Extends() - False() - Final() - Finally() - Float() - For() - Goto() - If() - Implements() - Import() - Instanceof() - Int() - Interface() - Long() - Native() - New() - Null() - Package() - Private() - Protected() - Public() - Return() - Short() - Static() - Strictfp() - Super() - Switch() - Synchronized() - This() - Throw() - Throws() - Transient() - True() - Try() - Void() - Volatile() +type StripInternal interface { + YouSeeMe() *string + SetYouSeeMe(val *string) } -// The jsii proxy struct for JavaReservedWords -type jsiiProxy_JavaReservedWords struct { +// The jsii proxy struct for StripInternal +type jsiiProxy_StripInternal struct { _ byte // padding } -func (j *jsiiProxy_JavaReservedWords) While() *string { +func (j *jsiiProxy_StripInternal) YouSeeMe() *string { var returns *string _jsii_.Get( j, - "while", + "youSeeMe", &returns, ) return returns } -func NewJavaReservedWords() JavaReservedWords { +func NewStripInternal() StripInternal { _init_.Initialize() - j := jsiiProxy_JavaReservedWords{} + j := jsiiProxy_StripInternal{} _jsii_.Create( - "jsii-calc.JavaReservedWords", + "jsii-calc.StripInternal", nil, // no parameters &j, ) @@ -15394,444 +16037,452 @@ func NewJavaReservedWords() JavaReservedWords { return &j } -func NewJavaReservedWords_Override(j JavaReservedWords) { +func NewStripInternal_Override(s StripInternal) { _init_.Initialize() _jsii_.Create( - "jsii-calc.JavaReservedWords", + "jsii-calc.StripInternal", nil, // no parameters - j, + s, ) } -func (j *jsiiProxy_JavaReservedWords)SetWhile(val *string) { +func (j *jsiiProxy_StripInternal)SetYouSeeMe(val *string) { _jsii_.Set( j, - "while", + "youSeeMe", val, ) } -func (j *jsiiProxy_JavaReservedWords) Abstract() { - _jsii_.InvokeVoid( - j, - "abstract", - nil, // no parameters - ) -} -func (j *jsiiProxy_JavaReservedWords) Assert() { - _jsii_.InvokeVoid( - j, - "assert", - nil, // no parameters - ) -} +`; -func (j *jsiiProxy_JavaReservedWords) Boolean() { - _jsii_.InvokeVoid( - j, - "boolean", - nil, // no parameters - ) -} +exports[`Generated code for "jsii-calc": /go/jsiicalc/StructA.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc -func (j *jsiiProxy_JavaReservedWords) Break() { - _jsii_.InvokeVoid( - j, - "break", - nil, // no parameters - ) -} -func (j *jsiiProxy_JavaReservedWords) Byte() { - _jsii_.InvokeVoid( - j, - "byte", - nil, // no parameters - ) +// We can serialize and deserialize structs without silently ignoring optional fields. +type StructA struct { + RequiredString *string \`field:"required" json:"requiredString" yaml:"requiredString"\` + OptionalNumber *float64 \`field:"optional" json:"optionalNumber" yaml:"optionalNumber"\` + OptionalString *string \`field:"optional" json:"optionalString" yaml:"optionalString"\` } -func (j *jsiiProxy_JavaReservedWords) Case() { - _jsii_.InvokeVoid( - j, - "case", - nil, // no parameters - ) -} -func (j *jsiiProxy_JavaReservedWords) Catch() { - _jsii_.InvokeVoid( - j, - "catch", - nil, // no parameters - ) -} +`; -func (j *jsiiProxy_JavaReservedWords) Char() { - _jsii_.InvokeVoid( - j, - "char", - nil, // no parameters - ) -} +exports[`Generated code for "jsii-calc": /go/jsiicalc/StructB.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc -func (j *jsiiProxy_JavaReservedWords) Class() { - _jsii_.InvokeVoid( - j, - "class", - nil, // no parameters - ) -} -func (j *jsiiProxy_JavaReservedWords) Const() { - _jsii_.InvokeVoid( - j, - "const", - nil, // no parameters - ) +// This intentionally overlaps with StructA (where only requiredString is provided) to test htat the kernel properly disambiguates those. +type StructB struct { + RequiredString *string \`field:"required" json:"requiredString" yaml:"requiredString"\` + OptionalBoolean *bool \`field:"optional" json:"optionalBoolean" yaml:"optionalBoolean"\` + OptionalStructA *StructA \`field:"optional" json:"optionalStructA" yaml:"optionalStructA"\` } -func (j *jsiiProxy_JavaReservedWords) Continue() { - _jsii_.InvokeVoid( - j, - "continue", - nil, // no parameters - ) -} -func (j *jsiiProxy_JavaReservedWords) Default() { - _jsii_.InvokeVoid( - j, - "default", - nil, // no parameters - ) -} +`; -func (j *jsiiProxy_JavaReservedWords) Do() { - _jsii_.InvokeVoid( - j, - "do", - nil, // no parameters - ) -} +exports[`Generated code for "jsii-calc": /go/jsiicalc/StructParameterType.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc -func (j *jsiiProxy_JavaReservedWords) Double() { - _jsii_.InvokeVoid( - j, - "double", - nil, // no parameters - ) -} -func (j *jsiiProxy_JavaReservedWords) Else() { - _jsii_.InvokeVoid( - j, - "else", - nil, // no parameters - ) +// Verifies that, in languages that do keyword lifting (e.g: Python), having a struct member with the same name as a positional parameter results in the correct code being emitted. +// +// See: https://github.com/aws/aws-cdk/issues/4302 +type StructParameterType struct { + Scope *string \`field:"required" json:"scope" yaml:"scope"\` + Props *bool \`field:"optional" json:"props" yaml:"props"\` } -func (j *jsiiProxy_JavaReservedWords) Enum() { - _jsii_.InvokeVoid( - j, - "enum", - nil, // no parameters - ) -} -func (j *jsiiProxy_JavaReservedWords) Extends() { - _jsii_.InvokeVoid( - j, - "extends", - nil, // no parameters - ) -} +`; -func (j *jsiiProxy_JavaReservedWords) False() { - _jsii_.InvokeVoid( - j, - "false", - nil, // no parameters - ) -} +exports[`Generated code for "jsii-calc": /go/jsiicalc/StructPassing.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) -func (j *jsiiProxy_JavaReservedWords) Final() { - _jsii_.InvokeVoid( - j, - "final", - nil, // no parameters - ) +// Just because we can. +type StructPassing interface { } -func (j *jsiiProxy_JavaReservedWords) Finally() { - _jsii_.InvokeVoid( - j, - "finally", - nil, // no parameters - ) +// The jsii proxy struct for StructPassing +type jsiiProxy_StructPassing struct { + _ byte // padding } -func (j *jsiiProxy_JavaReservedWords) Float() { - _jsii_.InvokeVoid( - j, - "float", - nil, // no parameters - ) -} +func NewStructPassing() StructPassing { + _init_.Initialize() -func (j *jsiiProxy_JavaReservedWords) For() { - _jsii_.InvokeVoid( - j, - "for", - nil, // no parameters - ) -} + j := jsiiProxy_StructPassing{} -func (j *jsiiProxy_JavaReservedWords) Goto() { - _jsii_.InvokeVoid( - j, - "goto", + _jsii_.Create( + "jsii-calc.StructPassing", nil, // no parameters + &j, ) -} -func (j *jsiiProxy_JavaReservedWords) If() { - _jsii_.InvokeVoid( - j, - "if", - nil, // no parameters - ) + return &j } -func (j *jsiiProxy_JavaReservedWords) Implements() { - _jsii_.InvokeVoid( - j, - "implements", - nil, // no parameters - ) -} +func NewStructPassing_Override(s StructPassing) { + _init_.Initialize() -func (j *jsiiProxy_JavaReservedWords) Import() { - _jsii_.InvokeVoid( - j, - "import", + _jsii_.Create( + "jsii-calc.StructPassing", nil, // no parameters + s, ) } -func (j *jsiiProxy_JavaReservedWords) Instanceof() { - _jsii_.InvokeVoid( - j, - "instanceof", - nil, // no parameters +func StructPassing_HowManyVarArgsDidIPass(_positional *float64, inputs ...*TopLevelStruct) *float64 { + _init_.Initialize() + + args := []interface{}{_positional} + for _, a := range inputs { + args = append(args, a) + } + + var returns *float64 + + _jsii_.StaticInvoke( + "jsii-calc.StructPassing", + "howManyVarArgsDidIPass", + args, + &returns, ) + + return returns } -func (j *jsiiProxy_JavaReservedWords) Int() { - _jsii_.InvokeVoid( - j, - "int", - nil, // no parameters +func StructPassing_RoundTrip(_positional *float64, input *TopLevelStruct) *TopLevelStruct { + _init_.Initialize() + + var returns *TopLevelStruct + + _jsii_.StaticInvoke( + "jsii-calc.StructPassing", + "roundTrip", + []interface{}{_positional, input}, + &returns, ) + + return returns } -func (j *jsiiProxy_JavaReservedWords) Interface() { - _jsii_.InvokeVoid( - j, - "interface", - nil, // no parameters - ) + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/StructUnionConsumer.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +type StructUnionConsumer interface { } -func (j *jsiiProxy_JavaReservedWords) Long() { - _jsii_.InvokeVoid( - j, - "long", - nil, // no parameters - ) +// The jsii proxy struct for StructUnionConsumer +type jsiiProxy_StructUnionConsumer struct { + _ byte // padding } -func (j *jsiiProxy_JavaReservedWords) Native() { - _jsii_.InvokeVoid( - j, - "native", - nil, // no parameters +func StructUnionConsumer_IsStructA(struct_ interface{}) *bool { + _init_.Initialize() + + var returns *bool + + _jsii_.StaticInvoke( + "jsii-calc.StructUnionConsumer", + "isStructA", + []interface{}{struct_}, + &returns, ) + + return returns } -func (j *jsiiProxy_JavaReservedWords) New() { - _jsii_.InvokeVoid( - j, - "new", - nil, // no parameters +func StructUnionConsumer_IsStructB(struct_ interface{}) *bool { + _init_.Initialize() + + var returns *bool + + _jsii_.StaticInvoke( + "jsii-calc.StructUnionConsumer", + "isStructB", + []interface{}{struct_}, + &returns, ) + + return returns } -func (j *jsiiProxy_JavaReservedWords) Null() { - _jsii_.InvokeVoid( - j, - "null", - nil, // no parameters +func StructUnionConsumer_ProvideStruct(which *string) interface{} { + _init_.Initialize() + + var returns interface{} + + _jsii_.StaticInvoke( + "jsii-calc.StructUnionConsumer", + "provideStruct", + []interface{}{which}, + &returns, ) + + return returns } -func (j *jsiiProxy_JavaReservedWords) Package() { - _jsii_.InvokeVoid( - j, - "package", - nil, // no parameters - ) + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/StructWithCollectionOfUnionts.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + + +type StructWithCollectionOfUnionts struct { + UnionProperty *[]*map[string]interface{} \`field:"required" json:"unionProperty" yaml:"unionProperty"\` } -func (j *jsiiProxy_JavaReservedWords) Private() { - _jsii_.InvokeVoid( - j, - "private", - nil, // no parameters - ) + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/StructWithEnum.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + + +type StructWithEnum struct { + // An enum value. + Foo StringEnum \`field:"required" json:"foo" yaml:"foo"\` + // Optional enum value (of type integer). + Bar AllTypesEnum \`field:"optional" json:"bar" yaml:"bar"\` } -func (j *jsiiProxy_JavaReservedWords) Protected() { - _jsii_.InvokeVoid( - j, - "protected", - nil, // no parameters - ) + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/StructWithJavaReservedWords.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + + +type StructWithJavaReservedWords struct { + Default *string \`field:"required" json:"default" yaml:"default"\` + Assert *string \`field:"optional" json:"assert" yaml:"assert"\` + Result *string \`field:"optional" json:"result" yaml:"result"\` + That *string \`field:"optional" json:"that" yaml:"that"\` } -func (j *jsiiProxy_JavaReservedWords) Public() { - _jsii_.InvokeVoid( - j, - "public", - nil, // no parameters - ) + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/Sum.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" + + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/composition" + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/internal" + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" +) + +// An operation that sums multiple values. +type Sum interface { + composition.CompositeOperation + // A set of postfixes to include in a decorated .toString(). + DecorationPostfixes() *[]*string + SetDecorationPostfixes(val *[]*string) + // A set of prefixes to include in a decorated .toString(). + DecorationPrefixes() *[]*string + SetDecorationPrefixes(val *[]*string) + // The expression that this operation consists of. + // + // Must be implemented by derived classes. + Expression() scopejsiicalclib.NumericValue + // The parts to sum. + Parts() *[]scopejsiicalclib.NumericValue + SetParts(val *[]scopejsiicalclib.NumericValue) + // The .toString() style. + StringStyle() composition.CompositeOperation_CompositionStringStyle + SetStringStyle(val composition.CompositeOperation_CompositionStringStyle) + // The value. + Value() *float64 + // String representation of the value. + ToString() *string + // Returns: the name of the class (to verify native type names are created for derived classes). + TypeName() interface{} } -func (j *jsiiProxy_JavaReservedWords) Return() { - _jsii_.InvokeVoid( - j, - "return", - nil, // no parameters - ) +// The jsii proxy struct for Sum +type jsiiProxy_Sum struct { + internal.Type__compositionCompositeOperation } -func (j *jsiiProxy_JavaReservedWords) Short() { - _jsii_.InvokeVoid( +func (j *jsiiProxy_Sum) DecorationPostfixes() *[]*string { + var returns *[]*string + _jsii_.Get( j, - "short", - nil, // no parameters + "decorationPostfixes", + &returns, ) + return returns } -func (j *jsiiProxy_JavaReservedWords) Static() { - _jsii_.InvokeVoid( +func (j *jsiiProxy_Sum) DecorationPrefixes() *[]*string { + var returns *[]*string + _jsii_.Get( j, - "static", - nil, // no parameters + "decorationPrefixes", + &returns, ) + return returns } -func (j *jsiiProxy_JavaReservedWords) Strictfp() { - _jsii_.InvokeVoid( +func (j *jsiiProxy_Sum) Expression() scopejsiicalclib.NumericValue { + var returns scopejsiicalclib.NumericValue + _jsii_.Get( j, - "strictfp", - nil, // no parameters + "expression", + &returns, ) + return returns } -func (j *jsiiProxy_JavaReservedWords) Super() { - _jsii_.InvokeVoid( +func (j *jsiiProxy_Sum) Parts() *[]scopejsiicalclib.NumericValue { + var returns *[]scopejsiicalclib.NumericValue + _jsii_.Get( j, - "super", - nil, // no parameters + "parts", + &returns, ) + return returns } -func (j *jsiiProxy_JavaReservedWords) Switch() { - _jsii_.InvokeVoid( +func (j *jsiiProxy_Sum) StringStyle() composition.CompositeOperation_CompositionStringStyle { + var returns composition.CompositeOperation_CompositionStringStyle + _jsii_.Get( j, - "switch", - nil, // no parameters + "stringStyle", + &returns, ) + return returns } -func (j *jsiiProxy_JavaReservedWords) Synchronized() { - _jsii_.InvokeVoid( +func (j *jsiiProxy_Sum) Value() *float64 { + var returns *float64 + _jsii_.Get( j, - "synchronized", - nil, // no parameters + "value", + &returns, ) + return returns } -func (j *jsiiProxy_JavaReservedWords) This() { - _jsii_.InvokeVoid( - j, - "this", + +func NewSum() Sum { + _init_.Initialize() + + j := jsiiProxy_Sum{} + + _jsii_.Create( + "jsii-calc.Sum", nil, // no parameters + &j, ) + + return &j } -func (j *jsiiProxy_JavaReservedWords) Throw() { - _jsii_.InvokeVoid( - j, - "throw", +func NewSum_Override(s Sum) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.Sum", nil, // no parameters + s, ) } -func (j *jsiiProxy_JavaReservedWords) Throws() { - _jsii_.InvokeVoid( +func (j *jsiiProxy_Sum)SetDecorationPostfixes(val *[]*string) { + _jsii_.Set( j, - "throws", - nil, // no parameters + "decorationPostfixes", + val, ) } -func (j *jsiiProxy_JavaReservedWords) Transient() { - _jsii_.InvokeVoid( +func (j *jsiiProxy_Sum)SetDecorationPrefixes(val *[]*string) { + _jsii_.Set( j, - "transient", - nil, // no parameters + "decorationPrefixes", + val, ) } -func (j *jsiiProxy_JavaReservedWords) True() { - _jsii_.InvokeVoid( +func (j *jsiiProxy_Sum)SetParts(val *[]scopejsiicalclib.NumericValue) { + _jsii_.Set( j, - "true", - nil, // no parameters + "parts", + val, ) } -func (j *jsiiProxy_JavaReservedWords) Try() { - _jsii_.InvokeVoid( +func (j *jsiiProxy_Sum)SetStringStyle(val composition.CompositeOperation_CompositionStringStyle) { + _jsii_.Set( j, - "try", - nil, // no parameters + "stringStyle", + val, ) } -func (j *jsiiProxy_JavaReservedWords) Void() { - _jsii_.InvokeVoid( - j, - "void", +func (s *jsiiProxy_Sum) ToString() *string { + var returns *string + + _jsii_.Invoke( + s, + "toString", nil, // no parameters + &returns, ) + + return returns } -func (j *jsiiProxy_JavaReservedWords) Volatile() { - _jsii_.InvokeVoid( - j, - "volatile", +func (s *jsiiProxy_Sum) TypeName() interface{} { + var returns interface{} + + _jsii_.Invoke( + s, + "typeName", nil, // no parameters + &returns, ) + + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Jsii487Derived.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/SupportsNiceJavaBuilder.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -15840,90 +16491,116 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type Jsii487Derived interface { - IJsii487External - IJsii487External2 +type SupportsNiceJavaBuilder interface { + SupportsNiceJavaBuilderWithRequiredProps + Bar() *float64 + // some identifier. + Id() *float64 + PropId() *string + Rest() *[]*string } -// The jsii proxy struct for Jsii487Derived -type jsiiProxy_Jsii487Derived struct { - jsiiProxy_IJsii487External - jsiiProxy_IJsii487External2 +// The jsii proxy struct for SupportsNiceJavaBuilder +type jsiiProxy_SupportsNiceJavaBuilder struct { + jsiiProxy_SupportsNiceJavaBuilderWithRequiredProps } -func NewJsii487Derived() Jsii487Derived { - _init_.Initialize() - - j := jsiiProxy_Jsii487Derived{} - - _jsii_.Create( - "jsii-calc.Jsii487Derived", - nil, // no parameters - &j, +func (j *jsiiProxy_SupportsNiceJavaBuilder) Bar() *float64 { + var returns *float64 + _jsii_.Get( + j, + "bar", + &returns, ) - - return &j + return returns } -func NewJsii487Derived_Override(j Jsii487Derived) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.Jsii487Derived", - nil, // no parameters +func (j *jsiiProxy_SupportsNiceJavaBuilder) Id() *float64 { + var returns *float64 + _jsii_.Get( j, + "id", + &returns, ) + return returns } - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Jsii496Derived.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -type Jsii496Derived interface { - IJsii496 +func (j *jsiiProxy_SupportsNiceJavaBuilder) PropId() *string { + var returns *string + _jsii_.Get( + j, + "propId", + &returns, + ) + return returns } -// The jsii proxy struct for Jsii496Derived -type jsiiProxy_Jsii496Derived struct { - jsiiProxy_IJsii496 +func (j *jsiiProxy_SupportsNiceJavaBuilder) Rest() *[]*string { + var returns *[]*string + _jsii_.Get( + j, + "rest", + &returns, + ) + return returns } -func NewJsii496Derived() Jsii496Derived { + +func NewSupportsNiceJavaBuilder(id *float64, defaultBar *float64, props *SupportsNiceJavaBuilderProps, rest ...*string) SupportsNiceJavaBuilder { _init_.Initialize() - j := jsiiProxy_Jsii496Derived{} + args := []interface{}{id, defaultBar, props} + for _, a := range rest { + args = append(args, a) + } + + j := jsiiProxy_SupportsNiceJavaBuilder{} _jsii_.Create( - "jsii-calc.Jsii496Derived", - nil, // no parameters + "jsii-calc.SupportsNiceJavaBuilder", + args, &j, ) return &j } -func NewJsii496Derived_Override(j Jsii496Derived) { +func NewSupportsNiceJavaBuilder_Override(s SupportsNiceJavaBuilder, id *float64, defaultBar *float64, props *SupportsNiceJavaBuilderProps, rest ...*string) { _init_.Initialize() + args := []interface{}{id, defaultBar, props} + for _, a := range rest { + args = append(args, a) + } + _jsii_.Create( - "jsii-calc.Jsii496Derived", - nil, // no parameters - j, + "jsii-calc.SupportsNiceJavaBuilder", + args, + s, ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_JsiiAgent.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/SupportsNiceJavaBuilderProps.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + + +type SupportsNiceJavaBuilderProps struct { + // Some number, like 42. + Bar *float64 \`field:"required" json:"bar" yaml:"bar"\` + // 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. + Id *string \`field:"optional" json:"id" yaml:"id"\` +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/SupportsNiceJavaBuilderWithRequiredProps.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -15932,54 +16609,78 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// Host runtime version should be set via JSII_AGENT. -type JsiiAgent interface { +// We can generate fancy builders in Java for classes which take a mix of positional & struct parameters. +type SupportsNiceJavaBuilderWithRequiredProps interface { + Bar() *float64 + // some identifier of your choice. + Id() *float64 + PropId() *string } -// The jsii proxy struct for JsiiAgent -type jsiiProxy_JsiiAgent struct { +// The jsii proxy struct for SupportsNiceJavaBuilderWithRequiredProps +type jsiiProxy_SupportsNiceJavaBuilderWithRequiredProps struct { _ byte // padding } -func NewJsiiAgent() JsiiAgent { +func (j *jsiiProxy_SupportsNiceJavaBuilderWithRequiredProps) Bar() *float64 { + var returns *float64 + _jsii_.Get( + j, + "bar", + &returns, + ) + return returns +} + +func (j *jsiiProxy_SupportsNiceJavaBuilderWithRequiredProps) Id() *float64 { + var returns *float64 + _jsii_.Get( + j, + "id", + &returns, + ) + return returns +} + +func (j *jsiiProxy_SupportsNiceJavaBuilderWithRequiredProps) PropId() *string { + var returns *string + _jsii_.Get( + j, + "propId", + &returns, + ) + return returns +} + + +func NewSupportsNiceJavaBuilderWithRequiredProps(id *float64, props *SupportsNiceJavaBuilderProps) SupportsNiceJavaBuilderWithRequiredProps { _init_.Initialize() - j := jsiiProxy_JsiiAgent{} + j := jsiiProxy_SupportsNiceJavaBuilderWithRequiredProps{} _jsii_.Create( - "jsii-calc.JsiiAgent", - nil, // no parameters + "jsii-calc.SupportsNiceJavaBuilderWithRequiredProps", + []interface{}{id, props}, &j, ) return &j } -func NewJsiiAgent_Override(j JsiiAgent) { +func NewSupportsNiceJavaBuilderWithRequiredProps_Override(s SupportsNiceJavaBuilderWithRequiredProps, id *float64, props *SupportsNiceJavaBuilderProps) { _init_.Initialize() _jsii_.Create( - "jsii-calc.JsiiAgent", - nil, // no parameters - j, - ) -} - -func JsiiAgent_Value() *string { - _init_.Initialize() - var returns *string - _jsii_.StaticGet( - "jsii-calc.JsiiAgent", - "value", - &returns, + "jsii-calc.SupportsNiceJavaBuilderWithRequiredProps", + []interface{}{id, props}, + s, ) - return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_JsonFormatter.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/SyncVirtualMethods.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -15988,160 +16689,166 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// Make sure structs are un-decorated on the way in. -// See: https://github.com/aws/aws-cdk/issues/5066 -// -type JsonFormatter interface { +type SyncVirtualMethods interface { + A() *float64 + SetA(val *float64) + CallerIsProperty() *float64 + SetCallerIsProperty(val *float64) + OtherProperty() *string + SetOtherProperty(val *string) + ReadonlyProperty() *string + TheProperty() *string + SetTheProperty(val *string) + ValueOfOtherProperty() *string + SetValueOfOtherProperty(val *string) + CallerIsAsync() *float64 + CallerIsMethod() *float64 + ModifyOtherProperty(value *string) + ModifyValueOfTheProperty(value *string) + ReadA() *float64 + RetrieveOtherProperty() *string + RetrieveReadOnlyProperty() *string + RetrieveValueOfTheProperty() *string + VirtualMethod(n *float64) *float64 + WriteA(value *float64) } -// The jsii proxy struct for JsonFormatter -type jsiiProxy_JsonFormatter struct { +// The jsii proxy struct for SyncVirtualMethods +type jsiiProxy_SyncVirtualMethods struct { _ byte // padding } -func JsonFormatter_AnyArray() interface{} { - _init_.Initialize() - - var returns interface{} - - _jsii_.StaticInvoke( - "jsii-calc.JsonFormatter", - "anyArray", - nil, // no parameters +func (j *jsiiProxy_SyncVirtualMethods) A() *float64 { + var returns *float64 + _jsii_.Get( + j, + "a", &returns, ) - return returns } -func JsonFormatter_AnyBooleanFalse() interface{} { - _init_.Initialize() - - var returns interface{} - - _jsii_.StaticInvoke( - "jsii-calc.JsonFormatter", - "anyBooleanFalse", - nil, // no parameters +func (j *jsiiProxy_SyncVirtualMethods) CallerIsProperty() *float64 { + var returns *float64 + _jsii_.Get( + j, + "callerIsProperty", &returns, ) - return returns } -func JsonFormatter_AnyBooleanTrue() interface{} { - _init_.Initialize() - - var returns interface{} - - _jsii_.StaticInvoke( - "jsii-calc.JsonFormatter", - "anyBooleanTrue", - nil, // no parameters +func (j *jsiiProxy_SyncVirtualMethods) OtherProperty() *string { + var returns *string + _jsii_.Get( + j, + "otherProperty", &returns, ) - return returns } -func JsonFormatter_AnyDate() interface{} { - _init_.Initialize() - - var returns interface{} - - _jsii_.StaticInvoke( - "jsii-calc.JsonFormatter", - "anyDate", - nil, // no parameters +func (j *jsiiProxy_SyncVirtualMethods) ReadonlyProperty() *string { + var returns *string + _jsii_.Get( + j, + "readonlyProperty", &returns, ) - return returns } -func JsonFormatter_AnyEmptyString() interface{} { - _init_.Initialize() - - var returns interface{} - - _jsii_.StaticInvoke( - "jsii-calc.JsonFormatter", - "anyEmptyString", - nil, // no parameters +func (j *jsiiProxy_SyncVirtualMethods) TheProperty() *string { + var returns *string + _jsii_.Get( + j, + "theProperty", &returns, ) - return returns } -func JsonFormatter_AnyFunction() interface{} { - _init_.Initialize() - - var returns interface{} - - _jsii_.StaticInvoke( - "jsii-calc.JsonFormatter", - "anyFunction", - nil, // no parameters +func (j *jsiiProxy_SyncVirtualMethods) ValueOfOtherProperty() *string { + var returns *string + _jsii_.Get( + j, + "valueOfOtherProperty", &returns, ) - return returns } -func JsonFormatter_AnyHash() interface{} { + +func NewSyncVirtualMethods() SyncVirtualMethods { _init_.Initialize() - var returns interface{} + j := jsiiProxy_SyncVirtualMethods{} - _jsii_.StaticInvoke( - "jsii-calc.JsonFormatter", - "anyHash", + _jsii_.Create( + "jsii-calc.SyncVirtualMethods", nil, // no parameters - &returns, + &j, ) - return returns + return &j } -func JsonFormatter_AnyNull() interface{} { +func NewSyncVirtualMethods_Override(s SyncVirtualMethods) { _init_.Initialize() - var returns interface{} - - _jsii_.StaticInvoke( - "jsii-calc.JsonFormatter", - "anyNull", + _jsii_.Create( + "jsii-calc.SyncVirtualMethods", nil, // no parameters - &returns, + s, ) - - return returns } -func JsonFormatter_AnyNumber() interface{} { - _init_.Initialize() +func (j *jsiiProxy_SyncVirtualMethods)SetA(val *float64) { + _jsii_.Set( + j, + "a", + val, + ) +} - var returns interface{} +func (j *jsiiProxy_SyncVirtualMethods)SetCallerIsProperty(val *float64) { + _jsii_.Set( + j, + "callerIsProperty", + val, + ) +} - _jsii_.StaticInvoke( - "jsii-calc.JsonFormatter", - "anyNumber", - nil, // no parameters - &returns, +func (j *jsiiProxy_SyncVirtualMethods)SetOtherProperty(val *string) { + _jsii_.Set( + j, + "otherProperty", + val, ) +} - return returns +func (j *jsiiProxy_SyncVirtualMethods)SetTheProperty(val *string) { + _jsii_.Set( + j, + "theProperty", + val, + ) } -func JsonFormatter_AnyRef() interface{} { - _init_.Initialize() +func (j *jsiiProxy_SyncVirtualMethods)SetValueOfOtherProperty(val *string) { + _jsii_.Set( + j, + "valueOfOtherProperty", + val, + ) +} - var returns interface{} +func (s *jsiiProxy_SyncVirtualMethods) CallerIsAsync() *float64 { + var returns *float64 - _jsii_.StaticInvoke( - "jsii-calc.JsonFormatter", - "anyRef", + _jsii_.Invoke( + s, + "callerIsAsync", nil, // no parameters &returns, ) @@ -16149,14 +16856,12 @@ func JsonFormatter_AnyRef() interface{} { return returns } -func JsonFormatter_AnyString() interface{} { - _init_.Initialize() - - var returns interface{} +func (s *jsiiProxy_SyncVirtualMethods) CallerIsMethod() *float64 { + var returns *float64 - _jsii_.StaticInvoke( - "jsii-calc.JsonFormatter", - "anyString", + _jsii_.Invoke( + s, + "callerIsMethod", nil, // no parameters &returns, ) @@ -16164,29 +16869,28 @@ func JsonFormatter_AnyString() interface{} { return returns } -func JsonFormatter_AnyUndefined() interface{} { - _init_.Initialize() - - var returns interface{} - - _jsii_.StaticInvoke( - "jsii-calc.JsonFormatter", - "anyUndefined", - nil, // no parameters - &returns, +func (s *jsiiProxy_SyncVirtualMethods) ModifyOtherProperty(value *string) { + _jsii_.InvokeVoid( + s, + "modifyOtherProperty", + []interface{}{value}, ) - - return returns } -func JsonFormatter_AnyZero() interface{} { - _init_.Initialize() +func (s *jsiiProxy_SyncVirtualMethods) ModifyValueOfTheProperty(value *string) { + _jsii_.InvokeVoid( + s, + "modifyValueOfTheProperty", + []interface{}{value}, + ) +} - var returns interface{} +func (s *jsiiProxy_SyncVirtualMethods) ReadA() *float64 { + var returns *float64 - _jsii_.StaticInvoke( - "jsii-calc.JsonFormatter", - "anyZero", + _jsii_.Invoke( + s, + "readA", nil, // no parameters &returns, ) @@ -16194,166 +16898,70 @@ func JsonFormatter_AnyZero() interface{} { return returns } -func JsonFormatter_Stringify(value interface{}) *string { - _init_.Initialize() - +func (s *jsiiProxy_SyncVirtualMethods) RetrieveOtherProperty() *string { var returns *string - _jsii_.StaticInvoke( - "jsii-calc.JsonFormatter", - "stringify", - []interface{}{value}, + _jsii_.Invoke( + s, + "retrieveOtherProperty", + nil, // no parameters &returns, ) return returns } +func (s *jsiiProxy_SyncVirtualMethods) RetrieveReadOnlyProperty() *string { + var returns *string -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_LevelOne.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -// Validates that nested classes get correct code generation for the occasional forward reference. -type LevelOne interface { - Props() *LevelOneProps -} - -// The jsii proxy struct for LevelOne -type jsiiProxy_LevelOne struct { - _ byte // padding -} - -func (j *jsiiProxy_LevelOne) Props() *LevelOneProps { - var returns *LevelOneProps - _jsii_.Get( - j, - "props", + _jsii_.Invoke( + s, + "retrieveReadOnlyProperty", + nil, // no parameters &returns, ) - return returns -} - - -func NewLevelOne(props *LevelOneProps) LevelOne { - _init_.Initialize() - - j := jsiiProxy_LevelOne{} - - _jsii_.Create( - "jsii-calc.LevelOne", - []interface{}{props}, - &j, - ) - return &j + return returns } -func NewLevelOne_Override(l LevelOne, props *LevelOneProps) { - _init_.Initialize() +func (s *jsiiProxy_SyncVirtualMethods) RetrieveValueOfTheProperty() *string { + var returns *string - _jsii_.Create( - "jsii-calc.LevelOne", - []interface{}{props}, - l, + _jsii_.Invoke( + s, + "retrieveValueOfTheProperty", + nil, // no parameters + &returns, ) -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_LevelOne_PropBooleanValue.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -type LevelOne_PropBooleanValue struct { - Value *bool \`field:"required" json:"value" yaml:"value"\` -} - - -`; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_LevelOne_PropProperty.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -type LevelOne_PropProperty struct { - Prop *LevelOne_PropBooleanValue \`field:"required" json:"prop" yaml:"prop"\` -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_LevelOneProps.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -type LevelOneProps struct { - Prop *LevelOne_PropProperty \`field:"required" json:"prop" yaml:"prop"\` + return returns } +func (s *jsiiProxy_SyncVirtualMethods) VirtualMethod(n *float64) *float64 { + var returns *float64 -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_LoadBalancedFargateServiceProps.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -// jsii#298: show default values in sphinx documentation, and respect newlines. -type LoadBalancedFargateServiceProps struct { - // The container port of the application load balancer attached to your Fargate service. - // - // Corresponds to container port mapping. - ContainerPort *float64 \`field:"optional" json:"containerPort" yaml:"containerPort"\` - // 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. - Cpu *string \`field:"optional" json:"cpu" yaml:"cpu"\` - // 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. - MemoryMiB *string \`field:"optional" json:"memoryMiB" yaml:"memoryMiB"\` - // Determines whether the Application Load Balancer will be internet-facing. - PublicLoadBalancer *bool \`field:"optional" json:"publicLoadBalancer" yaml:"publicLoadBalancer"\` - // Determines whether your Fargate Service will be assigned a public IP address. - PublicTasks *bool \`field:"optional" json:"publicTasks" yaml:"publicTasks"\` + _jsii_.Invoke( + s, + "virtualMethod", + []interface{}{n}, + &returns, + ) + + return returns +} + +func (s *jsiiProxy_SyncVirtualMethods) WriteA(value *float64) { + _jsii_.InvokeVoid( + s, + "writeA", + []interface{}{value}, + ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_MethodNamedProperty.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/TestStructWithEnum.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -16362,34 +16970,50 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type MethodNamedProperty interface { - Elite() *float64 - Property() *string +type TestStructWithEnum interface { + // Returns \`foo: StringEnum.A\`. + StructWithFoo() *StructWithEnum + // Returns \`foo: StringEnum.C\` and \`bar: AllTypesEnum.MY_ENUM_VALUE\`. + StructWithFooBar() *StructWithEnum + // Returns true if \`foo\` is \`StringEnum.A\`. + IsStringEnumA(input *StructWithEnum) *bool + // Returns true if \`foo\` is \`StringEnum.B\` and \`bar\` is \`AllTypesEnum.THIS_IS_GREAT\`. + IsStringEnumB(input *StructWithEnum) *bool } -// The jsii proxy struct for MethodNamedProperty -type jsiiProxy_MethodNamedProperty struct { +// The jsii proxy struct for TestStructWithEnum +type jsiiProxy_TestStructWithEnum struct { _ byte // padding } -func (j *jsiiProxy_MethodNamedProperty) Elite() *float64 { - var returns *float64 +func (j *jsiiProxy_TestStructWithEnum) StructWithFoo() *StructWithEnum { + var returns *StructWithEnum _jsii_.Get( j, - "elite", + "structWithFoo", &returns, ) return returns } +func (j *jsiiProxy_TestStructWithEnum) StructWithFooBar() *StructWithEnum { + var returns *StructWithEnum + _jsii_.Get( + j, + "structWithFooBar", + &returns, + ) + return returns +} -func NewMethodNamedProperty() MethodNamedProperty { + +func NewTestStructWithEnum() TestStructWithEnum { _init_.Initialize() - j := jsiiProxy_MethodNamedProperty{} + j := jsiiProxy_TestStructWithEnum{} _jsii_.Create( - "jsii-calc.MethodNamedProperty", + "jsii-calc.TestStructWithEnum", nil, // no parameters &j, ) @@ -16397,23 +17021,36 @@ func NewMethodNamedProperty() MethodNamedProperty { return &j } -func NewMethodNamedProperty_Override(m MethodNamedProperty) { +func NewTestStructWithEnum_Override(t TestStructWithEnum) { _init_.Initialize() _jsii_.Create( - "jsii-calc.MethodNamedProperty", + "jsii-calc.TestStructWithEnum", nil, // no parameters - m, + t, ) } -func (m *jsiiProxy_MethodNamedProperty) Property() *string { - var returns *string +func (t *jsiiProxy_TestStructWithEnum) IsStringEnumA(input *StructWithEnum) *bool { + var returns *bool _jsii_.Invoke( - m, - "property", - nil, // no parameters + t, + "isStringEnumA", + []interface{}{input}, + &returns, + ) + + return returns +} + +func (t *jsiiProxy_TestStructWithEnum) IsStringEnumB(input *StructWithEnum) *bool { + var returns *bool + + _jsii_.Invoke( + t, + "isStringEnumB", + []interface{}{input}, &returns, ) @@ -16423,112 +17060,155 @@ func (m *jsiiProxy_MethodNamedProperty) Property() *string { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Multiply.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/Thrower.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" - - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ) -// The "*" binary operation. -type Multiply interface { - BinaryOperation - IFriendlier - IRandomNumberGenerator - // Left-hand side operand. - Lhs() scopejsiicalclib.NumericValue - // Right-hand side operand. - Rhs() scopejsiicalclib.NumericValue - // The value. - Value() *float64 - // Say farewell. - Farewell() *string - // Say goodbye. - Goodbye() *string - // Say hello! - Hello() *string - // Returns another random number. - Next() *float64 - // String representation of the value. - ToString() *string - // Returns: the name of the class (to verify native type names are created for derived classes). - TypeName() interface{} +type Thrower interface { + ThrowError() } -// The jsii proxy struct for Multiply -type jsiiProxy_Multiply struct { - jsiiProxy_BinaryOperation - jsiiProxy_IFriendlier - jsiiProxy_IRandomNumberGenerator +// The jsii proxy struct for Thrower +type jsiiProxy_Thrower struct { + _ byte // padding } -func (j *jsiiProxy_Multiply) Lhs() scopejsiicalclib.NumericValue { - var returns scopejsiicalclib.NumericValue - _jsii_.Get( - j, - "lhs", - &returns, +func NewThrower() Thrower { + _init_.Initialize() + + j := jsiiProxy_Thrower{} + + _jsii_.Create( + "jsii-calc.Thrower", + nil, // no parameters + &j, ) - return returns + + return &j } -func (j *jsiiProxy_Multiply) Rhs() scopejsiicalclib.NumericValue { - var returns scopejsiicalclib.NumericValue +func NewThrower_Override(t Thrower) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.Thrower", + nil, // no parameters + t, + ) +} + +func (t *jsiiProxy_Thrower) ThrowError() { + _jsii_.InvokeVoid( + t, + "throwError", + nil, // no parameters + ) +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/TopLevelStruct.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + + +type TopLevelStruct struct { + // This is a required field. + Required *string \`field:"required" json:"required" yaml:"required"\` + // A union to really stress test our serialization. + SecondLevel interface{} \`field:"required" json:"secondLevel" yaml:"secondLevel"\` + // You don't have to pass this. + Optional *string \`field:"optional" json:"optional" yaml:"optional"\` +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/TwoMethodsWithSimilarCapitalization.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +// In TypeScript it is possible to have two methods with the same name but different capitalization. +// See: https://github.com/aws/jsii/issues/2508 +// +type TwoMethodsWithSimilarCapitalization interface { + FooBar() *float64 + // Deprecated: YES. + FooBAR() *float64 + ToIsoString() *string + // Deprecated: python requires that all alternatives are deprecated. + ToIsOString() *string + // Deprecated: python requires that all alternatives are deprecated. + ToISOString() *string +} + +// The jsii proxy struct for TwoMethodsWithSimilarCapitalization +type jsiiProxy_TwoMethodsWithSimilarCapitalization struct { + _ byte // padding +} + +func (j *jsiiProxy_TwoMethodsWithSimilarCapitalization) FooBar() *float64 { + var returns *float64 _jsii_.Get( j, - "rhs", + "fooBar", &returns, ) return returns } -func (j *jsiiProxy_Multiply) Value() *float64 { +func (j *jsiiProxy_TwoMethodsWithSimilarCapitalization) FooBAR() *float64 { var returns *float64 _jsii_.Get( j, - "value", + "fooBAR", &returns, ) return returns } -// Creates a BinaryOperation. -func NewMultiply(lhs scopejsiicalclib.NumericValue, rhs scopejsiicalclib.NumericValue) Multiply { +func NewTwoMethodsWithSimilarCapitalization() TwoMethodsWithSimilarCapitalization { _init_.Initialize() - j := jsiiProxy_Multiply{} + j := jsiiProxy_TwoMethodsWithSimilarCapitalization{} _jsii_.Create( - "jsii-calc.Multiply", - []interface{}{lhs, rhs}, + "jsii-calc.TwoMethodsWithSimilarCapitalization", + nil, // no parameters &j, ) return &j } -// Creates a BinaryOperation. -func NewMultiply_Override(m Multiply, lhs scopejsiicalclib.NumericValue, rhs scopejsiicalclib.NumericValue) { +func NewTwoMethodsWithSimilarCapitalization_Override(t TwoMethodsWithSimilarCapitalization) { _init_.Initialize() _jsii_.Create( - "jsii-calc.Multiply", - []interface{}{lhs, rhs}, - m, + "jsii-calc.TwoMethodsWithSimilarCapitalization", + nil, // no parameters + t, ) } -func (m *jsiiProxy_Multiply) Farewell() *string { +func (t *jsiiProxy_TwoMethodsWithSimilarCapitalization) ToIsoString() *string { var returns *string _jsii_.Invoke( - m, - "farewell", + t, + "toIsoString", nil, // no parameters &returns, ) @@ -16536,12 +17216,12 @@ func (m *jsiiProxy_Multiply) Farewell() *string { return returns } -func (m *jsiiProxy_Multiply) Goodbye() *string { +func (t *jsiiProxy_TwoMethodsWithSimilarCapitalization) ToIsOString() *string { var returns *string _jsii_.Invoke( - m, - "goodbye", + t, + "toIsOString", nil, // no parameters &returns, ) @@ -16549,12 +17229,12 @@ func (m *jsiiProxy_Multiply) Goodbye() *string { return returns } -func (m *jsiiProxy_Multiply) Hello() *string { +func (t *jsiiProxy_TwoMethodsWithSimilarCapitalization) ToISOString() *string { var returns *string _jsii_.Invoke( - m, - "hello", + t, + "toISOString", nil, // no parameters &returns, ) @@ -16562,38 +17242,38 @@ func (m *jsiiProxy_Multiply) Hello() *string { return returns } -func (m *jsiiProxy_Multiply) Next() *float64 { - var returns *float64 - _jsii_.Invoke( - m, - "next", - nil, // no parameters - &returns, - ) +`; - return returns -} +exports[`Generated code for "jsii-calc": /go/jsiicalc/UmaskCheck.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc -func (m *jsiiProxy_Multiply) ToString() *string { - var returns *string +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) - _jsii_.Invoke( - m, - "toString", - nil, // no parameters - &returns, - ) +// Checks the current file permissions are cool (no funky UMASK down-scoping happened). +// See: https://github.com/aws/jsii/issues/1765 +// +type UmaskCheck interface { +} - return returns +// The jsii proxy struct for UmaskCheck +type jsiiProxy_UmaskCheck struct { + _ byte // padding } -func (m *jsiiProxy_Multiply) TypeName() interface{} { - var returns interface{} +// This should return 0o644 (-rw-r--r--). +func UmaskCheck_Mode() *float64 { + _init_.Initialize() - _jsii_.Invoke( - m, - "typeName", + var returns *float64 + + _jsii_.StaticInvoke( + "jsii-calc.UmaskCheck", + "mode", nil, // no parameters &returns, ) @@ -16604,7 +17284,7 @@ func (m *jsiiProxy_Multiply) TypeName() interface{} { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Negate.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/UnaryOperation.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -16612,35 +17292,30 @@ import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/internal" "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ) -// The negation operation ("-value"). -type Negate interface { - UnaryOperation - IFriendlier +// An operation on a single operand. +type UnaryOperation interface { + scopejsiicalclib.Operation Operand() scopejsiicalclib.NumericValue // The value. + // Deprecated. Value() *float64 - // Say farewell. - Farewell() *string - // Say goodbye. - Goodbye() *string - // Say hello! - Hello() *string // String representation of the value. + // Deprecated. ToString() *string // Returns: the name of the class (to verify native type names are created for derived classes). TypeName() interface{} } -// The jsii proxy struct for Negate -type jsiiProxy_Negate struct { - jsiiProxy_UnaryOperation - jsiiProxy_IFriendlier +// The jsii proxy struct for UnaryOperation +type jsiiProxy_UnaryOperation struct { + internal.Type__scopejsiicalclibOperation } -func (j *jsiiProxy_Negate) Operand() scopejsiicalclib.NumericValue { +func (j *jsiiProxy_UnaryOperation) Operand() scopejsiicalclib.NumericValue { var returns scopejsiicalclib.NumericValue _jsii_.Get( j, @@ -16650,7 +17325,7 @@ func (j *jsiiProxy_Negate) Operand() scopejsiicalclib.NumericValue { return returns } -func (j *jsiiProxy_Negate) Value() *float64 { +func (j *jsiiProxy_UnaryOperation) Value() *float64 { var returns *float64 _jsii_.Get( j, @@ -16661,74 +17336,21 @@ func (j *jsiiProxy_Negate) Value() *float64 { } -func NewNegate(operand scopejsiicalclib.NumericValue) Negate { - _init_.Initialize() - - j := jsiiProxy_Negate{} - - _jsii_.Create( - "jsii-calc.Negate", - []interface{}{operand}, - &j, - ) - - return &j -} - -func NewNegate_Override(n Negate, operand scopejsiicalclib.NumericValue) { +func NewUnaryOperation_Override(u UnaryOperation, operand scopejsiicalclib.NumericValue) { _init_.Initialize() _jsii_.Create( - "jsii-calc.Negate", + "jsii-calc.UnaryOperation", []interface{}{operand}, - n, - ) -} - -func (n *jsiiProxy_Negate) Farewell() *string { - var returns *string - - _jsii_.Invoke( - n, - "farewell", - nil, // no parameters - &returns, - ) - - return returns -} - -func (n *jsiiProxy_Negate) Goodbye() *string { - var returns *string - - _jsii_.Invoke( - n, - "goodbye", - nil, // no parameters - &returns, - ) - - return returns -} - -func (n *jsiiProxy_Negate) Hello() *string { - var returns *string - - _jsii_.Invoke( - n, - "hello", - nil, // no parameters - &returns, + u, ) - - return returns } -func (n *jsiiProxy_Negate) ToString() *string { +func (u *jsiiProxy_UnaryOperation) ToString() *string { var returns *string _jsii_.Invoke( - n, + u, "toString", nil, // no parameters &returns, @@ -16737,11 +17359,11 @@ func (n *jsiiProxy_Negate) ToString() *string { return returns } -func (n *jsiiProxy_Negate) TypeName() interface{} { +func (u *jsiiProxy_UnaryOperation) TypeName() interface{} { var returns interface{} _jsii_.Invoke( - n, + u, "typeName", nil, // no parameters &returns, @@ -16753,155 +17375,139 @@ func (n *jsiiProxy_Negate) TypeName() interface{} { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_NestedClassInstance.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" - - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib/customsubmodulename" -) - -type NestedClassInstance interface { -} - -// The jsii proxy struct for NestedClassInstance -type jsiiProxy_NestedClassInstance struct { - _ byte // padding -} - -func NestedClassInstance_MakeInstance() customsubmodulename.NestingClass_NestedClass { - _init_.Initialize() - - var returns customsubmodulename.NestingClass_NestedClass - - _jsii_.StaticInvoke( - "jsii-calc.NestedClassInstance", - "makeInstance", - nil, // no parameters - &returns, - ) - - return returns -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_NestedStruct.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/UnionProperties.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc -type NestedStruct struct { - // When provided, must be > 0. - NumberProp *float64 \`field:"required" json:"numberProp" yaml:"numberProp"\` +type UnionProperties struct { + Bar interface{} \`field:"required" json:"bar" yaml:"bar"\` + Foo interface{} \`field:"optional" json:"foo" yaml:"foo"\` } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_NodeStandardLibrary.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/UpcasingReflectable.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" + + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/internal" + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib/customsubmodulename" ) -// Test fixture to verify that jsii modules can use the node standard library. -type NodeStandardLibrary interface { - // Returns the current os.platform() from the "os" node module. - OsPlatform() *string - // Uses node.js "crypto" module to calculate sha256 of a string. - // - // Returns: "6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50". - CryptoSha256() *string - // Reads a local resource file (resource.txt) asynchronously. - // - // Returns: "Hello, resource!" - FsReadFile() *string - // Sync version of fsReadFile. - // - // Returns: "Hello, resource! SYNC!" - FsReadFileSync() *string +// Ensures submodule-imported types from dependencies can be used correctly. +type UpcasingReflectable interface { + customsubmodulename.IReflectable + Entries() *[]*customsubmodulename.ReflectableEntry } -// The jsii proxy struct for NodeStandardLibrary -type jsiiProxy_NodeStandardLibrary struct { - _ byte // padding +// The jsii proxy struct for UpcasingReflectable +type jsiiProxy_UpcasingReflectable struct { + internal.Type__customsubmodulenameIReflectable } -func (j *jsiiProxy_NodeStandardLibrary) OsPlatform() *string { - var returns *string +func (j *jsiiProxy_UpcasingReflectable) Entries() *[]*customsubmodulename.ReflectableEntry { + var returns *[]*customsubmodulename.ReflectableEntry _jsii_.Get( j, - "osPlatform", + "entries", &returns, ) return returns } -func NewNodeStandardLibrary() NodeStandardLibrary { +func NewUpcasingReflectable(delegate *map[string]interface{}) UpcasingReflectable { _init_.Initialize() - j := jsiiProxy_NodeStandardLibrary{} + j := jsiiProxy_UpcasingReflectable{} _jsii_.Create( - "jsii-calc.NodeStandardLibrary", - nil, // no parameters + "jsii-calc.UpcasingReflectable", + []interface{}{delegate}, &j, ) return &j } -func NewNodeStandardLibrary_Override(n NodeStandardLibrary) { +func NewUpcasingReflectable_Override(u UpcasingReflectable, delegate *map[string]interface{}) { _init_.Initialize() _jsii_.Create( - "jsii-calc.NodeStandardLibrary", - nil, // no parameters - n, + "jsii-calc.UpcasingReflectable", + []interface{}{delegate}, + u, ) } -func (n *jsiiProxy_NodeStandardLibrary) CryptoSha256() *string { - var returns *string +func UpcasingReflectable_Reflector() customsubmodulename.Reflector { + _init_.Initialize() + var returns customsubmodulename.Reflector + _jsii_.StaticGet( + "jsii-calc.UpcasingReflectable", + "reflector", + &returns, + ) + return returns +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/UseBundledDependency.go 1`] = ` +// A simple calcuator built on JSII. +package jsiicalc + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +type UseBundledDependency interface { + Value() interface{} +} + +// The jsii proxy struct for UseBundledDependency +type jsiiProxy_UseBundledDependency struct { + _ byte // padding +} + +func NewUseBundledDependency() UseBundledDependency { + _init_.Initialize() + + j := jsiiProxy_UseBundledDependency{} - _jsii_.Invoke( - n, - "cryptoSha256", + _jsii_.Create( + "jsii-calc.UseBundledDependency", nil, // no parameters - &returns, + &j, ) - return returns + return &j } -func (n *jsiiProxy_NodeStandardLibrary) FsReadFile() *string { - var returns *string +func NewUseBundledDependency_Override(u UseBundledDependency) { + _init_.Initialize() - _jsii_.Invoke( - n, - "fsReadFile", + _jsii_.Create( + "jsii-calc.UseBundledDependency", nil, // no parameters - &returns, + u, ) - - return returns } -func (n *jsiiProxy_NodeStandardLibrary) FsReadFileSync() *string { - var returns *string +func (u *jsiiProxy_UseBundledDependency) Value() interface{} { + var returns interface{} _jsii_.Invoke( - n, - "fsReadFileSync", + u, + "value", nil, // no parameters &returns, ) @@ -16912,113 +17518,68 @@ func (n *jsiiProxy_NodeStandardLibrary) FsReadFileSync() *string { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_NullShouldBeTreatedAsUndefined.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/UseCalcBase.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" + + "github.com/aws/jsii/jsii-calc/go/jcb" ) -// jsii#282, aws-cdk#157: null should be treated as "undefined". -type NullShouldBeTreatedAsUndefined interface { - ChangeMeToUndefined() *string - SetChangeMeToUndefined(val *string) - GiveMeUndefined(value interface{}) - GiveMeUndefinedInsideAnObject(input *NullShouldBeTreatedAsUndefinedData) - VerifyPropertyIsUndefined() +// Depend on a type from jsii-calc-base as a test for awslabs/jsii#128. +type UseCalcBase interface { + Hello() jcb.Base } -// The jsii proxy struct for NullShouldBeTreatedAsUndefined -type jsiiProxy_NullShouldBeTreatedAsUndefined struct { +// The jsii proxy struct for UseCalcBase +type jsiiProxy_UseCalcBase struct { _ byte // padding } -func (j *jsiiProxy_NullShouldBeTreatedAsUndefined) ChangeMeToUndefined() *string { - var returns *string - _jsii_.Get( - j, - "changeMeToUndefined", - &returns, - ) - return returns -} - - -func NewNullShouldBeTreatedAsUndefined(_param1 *string, optional interface{}) NullShouldBeTreatedAsUndefined { +func NewUseCalcBase() UseCalcBase { _init_.Initialize() - j := jsiiProxy_NullShouldBeTreatedAsUndefined{} + j := jsiiProxy_UseCalcBase{} _jsii_.Create( - "jsii-calc.NullShouldBeTreatedAsUndefined", - []interface{}{_param1, optional}, + "jsii-calc.UseCalcBase", + nil, // no parameters &j, ) return &j } -func NewNullShouldBeTreatedAsUndefined_Override(n NullShouldBeTreatedAsUndefined, _param1 *string, optional interface{}) { +func NewUseCalcBase_Override(u UseCalcBase) { _init_.Initialize() _jsii_.Create( - "jsii-calc.NullShouldBeTreatedAsUndefined", - []interface{}{_param1, optional}, - n, - ) -} - -func (j *jsiiProxy_NullShouldBeTreatedAsUndefined)SetChangeMeToUndefined(val *string) { - _jsii_.Set( - j, - "changeMeToUndefined", - val, - ) -} - -func (n *jsiiProxy_NullShouldBeTreatedAsUndefined) GiveMeUndefined(value interface{}) { - _jsii_.InvokeVoid( - n, - "giveMeUndefined", - []interface{}{value}, + "jsii-calc.UseCalcBase", + nil, // no parameters + u, ) } -func (n *jsiiProxy_NullShouldBeTreatedAsUndefined) GiveMeUndefinedInsideAnObject(input *NullShouldBeTreatedAsUndefinedData) { - _jsii_.InvokeVoid( - n, - "giveMeUndefinedInsideAnObject", - []interface{}{input}, - ) -} +func (u *jsiiProxy_UseCalcBase) Hello() jcb.Base { + var returns jcb.Base -func (n *jsiiProxy_NullShouldBeTreatedAsUndefined) VerifyPropertyIsUndefined() { - _jsii_.InvokeVoid( - n, - "verifyPropertyIsUndefined", + _jsii_.Invoke( + u, + "hello", nil, // no parameters + &returns, ) -} - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_NullShouldBeTreatedAsUndefinedData.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -type NullShouldBeTreatedAsUndefinedData struct { - ArrayWithThreeElementsAndUndefinedAsSecondArgument *[]interface{} \`field:"required" json:"arrayWithThreeElementsAndUndefinedAsSecondArgument" yaml:"arrayWithThreeElementsAndUndefinedAsSecondArgument"\` - ThisShouldBeUndefined interface{} \`field:"optional" json:"thisShouldBeUndefined" yaml:"thisShouldBeUndefined"\` + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_NumberGenerator.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/UsesInterfaceWithProperties.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -17027,82 +17588,86 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// This allows us to test that a reference can be stored for objects that implement interfaces. -type NumberGenerator interface { - Generator() IRandomNumberGenerator - SetGenerator(val IRandomNumberGenerator) - IsSameGenerator(gen IRandomNumberGenerator) *bool - NextTimes100() *float64 +type UsesInterfaceWithProperties interface { + Obj() IInterfaceWithProperties + JustRead() *string + ReadStringAndNumber(ext IInterfaceWithPropertiesExtension) *string + WriteAndRead(value *string) *string } -// The jsii proxy struct for NumberGenerator -type jsiiProxy_NumberGenerator struct { +// The jsii proxy struct for UsesInterfaceWithProperties +type jsiiProxy_UsesInterfaceWithProperties struct { _ byte // padding } -func (j *jsiiProxy_NumberGenerator) Generator() IRandomNumberGenerator { - var returns IRandomNumberGenerator +func (j *jsiiProxy_UsesInterfaceWithProperties) Obj() IInterfaceWithProperties { + var returns IInterfaceWithProperties _jsii_.Get( j, - "generator", + "obj", &returns, ) return returns } -func NewNumberGenerator(generator IRandomNumberGenerator) NumberGenerator { +func NewUsesInterfaceWithProperties(obj IInterfaceWithProperties) UsesInterfaceWithProperties { _init_.Initialize() - j := jsiiProxy_NumberGenerator{} + j := jsiiProxy_UsesInterfaceWithProperties{} _jsii_.Create( - "jsii-calc.NumberGenerator", - []interface{}{generator}, + "jsii-calc.UsesInterfaceWithProperties", + []interface{}{obj}, &j, ) return &j } -func NewNumberGenerator_Override(n NumberGenerator, generator IRandomNumberGenerator) { +func NewUsesInterfaceWithProperties_Override(u UsesInterfaceWithProperties, obj IInterfaceWithProperties) { _init_.Initialize() _jsii_.Create( - "jsii-calc.NumberGenerator", - []interface{}{generator}, - n, + "jsii-calc.UsesInterfaceWithProperties", + []interface{}{obj}, + u, ) } -func (j *jsiiProxy_NumberGenerator)SetGenerator(val IRandomNumberGenerator) { - _jsii_.Set( - j, - "generator", - val, +func (u *jsiiProxy_UsesInterfaceWithProperties) JustRead() *string { + var returns *string + + _jsii_.Invoke( + u, + "justRead", + nil, // no parameters + &returns, ) + + return returns } -func (n *jsiiProxy_NumberGenerator) IsSameGenerator(gen IRandomNumberGenerator) *bool { - var returns *bool +func (u *jsiiProxy_UsesInterfaceWithProperties) ReadStringAndNumber(ext IInterfaceWithPropertiesExtension) *string { + var returns *string _jsii_.Invoke( - n, - "isSameGenerator", - []interface{}{gen}, + u, + "readStringAndNumber", + []interface{}{ext}, &returns, ) return returns } -func (n *jsiiProxy_NumberGenerator) NextTimes100() *float64 { - var returns *float64 +func (u *jsiiProxy_UsesInterfaceWithProperties) WriteAndRead(value *string) *string { + var returns *string _jsii_.Invoke( - n, - "nextTimes100", - nil, // no parameters + u, + "writeAndRead", + []interface{}{value}, &returns, ) @@ -17112,74 +17677,60 @@ func (n *jsiiProxy_NumberGenerator) NextTimes100() *float64 { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ObjectRefsInCollections.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/VariadicInvoker.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" - - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ) -// Verify that object references can be passed inside collections. -type ObjectRefsInCollections interface { - // Returns the sum of all values. - SumFromArray(values *[]scopejsiicalclib.NumericValue) *float64 - // Returns the sum of all values in a map. - SumFromMap(values *map[string]scopejsiicalclib.NumericValue) *float64 +type VariadicInvoker interface { + AsArray(values ...*float64) *[]*float64 } -// The jsii proxy struct for ObjectRefsInCollections -type jsiiProxy_ObjectRefsInCollections struct { +// The jsii proxy struct for VariadicInvoker +type jsiiProxy_VariadicInvoker struct { _ byte // padding } -func NewObjectRefsInCollections() ObjectRefsInCollections { +func NewVariadicInvoker(method VariadicMethod) VariadicInvoker { _init_.Initialize() - j := jsiiProxy_ObjectRefsInCollections{} + j := jsiiProxy_VariadicInvoker{} _jsii_.Create( - "jsii-calc.ObjectRefsInCollections", - nil, // no parameters + "jsii-calc.VariadicInvoker", + []interface{}{method}, &j, ) return &j } -func NewObjectRefsInCollections_Override(o ObjectRefsInCollections) { +func NewVariadicInvoker_Override(v VariadicInvoker, method VariadicMethod) { _init_.Initialize() _jsii_.Create( - "jsii-calc.ObjectRefsInCollections", - nil, // no parameters - o, + "jsii-calc.VariadicInvoker", + []interface{}{method}, + v, ) } -func (o *jsiiProxy_ObjectRefsInCollections) SumFromArray(values *[]scopejsiicalclib.NumericValue) *float64 { - var returns *float64 - - _jsii_.Invoke( - o, - "sumFromArray", - []interface{}{values}, - &returns, - ) - - return returns -} +func (v *jsiiProxy_VariadicInvoker) AsArray(values ...*float64) *[]*float64 { + args := []interface{}{} + for _, a := range values { + args = append(args, a) + } -func (o *jsiiProxy_ObjectRefsInCollections) SumFromMap(values *map[string]scopejsiicalclib.NumericValue) *float64 { - var returns *float64 + var returns *[]*float64 _jsii_.Invoke( - o, - "sumFromMap", - []interface{}{values}, + v, + "asArray", + args, &returns, ) @@ -17189,7 +17740,7 @@ func (o *jsiiProxy_ObjectRefsInCollections) SumFromMap(values *map[string]scopej `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ObjectWithPropertyProvider.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/VariadicMethod.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -17198,23 +17749,61 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type ObjectWithPropertyProvider interface { +type VariadicMethod interface { + AsArray(first *float64, others ...*float64) *[]*float64 } -// The jsii proxy struct for ObjectWithPropertyProvider -type jsiiProxy_ObjectWithPropertyProvider struct { +// The jsii proxy struct for VariadicMethod +type jsiiProxy_VariadicMethod struct { _ byte // padding } -func ObjectWithPropertyProvider_Provide() IObjectWithProperty { +func NewVariadicMethod(prefix ...*float64) VariadicMethod { _init_.Initialize() - var returns IObjectWithProperty + args := []interface{}{} + for _, a := range prefix { + args = append(args, a) + } - _jsii_.StaticInvoke( - "jsii-calc.ObjectWithPropertyProvider", - "provide", - nil, // no parameters + j := jsiiProxy_VariadicMethod{} + + _jsii_.Create( + "jsii-calc.VariadicMethod", + args, + &j, + ) + + return &j +} + +func NewVariadicMethod_Override(v VariadicMethod, prefix ...*float64) { + _init_.Initialize() + + args := []interface{}{} + for _, a := range prefix { + args = append(args, a) + } + + _jsii_.Create( + "jsii-calc.VariadicMethod", + args, + v, + ) +} + +func (v *jsiiProxy_VariadicMethod) AsArray(first *float64, others ...*float64) *[]*float64 { + args := []interface{}{first} + for _, a := range others { + args = append(args, a) + } + + var returns *[]*float64 + + _jsii_.Invoke( + v, + "asArray", + args, &returns, ) @@ -17224,7 +17813,7 @@ func ObjectWithPropertyProvider_Provide() IObjectWithProperty { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Old.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/VariadicTypeUnion.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -17233,61 +17822,73 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// Old class. -// Deprecated: Use the new class or the old class whatever you want because -// whatever you like is always the best. -type Old interface { - // Doo wop that thing. - // Deprecated: Use the new class or the old class whatever you want because - // whatever you like is always the best. - DoAThing() +type VariadicTypeUnion interface { + Union() *[]interface{} + SetUnion(val *[]interface{}) } -// The jsii proxy struct for Old -type jsiiProxy_Old struct { +// The jsii proxy struct for VariadicTypeUnion +type jsiiProxy_VariadicTypeUnion struct { _ byte // padding } -// Deprecated: Use the new class or the old class whatever you want because -// whatever you like is always the best. -func NewOld() Old { +func (j *jsiiProxy_VariadicTypeUnion) Union() *[]interface{} { + var returns *[]interface{} + _jsii_.Get( + j, + "union", + &returns, + ) + return returns +} + + +func NewVariadicTypeUnion(union ...interface{}) VariadicTypeUnion { _init_.Initialize() - j := jsiiProxy_Old{} + args := []interface{}{} + for _, a := range union { + args = append(args, a) + } + + j := jsiiProxy_VariadicTypeUnion{} _jsii_.Create( - "jsii-calc.Old", - nil, // no parameters + "jsii-calc.VariadicTypeUnion", + args, &j, ) return &j } -// Deprecated: Use the new class or the old class whatever you want because -// whatever you like is always the best. -func NewOld_Override(o Old) { +func NewVariadicTypeUnion_Override(v VariadicTypeUnion, union ...interface{}) { _init_.Initialize() + args := []interface{}{} + for _, a := range union { + args = append(args, a) + } + _jsii_.Create( - "jsii-calc.Old", - nil, // no parameters - o, + "jsii-calc.VariadicTypeUnion", + args, + v, ) } -func (o *jsiiProxy_Old) DoAThing() { - _jsii_.InvokeVoid( - o, - "doAThing", - nil, // no parameters +func (j *jsiiProxy_VariadicTypeUnion)SetUnion(val *[]interface{}) { + _jsii_.Set( + j, + "union", + val, ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_OptionalArgumentInvoker.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/VirtualMethodPlayground.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -17296,152 +17897,112 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type OptionalArgumentInvoker interface { - InvokeWithOptional() - InvokeWithoutOptional() +type VirtualMethodPlayground interface { + OverrideMeAsync(index *float64) *float64 + OverrideMeSync(index *float64) *float64 + ParallelSumAsync(count *float64) *float64 + SerialSumAsync(count *float64) *float64 + SumSync(count *float64) *float64 } -// The jsii proxy struct for OptionalArgumentInvoker -type jsiiProxy_OptionalArgumentInvoker struct { +// The jsii proxy struct for VirtualMethodPlayground +type jsiiProxy_VirtualMethodPlayground struct { _ byte // padding } -func NewOptionalArgumentInvoker(delegate IInterfaceWithOptionalMethodArguments) OptionalArgumentInvoker { +func NewVirtualMethodPlayground() VirtualMethodPlayground { _init_.Initialize() - j := jsiiProxy_OptionalArgumentInvoker{} + j := jsiiProxy_VirtualMethodPlayground{} _jsii_.Create( - "jsii-calc.OptionalArgumentInvoker", - []interface{}{delegate}, + "jsii-calc.VirtualMethodPlayground", + nil, // no parameters &j, ) return &j } -func NewOptionalArgumentInvoker_Override(o OptionalArgumentInvoker, delegate IInterfaceWithOptionalMethodArguments) { +func NewVirtualMethodPlayground_Override(v VirtualMethodPlayground) { _init_.Initialize() _jsii_.Create( - "jsii-calc.OptionalArgumentInvoker", - []interface{}{delegate}, - o, - ) -} - -func (o *jsiiProxy_OptionalArgumentInvoker) InvokeWithOptional() { - _jsii_.InvokeVoid( - o, - "invokeWithOptional", - nil, // no parameters - ) -} - -func (o *jsiiProxy_OptionalArgumentInvoker) InvokeWithoutOptional() { - _jsii_.InvokeVoid( - o, - "invokeWithoutOptional", + "jsii-calc.VirtualMethodPlayground", nil, // no parameters + v, ) } - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_OptionalConstructorArgument.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - "time" - - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -type OptionalConstructorArgument interface { - Arg1() *float64 - Arg2() *string - Arg3() *time.Time -} - -// The jsii proxy struct for OptionalConstructorArgument -type jsiiProxy_OptionalConstructorArgument struct { - _ byte // padding -} - -func (j *jsiiProxy_OptionalConstructorArgument) Arg1() *float64 { +func (v *jsiiProxy_VirtualMethodPlayground) OverrideMeAsync(index *float64) *float64 { var returns *float64 - _jsii_.Get( - j, - "arg1", - &returns, - ) - return returns -} -func (j *jsiiProxy_OptionalConstructorArgument) Arg2() *string { - var returns *string - _jsii_.Get( - j, - "arg2", + _jsii_.Invoke( + v, + "overrideMeAsync", + []interface{}{index}, &returns, ) + return returns } -func (j *jsiiProxy_OptionalConstructorArgument) Arg3() *time.Time { - var returns *time.Time - _jsii_.Get( - j, - "arg3", +func (v *jsiiProxy_VirtualMethodPlayground) OverrideMeSync(index *float64) *float64 { + var returns *float64 + + _jsii_.Invoke( + v, + "overrideMeSync", + []interface{}{index}, &returns, ) + return returns } +func (v *jsiiProxy_VirtualMethodPlayground) ParallelSumAsync(count *float64) *float64 { + var returns *float64 -func NewOptionalConstructorArgument(arg1 *float64, arg2 *string, arg3 *time.Time) OptionalConstructorArgument { - _init_.Initialize() - - j := jsiiProxy_OptionalConstructorArgument{} - - _jsii_.Create( - "jsii-calc.OptionalConstructorArgument", - []interface{}{arg1, arg2, arg3}, - &j, + _jsii_.Invoke( + v, + "parallelSumAsync", + []interface{}{count}, + &returns, ) - return &j + return returns } -func NewOptionalConstructorArgument_Override(o OptionalConstructorArgument, arg1 *float64, arg2 *string, arg3 *time.Time) { - _init_.Initialize() +func (v *jsiiProxy_VirtualMethodPlayground) SerialSumAsync(count *float64) *float64 { + var returns *float64 - _jsii_.Create( - "jsii-calc.OptionalConstructorArgument", - []interface{}{arg1, arg2, arg3}, - o, + _jsii_.Invoke( + v, + "serialSumAsync", + []interface{}{count}, + &returns, ) -} + return returns +} -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_OptionalStruct.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc +func (v *jsiiProxy_VirtualMethodPlayground) SumSync(count *float64) *float64 { + var returns *float64 + _jsii_.Invoke( + v, + "sumSync", + []interface{}{count}, + &returns, + ) -type OptionalStruct struct { - Field *string \`field:"optional" json:"field" yaml:"field"\` + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_OptionalStructConsumer.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/VoidCallback.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -17450,65 +18011,63 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type OptionalStructConsumer interface { - FieldValue() *string - ParameterWasUndefined() *bool +// This test is used to validate the runtimes can return correctly from a void callback. +// +// - Implement \`overrideMe\` (method does not have to do anything). +// - Invoke \`callMe\` +// - Verify that \`methodWasCalled\` is \`true\`. +type VoidCallback interface { + MethodWasCalled() *bool + CallMe() + OverrideMe() } -// The jsii proxy struct for OptionalStructConsumer -type jsiiProxy_OptionalStructConsumer struct { +// The jsii proxy struct for VoidCallback +type jsiiProxy_VoidCallback struct { _ byte // padding } -func (j *jsiiProxy_OptionalStructConsumer) FieldValue() *string { - var returns *string - _jsii_.Get( - j, - "fieldValue", - &returns, - ) - return returns -} - -func (j *jsiiProxy_OptionalStructConsumer) ParameterWasUndefined() *bool { +func (j *jsiiProxy_VoidCallback) MethodWasCalled() *bool { var returns *bool _jsii_.Get( j, - "parameterWasUndefined", + "methodWasCalled", &returns, ) return returns } -func NewOptionalStructConsumer(optionalStruct *OptionalStruct) OptionalStructConsumer { +func NewVoidCallback_Override(v VoidCallback) { _init_.Initialize() - j := jsiiProxy_OptionalStructConsumer{} - _jsii_.Create( - "jsii-calc.OptionalStructConsumer", - []interface{}{optionalStruct}, - &j, + "jsii-calc.VoidCallback", + nil, // no parameters + v, ) - - return &j } -func NewOptionalStructConsumer_Override(o OptionalStructConsumer, optionalStruct *OptionalStruct) { - _init_.Initialize() +func (v *jsiiProxy_VoidCallback) CallMe() { + _jsii_.InvokeVoid( + v, + "callMe", + nil, // no parameters + ) +} - _jsii_.Create( - "jsii-calc.OptionalStructConsumer", - []interface{}{optionalStruct}, - o, +func (v *jsiiProxy_VoidCallback) OverrideMe() { + _jsii_.InvokeVoid( + v, + "overrideMe", + nil, // no parameters ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_OverridableProtectedMember.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/WithPrivatePropertyInConstructor.go 1`] = ` // A simple calcuator built on JSII. package jsiicalc @@ -17517,81 +18076,76 @@ import ( _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// See: https://github.com/aws/jsii/issues/903 -// -type OverridableProtectedMember interface { - OverrideReadOnly() *string - OverrideReadWrite() *string - SetOverrideReadWrite(val *string) - OverrideMe() *string - SwitchModes() - ValueFromProtected() *string +// Verifies that private property declarations in constructor arguments are hidden. +type WithPrivatePropertyInConstructor interface { + Success() *bool } -// The jsii proxy struct for OverridableProtectedMember -type jsiiProxy_OverridableProtectedMember struct { +// The jsii proxy struct for WithPrivatePropertyInConstructor +type jsiiProxy_WithPrivatePropertyInConstructor struct { _ byte // padding } -func (j *jsiiProxy_OverridableProtectedMember) OverrideReadOnly() *string { - var returns *string - _jsii_.Get( - j, - "overrideReadOnly", - &returns, - ) - return returns -} - -func (j *jsiiProxy_OverridableProtectedMember) OverrideReadWrite() *string { - var returns *string +func (j *jsiiProxy_WithPrivatePropertyInConstructor) Success() *bool { + var returns *bool _jsii_.Get( j, - "overrideReadWrite", + "success", &returns, ) return returns } -func NewOverridableProtectedMember() OverridableProtectedMember { +func NewWithPrivatePropertyInConstructor(privateField *string) WithPrivatePropertyInConstructor { _init_.Initialize() - j := jsiiProxy_OverridableProtectedMember{} + j := jsiiProxy_WithPrivatePropertyInConstructor{} _jsii_.Create( - "jsii-calc.OverridableProtectedMember", - nil, // no parameters + "jsii-calc.WithPrivatePropertyInConstructor", + []interface{}{privateField}, &j, ) return &j } -func NewOverridableProtectedMember_Override(o OverridableProtectedMember) { +func NewWithPrivatePropertyInConstructor_Override(w WithPrivatePropertyInConstructor, privateField *string) { _init_.Initialize() _jsii_.Create( - "jsii-calc.OverridableProtectedMember", - nil, // no parameters - o, + "jsii-calc.WithPrivatePropertyInConstructor", + []interface{}{privateField}, + w, ) } -func (j *jsiiProxy_OverridableProtectedMember)SetOverrideReadWrite(val *string) { - _jsii_.Set( - j, - "overrideReadWrite", - val, - ) + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/anonymous/IOptionA.go 1`] = ` +package anonymous + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +type IOptionA interface { + DoSomething() *string } -func (o *jsiiProxy_OverridableProtectedMember) OverrideMe() *string { +// The jsii proxy for IOptionA +type jsiiProxy_IOptionA struct { + _ byte // padding +} + +func (i *jsiiProxy_IOptionA) DoSomething() *string { var returns *string _jsii_.Invoke( - o, - "overrideMe", + i, + "doSomething", nil, // no parameters &returns, ) @@ -17599,20 +18153,31 @@ func (o *jsiiProxy_OverridableProtectedMember) OverrideMe() *string { return returns } -func (o *jsiiProxy_OverridableProtectedMember) SwitchModes() { - _jsii_.InvokeVoid( - o, - "switchModes", - nil, // no parameters - ) + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/anonymous/IOptionB.go 1`] = ` +package anonymous + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +type IOptionB interface { + DoSomethingElse() *string } -func (o *jsiiProxy_OverridableProtectedMember) ValueFromProtected() *string { +// The jsii proxy for IOptionB +type jsiiProxy_IOptionB struct { + _ byte // padding +} + +func (i *jsiiProxy_IOptionB) DoSomethingElse() *string { var returns *string _jsii_.Invoke( - o, - "valueFromProtected", + i, + "doSomethingElse", nil, // no parameters &returns, ) @@ -17623,55 +18188,61 @@ func (o *jsiiProxy_OverridableProtectedMember) ValueFromProtected() *string { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_OverrideReturnsObject.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc +exports[`Generated code for "jsii-calc": /go/jsiicalc/anonymous/UseOptions.go 1`] = ` +package anonymous import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type OverrideReturnsObject interface { - Test(obj IReturnsNumber) *float64 +type UseOptions interface { } -// The jsii proxy struct for OverrideReturnsObject -type jsiiProxy_OverrideReturnsObject struct { +// The jsii proxy struct for UseOptions +type jsiiProxy_UseOptions struct { _ byte // padding } -func NewOverrideReturnsObject() OverrideReturnsObject { +func UseOptions_Consume(option interface{}) *string { _init_.Initialize() - j := jsiiProxy_OverrideReturnsObject{} + var returns *string - _jsii_.Create( - "jsii-calc.OverrideReturnsObject", - nil, // no parameters - &j, + _jsii_.StaticInvoke( + "jsii-calc.anonymous.UseOptions", + "consume", + []interface{}{option}, + &returns, ) - return &j + return returns } -func NewOverrideReturnsObject_Override(o OverrideReturnsObject) { +func UseOptions_PrivideAsAny(which *string) interface{} { _init_.Initialize() - _jsii_.Create( - "jsii-calc.OverrideReturnsObject", - nil, // no parameters - o, + var returns interface{} + + _jsii_.StaticInvoke( + "jsii-calc.anonymous.UseOptions", + "privideAsAny", + []interface{}{which}, + &returns, ) + + return returns } -func (o *jsiiProxy_OverrideReturnsObject) Test(obj IReturnsNumber) *float64 { - var returns *float64 +func UseOptions_Provide(which *string) interface{} { + _init_.Initialize() - _jsii_.Invoke( - o, - "test", - []interface{}{obj}, + var returns interface{} + + _jsii_.StaticInvoke( + "jsii-calc.anonymous.UseOptions", + "provide", + []interface{}{which}, &returns, ) @@ -17681,119 +18252,166 @@ func (o *jsiiProxy_OverrideReturnsObject) Test(obj IReturnsNumber) *float64 { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ParamShadowsBuiltins.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc +exports[`Generated code for "jsii-calc": /go/jsiicalc/anonymous/main.go 1`] = ` +package anonymous import ( + "reflect" + _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// Validate that parameters named "str" or "builtins" do not shadow the actual type names in Python. -type ParamShadowsBuiltins interface { +func init() { + _jsii_.RegisterInterface( + "jsii-calc.anonymous.IOptionA", + reflect.TypeOf((*IOptionA)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "doSomething", GoMethod: "DoSomething"}, + }, + func() interface{} { + return &jsiiProxy_IOptionA{} + }, + ) + _jsii_.RegisterInterface( + "jsii-calc.anonymous.IOptionB", + reflect.TypeOf((*IOptionB)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "doSomethingElse", GoMethod: "DoSomethingElse"}, + }, + func() interface{} { + return &jsiiProxy_IOptionB{} + }, + ) + _jsii_.RegisterClass( + "jsii-calc.anonymous.UseOptions", + reflect.TypeOf((*UseOptions)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_UseOptions{} + }, + ) } -// The jsii proxy struct for ParamShadowsBuiltins -type jsiiProxy_ParamShadowsBuiltins struct { - _ byte // padding -} +`; -func NewParamShadowsBuiltins(builtins *string, str *string, props *ParamShadowsBuiltinsProps) ParamShadowsBuiltins { - _init_.Initialize() +exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk16625/Cdk16625.go 1`] = ` +package cdk16625 - j := jsiiProxy_ParamShadowsBuiltins{} +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" - _jsii_.Create( - "jsii-calc.ParamShadowsBuiltins", - []interface{}{builtins, str, props}, - &j, - ) + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3" +) - return &j +type Cdk16625 interface { + // Run this function to verify that everything is working as it should. + Test() + // 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). + Unwrap(gen jsiicalc.IRandomNumberGenerator) *float64 } -func NewParamShadowsBuiltins_Override(p ParamShadowsBuiltins, builtins *string, str *string, props *ParamShadowsBuiltinsProps) { +// The jsii proxy struct for Cdk16625 +type jsiiProxy_Cdk16625 struct { + _ byte // padding +} + +func NewCdk16625_Override(c Cdk16625) { _init_.Initialize() _jsii_.Create( - "jsii-calc.ParamShadowsBuiltins", - []interface{}{builtins, str, props}, - p, + "jsii-calc.cdk16625.Cdk16625", + nil, // no parameters + c, ) } +func (c *jsiiProxy_Cdk16625) Test() { + _jsii_.InvokeVoid( + c, + "test", + nil, // no parameters + ) +} -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ParamShadowsBuiltinsProps.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc +func (c *jsiiProxy_Cdk16625) Unwrap(gen jsiicalc.IRandomNumberGenerator) *float64 { + var returns *float64 + _jsii_.Invoke( + c, + "unwrap", + []interface{}{gen}, + &returns, + ) -type ParamShadowsBuiltinsProps struct { - BooleanProperty *bool \`field:"required" json:"booleanProperty" yaml:"booleanProperty"\` - StringProperty *string \`field:"required" json:"stringProperty" yaml:"stringProperty"\` - StructProperty *StructA \`field:"required" json:"structProperty" yaml:"structProperty"\` + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ParamShadowsScope.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc +exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk16625/donotimport/UnimportedSubmoduleType.go 1`] = ` +package donotimport import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3" + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/cdk16625/donotimport/internal" ) -// Validate that namespaces being shadowed by local variables does not cause type checking issues. -// See: https://github.com/aws/aws-cdk/issues/22975 +// This type demonstrates the ability to receive a callback argument that has a type from a submodule not explicitly imported in the user's code. // -type ParamShadowsScope interface { - UseScope(scope scopejsiicalclib.Number) scopejsiicalclib.Number +// This checks +// that all types available in the assembly can be resolved by the runtime +// library, regardless of whether they were explicitly referenced or not. +// See: https://github.com/aws/aws-cdk/issues/16625 +// +type UnimportedSubmoduleType interface { + jsiicalc.IRandomNumberGenerator + // Not quite random, but it'll do. + // + // Returns: 1337. + Next() *float64 } -// The jsii proxy struct for ParamShadowsScope -type jsiiProxy_ParamShadowsScope struct { - _ byte // padding +// The jsii proxy struct for UnimportedSubmoduleType +type jsiiProxy_UnimportedSubmoduleType struct { + internal.Type__jsiicalcIRandomNumberGenerator } -func NewParamShadowsScope() ParamShadowsScope { +func NewUnimportedSubmoduleType(value *float64) UnimportedSubmoduleType { _init_.Initialize() - j := jsiiProxy_ParamShadowsScope{} + j := jsiiProxy_UnimportedSubmoduleType{} _jsii_.Create( - "jsii-calc.ParamShadowsScope", - nil, // no parameters + "jsii-calc.cdk16625.donotimport.UnimportedSubmoduleType", + []interface{}{value}, &j, ) return &j } -func NewParamShadowsScope_Override(p ParamShadowsScope) { +func NewUnimportedSubmoduleType_Override(u UnimportedSubmoduleType, value *float64) { _init_.Initialize() _jsii_.Create( - "jsii-calc.ParamShadowsScope", - nil, // no parameters - p, + "jsii-calc.cdk16625.donotimport.UnimportedSubmoduleType", + []interface{}{value}, + u, ) } -func (p *jsiiProxy_ParamShadowsScope) UseScope(scope scopejsiicalclib.Number) scopejsiicalclib.Number { - var returns scopejsiicalclib.Number +func (u *jsiiProxy_UnimportedSubmoduleType) Next() *float64 { + var returns *float64 _jsii_.Invoke( - p, - "useScope", - []interface{}{scope}, + u, + "next", + nil, // no parameters &returns, ) @@ -17803,143 +18421,161 @@ func (p *jsiiProxy_ParamShadowsScope) UseScope(scope scopejsiicalclib.Number) sc `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ParentStruct982.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -// https://github.com/aws/jsii/issues/982. -type ParentStruct982 struct { - Foo *string \`field:"required" json:"foo" yaml:"foo"\` -} - +exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk16625/donotimport/internal/types.go 1`] = ` +package internal +import ( + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3" +) +type Type__jsiicalcIRandomNumberGenerator = jsiicalc.IRandomNumberGenerator `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_PartiallyInitializedThisConsumer.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc +exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk16625/donotimport/main.go 1`] = ` +package donotimport import ( - "time" + "reflect" _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type PartiallyInitializedThisConsumer interface { - ConsumePartiallyInitializedThis(obj ConstructorPassesThisOut, dt *time.Time, ev AllTypesEnum) *string +func init() { + _jsii_.RegisterClass( + "jsii-calc.cdk16625.donotimport.UnimportedSubmoduleType", + reflect.TypeOf((*UnimportedSubmoduleType)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "next", GoMethod: "Next"}, + }, + func() interface{} { + j := jsiiProxy_UnimportedSubmoduleType{} + _jsii_.InitJsiiProxy(&j.Type__jsiicalcIRandomNumberGenerator) + return &j + }, + ) } -// The jsii proxy struct for PartiallyInitializedThisConsumer -type jsiiProxy_PartiallyInitializedThisConsumer struct { - _ byte // padding -} +`; -func NewPartiallyInitializedThisConsumer_Override(p PartiallyInitializedThisConsumer) { - _init_.Initialize() +exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk16625/main.go 1`] = ` +package cdk16625 - _jsii_.Create( - "jsii-calc.PartiallyInitializedThisConsumer", - nil, // no parameters - p, - ) -} +import ( + "reflect" -func (p *jsiiProxy_PartiallyInitializedThisConsumer) ConsumePartiallyInitializedThis(obj ConstructorPassesThisOut, dt *time.Time, ev AllTypesEnum) *string { - var returns *string + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) - _jsii_.Invoke( - p, - "consumePartiallyInitializedThis", - []interface{}{obj, dt, ev}, - &returns, +func init() { + _jsii_.RegisterClass( + "jsii-calc.cdk16625.Cdk16625", + reflect.TypeOf((*Cdk16625)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "test", GoMethod: "Test"}, + _jsii_.MemberMethod{JsiiMethod: "unwrap", GoMethod: "Unwrap"}, + }, + func() interface{} { + return &jsiiProxy_Cdk16625{} + }, ) - - return returns } - `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Polymorphism.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc +exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk22369/AcceptsPath.go 1`] = ` +package cdk22369 import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" - - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ) -type Polymorphism interface { - SayHello(friendly scopejsiicalclib.IFriendly) *string +type AcceptsPath interface { } -// The jsii proxy struct for Polymorphism -type jsiiProxy_Polymorphism struct { +// The jsii proxy struct for AcceptsPath +type jsiiProxy_AcceptsPath struct { _ byte // padding } -func NewPolymorphism() Polymorphism { +func NewAcceptsPath(props *AcceptsPathProps) AcceptsPath { _init_.Initialize() - j := jsiiProxy_Polymorphism{} + j := jsiiProxy_AcceptsPath{} _jsii_.Create( - "jsii-calc.Polymorphism", - nil, // no parameters + "jsii-calc.cdk22369.AcceptsPath", + []interface{}{props}, &j, ) return &j } -func NewPolymorphism_Override(p Polymorphism) { +func NewAcceptsPath_Override(a AcceptsPath, props *AcceptsPathProps) { _init_.Initialize() _jsii_.Create( - "jsii-calc.Polymorphism", - nil, // no parameters - p, + "jsii-calc.cdk22369.AcceptsPath", + []interface{}{props}, + a, ) } -func (p *jsiiProxy_Polymorphism) SayHello(friendly scopejsiicalclib.IFriendly) *string { - var returns *string - _jsii_.Invoke( - p, - "sayHello", - []interface{}{friendly}, - &returns, +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk22369/AcceptsPathProps.go 1`] = ` +package cdk22369 + + +type AcceptsPathProps struct { + // A path that doesn't exist. + SourcePath *string \`field:"required" json:"sourcePath" yaml:"sourcePath"\` +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk22369/main.go 1`] = ` +package cdk22369 + +import ( + "reflect" + + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +func init() { + _jsii_.RegisterClass( + "jsii-calc.cdk22369.AcceptsPath", + reflect.TypeOf((*AcceptsPath)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_AcceptsPath{} + }, + ) + _jsii_.RegisterStruct( + "jsii-calc.cdk22369.AcceptsPathProps", + reflect.TypeOf((*AcceptsPathProps)(nil)).Elem(), ) - - return returns } - `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Power.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc +exports[`Generated code for "jsii-calc": /go/jsiicalc/composition/CompositeOperation.go 1`] = ` +package composition import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" - "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/composition" - "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/internal" + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/composition/internal" "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ) -// The power operation. -type Power interface { - composition.CompositeOperation - // The base of the power. - Base() scopejsiicalclib.NumericValue +// Abstract operation composed from an expression of other operations. +type CompositeOperation interface { + scopejsiicalclib.Operation // A set of postfixes to include in a decorated .toString(). DecorationPostfixes() *[]*string SetDecorationPostfixes(val *[]*string) @@ -17950,11 +18586,9 @@ type Power interface { // // Must be implemented by derived classes. Expression() scopejsiicalclib.NumericValue - // The number of times to multiply. - Pow() scopejsiicalclib.NumericValue // The .toString() style. - StringStyle() composition.CompositeOperation_CompositionStringStyle - SetStringStyle(val composition.CompositeOperation_CompositionStringStyle) + StringStyle() CompositeOperation_CompositionStringStyle + SetStringStyle(val CompositeOperation_CompositionStringStyle) // The value. Value() *float64 // String representation of the value. @@ -17963,22 +18597,12 @@ type Power interface { TypeName() interface{} } -// The jsii proxy struct for Power -type jsiiProxy_Power struct { - internal.Type__compositionCompositeOperation -} - -func (j *jsiiProxy_Power) Base() scopejsiicalclib.NumericValue { - var returns scopejsiicalclib.NumericValue - _jsii_.Get( - j, - "base", - &returns, - ) - return returns +// The jsii proxy struct for CompositeOperation +type jsiiProxy_CompositeOperation struct { + internal.Type__scopejsiicalclibOperation } -func (j *jsiiProxy_Power) DecorationPostfixes() *[]*string { +func (j *jsiiProxy_CompositeOperation) DecorationPostfixes() *[]*string { var returns *[]*string _jsii_.Get( j, @@ -17988,7 +18612,7 @@ func (j *jsiiProxy_Power) DecorationPostfixes() *[]*string { return returns } -func (j *jsiiProxy_Power) DecorationPrefixes() *[]*string { +func (j *jsiiProxy_CompositeOperation) DecorationPrefixes() *[]*string { var returns *[]*string _jsii_.Get( j, @@ -17998,7 +18622,7 @@ func (j *jsiiProxy_Power) DecorationPrefixes() *[]*string { return returns } -func (j *jsiiProxy_Power) Expression() scopejsiicalclib.NumericValue { +func (j *jsiiProxy_CompositeOperation) Expression() scopejsiicalclib.NumericValue { var returns scopejsiicalclib.NumericValue _jsii_.Get( j, @@ -18008,18 +18632,8 @@ func (j *jsiiProxy_Power) Expression() scopejsiicalclib.NumericValue { return returns } -func (j *jsiiProxy_Power) Pow() scopejsiicalclib.NumericValue { - var returns scopejsiicalclib.NumericValue - _jsii_.Get( - j, - "pow", - &returns, - ) - return returns -} - -func (j *jsiiProxy_Power) StringStyle() composition.CompositeOperation_CompositionStringStyle { - var returns composition.CompositeOperation_CompositionStringStyle +func (j *jsiiProxy_CompositeOperation) StringStyle() CompositeOperation_CompositionStringStyle { + var returns CompositeOperation_CompositionStringStyle _jsii_.Get( j, "stringStyle", @@ -18028,7 +18642,7 @@ func (j *jsiiProxy_Power) StringStyle() composition.CompositeOperation_Compositi return returns } -func (j *jsiiProxy_Power) Value() *float64 { +func (j *jsiiProxy_CompositeOperation) Value() *float64 { var returns *float64 _jsii_.Get( j, @@ -18039,33 +18653,17 @@ func (j *jsiiProxy_Power) Value() *float64 { } -// Creates a Power operation. -func NewPower(base scopejsiicalclib.NumericValue, pow scopejsiicalclib.NumericValue) Power { - _init_.Initialize() - - j := jsiiProxy_Power{} - - _jsii_.Create( - "jsii-calc.Power", - []interface{}{base, pow}, - &j, - ) - - return &j -} - -// Creates a Power operation. -func NewPower_Override(p Power, base scopejsiicalclib.NumericValue, pow scopejsiicalclib.NumericValue) { +func NewCompositeOperation_Override(c CompositeOperation) { _init_.Initialize() _jsii_.Create( - "jsii-calc.Power", - []interface{}{base, pow}, - p, + "jsii-calc.composition.CompositeOperation", + nil, // no parameters + c, ) } -func (j *jsiiProxy_Power)SetDecorationPostfixes(val *[]*string) { +func (j *jsiiProxy_CompositeOperation)SetDecorationPostfixes(val *[]*string) { _jsii_.Set( j, "decorationPostfixes", @@ -18073,7 +18671,7 @@ func (j *jsiiProxy_Power)SetDecorationPostfixes(val *[]*string) { ) } -func (j *jsiiProxy_Power)SetDecorationPrefixes(val *[]*string) { +func (j *jsiiProxy_CompositeOperation)SetDecorationPrefixes(val *[]*string) { _jsii_.Set( j, "decorationPrefixes", @@ -18081,7 +18679,7 @@ func (j *jsiiProxy_Power)SetDecorationPrefixes(val *[]*string) { ) } -func (j *jsiiProxy_Power)SetStringStyle(val composition.CompositeOperation_CompositionStringStyle) { +func (j *jsiiProxy_CompositeOperation)SetStringStyle(val CompositeOperation_CompositionStringStyle) { _jsii_.Set( j, "stringStyle", @@ -18089,11 +18687,11 @@ func (j *jsiiProxy_Power)SetStringStyle(val composition.CompositeOperation_Compo ) } -func (p *jsiiProxy_Power) ToString() *string { +func (c *jsiiProxy_CompositeOperation) ToString() *string { var returns *string _jsii_.Invoke( - p, + c, "toString", nil, // no parameters &returns, @@ -18102,11 +18700,11 @@ func (p *jsiiProxy_Power) ToString() *string { return returns } -func (p *jsiiProxy_Power) TypeName() interface{} { +func (c *jsiiProxy_CompositeOperation) TypeName() interface{} { var returns interface{} _jsii_.Invoke( - p, + c, "typeName", nil, // no parameters &returns, @@ -18118,31 +18716,108 @@ func (p *jsiiProxy_Power) TypeName() interface{} { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_PromiseNothing.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc +exports[`Generated code for "jsii-calc": /go/jsiicalc/composition/CompositeOperation_CompositionStringStyle.go 1`] = ` +package composition + + +// Style of .toString() output for CompositeOperation. +type CompositeOperation_CompositionStringStyle string + +const ( + // Normal string expression. + CompositeOperation_CompositionStringStyle_NORMAL CompositeOperation_CompositionStringStyle = "NORMAL" + // Decorated string expression. + CompositeOperation_CompositionStringStyle_DECORATED CompositeOperation_CompositionStringStyle = "DECORATED" +) + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/composition/internal/types.go 1`] = ` +package internal +import ( + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" +) +type Type__scopejsiicalclibOperation = scopejsiicalclib.Operation + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/composition/main.go 1`] = ` +package composition + +import ( + "reflect" + + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +func init() { + _jsii_.RegisterClass( + "jsii-calc.composition.CompositeOperation", + reflect.TypeOf((*CompositeOperation)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "decorationPostfixes", GoGetter: "DecorationPostfixes"}, + _jsii_.MemberProperty{JsiiProperty: "decorationPrefixes", GoGetter: "DecorationPrefixes"}, + _jsii_.MemberProperty{JsiiProperty: "expression", GoGetter: "Expression"}, + _jsii_.MemberProperty{JsiiProperty: "stringStyle", GoGetter: "StringStyle"}, + _jsii_.MemberMethod{JsiiMethod: "toString", GoMethod: "ToString"}, + _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, + _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, + }, + func() interface{} { + j := jsiiProxy_CompositeOperation{} + _jsii_.InitJsiiProxy(&j.Type__scopejsiicalclibOperation) + return &j + }, + ) + _jsii_.RegisterEnum( + "jsii-calc.composition.CompositeOperation.CompositionStringStyle", + reflect.TypeOf((*CompositeOperation_CompositionStringStyle)(nil)).Elem(), + map[string]interface{}{ + "NORMAL": CompositeOperation_CompositionStringStyle_NORMAL, + "DECORATED": CompositeOperation_CompositionStringStyle_DECORATED, + }, + ) +} + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/derivedclasshasnoproperties/Base.go 1`] = ` +package derivedclasshasnoproperties import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type PromiseNothing interface { - InstancePromiseIt() +type Base interface { + Prop() *string + SetProp(val *string) } -// The jsii proxy struct for PromiseNothing -type jsiiProxy_PromiseNothing struct { +// The jsii proxy struct for Base +type jsiiProxy_Base struct { _ byte // padding } -func NewPromiseNothing() PromiseNothing { +func (j *jsiiProxy_Base) Prop() *string { + var returns *string + _jsii_.Get( + j, + "prop", + &returns, + ) + return returns +} + + +func NewBase() Base { _init_.Initialize() - j := jsiiProxy_PromiseNothing{} + j := jsiiProxy_Base{} _jsii_.Create( - "jsii-calc.PromiseNothing", + "jsii-calc.DerivedClassHasNoProperties.Base", nil, // no parameters &j, ) @@ -18150,85 +18825,358 @@ func NewPromiseNothing() PromiseNothing { return &j } -func NewPromiseNothing_Override(p PromiseNothing) { +func NewBase_Override(b Base) { _init_.Initialize() _jsii_.Create( - "jsii-calc.PromiseNothing", + "jsii-calc.DerivedClassHasNoProperties.Base", nil, // no parameters - p, + b, ) } -func PromiseNothing_PromiseIt() { +func (j *jsiiProxy_Base)SetProp(val *string) { + _jsii_.Set( + j, + "prop", + val, + ) +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/derivedclasshasnoproperties/Derived.go 1`] = ` +package derivedclasshasnoproperties + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +type Derived interface { + Base + Prop() *string + SetProp(val *string) +} + +// The jsii proxy struct for Derived +type jsiiProxy_Derived struct { + jsiiProxy_Base +} + +func (j *jsiiProxy_Derived) Prop() *string { + var returns *string + _jsii_.Get( + j, + "prop", + &returns, + ) + return returns +} + + +func NewDerived() Derived { _init_.Initialize() - _jsii_.StaticInvokeVoid( - "jsii-calc.PromiseNothing", - "promiseIt", + j := jsiiProxy_Derived{} + + _jsii_.Create( + "jsii-calc.DerivedClassHasNoProperties.Derived", nil, // no parameters + &j, ) + + return &j } -func (p *jsiiProxy_PromiseNothing) InstancePromiseIt() { - _jsii_.InvokeVoid( - p, - "instancePromiseIt", +func NewDerived_Override(d Derived) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.DerivedClassHasNoProperties.Derived", nil, // no parameters + d, + ) +} + +func (j *jsiiProxy_Derived)SetProp(val *string) { + _jsii_.Set( + j, + "prop", + val, ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_PropertyNamedProperty.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc +exports[`Generated code for "jsii-calc": /go/jsiicalc/derivedclasshasnoproperties/main.go 1`] = ` +package derivedclasshasnoproperties + +import ( + "reflect" + + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +func init() { + _jsii_.RegisterClass( + "jsii-calc.DerivedClassHasNoProperties.Base", + reflect.TypeOf((*Base)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "prop", GoGetter: "Prop"}, + }, + func() interface{} { + return &jsiiProxy_Base{} + }, + ) + _jsii_.RegisterClass( + "jsii-calc.DerivedClassHasNoProperties.Derived", + reflect.TypeOf((*Derived)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "prop", GoGetter: "Prop"}, + }, + func() interface{} { + j := jsiiProxy_Derived{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_Base) + return &j + }, + ) +} + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/go.mod 1`] = ` +module github.com/aws/jsii/jsii-calc/go/jsiicalc/v3 + +go 1.18 + +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/scopejsiicalclib v0.0.0-devpreview + github.com/aws/jsii/jsii-calc/go/scopejsiicalcbaseofbase/v2 v2.1.1 // indirect +) + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/README.md 1`] = ` +Verifies homonymous forward references don't trip the Python type checker + +This has been an issue when stub functions were introduced to create a reliable source for type checking +information, which was reported in https://github.com/aws/jsii/issues/3818. + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/bar/Consumer.go 1`] = ` +package bar import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -// Reproduction for https://github.com/aws/jsii/issues/1113 Where a method or property named "property" would result in impossible to load Python code. -type PropertyNamedProperty interface { - Property() *string - YetAnoterOne() *bool +type Consumer interface { } -// The jsii proxy struct for PropertyNamedProperty -type jsiiProxy_PropertyNamedProperty struct { +// The jsii proxy struct for Consumer +type jsiiProxy_Consumer struct { + _ byte // padding +} + +func Consumer_Consume(props *ConsumerProps) *Homonymous { + _init_.Initialize() + + var returns *Homonymous + + _jsii_.StaticInvoke( + "jsii-calc.homonymousForwardReferences.bar.Consumer", + "consume", + []interface{}{props}, + &returns, + ) + + return returns +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/bar/ConsumerProps.go 1`] = ` +package bar + + +type ConsumerProps struct { + Homonymous *Homonymous \`field:"required" json:"homonymous" yaml:"homonymous"\` +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/bar/Homonymous.go 1`] = ` +package bar + + +type Homonymous struct { + NumericProperty *float64 \`field:"required" json:"numericProperty" yaml:"numericProperty"\` +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/bar/main.go 1`] = ` +package bar + +import ( + "reflect" + + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +func init() { + _jsii_.RegisterClass( + "jsii-calc.homonymousForwardReferences.bar.Consumer", + reflect.TypeOf((*Consumer)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_Consumer{} + }, + ) + _jsii_.RegisterStruct( + "jsii-calc.homonymousForwardReferences.bar.ConsumerProps", + reflect.TypeOf((*ConsumerProps)(nil)).Elem(), + ) + _jsii_.RegisterStruct( + "jsii-calc.homonymousForwardReferences.bar.Homonymous", + reflect.TypeOf((*Homonymous)(nil)).Elem(), + ) +} + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/foo/Consumer.go 1`] = ` +package foo + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +type Consumer interface { +} + +// The jsii proxy struct for Consumer +type jsiiProxy_Consumer struct { + _ byte // padding +} + +func Consumer_Consume(props *ConsumerProps) *Homonymous { + _init_.Initialize() + + var returns *Homonymous + + _jsii_.StaticInvoke( + "jsii-calc.homonymousForwardReferences.foo.Consumer", + "consume", + []interface{}{props}, + &returns, + ) + + return returns +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/foo/ConsumerProps.go 1`] = ` +package foo + + +type ConsumerProps struct { + Homonymous *Homonymous \`field:"required" json:"homonymous" yaml:"homonymous"\` +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/foo/Homonymous.go 1`] = ` +package foo + + +type Homonymous struct { + StringProperty *string \`field:"required" json:"stringProperty" yaml:"stringProperty"\` +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/foo/main.go 1`] = ` +package foo + +import ( + "reflect" + + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +func init() { + _jsii_.RegisterClass( + "jsii-calc.homonymousForwardReferences.foo.Consumer", + reflect.TypeOf((*Consumer)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_Consumer{} + }, + ) + _jsii_.RegisterStruct( + "jsii-calc.homonymousForwardReferences.foo.ConsumerProps", + reflect.TypeOf((*ConsumerProps)(nil)).Elem(), + ) + _jsii_.RegisterStruct( + "jsii-calc.homonymousForwardReferences.foo.Homonymous", + reflect.TypeOf((*Homonymous)(nil)).Elem(), + ) +} + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/interfaceinnamespaceincludesclasses/Foo.go 1`] = ` +package interfaceinnamespaceincludesclasses + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" +) + +type Foo interface { + Bar() *string + SetBar(val *string) +} + +// The jsii proxy struct for Foo +type jsiiProxy_Foo struct { _ byte // padding } -func (j *jsiiProxy_PropertyNamedProperty) Property() *string { +func (j *jsiiProxy_Foo) Bar() *string { var returns *string _jsii_.Get( j, - "property", - &returns, - ) - return returns -} - -func (j *jsiiProxy_PropertyNamedProperty) YetAnoterOne() *bool { - var returns *bool - _jsii_.Get( - j, - "yetAnoterOne", + "bar", &returns, ) return returns } -func NewPropertyNamedProperty() PropertyNamedProperty { +func NewFoo() Foo { _init_.Initialize() - j := jsiiProxy_PropertyNamedProperty{} + j := jsiiProxy_Foo{} _jsii_.Create( - "jsii-calc.PropertyNamedProperty", + "jsii-calc.InterfaceInNamespaceIncludesClasses.Foo", nil, // no parameters &j, ) @@ -18236,3585 +19184,2613 @@ func NewPropertyNamedProperty() PropertyNamedProperty { return &j } -func NewPropertyNamedProperty_Override(p PropertyNamedProperty) { +func NewFoo_Override(f Foo) { _init_.Initialize() _jsii_.Create( - "jsii-calc.PropertyNamedProperty", + "jsii-calc.InterfaceInNamespaceIncludesClasses.Foo", nil, // no parameters - p, + f, + ) +} + +func (j *jsiiProxy_Foo)SetBar(val *string) { + _jsii_.Set( + j, + "bar", + val, ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_PublicClass.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc +exports[`Generated code for "jsii-calc": /go/jsiicalc/interfaceinnamespaceincludesclasses/Hello.go 1`] = ` +package interfaceinnamespaceincludesclasses + + +type Hello struct { + Foo *float64 \`field:"required" json:"foo" yaml:"foo"\` +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/interfaceinnamespaceincludesclasses/main.go 1`] = ` +package interfaceinnamespaceincludesclasses import ( + "reflect" + _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type PublicClass interface { - Hello() +func init() { + _jsii_.RegisterClass( + "jsii-calc.InterfaceInNamespaceIncludesClasses.Foo", + reflect.TypeOf((*Foo)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "bar", GoGetter: "Bar"}, + }, + func() interface{} { + return &jsiiProxy_Foo{} + }, + ) + _jsii_.RegisterStruct( + "jsii-calc.InterfaceInNamespaceIncludesClasses.Hello", + reflect.TypeOf((*Hello)(nil)).Elem(), + ) } -// The jsii proxy struct for PublicClass -type jsiiProxy_PublicClass struct { - _ byte // padding +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/interfaceinnamespaceonlyinterface/Hello.go 1`] = ` +package interfaceinnamespaceonlyinterface + + +type Hello struct { + Foo *float64 \`field:"required" json:"foo" yaml:"foo"\` } -func NewPublicClass() PublicClass { - _init_.Initialize() - j := jsiiProxy_PublicClass{} +`; - _jsii_.Create( - "jsii-calc.PublicClass", - nil, // no parameters - &j, - ) +exports[`Generated code for "jsii-calc": /go/jsiicalc/interfaceinnamespaceonlyinterface/main.go 1`] = ` +package interfaceinnamespaceonlyinterface - return &j -} +import ( + "reflect" -func NewPublicClass_Override(p PublicClass) { - _init_.Initialize() + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) - _jsii_.Create( - "jsii-calc.PublicClass", - nil, // no parameters - p, +func init() { + _jsii_.RegisterStruct( + "jsii-calc.InterfaceInNamespaceOnlyInterface.Hello", + reflect.TypeOf((*Hello)(nil)).Elem(), ) } -func (p *jsiiProxy_PublicClass) Hello() { - _jsii_.InvokeVoid( - p, - "hello", - nil, // no parameters - ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/internal/types.go 1`] = ` +package internal +import ( + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/composition" + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib/customsubmodulename" +) +type Type__scopejsiicalclibOperation = scopejsiicalclib.Operation +type Type__scopejsiicalclibIFriendly = scopejsiicalclib.IFriendly +type Type__compositionCompositeOperation = composition.CompositeOperation +type Type__customsubmodulenameIReflectable = customsubmodulename.IReflectable + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsii/jsii.go 1`] = ` +// Package jsii contains the functionaility needed for jsii packages to +// initialize their dependencies and themselves. Users should never need to use this package +// directly. If you find you need to - please report a bug at +// https://github.com/aws/jsii/issues/new/choose +package jsii + +import ( + _ "embed" + + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + + jcb "github.com/aws/jsii/jsii-calc/go/jcb/jsii" + scopejsiicalclib "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib/jsii" +) + +//go:embed jsii-calc-3.20.120.tgz +var tarball []byte + +// Initialize loads the necessary packages in the @jsii/kernel to support the enclosing module. +// The implementation is idempotent (and hence safe to be called over and over). +func Initialize() { + // Ensure all dependencies are initialized + jcb.Initialize() + scopejsiicalclib.Initialize() + + // Load this library into the kernel + _jsii_.Load("jsii-calc", "3.20.120", tarball) +} + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsii/jsii-calc-3.20.120.tgz 1`] = `go/jsiicalc/jsii/jsii-calc-3.20.120.tgz is a tarball`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsii3656/ImplementMeOpts.go 1`] = ` +package jsii3656 + + +type ImplementMeOpts struct { + Name *string \`field:"required" json:"name" yaml:"name"\` + Count *float64 \`field:"optional" json:"count" yaml:"count"\` } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_PythonReservedWords.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsii3656/OverrideMe.go 1`] = ` +package jsii3656 import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" ) -type PythonReservedWords interface { - And() - As() - Assert() - Async() - Await() - Break() - Class() - Continue() - Def() - Del() - Elif() - Else() - Except() - Finally() - For() - From() - Global() - If() - Import() - In() - Is() - Lambda() - Nonlocal() - Not() - Or() - Pass() - Raise() - Return() - Try() - While() - With() - Yield() +type OverrideMe interface { + ImplementMe(opts *ImplementMeOpts) *bool } -// The jsii proxy struct for PythonReservedWords -type jsiiProxy_PythonReservedWords struct { +// The jsii proxy struct for OverrideMe +type jsiiProxy_OverrideMe struct { _ byte // padding } -func NewPythonReservedWords() PythonReservedWords { +func NewOverrideMe_Override(o OverrideMe) { _init_.Initialize() - j := jsiiProxy_PythonReservedWords{} - _jsii_.Create( - "jsii-calc.PythonReservedWords", + "jsii-calc.jsii3656.OverrideMe", nil, // no parameters - &j, + o, ) - - return &j } -func NewPythonReservedWords_Override(p PythonReservedWords) { +func OverrideMe_CallAbstract(receiver OverrideMe) *bool { _init_.Initialize() - _jsii_.Create( - "jsii-calc.PythonReservedWords", - nil, // no parameters - p, - ) -} + var returns *bool -func (p *jsiiProxy_PythonReservedWords) And() { - _jsii_.InvokeVoid( - p, - "and", - nil, // no parameters + _jsii_.StaticInvoke( + "jsii-calc.jsii3656.OverrideMe", + "callAbstract", + []interface{}{receiver}, + &returns, ) -} -func (p *jsiiProxy_PythonReservedWords) As() { - _jsii_.InvokeVoid( - p, - "as", - nil, // no parameters - ) + return returns } -func (p *jsiiProxy_PythonReservedWords) Assert() { - _jsii_.InvokeVoid( - p, - "assert", - nil, // no parameters - ) -} +func (o *jsiiProxy_OverrideMe) ImplementMe(opts *ImplementMeOpts) *bool { + var returns *bool -func (p *jsiiProxy_PythonReservedWords) Async() { - _jsii_.InvokeVoid( - p, - "async", - nil, // no parameters + _jsii_.Invoke( + o, + "implementMe", + []interface{}{opts}, + &returns, ) -} -func (p *jsiiProxy_PythonReservedWords) Await() { - _jsii_.InvokeVoid( - p, - "await", - nil, // no parameters - ) + return returns } -func (p *jsiiProxy_PythonReservedWords) Break() { - _jsii_.InvokeVoid( - p, - "break", - nil, // no parameters - ) -} -func (p *jsiiProxy_PythonReservedWords) Class() { - _jsii_.InvokeVoid( - p, - "class", - nil, // no parameters - ) -} +`; -func (p *jsiiProxy_PythonReservedWords) Continue() { - _jsii_.InvokeVoid( - p, - "continue", - nil, // no parameters +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsii3656/main.go 1`] = ` +package jsii3656 + +import ( + "reflect" + + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +func init() { + _jsii_.RegisterStruct( + "jsii-calc.jsii3656.ImplementMeOpts", + reflect.TypeOf((*ImplementMeOpts)(nil)).Elem(), + ) + _jsii_.RegisterClass( + "jsii-calc.jsii3656.OverrideMe", + reflect.TypeOf((*OverrideMe)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "implementMe", GoMethod: "ImplementMe"}, + }, + func() interface{} { + return &jsiiProxy_OverrideMe{} + }, ) } -func (p *jsiiProxy_PythonReservedWords) Def() { - _jsii_.InvokeVoid( - p, - "def", - nil, // no parameters +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/main.go 1`] = ` +package jsiicalc + +import ( + "reflect" + + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +func init() { + _jsii_.RegisterClass( + "jsii-calc.AbstractClass", + reflect.TypeOf((*AbstractClass)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "abstractMethod", GoMethod: "AbstractMethod"}, + _jsii_.MemberProperty{JsiiProperty: "abstractProperty", GoGetter: "AbstractProperty"}, + _jsii_.MemberMethod{JsiiMethod: "nonAbstractMethod", GoMethod: "NonAbstractMethod"}, + _jsii_.MemberProperty{JsiiProperty: "propFromInterface", GoGetter: "PropFromInterface"}, + }, + func() interface{} { + j := jsiiProxy_AbstractClass{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_AbstractClassBase) + _jsii_.InitJsiiProxy(&j.jsiiProxy_IInterfaceImplementedByAbstractClass) + return &j + }, + ) + _jsii_.RegisterClass( + "jsii-calc.AbstractClassBase", + reflect.TypeOf((*AbstractClassBase)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "abstractProperty", GoGetter: "AbstractProperty"}, + }, + func() interface{} { + return &jsiiProxy_AbstractClassBase{} + }, + ) + _jsii_.RegisterClass( + "jsii-calc.AbstractClassReturner", + reflect.TypeOf((*AbstractClassReturner)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "giveMeAbstract", GoMethod: "GiveMeAbstract"}, + _jsii_.MemberMethod{JsiiMethod: "giveMeInterface", GoMethod: "GiveMeInterface"}, + _jsii_.MemberProperty{JsiiProperty: "returnAbstractFromProperty", GoGetter: "ReturnAbstractFromProperty"}, + }, + func() interface{} { + return &jsiiProxy_AbstractClassReturner{} + }, + ) + _jsii_.RegisterClass( + "jsii-calc.AbstractSuite", + reflect.TypeOf((*AbstractSuite)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "property", GoGetter: "Property"}, + _jsii_.MemberMethod{JsiiMethod: "someMethod", GoMethod: "SomeMethod"}, + _jsii_.MemberMethod{JsiiMethod: "workItAll", GoMethod: "WorkItAll"}, + }, + func() interface{} { + return &jsiiProxy_AbstractSuite{} + }, + ) + _jsii_.RegisterClass( + "jsii-calc.Add", + reflect.TypeOf((*Add)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, + _jsii_.MemberProperty{JsiiProperty: "lhs", GoGetter: "Lhs"}, + _jsii_.MemberProperty{JsiiProperty: "rhs", GoGetter: "Rhs"}, + _jsii_.MemberMethod{JsiiMethod: "toString", GoMethod: "ToString"}, + _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, + _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, + }, + func() interface{} { + j := jsiiProxy_Add{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_BinaryOperation) + return &j + }, + ) + _jsii_.RegisterClass( + "jsii-calc.AllTypes", + reflect.TypeOf((*AllTypes)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "anyArrayProperty", GoGetter: "AnyArrayProperty"}, + _jsii_.MemberMethod{JsiiMethod: "anyIn", GoMethod: "AnyIn"}, + _jsii_.MemberProperty{JsiiProperty: "anyMapProperty", GoGetter: "AnyMapProperty"}, + _jsii_.MemberMethod{JsiiMethod: "anyOut", GoMethod: "AnyOut"}, + _jsii_.MemberProperty{JsiiProperty: "anyProperty", GoGetter: "AnyProperty"}, + _jsii_.MemberProperty{JsiiProperty: "arrayProperty", GoGetter: "ArrayProperty"}, + _jsii_.MemberProperty{JsiiProperty: "booleanProperty", GoGetter: "BooleanProperty"}, + _jsii_.MemberProperty{JsiiProperty: "dateProperty", GoGetter: "DateProperty"}, + _jsii_.MemberMethod{JsiiMethod: "enumMethod", GoMethod: "EnumMethod"}, + _jsii_.MemberProperty{JsiiProperty: "enumProperty", GoGetter: "EnumProperty"}, + _jsii_.MemberProperty{JsiiProperty: "enumPropertyValue", GoGetter: "EnumPropertyValue"}, + _jsii_.MemberProperty{JsiiProperty: "jsonProperty", GoGetter: "JsonProperty"}, + _jsii_.MemberProperty{JsiiProperty: "mapProperty", GoGetter: "MapProperty"}, + _jsii_.MemberProperty{JsiiProperty: "numberProperty", GoGetter: "NumberProperty"}, + _jsii_.MemberProperty{JsiiProperty: "optionalEnumValue", GoGetter: "OptionalEnumValue"}, + _jsii_.MemberProperty{JsiiProperty: "stringProperty", GoGetter: "StringProperty"}, + _jsii_.MemberProperty{JsiiProperty: "unionArrayProperty", GoGetter: "UnionArrayProperty"}, + _jsii_.MemberProperty{JsiiProperty: "unionMapProperty", GoGetter: "UnionMapProperty"}, + _jsii_.MemberProperty{JsiiProperty: "unionProperty", GoGetter: "UnionProperty"}, + _jsii_.MemberProperty{JsiiProperty: "unknownArrayProperty", GoGetter: "UnknownArrayProperty"}, + _jsii_.MemberProperty{JsiiProperty: "unknownMapProperty", GoGetter: "UnknownMapProperty"}, + _jsii_.MemberProperty{JsiiProperty: "unknownProperty", GoGetter: "UnknownProperty"}, + }, + func() interface{} { + return &jsiiProxy_AllTypes{} + }, + ) + _jsii_.RegisterEnum( + "jsii-calc.AllTypesEnum", + reflect.TypeOf((*AllTypesEnum)(nil)).Elem(), + map[string]interface{}{ + "MY_ENUM_VALUE": AllTypesEnum_MY_ENUM_VALUE, + "YOUR_ENUM_VALUE": AllTypesEnum_YOUR_ENUM_VALUE, + "THIS_IS_GREAT": AllTypesEnum_THIS_IS_GREAT, + }, + ) + _jsii_.RegisterClass( + "jsii-calc.AllowedMethodNames", + reflect.TypeOf((*AllowedMethodNames)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "getBar", GoMethod: "GetBar"}, + _jsii_.MemberMethod{JsiiMethod: "getFoo", GoMethod: "GetFoo"}, + _jsii_.MemberMethod{JsiiMethod: "setBar", GoMethod: "SetBar"}, + _jsii_.MemberMethod{JsiiMethod: "setFoo", GoMethod: "SetFoo"}, + }, + func() interface{} { + return &jsiiProxy_AllowedMethodNames{} + }, + ) + _jsii_.RegisterClass( + "jsii-calc.AmbiguousParameters", + reflect.TypeOf((*AmbiguousParameters)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "props", GoGetter: "Props"}, + _jsii_.MemberProperty{JsiiProperty: "scope", GoGetter: "Scope"}, + }, + func() interface{} { + return &jsiiProxy_AmbiguousParameters{} + }, + ) + _jsii_.RegisterClass( + "jsii-calc.AnonymousImplementationProvider", + reflect.TypeOf((*AnonymousImplementationProvider)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "provideAsClass", GoMethod: "ProvideAsClass"}, + _jsii_.MemberMethod{JsiiMethod: "provideAsInterface", GoMethod: "ProvideAsInterface"}, + }, + func() interface{} { + j := jsiiProxy_AnonymousImplementationProvider{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_IAnonymousImplementationProvider) + return &j + }, + ) + _jsii_.RegisterClass( + "jsii-calc.AsyncVirtualMethods", + reflect.TypeOf((*AsyncVirtualMethods)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "callMe", GoMethod: "CallMe"}, + _jsii_.MemberMethod{JsiiMethod: "callMe2", GoMethod: "CallMe2"}, + _jsii_.MemberMethod{JsiiMethod: "callMeDoublePromise", GoMethod: "CallMeDoublePromise"}, + _jsii_.MemberMethod{JsiiMethod: "dontOverrideMe", GoMethod: "DontOverrideMe"}, + _jsii_.MemberMethod{JsiiMethod: "overrideMe", GoMethod: "OverrideMe"}, + _jsii_.MemberMethod{JsiiMethod: "overrideMeToo", GoMethod: "OverrideMeToo"}, + }, + func() interface{} { + return &jsiiProxy_AsyncVirtualMethods{} + }, + ) + _jsii_.RegisterClass( + "jsii-calc.AugmentableClass", + reflect.TypeOf((*AugmentableClass)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "methodOne", GoMethod: "MethodOne"}, + _jsii_.MemberMethod{JsiiMethod: "methodTwo", GoMethod: "MethodTwo"}, + }, + func() interface{} { + return &jsiiProxy_AugmentableClass{} + }, + ) + _jsii_.RegisterClass( + "jsii-calc.BaseClass", + reflect.TypeOf((*BaseClass)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, + _jsii_.MemberProperty{JsiiProperty: "property", GoGetter: "Property"}, + }, + func() interface{} { + return &jsiiProxy_BaseClass{} + }, + ) + _jsii_.RegisterClass( + "jsii-calc.BaseJsii976", + reflect.TypeOf((*BaseJsii976)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_BaseJsii976{} + }, ) -} - -func (p *jsiiProxy_PythonReservedWords) Del() { - _jsii_.InvokeVoid( - p, - "del", - nil, // no parameters + _jsii_.RegisterClass( + "jsii-calc.Bell", + reflect.TypeOf((*Bell)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "ring", GoMethod: "Ring"}, + _jsii_.MemberProperty{JsiiProperty: "rung", GoGetter: "Rung"}, + }, + func() interface{} { + j := jsiiProxy_Bell{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_IBell) + return &j + }, ) -} - -func (p *jsiiProxy_PythonReservedWords) Elif() { - _jsii_.InvokeVoid( - p, - "elif", - nil, // no parameters + _jsii_.RegisterClass( + "jsii-calc.BinaryOperation", + reflect.TypeOf((*BinaryOperation)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, + _jsii_.MemberProperty{JsiiProperty: "lhs", GoGetter: "Lhs"}, + _jsii_.MemberProperty{JsiiProperty: "rhs", GoGetter: "Rhs"}, + _jsii_.MemberMethod{JsiiMethod: "toString", GoMethod: "ToString"}, + _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, + _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, + }, + func() interface{} { + j := jsiiProxy_BinaryOperation{} + _jsii_.InitJsiiProxy(&j.Type__scopejsiicalclibOperation) + _jsii_.InitJsiiProxy(&j.Type__scopejsiicalclibIFriendly) + return &j + }, ) -} - -func (p *jsiiProxy_PythonReservedWords) Else() { - _jsii_.InvokeVoid( - p, - "else", - nil, // no parameters + _jsii_.RegisterClass( + "jsii-calc.BurriedAnonymousObject", + reflect.TypeOf((*BurriedAnonymousObject)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "check", GoMethod: "Check"}, + _jsii_.MemberMethod{JsiiMethod: "giveItBack", GoMethod: "GiveItBack"}, + }, + func() interface{} { + return &jsiiProxy_BurriedAnonymousObject{} + }, ) -} - -func (p *jsiiProxy_PythonReservedWords) Except() { - _jsii_.InvokeVoid( - p, - "except", - nil, // no parameters + _jsii_.RegisterClass( + "jsii-calc.Calculator", + reflect.TypeOf((*Calculator)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "add", GoMethod: "Add"}, + _jsii_.MemberProperty{JsiiProperty: "curr", GoGetter: "Curr"}, + _jsii_.MemberProperty{JsiiProperty: "decorationPostfixes", GoGetter: "DecorationPostfixes"}, + _jsii_.MemberProperty{JsiiProperty: "decorationPrefixes", GoGetter: "DecorationPrefixes"}, + _jsii_.MemberProperty{JsiiProperty: "expression", GoGetter: "Expression"}, + _jsii_.MemberProperty{JsiiProperty: "maxValue", GoGetter: "MaxValue"}, + _jsii_.MemberMethod{JsiiMethod: "mul", GoMethod: "Mul"}, + _jsii_.MemberMethod{JsiiMethod: "neg", GoMethod: "Neg"}, + _jsii_.MemberProperty{JsiiProperty: "operationsLog", GoGetter: "OperationsLog"}, + _jsii_.MemberProperty{JsiiProperty: "operationsMap", GoGetter: "OperationsMap"}, + _jsii_.MemberMethod{JsiiMethod: "pow", GoMethod: "Pow"}, + _jsii_.MemberMethod{JsiiMethod: "readUnionValue", GoMethod: "ReadUnionValue"}, + _jsii_.MemberProperty{JsiiProperty: "stringStyle", GoGetter: "StringStyle"}, + _jsii_.MemberMethod{JsiiMethod: "toString", GoMethod: "ToString"}, + _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, + _jsii_.MemberProperty{JsiiProperty: "unionProperty", GoGetter: "UnionProperty"}, + _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, + }, + func() interface{} { + j := jsiiProxy_Calculator{} + _jsii_.InitJsiiProxy(&j.Type__compositionCompositeOperation) + return &j + }, ) -} - -func (p *jsiiProxy_PythonReservedWords) Finally() { - _jsii_.InvokeVoid( - p, - "finally", - nil, // no parameters + _jsii_.RegisterStruct( + "jsii-calc.CalculatorProps", + reflect.TypeOf((*CalculatorProps)(nil)).Elem(), ) -} - -func (p *jsiiProxy_PythonReservedWords) For() { - _jsii_.InvokeVoid( - p, - "for", - nil, // no parameters + _jsii_.RegisterStruct( + "jsii-calc.ChildStruct982", + reflect.TypeOf((*ChildStruct982)(nil)).Elem(), ) -} - -func (p *jsiiProxy_PythonReservedWords) From() { - _jsii_.InvokeVoid( - p, - "from", - nil, // no parameters + _jsii_.RegisterClass( + "jsii-calc.ClassThatImplementsTheInternalInterface", + reflect.TypeOf((*ClassThatImplementsTheInternalInterface)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "a", GoGetter: "A"}, + _jsii_.MemberProperty{JsiiProperty: "b", GoGetter: "B"}, + _jsii_.MemberProperty{JsiiProperty: "c", GoGetter: "C"}, + _jsii_.MemberProperty{JsiiProperty: "d", GoGetter: "D"}, + }, + func() interface{} { + j := jsiiProxy_ClassThatImplementsTheInternalInterface{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_INonInternalInterface) + return &j + }, ) -} - -func (p *jsiiProxy_PythonReservedWords) Global() { - _jsii_.InvokeVoid( - p, - "global", - nil, // no parameters + _jsii_.RegisterClass( + "jsii-calc.ClassThatImplementsThePrivateInterface", + reflect.TypeOf((*ClassThatImplementsThePrivateInterface)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "a", GoGetter: "A"}, + _jsii_.MemberProperty{JsiiProperty: "b", GoGetter: "B"}, + _jsii_.MemberProperty{JsiiProperty: "c", GoGetter: "C"}, + _jsii_.MemberProperty{JsiiProperty: "e", GoGetter: "E"}, + }, + func() interface{} { + j := jsiiProxy_ClassThatImplementsThePrivateInterface{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_INonInternalInterface) + return &j + }, ) -} - -func (p *jsiiProxy_PythonReservedWords) If() { - _jsii_.InvokeVoid( - p, - "if", - nil, // no parameters + _jsii_.RegisterClass( + "jsii-calc.ClassWithCollectionOfUnions", + reflect.TypeOf((*ClassWithCollectionOfUnions)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "unionProperty", GoGetter: "UnionProperty"}, + }, + func() interface{} { + return &jsiiProxy_ClassWithCollectionOfUnions{} + }, ) -} - -func (p *jsiiProxy_PythonReservedWords) Import() { - _jsii_.InvokeVoid( - p, - "import", - nil, // no parameters + _jsii_.RegisterClass( + "jsii-calc.ClassWithCollections", + reflect.TypeOf((*ClassWithCollections)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "array", GoGetter: "Array"}, + _jsii_.MemberProperty{JsiiProperty: "map", GoGetter: "Map"}, + }, + func() interface{} { + return &jsiiProxy_ClassWithCollections{} + }, ) -} - -func (p *jsiiProxy_PythonReservedWords) In() { - _jsii_.InvokeVoid( - p, - "in", - nil, // no parameters + _jsii_.RegisterClass( + "jsii-calc.ClassWithContainerTypes", + reflect.TypeOf((*ClassWithContainerTypes)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "array", GoGetter: "Array"}, + _jsii_.MemberProperty{JsiiProperty: "obj", GoGetter: "Obj"}, + _jsii_.MemberProperty{JsiiProperty: "props", GoGetter: "Props"}, + _jsii_.MemberProperty{JsiiProperty: "record", GoGetter: "Record"}, + }, + func() interface{} { + return &jsiiProxy_ClassWithContainerTypes{} + }, ) -} - -func (p *jsiiProxy_PythonReservedWords) Is() { - _jsii_.InvokeVoid( - p, - "is", - nil, // no parameters + _jsii_.RegisterClass( + "jsii-calc.ClassWithDocs", + reflect.TypeOf((*ClassWithDocs)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_ClassWithDocs{} + }, ) -} - -func (p *jsiiProxy_PythonReservedWords) Lambda() { - _jsii_.InvokeVoid( - p, - "lambda", - nil, // no parameters + _jsii_.RegisterClass( + "jsii-calc.ClassWithJavaReservedWords", + reflect.TypeOf((*ClassWithJavaReservedWords)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "import", GoMethod: "Import"}, + _jsii_.MemberProperty{JsiiProperty: "int", GoGetter: "Int"}, + }, + func() interface{} { + return &jsiiProxy_ClassWithJavaReservedWords{} + }, ) -} - -func (p *jsiiProxy_PythonReservedWords) Nonlocal() { - _jsii_.InvokeVoid( - p, - "nonlocal", - nil, // no parameters + _jsii_.RegisterClass( + "jsii-calc.ClassWithMutableObjectLiteralProperty", + reflect.TypeOf((*ClassWithMutableObjectLiteralProperty)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "mutableObject", GoGetter: "MutableObject"}, + }, + func() interface{} { + return &jsiiProxy_ClassWithMutableObjectLiteralProperty{} + }, ) -} - -func (p *jsiiProxy_PythonReservedWords) Not() { - _jsii_.InvokeVoid( - p, - "not", - nil, // no parameters + _jsii_.RegisterClass( + "jsii-calc.ClassWithNestedUnion", + reflect.TypeOf((*ClassWithNestedUnion)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "unionProperty", GoGetter: "UnionProperty"}, + }, + func() interface{} { + return &jsiiProxy_ClassWithNestedUnion{} + }, ) -} - -func (p *jsiiProxy_PythonReservedWords) Or() { - _jsii_.InvokeVoid( - p, - "or", - nil, // no parameters + _jsii_.RegisterClass( + "jsii-calc.ClassWithPrivateConstructorAndAutomaticProperties", + reflect.TypeOf((*ClassWithPrivateConstructorAndAutomaticProperties)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "readOnlyString", GoGetter: "ReadOnlyString"}, + _jsii_.MemberProperty{JsiiProperty: "readWriteString", GoGetter: "ReadWriteString"}, + }, + func() interface{} { + j := jsiiProxy_ClassWithPrivateConstructorAndAutomaticProperties{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_IInterfaceWithProperties) + return &j + }, ) -} - -func (p *jsiiProxy_PythonReservedWords) Pass() { - _jsii_.InvokeVoid( - p, - "pass", - nil, // no parameters + _jsii_.RegisterClass( + "jsii-calc.ConfusingToJackson", + reflect.TypeOf((*ConfusingToJackson)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "unionProperty", GoGetter: "UnionProperty"}, + }, + func() interface{} { + return &jsiiProxy_ConfusingToJackson{} + }, ) -} - -func (p *jsiiProxy_PythonReservedWords) Raise() { - _jsii_.InvokeVoid( - p, - "raise", - nil, // no parameters + _jsii_.RegisterStruct( + "jsii-calc.ConfusingToJacksonStruct", + reflect.TypeOf((*ConfusingToJacksonStruct)(nil)).Elem(), ) -} - -func (p *jsiiProxy_PythonReservedWords) Return() { - _jsii_.InvokeVoid( - p, - "return", - nil, // no parameters + _jsii_.RegisterClass( + "jsii-calc.ConstructorPassesThisOut", + reflect.TypeOf((*ConstructorPassesThisOut)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_ConstructorPassesThisOut{} + }, ) -} - -func (p *jsiiProxy_PythonReservedWords) Try() { - _jsii_.InvokeVoid( - p, - "try", - nil, // no parameters + _jsii_.RegisterClass( + "jsii-calc.Constructors", + reflect.TypeOf((*Constructors)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_Constructors{} + }, ) -} - -func (p *jsiiProxy_PythonReservedWords) While() { - _jsii_.InvokeVoid( - p, - "while", - nil, // no parameters + _jsii_.RegisterClass( + "jsii-calc.ConsumePureInterface", + reflect.TypeOf((*ConsumePureInterface)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "workItBaby", GoMethod: "WorkItBaby"}, + }, + func() interface{} { + return &jsiiProxy_ConsumePureInterface{} + }, ) -} - -func (p *jsiiProxy_PythonReservedWords) With() { - _jsii_.InvokeVoid( - p, - "with", - nil, // no parameters + _jsii_.RegisterClass( + "jsii-calc.ConsumerCanRingBell", + reflect.TypeOf((*ConsumerCanRingBell)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "implementedByObjectLiteral", GoMethod: "ImplementedByObjectLiteral"}, + _jsii_.MemberMethod{JsiiMethod: "implementedByPrivateClass", GoMethod: "ImplementedByPrivateClass"}, + _jsii_.MemberMethod{JsiiMethod: "implementedByPublicClass", GoMethod: "ImplementedByPublicClass"}, + _jsii_.MemberMethod{JsiiMethod: "whenTypedAsClass", GoMethod: "WhenTypedAsClass"}, + }, + func() interface{} { + return &jsiiProxy_ConsumerCanRingBell{} + }, ) -} - -func (p *jsiiProxy_PythonReservedWords) Yield() { - _jsii_.InvokeVoid( - p, - "yield", - nil, // no parameters + _jsii_.RegisterClass( + "jsii-calc.ConsumersOfThisCrazyTypeSystem", + reflect.TypeOf((*ConsumersOfThisCrazyTypeSystem)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "consumeAnotherPublicInterface", GoMethod: "ConsumeAnotherPublicInterface"}, + _jsii_.MemberMethod{JsiiMethod: "consumeNonInternalInterface", GoMethod: "ConsumeNonInternalInterface"}, + }, + func() interface{} { + return &jsiiProxy_ConsumersOfThisCrazyTypeSystem{} + }, ) -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ReferenceEnumFromScopedPackage.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" - - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" -) - -// See awslabs/jsii#138. -type ReferenceEnumFromScopedPackage interface { - Foo() scopejsiicalclib.EnumFromScopedModule - SetFoo(val scopejsiicalclib.EnumFromScopedModule) - LoadFoo() scopejsiicalclib.EnumFromScopedModule - SaveFoo(value scopejsiicalclib.EnumFromScopedModule) -} - -// The jsii proxy struct for ReferenceEnumFromScopedPackage -type jsiiProxy_ReferenceEnumFromScopedPackage struct { - _ byte // padding -} - -func (j *jsiiProxy_ReferenceEnumFromScopedPackage) Foo() scopejsiicalclib.EnumFromScopedModule { - var returns scopejsiicalclib.EnumFromScopedModule - _jsii_.Get( - j, - "foo", - &returns, + _jsii_.RegisterStruct( + "jsii-calc.ContainerProps", + reflect.TypeOf((*ContainerProps)(nil)).Elem(), ) - return returns -} - - -func NewReferenceEnumFromScopedPackage() ReferenceEnumFromScopedPackage { - _init_.Initialize() - - j := jsiiProxy_ReferenceEnumFromScopedPackage{} - - _jsii_.Create( - "jsii-calc.ReferenceEnumFromScopedPackage", - nil, // no parameters - &j, + _jsii_.RegisterClass( + "jsii-calc.DataRenderer", + reflect.TypeOf((*DataRenderer)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "render", GoMethod: "Render"}, + _jsii_.MemberMethod{JsiiMethod: "renderArbitrary", GoMethod: "RenderArbitrary"}, + _jsii_.MemberMethod{JsiiMethod: "renderMap", GoMethod: "RenderMap"}, + }, + func() interface{} { + return &jsiiProxy_DataRenderer{} + }, ) - - return &j -} - -func NewReferenceEnumFromScopedPackage_Override(r ReferenceEnumFromScopedPackage) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.ReferenceEnumFromScopedPackage", - nil, // no parameters - r, + _jsii_.RegisterClass( + "jsii-calc.Default", + reflect.TypeOf((*Default)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "pleaseCompile", GoMethod: "PleaseCompile"}, + }, + func() interface{} { + return &jsiiProxy_Default{} + }, ) -} - -func (j *jsiiProxy_ReferenceEnumFromScopedPackage)SetFoo(val scopejsiicalclib.EnumFromScopedModule) { - _jsii_.Set( - j, - "foo", - val, + _jsii_.RegisterClass( + "jsii-calc.DefaultedConstructorArgument", + reflect.TypeOf((*DefaultedConstructorArgument)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "arg1", GoGetter: "Arg1"}, + _jsii_.MemberProperty{JsiiProperty: "arg2", GoGetter: "Arg2"}, + _jsii_.MemberProperty{JsiiProperty: "arg3", GoGetter: "Arg3"}, + }, + func() interface{} { + return &jsiiProxy_DefaultedConstructorArgument{} + }, ) -} - -func (r *jsiiProxy_ReferenceEnumFromScopedPackage) LoadFoo() scopejsiicalclib.EnumFromScopedModule { - var returns scopejsiicalclib.EnumFromScopedModule - - _jsii_.Invoke( - r, - "loadFoo", - nil, // no parameters - &returns, + _jsii_.RegisterClass( + "jsii-calc.Demonstrate982", + reflect.TypeOf((*Demonstrate982)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_Demonstrate982{} + }, ) - - return returns -} - -func (r *jsiiProxy_ReferenceEnumFromScopedPackage) SaveFoo(value scopejsiicalclib.EnumFromScopedModule) { - _jsii_.InvokeVoid( - r, - "saveFoo", - []interface{}{value}, + _jsii_.RegisterClass( + "jsii-calc.DeprecatedClass", + reflect.TypeOf((*DeprecatedClass)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, + _jsii_.MemberProperty{JsiiProperty: "mutableProperty", GoGetter: "MutableProperty"}, + _jsii_.MemberProperty{JsiiProperty: "readonlyProperty", GoGetter: "ReadonlyProperty"}, + }, + func() interface{} { + return &jsiiProxy_DeprecatedClass{} + }, ) -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ReturnsPrivateImplementationOfInterface.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -// Helps ensure the JSII kernel & runtime cooperate correctly when an un-exported instance of a class is returned with a declared type that is an exported interface, and the instance inherits from an exported class. -// -// Returns: an instance of an un-exported class that extends \`ExportedBaseClass\`, declared as \`IPrivatelyImplemented\`. -// See: https://github.com/aws/jsii/issues/320 -// -type ReturnsPrivateImplementationOfInterface interface { - PrivateImplementation() IPrivatelyImplemented -} - -// The jsii proxy struct for ReturnsPrivateImplementationOfInterface -type jsiiProxy_ReturnsPrivateImplementationOfInterface struct { - _ byte // padding -} - -func (j *jsiiProxy_ReturnsPrivateImplementationOfInterface) PrivateImplementation() IPrivatelyImplemented { - var returns IPrivatelyImplemented - _jsii_.Get( - j, - "privateImplementation", - &returns, + _jsii_.RegisterEnum( + "jsii-calc.DeprecatedEnum", + reflect.TypeOf((*DeprecatedEnum)(nil)).Elem(), + map[string]interface{}{ + "OPTION_A": DeprecatedEnum_OPTION_A, + "OPTION_B": DeprecatedEnum_OPTION_B, + }, ) - return returns -} - - -func NewReturnsPrivateImplementationOfInterface() ReturnsPrivateImplementationOfInterface { - _init_.Initialize() - - j := jsiiProxy_ReturnsPrivateImplementationOfInterface{} - - _jsii_.Create( - "jsii-calc.ReturnsPrivateImplementationOfInterface", - nil, // no parameters - &j, + _jsii_.RegisterStruct( + "jsii-calc.DeprecatedStruct", + reflect.TypeOf((*DeprecatedStruct)(nil)).Elem(), ) - - return &j -} - -func NewReturnsPrivateImplementationOfInterface_Override(r ReturnsPrivateImplementationOfInterface) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.ReturnsPrivateImplementationOfInterface", - nil, // no parameters - r, + _jsii_.RegisterStruct( + "jsii-calc.DerivedStruct", + reflect.TypeOf((*DerivedStruct)(nil)).Elem(), ) -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_RootStruct.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -// This is here to check that we can pass a nested struct into a kwargs by specifying it as an in-line dictionary. -// -// This is cheating with the (current) declared types, but this is the "more -// idiomatic" way for Pythonists. -type RootStruct struct { - // May not be empty. - StringProp *string \`field:"required" json:"stringProp" yaml:"stringProp"\` - NestedStruct *NestedStruct \`field:"optional" json:"nestedStruct" yaml:"nestedStruct"\` -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_RootStructValidator.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -type RootStructValidator interface { -} - -// The jsii proxy struct for RootStructValidator -type jsiiProxy_RootStructValidator struct { - _ byte // padding -} - -func RootStructValidator_Validate(struct_ *RootStruct) { - _init_.Initialize() - - _jsii_.StaticInvokeVoid( - "jsii-calc.RootStructValidator", - "validate", - []interface{}{struct_}, + _jsii_.RegisterStruct( + "jsii-calc.DiamondBottom", + reflect.TypeOf((*DiamondBottom)(nil)).Elem(), ) -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_RuntimeTypeChecking.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - "time" - - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -type RuntimeTypeChecking interface { - MethodWithDefaultedArguments(arg1 *float64, arg2 *string, arg3 *time.Time) - MethodWithOptionalAnyArgument(arg interface{}) - // Used to verify verification of number of method arguments. - MethodWithOptionalArguments(arg1 *float64, arg2 *string, arg3 *time.Time) -} - -// The jsii proxy struct for RuntimeTypeChecking -type jsiiProxy_RuntimeTypeChecking struct { - _ byte // padding -} - -func NewRuntimeTypeChecking() RuntimeTypeChecking { - _init_.Initialize() - - j := jsiiProxy_RuntimeTypeChecking{} - - _jsii_.Create( - "jsii-calc.RuntimeTypeChecking", - nil, // no parameters - &j, + _jsii_.RegisterStruct( + "jsii-calc.DiamondInheritanceBaseLevelStruct", + reflect.TypeOf((*DiamondInheritanceBaseLevelStruct)(nil)).Elem(), ) - - return &j -} - -func NewRuntimeTypeChecking_Override(r RuntimeTypeChecking) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.RuntimeTypeChecking", - nil, // no parameters - r, + _jsii_.RegisterStruct( + "jsii-calc.DiamondInheritanceFirstMidLevelStruct", + reflect.TypeOf((*DiamondInheritanceFirstMidLevelStruct)(nil)).Elem(), ) -} - -func (r *jsiiProxy_RuntimeTypeChecking) MethodWithDefaultedArguments(arg1 *float64, arg2 *string, arg3 *time.Time) { - _jsii_.InvokeVoid( - r, - "methodWithDefaultedArguments", - []interface{}{arg1, arg2, arg3}, + _jsii_.RegisterStruct( + "jsii-calc.DiamondInheritanceSecondMidLevelStruct", + reflect.TypeOf((*DiamondInheritanceSecondMidLevelStruct)(nil)).Elem(), ) -} - -func (r *jsiiProxy_RuntimeTypeChecking) MethodWithOptionalAnyArgument(arg interface{}) { - _jsii_.InvokeVoid( - r, - "methodWithOptionalAnyArgument", - []interface{}{arg}, + _jsii_.RegisterStruct( + "jsii-calc.DiamondInheritanceTopLevelStruct", + reflect.TypeOf((*DiamondInheritanceTopLevelStruct)(nil)).Elem(), ) -} - -func (r *jsiiProxy_RuntimeTypeChecking) MethodWithOptionalArguments(arg1 *float64, arg2 *string, arg3 *time.Time) { - _jsii_.InvokeVoid( - r, - "methodWithOptionalArguments", - []interface{}{arg1, arg2, arg3}, + _jsii_.RegisterClass( + "jsii-calc.DisappointingCollectionSource", + reflect.TypeOf((*DisappointingCollectionSource)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_DisappointingCollectionSource{} + }, ) -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SecondLevelStruct.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -type SecondLevelStruct struct { - // It's long and required. - DeeperRequiredProp *string \`field:"required" json:"deeperRequiredProp" yaml:"deeperRequiredProp"\` - // It's long, but you'll almost never pass it. - DeeperOptionalProp *string \`field:"optional" json:"deeperOptionalProp" yaml:"deeperOptionalProp"\` -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SingleInstanceTwoTypes.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -// Test that a single instance can be returned under two different FQNs. -// -// JSII clients can instantiate 2 different strongly-typed wrappers for the same -// object. Unfortunately, this will break object equality, but if we didn't do -// this it would break runtime type checks in the JVM or CLR. -type SingleInstanceTwoTypes interface { - Interface1() InbetweenClass - Interface2() IPublicInterface -} - -// The jsii proxy struct for SingleInstanceTwoTypes -type jsiiProxy_SingleInstanceTwoTypes struct { - _ byte // padding -} - -func NewSingleInstanceTwoTypes() SingleInstanceTwoTypes { - _init_.Initialize() - - j := jsiiProxy_SingleInstanceTwoTypes{} - - _jsii_.Create( - "jsii-calc.SingleInstanceTwoTypes", - nil, // no parameters - &j, + _jsii_.RegisterClass( + "jsii-calc.DoNotOverridePrivates", + reflect.TypeOf((*DoNotOverridePrivates)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "changePrivatePropertyValue", GoMethod: "ChangePrivatePropertyValue"}, + _jsii_.MemberMethod{JsiiMethod: "privateMethodValue", GoMethod: "PrivateMethodValue"}, + _jsii_.MemberMethod{JsiiMethod: "privatePropertyValue", GoMethod: "PrivatePropertyValue"}, + }, + func() interface{} { + return &jsiiProxy_DoNotOverridePrivates{} + }, ) - - return &j -} - -func NewSingleInstanceTwoTypes_Override(s SingleInstanceTwoTypes) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.SingleInstanceTwoTypes", - nil, // no parameters - s, + _jsii_.RegisterClass( + "jsii-calc.DoNotRecognizeAnyAsOptional", + reflect.TypeOf((*DoNotRecognizeAnyAsOptional)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, + }, + func() interface{} { + return &jsiiProxy_DoNotRecognizeAnyAsOptional{} + }, ) -} - -func (s *jsiiProxy_SingleInstanceTwoTypes) Interface1() InbetweenClass { - var returns InbetweenClass - - _jsii_.Invoke( - s, - "interface1", - nil, // no parameters - &returns, + _jsii_.RegisterClass( + "jsii-calc.DocumentedClass", + reflect.TypeOf((*DocumentedClass)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "greet", GoMethod: "Greet"}, + _jsii_.MemberMethod{JsiiMethod: "hola", GoMethod: "Hola"}, + }, + func() interface{} { + return &jsiiProxy_DocumentedClass{} + }, ) - - return returns -} - -func (s *jsiiProxy_SingleInstanceTwoTypes) Interface2() IPublicInterface { - var returns IPublicInterface - - _jsii_.Invoke( - s, - "interface2", - nil, // no parameters - &returns, + _jsii_.RegisterClass( + "jsii-calc.DontComplainAboutVariadicAfterOptional", + reflect.TypeOf((*DontComplainAboutVariadicAfterOptional)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "optionalAndVariadic", GoMethod: "OptionalAndVariadic"}, + }, + func() interface{} { + return &jsiiProxy_DontComplainAboutVariadicAfterOptional{} + }, ) - - return returns -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SingletonInt.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -// Verifies that singleton enums are handled correctly. -// -// https://github.com/aws/jsii/issues/231 -type SingletonInt interface { - IsSingletonInt(value *float64) *bool -} - -// The jsii proxy struct for SingletonInt -type jsiiProxy_SingletonInt struct { - _ byte // padding -} - -func (s *jsiiProxy_SingletonInt) IsSingletonInt(value *float64) *bool { - var returns *bool - - _jsii_.Invoke( - s, - "isSingletonInt", - []interface{}{value}, - &returns, + _jsii_.RegisterClass( + "jsii-calc.DoubleTrouble", + reflect.TypeOf((*DoubleTrouble)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, + _jsii_.MemberMethod{JsiiMethod: "next", GoMethod: "Next"}, + }, + func() interface{} { + j := jsiiProxy_DoubleTrouble{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_IFriendlyRandomGenerator) + return &j + }, ) - - return returns -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SingletonIntEnum.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -// A singleton integer. -type SingletonIntEnum string - -const ( - // Elite! - SingletonIntEnum_SINGLETON_INT SingletonIntEnum = "SINGLETON_INT" -) - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SingletonString.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -// Verifies that singleton enums are handled correctly. -// -// https://github.com/aws/jsii/issues/231 -type SingletonString interface { - IsSingletonString(value *string) *bool -} - -// The jsii proxy struct for SingletonString -type jsiiProxy_SingletonString struct { - _ byte // padding -} - -func (s *jsiiProxy_SingletonString) IsSingletonString(value *string) *bool { - var returns *bool - - _jsii_.Invoke( - s, - "isSingletonString", - []interface{}{value}, - &returns, + _jsii_.RegisterStruct( + "jsii-calc.DummyObj", + reflect.TypeOf((*DummyObj)(nil)).Elem(), ) - - return returns -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SingletonStringEnum.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -// A singleton string. -type SingletonStringEnum string - -const ( - // 1337. - SingletonStringEnum_SINGLETON_STRING SingletonStringEnum = "SINGLETON_STRING" -) - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SmellyStruct.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -type SmellyStruct struct { - Property *string \`field:"required" json:"property" yaml:"property"\` - YetAnoterOne *bool \`field:"required" json:"yetAnoterOne" yaml:"yetAnoterOne"\` -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SomeTypeJsii976.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -type SomeTypeJsii976 interface { -} - -// The jsii proxy struct for SomeTypeJsii976 -type jsiiProxy_SomeTypeJsii976 struct { - _ byte // padding -} - -func NewSomeTypeJsii976() SomeTypeJsii976 { - _init_.Initialize() - - j := jsiiProxy_SomeTypeJsii976{} - - _jsii_.Create( - "jsii-calc.SomeTypeJsii976", - nil, // no parameters - &j, + _jsii_.RegisterClass( + "jsii-calc.DynamicPropertyBearer", + reflect.TypeOf((*DynamicPropertyBearer)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "dynamicProperty", GoGetter: "DynamicProperty"}, + _jsii_.MemberProperty{JsiiProperty: "valueStore", GoGetter: "ValueStore"}, + }, + func() interface{} { + return &jsiiProxy_DynamicPropertyBearer{} + }, ) - - return &j -} - -func NewSomeTypeJsii976_Override(s SomeTypeJsii976) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.SomeTypeJsii976", - nil, // no parameters - s, + _jsii_.RegisterClass( + "jsii-calc.DynamicPropertyBearerChild", + reflect.TypeOf((*DynamicPropertyBearerChild)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "dynamicProperty", GoGetter: "DynamicProperty"}, + _jsii_.MemberProperty{JsiiProperty: "originalValue", GoGetter: "OriginalValue"}, + _jsii_.MemberMethod{JsiiMethod: "overrideValue", GoMethod: "OverrideValue"}, + _jsii_.MemberProperty{JsiiProperty: "valueStore", GoGetter: "ValueStore"}, + }, + func() interface{} { + j := jsiiProxy_DynamicPropertyBearerChild{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_DynamicPropertyBearer) + return &j + }, ) -} - -func SomeTypeJsii976_ReturnAnonymous() interface{} { - _init_.Initialize() - - var returns interface{} - - _jsii_.StaticInvoke( - "jsii-calc.SomeTypeJsii976", - "returnAnonymous", - nil, // no parameters - &returns, + _jsii_.RegisterClass( + "jsii-calc.Entropy", + reflect.TypeOf((*Entropy)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "increase", GoMethod: "Increase"}, + _jsii_.MemberMethod{JsiiMethod: "repeat", GoMethod: "Repeat"}, + }, + func() interface{} { + return &jsiiProxy_Entropy{} + }, ) - - return returns -} - -func SomeTypeJsii976_ReturnReturn() IReturnJsii976 { - _init_.Initialize() - - var returns IReturnJsii976 - - _jsii_.StaticInvoke( - "jsii-calc.SomeTypeJsii976", - "returnReturn", - nil, // no parameters - &returns, + _jsii_.RegisterClass( + "jsii-calc.EnumDispenser", + reflect.TypeOf((*EnumDispenser)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_EnumDispenser{} + }, ) - - return returns -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StableClass.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -type StableClass interface { - MutableProperty() *float64 - SetMutableProperty(val *float64) - ReadonlyProperty() *string - Method() -} - -// The jsii proxy struct for StableClass -type jsiiProxy_StableClass struct { - _ byte // padding -} - -func (j *jsiiProxy_StableClass) MutableProperty() *float64 { - var returns *float64 - _jsii_.Get( - j, - "mutableProperty", - &returns, + _jsii_.RegisterClass( + "jsii-calc.EraseUndefinedHashValues", + reflect.TypeOf((*EraseUndefinedHashValues)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_EraseUndefinedHashValues{} + }, ) - return returns -} - -func (j *jsiiProxy_StableClass) ReadonlyProperty() *string { - var returns *string - _jsii_.Get( - j, - "readonlyProperty", - &returns, + _jsii_.RegisterStruct( + "jsii-calc.EraseUndefinedHashValuesOptions", + reflect.TypeOf((*EraseUndefinedHashValuesOptions)(nil)).Elem(), ) - return returns -} - - -func NewStableClass(readonlyString *string, mutableNumber *float64) StableClass { - _init_.Initialize() - - j := jsiiProxy_StableClass{} - - _jsii_.Create( - "jsii-calc.StableClass", - []interface{}{readonlyString, mutableNumber}, - &j, + _jsii_.RegisterClass( + "jsii-calc.ExperimentalClass", + reflect.TypeOf((*ExperimentalClass)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, + _jsii_.MemberProperty{JsiiProperty: "mutableProperty", GoGetter: "MutableProperty"}, + _jsii_.MemberProperty{JsiiProperty: "readonlyProperty", GoGetter: "ReadonlyProperty"}, + }, + func() interface{} { + return &jsiiProxy_ExperimentalClass{} + }, ) - - return &j -} - -func NewStableClass_Override(s StableClass, readonlyString *string, mutableNumber *float64) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.StableClass", - []interface{}{readonlyString, mutableNumber}, - s, + _jsii_.RegisterEnum( + "jsii-calc.ExperimentalEnum", + reflect.TypeOf((*ExperimentalEnum)(nil)).Elem(), + map[string]interface{}{ + "OPTION_A": ExperimentalEnum_OPTION_A, + "OPTION_B": ExperimentalEnum_OPTION_B, + }, ) -} - -func (j *jsiiProxy_StableClass)SetMutableProperty(val *float64) { - _jsii_.Set( - j, - "mutableProperty", - val, + _jsii_.RegisterStruct( + "jsii-calc.ExperimentalStruct", + reflect.TypeOf((*ExperimentalStruct)(nil)).Elem(), ) -} - -func (s *jsiiProxy_StableClass) Method() { - _jsii_.InvokeVoid( - s, - "method", - nil, // no parameters + _jsii_.RegisterClass( + "jsii-calc.ExportedBaseClass", + reflect.TypeOf((*ExportedBaseClass)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "success", GoGetter: "Success"}, + }, + func() interface{} { + return &jsiiProxy_ExportedBaseClass{} + }, ) -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StableEnum.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -type StableEnum string - -const ( - StableEnum_OPTION_A StableEnum = "OPTION_A" - StableEnum_OPTION_B StableEnum = "OPTION_B" -) - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StableStruct.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -type StableStruct struct { - ReadonlyProperty *string \`field:"required" json:"readonlyProperty" yaml:"readonlyProperty"\` -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StaticContext.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -// This is used to validate the ability to use \`this\` from within a static context. -// -// https://github.com/awslabs/aws-cdk/issues/2304 -type StaticContext interface { -} - -// The jsii proxy struct for StaticContext -type jsiiProxy_StaticContext struct { - _ byte // padding -} - -func StaticContext_CanAccessStaticContext() *bool { - _init_.Initialize() - - var returns *bool - - _jsii_.StaticInvoke( - "jsii-calc.StaticContext", - "canAccessStaticContext", - nil, // no parameters - &returns, + _jsii_.RegisterStruct( + "jsii-calc.ExtendsInternalInterface", + reflect.TypeOf((*ExtendsInternalInterface)(nil)).Elem(), ) - - return returns -} - -func StaticContext_StaticVariable() *bool { - _init_.Initialize() - var returns *bool - _jsii_.StaticGet( - "jsii-calc.StaticContext", - "staticVariable", - &returns, + _jsii_.RegisterClass( + "jsii-calc.ExternalClass", + reflect.TypeOf((*ExternalClass)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, + _jsii_.MemberProperty{JsiiProperty: "mutableProperty", GoGetter: "MutableProperty"}, + _jsii_.MemberProperty{JsiiProperty: "readonlyProperty", GoGetter: "ReadonlyProperty"}, + }, + func() interface{} { + return &jsiiProxy_ExternalClass{} + }, ) - return returns -} - -func StaticContext_SetStaticVariable(val *bool) { - _init_.Initialize() - _jsii_.StaticSet( - "jsii-calc.StaticContext", - "staticVariable", - val, + _jsii_.RegisterEnum( + "jsii-calc.ExternalEnum", + reflect.TypeOf((*ExternalEnum)(nil)).Elem(), + map[string]interface{}{ + "OPTION_A": ExternalEnum_OPTION_A, + "OPTION_B": ExternalEnum_OPTION_B, + }, ) -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StaticHelloChild.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -type StaticHelloChild interface { - StaticHelloParent -} - -// The jsii proxy struct for StaticHelloChild -type jsiiProxy_StaticHelloChild struct { - jsiiProxy_StaticHelloParent -} - -func StaticHelloChild_Method() { - _init_.Initialize() - - _jsii_.StaticInvokeVoid( - "jsii-calc.StaticHelloChild", - "method", - nil, // no parameters + _jsii_.RegisterStruct( + "jsii-calc.ExternalStruct", + reflect.TypeOf((*ExternalStruct)(nil)).Elem(), ) -} - -func StaticHelloChild_Property() *float64 { - _init_.Initialize() - var returns *float64 - _jsii_.StaticGet( - "jsii-calc.StaticHelloChild", - "property", - &returns, + _jsii_.RegisterClass( + "jsii-calc.FullCombo", + reflect.TypeOf((*FullCombo)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, + _jsii_.MemberProperty{JsiiProperty: "property", GoGetter: "Property"}, + }, + func() interface{} { + j := jsiiProxy_FullCombo{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_BaseClass) + _jsii_.InitJsiiProxy(&j.jsiiProxy_IIndirectlyImplemented) + return &j + }, ) - return returns -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StaticHelloParent.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -// Static methods that override parent class are technically overrides (the inheritance of statics is part of the ES6 specification), but certain other languages such as Java do not carry statics in the inheritance chain at all, so they cannot be overridden, only hidden. -// -// The difference is fairly minor (for typical use-cases, the end result is the -// same), however this has implications on what the generated code should look -// like. -type StaticHelloParent interface { -} - -// The jsii proxy struct for StaticHelloParent -type jsiiProxy_StaticHelloParent struct { - _ byte // padding -} - -func NewStaticHelloParent() StaticHelloParent { - _init_.Initialize() - - j := jsiiProxy_StaticHelloParent{} - - _jsii_.Create( - "jsii-calc.StaticHelloParent", - nil, // no parameters - &j, + _jsii_.RegisterClass( + "jsii-calc.GiveMeStructs", + reflect.TypeOf((*GiveMeStructs)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "derivedToFirst", GoMethod: "DerivedToFirst"}, + _jsii_.MemberMethod{JsiiMethod: "readDerivedNonPrimitive", GoMethod: "ReadDerivedNonPrimitive"}, + _jsii_.MemberMethod{JsiiMethod: "readFirstNumber", GoMethod: "ReadFirstNumber"}, + _jsii_.MemberProperty{JsiiProperty: "structLiteral", GoGetter: "StructLiteral"}, + }, + func() interface{} { + return &jsiiProxy_GiveMeStructs{} + }, ) - - return &j -} - -func NewStaticHelloParent_Override(s StaticHelloParent) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.StaticHelloParent", - nil, // no parameters - s, + _jsii_.RegisterStruct( + "jsii-calc.Greetee", + reflect.TypeOf((*Greetee)(nil)).Elem(), ) -} - -func StaticHelloParent_Method() { - _init_.Initialize() - - _jsii_.StaticInvokeVoid( - "jsii-calc.StaticHelloParent", - "method", - nil, // no parameters + _jsii_.RegisterClass( + "jsii-calc.GreetingAugmenter", + reflect.TypeOf((*GreetingAugmenter)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "betterGreeting", GoMethod: "BetterGreeting"}, + }, + func() interface{} { + return &jsiiProxy_GreetingAugmenter{} + }, ) -} - -func StaticHelloParent_Property() *float64 { - _init_.Initialize() - var returns *float64 - _jsii_.StaticGet( - "jsii-calc.StaticHelloParent", - "property", - &returns, + _jsii_.RegisterInterface( + "jsii-calc.IAnonymousImplementationProvider", + reflect.TypeOf((*IAnonymousImplementationProvider)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "provideAsClass", GoMethod: "ProvideAsClass"}, + _jsii_.MemberMethod{JsiiMethod: "provideAsInterface", GoMethod: "ProvideAsInterface"}, + }, + func() interface{} { + return &jsiiProxy_IAnonymousImplementationProvider{} + }, ) - return returns -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Statics.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -type Statics interface { - Value() *string - JustMethod() *string -} - -// The jsii proxy struct for Statics -type jsiiProxy_Statics struct { - _ byte // padding -} - -func (j *jsiiProxy_Statics) Value() *string { - var returns *string - _jsii_.Get( - j, - "value", - &returns, + _jsii_.RegisterInterface( + "jsii-calc.IAnonymouslyImplementMe", + reflect.TypeOf((*IAnonymouslyImplementMe)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, + _jsii_.MemberMethod{JsiiMethod: "verb", GoMethod: "Verb"}, + }, + func() interface{} { + return &jsiiProxy_IAnonymouslyImplementMe{} + }, + ) + _jsii_.RegisterInterface( + "jsii-calc.IAnotherPublicInterface", + reflect.TypeOf((*IAnotherPublicInterface)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "a", GoGetter: "A"}, + }, + func() interface{} { + return &jsiiProxy_IAnotherPublicInterface{} + }, + ) + _jsii_.RegisterInterface( + "jsii-calc.IBell", + reflect.TypeOf((*IBell)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "ring", GoMethod: "Ring"}, + }, + func() interface{} { + return &jsiiProxy_IBell{} + }, + ) + _jsii_.RegisterInterface( + "jsii-calc.IBellRinger", + reflect.TypeOf((*IBellRinger)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "yourTurn", GoMethod: "YourTurn"}, + }, + func() interface{} { + return &jsiiProxy_IBellRinger{} + }, ) - return returns -} - - -func NewStatics(value *string) Statics { - _init_.Initialize() - - j := jsiiProxy_Statics{} - - _jsii_.Create( - "jsii-calc.Statics", - []interface{}{value}, - &j, + _jsii_.RegisterInterface( + "jsii-calc.IConcreteBellRinger", + reflect.TypeOf((*IConcreteBellRinger)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "yourTurn", GoMethod: "YourTurn"}, + }, + func() interface{} { + return &jsiiProxy_IConcreteBellRinger{} + }, ) - - return &j -} - -func NewStatics_Override(s Statics, value *string) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.Statics", - []interface{}{value}, - s, + _jsii_.RegisterInterface( + "jsii-calc.IDeprecatedInterface", + reflect.TypeOf((*IDeprecatedInterface)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, + _jsii_.MemberProperty{JsiiProperty: "mutableProperty", GoGetter: "MutableProperty"}, + }, + func() interface{} { + return &jsiiProxy_IDeprecatedInterface{} + }, ) -} - -// Jsdocs for static method. -func Statics_StaticMethod(name *string) *string { - _init_.Initialize() - - var returns *string - - _jsii_.StaticInvoke( - "jsii-calc.Statics", - "staticMethod", - []interface{}{name}, - &returns, + _jsii_.RegisterInterface( + "jsii-calc.IExperimentalInterface", + reflect.TypeOf((*IExperimentalInterface)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, + _jsii_.MemberProperty{JsiiProperty: "mutableProperty", GoGetter: "MutableProperty"}, + }, + func() interface{} { + return &jsiiProxy_IExperimentalInterface{} + }, ) - - return returns -} - -func Statics_BAR() *float64 { - _init_.Initialize() - var returns *float64 - _jsii_.StaticGet( - "jsii-calc.Statics", - "BAR", - &returns, + _jsii_.RegisterInterface( + "jsii-calc.IExtendsPrivateInterface", + reflect.TypeOf((*IExtendsPrivateInterface)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "moreThings", GoGetter: "MoreThings"}, + _jsii_.MemberProperty{JsiiProperty: "private", GoGetter: "Private"}, + }, + func() interface{} { + return &jsiiProxy_IExtendsPrivateInterface{} + }, ) - return returns -} - -func Statics_ConstObj() DoubleTrouble { - _init_.Initialize() - var returns DoubleTrouble - _jsii_.StaticGet( - "jsii-calc.Statics", - "ConstObj", - &returns, + _jsii_.RegisterInterface( + "jsii-calc.IExternalInterface", + reflect.TypeOf((*IExternalInterface)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, + _jsii_.MemberProperty{JsiiProperty: "mutableProperty", GoGetter: "MutableProperty"}, + }, + func() interface{} { + return &jsiiProxy_IExternalInterface{} + }, ) - return returns -} - -func Statics_Foo() *string { - _init_.Initialize() - var returns *string - _jsii_.StaticGet( - "jsii-calc.Statics", - "Foo", - &returns, + _jsii_.RegisterInterface( + "jsii-calc.IFriendlier", + reflect.TypeOf((*IFriendlier)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "farewell", GoMethod: "Farewell"}, + _jsii_.MemberMethod{JsiiMethod: "goodbye", GoMethod: "Goodbye"}, + _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, + }, + func() interface{} { + j := jsiiProxy_IFriendlier{} + _jsii_.InitJsiiProxy(&j.Type__scopejsiicalclibIFriendly) + return &j + }, ) - return returns -} - -func Statics_Instance() Statics { - _init_.Initialize() - var returns Statics - _jsii_.StaticGet( - "jsii-calc.Statics", - "instance", - &returns, + _jsii_.RegisterInterface( + "jsii-calc.IFriendlyRandomGenerator", + reflect.TypeOf((*IFriendlyRandomGenerator)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, + _jsii_.MemberMethod{JsiiMethod: "next", GoMethod: "Next"}, + }, + func() interface{} { + j := jsiiProxy_IFriendlyRandomGenerator{} + _jsii_.InitJsiiProxy(&j.Type__scopejsiicalclibIFriendly) + _jsii_.InitJsiiProxy(&j.jsiiProxy_IRandomNumberGenerator) + return &j + }, ) - return returns -} - -func Statics_SetInstance(val Statics) { - _init_.Initialize() - _jsii_.StaticSet( - "jsii-calc.Statics", - "instance", - val, + _jsii_.RegisterInterface( + "jsii-calc.IIndirectlyImplemented", + reflect.TypeOf((*IIndirectlyImplemented)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, + _jsii_.MemberProperty{JsiiProperty: "property", GoGetter: "Property"}, + }, + func() interface{} { + return &jsiiProxy_IIndirectlyImplemented{} + }, ) -} - -func Statics_NonConstStatic() *float64 { - _init_.Initialize() - var returns *float64 - _jsii_.StaticGet( - "jsii-calc.Statics", - "nonConstStatic", - &returns, + _jsii_.RegisterInterface( + "jsii-calc.IInterfaceImplementedByAbstractClass", + reflect.TypeOf((*IInterfaceImplementedByAbstractClass)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "propFromInterface", GoGetter: "PropFromInterface"}, + }, + func() interface{} { + return &jsiiProxy_IInterfaceImplementedByAbstractClass{} + }, ) - return returns -} - -func Statics_SetNonConstStatic(val *float64) { - _init_.Initialize() - _jsii_.StaticSet( - "jsii-calc.Statics", - "nonConstStatic", - val, + _jsii_.RegisterInterface( + "jsii-calc.IInterfaceThatShouldNotBeADataType", + reflect.TypeOf((*IInterfaceThatShouldNotBeADataType)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "doThings", GoMethod: "DoThings"}, + _jsii_.MemberProperty{JsiiProperty: "otherValue", GoGetter: "OtherValue"}, + _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, + }, + func() interface{} { + j := jsiiProxy_IInterfaceThatShouldNotBeADataType{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_IInterfaceWithMethods) + return &j + }, ) -} - -func Statics_ZooBar() *map[string]*string { - _init_.Initialize() - var returns *map[string]*string - _jsii_.StaticGet( - "jsii-calc.Statics", - "zooBar", - &returns, + _jsii_.RegisterInterface( + "jsii-calc.IInterfaceWithInternal", + reflect.TypeOf((*IInterfaceWithInternal)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "visible", GoMethod: "Visible"}, + }, + func() interface{} { + return &jsiiProxy_IInterfaceWithInternal{} + }, ) - return returns -} - -func (s *jsiiProxy_Statics) JustMethod() *string { - var returns *string - - _jsii_.Invoke( - s, - "justMethod", - nil, // no parameters - &returns, + _jsii_.RegisterInterface( + "jsii-calc.IInterfaceWithMethods", + reflect.TypeOf((*IInterfaceWithMethods)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "doThings", GoMethod: "DoThings"}, + _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, + }, + func() interface{} { + return &jsiiProxy_IInterfaceWithMethods{} + }, ) - - return returns -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StringEnum.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -type StringEnum string - -const ( - StringEnum_A StringEnum = "A" - StringEnum_B StringEnum = "B" - StringEnum_C StringEnum = "C" -) - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StripInternal.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -type StripInternal interface { - YouSeeMe() *string - SetYouSeeMe(val *string) -} - -// The jsii proxy struct for StripInternal -type jsiiProxy_StripInternal struct { - _ byte // padding -} - -func (j *jsiiProxy_StripInternal) YouSeeMe() *string { - var returns *string - _jsii_.Get( - j, - "youSeeMe", - &returns, + _jsii_.RegisterInterface( + "jsii-calc.IInterfaceWithOptionalMethodArguments", + reflect.TypeOf((*IInterfaceWithOptionalMethodArguments)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, + }, + func() interface{} { + return &jsiiProxy_IInterfaceWithOptionalMethodArguments{} + }, ) - return returns -} - - -func NewStripInternal() StripInternal { - _init_.Initialize() - - j := jsiiProxy_StripInternal{} - - _jsii_.Create( - "jsii-calc.StripInternal", - nil, // no parameters - &j, + _jsii_.RegisterInterface( + "jsii-calc.IInterfaceWithProperties", + reflect.TypeOf((*IInterfaceWithProperties)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "readOnlyString", GoGetter: "ReadOnlyString"}, + _jsii_.MemberProperty{JsiiProperty: "readWriteString", GoGetter: "ReadWriteString"}, + }, + func() interface{} { + return &jsiiProxy_IInterfaceWithProperties{} + }, ) - - return &j -} - -func NewStripInternal_Override(s StripInternal) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.StripInternal", - nil, // no parameters - s, + _jsii_.RegisterInterface( + "jsii-calc.IInterfaceWithPropertiesExtension", + reflect.TypeOf((*IInterfaceWithPropertiesExtension)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "foo", GoGetter: "Foo"}, + _jsii_.MemberProperty{JsiiProperty: "readOnlyString", GoGetter: "ReadOnlyString"}, + _jsii_.MemberProperty{JsiiProperty: "readWriteString", GoGetter: "ReadWriteString"}, + }, + func() interface{} { + j := jsiiProxy_IInterfaceWithPropertiesExtension{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_IInterfaceWithProperties) + return &j + }, ) -} - -func (j *jsiiProxy_StripInternal)SetYouSeeMe(val *string) { - _jsii_.Set( - j, - "youSeeMe", - val, + _jsii_.RegisterInterface( + "jsii-calc.IJSII417Derived", + reflect.TypeOf((*IJSII417Derived)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "bar", GoMethod: "Bar"}, + _jsii_.MemberMethod{JsiiMethod: "baz", GoMethod: "Baz"}, + _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, + _jsii_.MemberProperty{JsiiProperty: "hasRoot", GoGetter: "HasRoot"}, + _jsii_.MemberProperty{JsiiProperty: "property", GoGetter: "Property"}, + }, + func() interface{} { + j := jsiiProxy_IJSII417Derived{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_IJSII417PublicBaseOfBase) + return &j + }, ) -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StructA.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -// We can serialize and deserialize structs without silently ignoring optional fields. -type StructA struct { - RequiredString *string \`field:"required" json:"requiredString" yaml:"requiredString"\` - OptionalNumber *float64 \`field:"optional" json:"optionalNumber" yaml:"optionalNumber"\` - OptionalString *string \`field:"optional" json:"optionalString" yaml:"optionalString"\` -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StructB.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -// This intentionally overlaps with StructA (where only requiredString is provided) to test htat the kernel properly disambiguates those. -type StructB struct { - RequiredString *string \`field:"required" json:"requiredString" yaml:"requiredString"\` - OptionalBoolean *bool \`field:"optional" json:"optionalBoolean" yaml:"optionalBoolean"\` - OptionalStructA *StructA \`field:"optional" json:"optionalStructA" yaml:"optionalStructA"\` -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StructParameterType.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -// Verifies that, in languages that do keyword lifting (e.g: Python), having a struct member with the same name as a positional parameter results in the correct code being emitted. -// -// See: https://github.com/aws/aws-cdk/issues/4302 -type StructParameterType struct { - Scope *string \`field:"required" json:"scope" yaml:"scope"\` - Props *bool \`field:"optional" json:"props" yaml:"props"\` -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StructPassing.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -// Just because we can. -type StructPassing interface { -} - -// The jsii proxy struct for StructPassing -type jsiiProxy_StructPassing struct { - _ byte // padding -} - -func NewStructPassing() StructPassing { - _init_.Initialize() - - j := jsiiProxy_StructPassing{} - - _jsii_.Create( - "jsii-calc.StructPassing", - nil, // no parameters - &j, + _jsii_.RegisterInterface( + "jsii-calc.IJSII417PublicBaseOfBase", + reflect.TypeOf((*IJSII417PublicBaseOfBase)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, + _jsii_.MemberProperty{JsiiProperty: "hasRoot", GoGetter: "HasRoot"}, + }, + func() interface{} { + return &jsiiProxy_IJSII417PublicBaseOfBase{} + }, + ) + _jsii_.RegisterInterface( + "jsii-calc.IJavaReservedWordsInAnInterface", + reflect.TypeOf((*IJavaReservedWordsInAnInterface)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "abstract", GoMethod: "Abstract"}, + _jsii_.MemberMethod{JsiiMethod: "assert", GoMethod: "Assert"}, + _jsii_.MemberMethod{JsiiMethod: "boolean", GoMethod: "Boolean"}, + _jsii_.MemberMethod{JsiiMethod: "break", GoMethod: "Break"}, + _jsii_.MemberMethod{JsiiMethod: "byte", GoMethod: "Byte"}, + _jsii_.MemberMethod{JsiiMethod: "case", GoMethod: "Case"}, + _jsii_.MemberMethod{JsiiMethod: "catch", GoMethod: "Catch"}, + _jsii_.MemberMethod{JsiiMethod: "char", GoMethod: "Char"}, + _jsii_.MemberMethod{JsiiMethod: "class", GoMethod: "Class"}, + _jsii_.MemberMethod{JsiiMethod: "const", GoMethod: "Const"}, + _jsii_.MemberMethod{JsiiMethod: "continue", GoMethod: "Continue"}, + _jsii_.MemberMethod{JsiiMethod: "default", GoMethod: "Default"}, + _jsii_.MemberMethod{JsiiMethod: "do", GoMethod: "Do"}, + _jsii_.MemberMethod{JsiiMethod: "double", GoMethod: "Double"}, + _jsii_.MemberMethod{JsiiMethod: "else", GoMethod: "Else"}, + _jsii_.MemberMethod{JsiiMethod: "enum", GoMethod: "Enum"}, + _jsii_.MemberMethod{JsiiMethod: "extends", GoMethod: "Extends"}, + _jsii_.MemberMethod{JsiiMethod: "false", GoMethod: "False"}, + _jsii_.MemberMethod{JsiiMethod: "final", GoMethod: "Final"}, + _jsii_.MemberMethod{JsiiMethod: "finally", GoMethod: "Finally"}, + _jsii_.MemberMethod{JsiiMethod: "float", GoMethod: "Float"}, + _jsii_.MemberMethod{JsiiMethod: "for", GoMethod: "For"}, + _jsii_.MemberMethod{JsiiMethod: "goto", GoMethod: "Goto"}, + _jsii_.MemberMethod{JsiiMethod: "if", GoMethod: "If"}, + _jsii_.MemberMethod{JsiiMethod: "implements", GoMethod: "Implements"}, + _jsii_.MemberMethod{JsiiMethod: "import", GoMethod: "Import"}, + _jsii_.MemberMethod{JsiiMethod: "instanceof", GoMethod: "Instanceof"}, + _jsii_.MemberMethod{JsiiMethod: "int", GoMethod: "Int"}, + _jsii_.MemberMethod{JsiiMethod: "interface", GoMethod: "Interface"}, + _jsii_.MemberMethod{JsiiMethod: "long", GoMethod: "Long"}, + _jsii_.MemberMethod{JsiiMethod: "native", GoMethod: "Native"}, + _jsii_.MemberMethod{JsiiMethod: "null", GoMethod: "Null"}, + _jsii_.MemberMethod{JsiiMethod: "package", GoMethod: "Package"}, + _jsii_.MemberMethod{JsiiMethod: "private", GoMethod: "Private"}, + _jsii_.MemberMethod{JsiiMethod: "protected", GoMethod: "Protected"}, + _jsii_.MemberMethod{JsiiMethod: "public", GoMethod: "Public"}, + _jsii_.MemberMethod{JsiiMethod: "return", GoMethod: "Return"}, + _jsii_.MemberMethod{JsiiMethod: "short", GoMethod: "Short"}, + _jsii_.MemberMethod{JsiiMethod: "static", GoMethod: "Static"}, + _jsii_.MemberMethod{JsiiMethod: "strictfp", GoMethod: "Strictfp"}, + _jsii_.MemberMethod{JsiiMethod: "super", GoMethod: "Super"}, + _jsii_.MemberMethod{JsiiMethod: "switch", GoMethod: "Switch"}, + _jsii_.MemberMethod{JsiiMethod: "synchronized", GoMethod: "Synchronized"}, + _jsii_.MemberMethod{JsiiMethod: "this", GoMethod: "This"}, + _jsii_.MemberMethod{JsiiMethod: "throw", GoMethod: "Throw"}, + _jsii_.MemberMethod{JsiiMethod: "throws", GoMethod: "Throws"}, + _jsii_.MemberMethod{JsiiMethod: "transient", GoMethod: "Transient"}, + _jsii_.MemberMethod{JsiiMethod: "true", GoMethod: "True"}, + _jsii_.MemberMethod{JsiiMethod: "try", GoMethod: "Try"}, + _jsii_.MemberMethod{JsiiMethod: "void", GoMethod: "Void"}, + _jsii_.MemberMethod{JsiiMethod: "volatile", GoMethod: "Volatile"}, + _jsii_.MemberProperty{JsiiProperty: "while", GoGetter: "While"}, + }, + func() interface{} { + return &jsiiProxy_IJavaReservedWordsInAnInterface{} + }, ) - - return &j -} - -func NewStructPassing_Override(s StructPassing) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.StructPassing", - nil, // no parameters - s, + _jsii_.RegisterInterface( + "jsii-calc.IJsii487External", + reflect.TypeOf((*IJsii487External)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_IJsii487External{} + }, ) -} - -func StructPassing_HowManyVarArgsDidIPass(_positional *float64, inputs ...*TopLevelStruct) *float64 { - _init_.Initialize() - - args := []interface{}{_positional} - for _, a := range inputs { - args = append(args, a) - } - - var returns *float64 - - _jsii_.StaticInvoke( - "jsii-calc.StructPassing", - "howManyVarArgsDidIPass", - args, - &returns, + _jsii_.RegisterInterface( + "jsii-calc.IJsii487External2", + reflect.TypeOf((*IJsii487External2)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_IJsii487External2{} + }, ) - - return returns -} - -func StructPassing_RoundTrip(_positional *float64, input *TopLevelStruct) *TopLevelStruct { - _init_.Initialize() - - var returns *TopLevelStruct - - _jsii_.StaticInvoke( - "jsii-calc.StructPassing", - "roundTrip", - []interface{}{_positional, input}, - &returns, + _jsii_.RegisterInterface( + "jsii-calc.IJsii496", + reflect.TypeOf((*IJsii496)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_IJsii496{} + }, ) - - return returns -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StructUnionConsumer.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -type StructUnionConsumer interface { -} - -// The jsii proxy struct for StructUnionConsumer -type jsiiProxy_StructUnionConsumer struct { - _ byte // padding -} - -func StructUnionConsumer_IsStructA(struct_ interface{}) *bool { - _init_.Initialize() - - var returns *bool - - _jsii_.StaticInvoke( - "jsii-calc.StructUnionConsumer", - "isStructA", - []interface{}{struct_}, - &returns, + _jsii_.RegisterInterface( + "jsii-calc.IMutableObjectLiteral", + reflect.TypeOf((*IMutableObjectLiteral)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, + }, + func() interface{} { + return &jsiiProxy_IMutableObjectLiteral{} + }, ) - - return returns -} - -func StructUnionConsumer_IsStructB(struct_ interface{}) *bool { - _init_.Initialize() - - var returns *bool - - _jsii_.StaticInvoke( - "jsii-calc.StructUnionConsumer", - "isStructB", - []interface{}{struct_}, - &returns, + _jsii_.RegisterInterface( + "jsii-calc.INonInternalInterface", + reflect.TypeOf((*INonInternalInterface)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "a", GoGetter: "A"}, + _jsii_.MemberProperty{JsiiProperty: "b", GoGetter: "B"}, + _jsii_.MemberProperty{JsiiProperty: "c", GoGetter: "C"}, + }, + func() interface{} { + j := jsiiProxy_INonInternalInterface{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_IAnotherPublicInterface) + return &j + }, ) - - return returns -} - -func StructUnionConsumer_ProvideStruct(which *string) interface{} { - _init_.Initialize() - - var returns interface{} - - _jsii_.StaticInvoke( - "jsii-calc.StructUnionConsumer", - "provideStruct", - []interface{}{which}, - &returns, + _jsii_.RegisterInterface( + "jsii-calc.IObjectWithProperty", + reflect.TypeOf((*IObjectWithProperty)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "property", GoGetter: "Property"}, + _jsii_.MemberMethod{JsiiMethod: "wasSet", GoMethod: "WasSet"}, + }, + func() interface{} { + return &jsiiProxy_IObjectWithProperty{} + }, ) - - return returns -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StructWithCollectionOfUnionts.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -type StructWithCollectionOfUnionts struct { - UnionProperty *[]*map[string]interface{} \`field:"required" json:"unionProperty" yaml:"unionProperty"\` -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StructWithEnum.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -type StructWithEnum struct { - // An enum value. - Foo StringEnum \`field:"required" json:"foo" yaml:"foo"\` - // Optional enum value (of type integer). - Bar AllTypesEnum \`field:"optional" json:"bar" yaml:"bar"\` -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_StructWithJavaReservedWords.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -type StructWithJavaReservedWords struct { - Default *string \`field:"required" json:"default" yaml:"default"\` - Assert *string \`field:"optional" json:"assert" yaml:"assert"\` - Result *string \`field:"optional" json:"result" yaml:"result"\` - That *string \`field:"optional" json:"that" yaml:"that"\` -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Sum.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" - - "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/composition" - "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/internal" - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" -) - -// An operation that sums multiple values. -type Sum interface { - composition.CompositeOperation - // A set of postfixes to include in a decorated .toString(). - DecorationPostfixes() *[]*string - SetDecorationPostfixes(val *[]*string) - // A set of prefixes to include in a decorated .toString(). - DecorationPrefixes() *[]*string - SetDecorationPrefixes(val *[]*string) - // The expression that this operation consists of. - // - // Must be implemented by derived classes. - Expression() scopejsiicalclib.NumericValue - // The parts to sum. - Parts() *[]scopejsiicalclib.NumericValue - SetParts(val *[]scopejsiicalclib.NumericValue) - // The .toString() style. - StringStyle() composition.CompositeOperation_CompositionStringStyle - SetStringStyle(val composition.CompositeOperation_CompositionStringStyle) - // The value. - Value() *float64 - // String representation of the value. - ToString() *string - // Returns: the name of the class (to verify native type names are created for derived classes). - TypeName() interface{} -} - -// The jsii proxy struct for Sum -type jsiiProxy_Sum struct { - internal.Type__compositionCompositeOperation -} - -func (j *jsiiProxy_Sum) DecorationPostfixes() *[]*string { - var returns *[]*string - _jsii_.Get( - j, - "decorationPostfixes", - &returns, + _jsii_.RegisterInterface( + "jsii-calc.IOptionalMethod", + reflect.TypeOf((*IOptionalMethod)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "optional", GoMethod: "Optional"}, + }, + func() interface{} { + return &jsiiProxy_IOptionalMethod{} + }, ) - return returns -} - -func (j *jsiiProxy_Sum) DecorationPrefixes() *[]*string { - var returns *[]*string - _jsii_.Get( - j, - "decorationPrefixes", - &returns, + _jsii_.RegisterInterface( + "jsii-calc.IPrivatelyImplemented", + reflect.TypeOf((*IPrivatelyImplemented)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "success", GoGetter: "Success"}, + }, + func() interface{} { + return &jsiiProxy_IPrivatelyImplemented{} + }, ) - return returns -} - -func (j *jsiiProxy_Sum) Expression() scopejsiicalclib.NumericValue { - var returns scopejsiicalclib.NumericValue - _jsii_.Get( - j, - "expression", - &returns, + _jsii_.RegisterInterface( + "jsii-calc.IPublicInterface", + reflect.TypeOf((*IPublicInterface)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "bye", GoMethod: "Bye"}, + }, + func() interface{} { + return &jsiiProxy_IPublicInterface{} + }, ) - return returns -} - -func (j *jsiiProxy_Sum) Parts() *[]scopejsiicalclib.NumericValue { - var returns *[]scopejsiicalclib.NumericValue - _jsii_.Get( - j, - "parts", - &returns, + _jsii_.RegisterInterface( + "jsii-calc.IPublicInterface2", + reflect.TypeOf((*IPublicInterface2)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "ciao", GoMethod: "Ciao"}, + }, + func() interface{} { + return &jsiiProxy_IPublicInterface2{} + }, ) - return returns -} - -func (j *jsiiProxy_Sum) StringStyle() composition.CompositeOperation_CompositionStringStyle { - var returns composition.CompositeOperation_CompositionStringStyle - _jsii_.Get( - j, - "stringStyle", - &returns, + _jsii_.RegisterInterface( + "jsii-calc.IRandomNumberGenerator", + reflect.TypeOf((*IRandomNumberGenerator)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "next", GoMethod: "Next"}, + }, + func() interface{} { + return &jsiiProxy_IRandomNumberGenerator{} + }, ) - return returns -} - -func (j *jsiiProxy_Sum) Value() *float64 { - var returns *float64 - _jsii_.Get( - j, - "value", - &returns, + _jsii_.RegisterInterface( + "jsii-calc.IReturnJsii976", + reflect.TypeOf((*IReturnJsii976)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "foo", GoGetter: "Foo"}, + }, + func() interface{} { + return &jsiiProxy_IReturnJsii976{} + }, ) - return returns -} - - -func NewSum() Sum { - _init_.Initialize() - - j := jsiiProxy_Sum{} - - _jsii_.Create( - "jsii-calc.Sum", - nil, // no parameters - &j, + _jsii_.RegisterInterface( + "jsii-calc.IReturnsNumber", + reflect.TypeOf((*IReturnsNumber)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "numberProp", GoGetter: "NumberProp"}, + _jsii_.MemberMethod{JsiiMethod: "obtainNumber", GoMethod: "ObtainNumber"}, + }, + func() interface{} { + return &jsiiProxy_IReturnsNumber{} + }, ) - - return &j -} - -func NewSum_Override(s Sum) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.Sum", - nil, // no parameters - s, + _jsii_.RegisterInterface( + "jsii-calc.IStableInterface", + reflect.TypeOf((*IStableInterface)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, + _jsii_.MemberProperty{JsiiProperty: "mutableProperty", GoGetter: "MutableProperty"}, + }, + func() interface{} { + return &jsiiProxy_IStableInterface{} + }, ) -} - -func (j *jsiiProxy_Sum)SetDecorationPostfixes(val *[]*string) { - _jsii_.Set( - j, - "decorationPostfixes", - val, + _jsii_.RegisterInterface( + "jsii-calc.IStructReturningDelegate", + reflect.TypeOf((*IStructReturningDelegate)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "returnStruct", GoMethod: "ReturnStruct"}, + }, + func() interface{} { + return &jsiiProxy_IStructReturningDelegate{} + }, ) -} - -func (j *jsiiProxy_Sum)SetDecorationPrefixes(val *[]*string) { - _jsii_.Set( - j, - "decorationPrefixes", - val, + _jsii_.RegisterInterface( + "jsii-calc.IWallClock", + reflect.TypeOf((*IWallClock)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "iso8601Now", GoMethod: "Iso8601Now"}, + }, + func() interface{} { + return &jsiiProxy_IWallClock{} + }, ) -} - -func (j *jsiiProxy_Sum)SetParts(val *[]scopejsiicalclib.NumericValue) { - _jsii_.Set( - j, - "parts", - val, + _jsii_.RegisterClass( + "jsii-calc.ImplementInternalInterface", + reflect.TypeOf((*ImplementInternalInterface)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "prop", GoGetter: "Prop"}, + }, + func() interface{} { + return &jsiiProxy_ImplementInternalInterface{} + }, + ) + _jsii_.RegisterClass( + "jsii-calc.Implementation", + reflect.TypeOf((*Implementation)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, + }, + func() interface{} { + return &jsiiProxy_Implementation{} + }, + ) + _jsii_.RegisterClass( + "jsii-calc.ImplementsInterfaceWithInternal", + reflect.TypeOf((*ImplementsInterfaceWithInternal)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "visible", GoMethod: "Visible"}, + }, + func() interface{} { + j := jsiiProxy_ImplementsInterfaceWithInternal{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_IInterfaceWithInternal) + return &j + }, + ) + _jsii_.RegisterClass( + "jsii-calc.ImplementsInterfaceWithInternalSubclass", + reflect.TypeOf((*ImplementsInterfaceWithInternalSubclass)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "visible", GoMethod: "Visible"}, + }, + func() interface{} { + j := jsiiProxy_ImplementsInterfaceWithInternalSubclass{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_ImplementsInterfaceWithInternal) + return &j + }, + ) + _jsii_.RegisterClass( + "jsii-calc.ImplementsPrivateInterface", + reflect.TypeOf((*ImplementsPrivateInterface)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "private", GoGetter: "Private"}, + }, + func() interface{} { + return &jsiiProxy_ImplementsPrivateInterface{} + }, + ) + _jsii_.RegisterStruct( + "jsii-calc.ImplictBaseOfBase", + reflect.TypeOf((*ImplictBaseOfBase)(nil)).Elem(), + ) + _jsii_.RegisterClass( + "jsii-calc.InbetweenClass", + reflect.TypeOf((*InbetweenClass)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "ciao", GoMethod: "Ciao"}, + _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, + }, + func() interface{} { + j := jsiiProxy_InbetweenClass{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_PublicClass) + _jsii_.InitJsiiProxy(&j.jsiiProxy_IPublicInterface2) + return &j + }, ) -} - -func (j *jsiiProxy_Sum)SetStringStyle(val composition.CompositeOperation_CompositionStringStyle) { - _jsii_.Set( - j, - "stringStyle", - val, + _jsii_.RegisterClass( + "jsii-calc.InterfaceCollections", + reflect.TypeOf((*InterfaceCollections)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_InterfaceCollections{} + }, ) -} - -func (s *jsiiProxy_Sum) ToString() *string { - var returns *string - - _jsii_.Invoke( - s, - "toString", - nil, // no parameters - &returns, + _jsii_.RegisterClass( + "jsii-calc.InterfacesMaker", + reflect.TypeOf((*InterfacesMaker)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_InterfacesMaker{} + }, ) - - return returns -} - -func (s *jsiiProxy_Sum) TypeName() interface{} { - var returns interface{} - - _jsii_.Invoke( - s, - "typeName", - nil, // no parameters - &returns, + _jsii_.RegisterClass( + "jsii-calc.Isomorphism", + reflect.TypeOf((*Isomorphism)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "myself", GoMethod: "Myself"}, + }, + func() interface{} { + return &jsiiProxy_Isomorphism{} + }, ) - - return returns -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SupportsNiceJavaBuilder.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -type SupportsNiceJavaBuilder interface { - SupportsNiceJavaBuilderWithRequiredProps - Bar() *float64 - // some identifier. - Id() *float64 - PropId() *string - Rest() *[]*string -} - -// The jsii proxy struct for SupportsNiceJavaBuilder -type jsiiProxy_SupportsNiceJavaBuilder struct { - jsiiProxy_SupportsNiceJavaBuilderWithRequiredProps -} - -func (j *jsiiProxy_SupportsNiceJavaBuilder) Bar() *float64 { - var returns *float64 - _jsii_.Get( - j, - "bar", - &returns, + _jsii_.RegisterClass( + "jsii-calc.Issue2638", + reflect.TypeOf((*Issue2638)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_Issue2638{} + }, ) - return returns -} - -func (j *jsiiProxy_SupportsNiceJavaBuilder) Id() *float64 { - var returns *float64 - _jsii_.Get( - j, - "id", - &returns, + _jsii_.RegisterClass( + "jsii-calc.Issue2638B", + reflect.TypeOf((*Issue2638B)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_Issue2638B{} + }, ) - return returns -} - -func (j *jsiiProxy_SupportsNiceJavaBuilder) PropId() *string { - var returns *string - _jsii_.Get( - j, - "propId", - &returns, + _jsii_.RegisterClass( + "jsii-calc.JSII417Derived", + reflect.TypeOf((*JSII417Derived)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "bar", GoMethod: "Bar"}, + _jsii_.MemberMethod{JsiiMethod: "baz", GoMethod: "Baz"}, + _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, + _jsii_.MemberProperty{JsiiProperty: "hasRoot", GoGetter: "HasRoot"}, + _jsii_.MemberProperty{JsiiProperty: "property", GoGetter: "Property"}, + }, + func() interface{} { + j := jsiiProxy_JSII417Derived{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_JSII417PublicBaseOfBase) + return &j + }, ) - return returns -} - -func (j *jsiiProxy_SupportsNiceJavaBuilder) Rest() *[]*string { - var returns *[]*string - _jsii_.Get( - j, - "rest", - &returns, + _jsii_.RegisterClass( + "jsii-calc.JSII417PublicBaseOfBase", + reflect.TypeOf((*JSII417PublicBaseOfBase)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, + _jsii_.MemberProperty{JsiiProperty: "hasRoot", GoGetter: "HasRoot"}, + }, + func() interface{} { + return &jsiiProxy_JSII417PublicBaseOfBase{} + }, ) - return returns -} - - -func NewSupportsNiceJavaBuilder(id *float64, defaultBar *float64, props *SupportsNiceJavaBuilderProps, rest ...*string) SupportsNiceJavaBuilder { - _init_.Initialize() - - args := []interface{}{id, defaultBar, props} - for _, a := range rest { - args = append(args, a) - } - - j := jsiiProxy_SupportsNiceJavaBuilder{} - - _jsii_.Create( - "jsii-calc.SupportsNiceJavaBuilder", - args, - &j, + _jsii_.RegisterClass( + "jsii-calc.JSObjectLiteralForInterface", + reflect.TypeOf((*JSObjectLiteralForInterface)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "giveMeFriendly", GoMethod: "GiveMeFriendly"}, + _jsii_.MemberMethod{JsiiMethod: "giveMeFriendlyGenerator", GoMethod: "GiveMeFriendlyGenerator"}, + }, + func() interface{} { + return &jsiiProxy_JSObjectLiteralForInterface{} + }, ) - - return &j -} - -func NewSupportsNiceJavaBuilder_Override(s SupportsNiceJavaBuilder, id *float64, defaultBar *float64, props *SupportsNiceJavaBuilderProps, rest ...*string) { - _init_.Initialize() - - args := []interface{}{id, defaultBar, props} - for _, a := range rest { - args = append(args, a) - } - - _jsii_.Create( - "jsii-calc.SupportsNiceJavaBuilder", - args, - s, + _jsii_.RegisterClass( + "jsii-calc.JSObjectLiteralToNative", + reflect.TypeOf((*JSObjectLiteralToNative)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "returnLiteral", GoMethod: "ReturnLiteral"}, + }, + func() interface{} { + return &jsiiProxy_JSObjectLiteralToNative{} + }, ) -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SupportsNiceJavaBuilderProps.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -type SupportsNiceJavaBuilderProps struct { - // Some number, like 42. - Bar *float64 \`field:"required" json:"bar" yaml:"bar"\` - // 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. - Id *string \`field:"optional" json:"id" yaml:"id"\` -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SupportsNiceJavaBuilderWithRequiredProps.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -// We can generate fancy builders in Java for classes which take a mix of positional & struct parameters. -type SupportsNiceJavaBuilderWithRequiredProps interface { - Bar() *float64 - // some identifier of your choice. - Id() *float64 - PropId() *string -} - -// The jsii proxy struct for SupportsNiceJavaBuilderWithRequiredProps -type jsiiProxy_SupportsNiceJavaBuilderWithRequiredProps struct { - _ byte // padding -} - -func (j *jsiiProxy_SupportsNiceJavaBuilderWithRequiredProps) Bar() *float64 { - var returns *float64 - _jsii_.Get( - j, - "bar", - &returns, + _jsii_.RegisterClass( + "jsii-calc.JSObjectLiteralToNativeClass", + reflect.TypeOf((*JSObjectLiteralToNativeClass)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "propA", GoGetter: "PropA"}, + _jsii_.MemberProperty{JsiiProperty: "propB", GoGetter: "PropB"}, + }, + func() interface{} { + return &jsiiProxy_JSObjectLiteralToNativeClass{} + }, ) - return returns -} - -func (j *jsiiProxy_SupportsNiceJavaBuilderWithRequiredProps) Id() *float64 { - var returns *float64 - _jsii_.Get( - j, - "id", - &returns, + _jsii_.RegisterClass( + "jsii-calc.JavaReservedWords", + reflect.TypeOf((*JavaReservedWords)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "abstract", GoMethod: "Abstract"}, + _jsii_.MemberMethod{JsiiMethod: "assert", GoMethod: "Assert"}, + _jsii_.MemberMethod{JsiiMethod: "boolean", GoMethod: "Boolean"}, + _jsii_.MemberMethod{JsiiMethod: "break", GoMethod: "Break"}, + _jsii_.MemberMethod{JsiiMethod: "byte", GoMethod: "Byte"}, + _jsii_.MemberMethod{JsiiMethod: "case", GoMethod: "Case"}, + _jsii_.MemberMethod{JsiiMethod: "catch", GoMethod: "Catch"}, + _jsii_.MemberMethod{JsiiMethod: "char", GoMethod: "Char"}, + _jsii_.MemberMethod{JsiiMethod: "class", GoMethod: "Class"}, + _jsii_.MemberMethod{JsiiMethod: "const", GoMethod: "Const"}, + _jsii_.MemberMethod{JsiiMethod: "continue", GoMethod: "Continue"}, + _jsii_.MemberMethod{JsiiMethod: "default", GoMethod: "Default"}, + _jsii_.MemberMethod{JsiiMethod: "do", GoMethod: "Do"}, + _jsii_.MemberMethod{JsiiMethod: "double", GoMethod: "Double"}, + _jsii_.MemberMethod{JsiiMethod: "else", GoMethod: "Else"}, + _jsii_.MemberMethod{JsiiMethod: "enum", GoMethod: "Enum"}, + _jsii_.MemberMethod{JsiiMethod: "extends", GoMethod: "Extends"}, + _jsii_.MemberMethod{JsiiMethod: "false", GoMethod: "False"}, + _jsii_.MemberMethod{JsiiMethod: "final", GoMethod: "Final"}, + _jsii_.MemberMethod{JsiiMethod: "finally", GoMethod: "Finally"}, + _jsii_.MemberMethod{JsiiMethod: "float", GoMethod: "Float"}, + _jsii_.MemberMethod{JsiiMethod: "for", GoMethod: "For"}, + _jsii_.MemberMethod{JsiiMethod: "goto", GoMethod: "Goto"}, + _jsii_.MemberMethod{JsiiMethod: "if", GoMethod: "If"}, + _jsii_.MemberMethod{JsiiMethod: "implements", GoMethod: "Implements"}, + _jsii_.MemberMethod{JsiiMethod: "import", GoMethod: "Import"}, + _jsii_.MemberMethod{JsiiMethod: "instanceof", GoMethod: "Instanceof"}, + _jsii_.MemberMethod{JsiiMethod: "int", GoMethod: "Int"}, + _jsii_.MemberMethod{JsiiMethod: "interface", GoMethod: "Interface"}, + _jsii_.MemberMethod{JsiiMethod: "long", GoMethod: "Long"}, + _jsii_.MemberMethod{JsiiMethod: "native", GoMethod: "Native"}, + _jsii_.MemberMethod{JsiiMethod: "new", GoMethod: "New"}, + _jsii_.MemberMethod{JsiiMethod: "null", GoMethod: "Null"}, + _jsii_.MemberMethod{JsiiMethod: "package", GoMethod: "Package"}, + _jsii_.MemberMethod{JsiiMethod: "private", GoMethod: "Private"}, + _jsii_.MemberMethod{JsiiMethod: "protected", GoMethod: "Protected"}, + _jsii_.MemberMethod{JsiiMethod: "public", GoMethod: "Public"}, + _jsii_.MemberMethod{JsiiMethod: "return", GoMethod: "Return"}, + _jsii_.MemberMethod{JsiiMethod: "short", GoMethod: "Short"}, + _jsii_.MemberMethod{JsiiMethod: "static", GoMethod: "Static"}, + _jsii_.MemberMethod{JsiiMethod: "strictfp", GoMethod: "Strictfp"}, + _jsii_.MemberMethod{JsiiMethod: "super", GoMethod: "Super"}, + _jsii_.MemberMethod{JsiiMethod: "switch", GoMethod: "Switch"}, + _jsii_.MemberMethod{JsiiMethod: "synchronized", GoMethod: "Synchronized"}, + _jsii_.MemberMethod{JsiiMethod: "this", GoMethod: "This"}, + _jsii_.MemberMethod{JsiiMethod: "throw", GoMethod: "Throw"}, + _jsii_.MemberMethod{JsiiMethod: "throws", GoMethod: "Throws"}, + _jsii_.MemberMethod{JsiiMethod: "transient", GoMethod: "Transient"}, + _jsii_.MemberMethod{JsiiMethod: "true", GoMethod: "True"}, + _jsii_.MemberMethod{JsiiMethod: "try", GoMethod: "Try"}, + _jsii_.MemberMethod{JsiiMethod: "void", GoMethod: "Void"}, + _jsii_.MemberMethod{JsiiMethod: "volatile", GoMethod: "Volatile"}, + _jsii_.MemberProperty{JsiiProperty: "while", GoGetter: "While"}, + }, + func() interface{} { + return &jsiiProxy_JavaReservedWords{} + }, ) - return returns -} - -func (j *jsiiProxy_SupportsNiceJavaBuilderWithRequiredProps) PropId() *string { - var returns *string - _jsii_.Get( - j, - "propId", - &returns, + _jsii_.RegisterClass( + "jsii-calc.Jsii487Derived", + reflect.TypeOf((*Jsii487Derived)(nil)).Elem(), + nil, // no members + func() interface{} { + j := jsiiProxy_Jsii487Derived{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_IJsii487External) + _jsii_.InitJsiiProxy(&j.jsiiProxy_IJsii487External2) + return &j + }, ) - return returns -} - - -func NewSupportsNiceJavaBuilderWithRequiredProps(id *float64, props *SupportsNiceJavaBuilderProps) SupportsNiceJavaBuilderWithRequiredProps { - _init_.Initialize() - - j := jsiiProxy_SupportsNiceJavaBuilderWithRequiredProps{} - - _jsii_.Create( - "jsii-calc.SupportsNiceJavaBuilderWithRequiredProps", - []interface{}{id, props}, - &j, + _jsii_.RegisterClass( + "jsii-calc.Jsii496Derived", + reflect.TypeOf((*Jsii496Derived)(nil)).Elem(), + nil, // no members + func() interface{} { + j := jsiiProxy_Jsii496Derived{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_IJsii496) + return &j + }, ) - - return &j -} - -func NewSupportsNiceJavaBuilderWithRequiredProps_Override(s SupportsNiceJavaBuilderWithRequiredProps, id *float64, props *SupportsNiceJavaBuilderProps) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.SupportsNiceJavaBuilderWithRequiredProps", - []interface{}{id, props}, - s, + _jsii_.RegisterClass( + "jsii-calc.JsiiAgent", + reflect.TypeOf((*JsiiAgent)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_JsiiAgent{} + }, ) -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_SyncVirtualMethods.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -type SyncVirtualMethods interface { - A() *float64 - SetA(val *float64) - CallerIsProperty() *float64 - SetCallerIsProperty(val *float64) - OtherProperty() *string - SetOtherProperty(val *string) - ReadonlyProperty() *string - TheProperty() *string - SetTheProperty(val *string) - ValueOfOtherProperty() *string - SetValueOfOtherProperty(val *string) - CallerIsAsync() *float64 - CallerIsMethod() *float64 - ModifyOtherProperty(value *string) - ModifyValueOfTheProperty(value *string) - ReadA() *float64 - RetrieveOtherProperty() *string - RetrieveReadOnlyProperty() *string - RetrieveValueOfTheProperty() *string - VirtualMethod(n *float64) *float64 - WriteA(value *float64) -} - -// The jsii proxy struct for SyncVirtualMethods -type jsiiProxy_SyncVirtualMethods struct { - _ byte // padding -} - -func (j *jsiiProxy_SyncVirtualMethods) A() *float64 { - var returns *float64 - _jsii_.Get( - j, - "a", - &returns, + _jsii_.RegisterClass( + "jsii-calc.JsonFormatter", + reflect.TypeOf((*JsonFormatter)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_JsonFormatter{} + }, ) - return returns -} - -func (j *jsiiProxy_SyncVirtualMethods) CallerIsProperty() *float64 { - var returns *float64 - _jsii_.Get( - j, - "callerIsProperty", - &returns, + _jsii_.RegisterClass( + "jsii-calc.LevelOne", + reflect.TypeOf((*LevelOne)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "props", GoGetter: "Props"}, + }, + func() interface{} { + return &jsiiProxy_LevelOne{} + }, ) - return returns -} - -func (j *jsiiProxy_SyncVirtualMethods) OtherProperty() *string { - var returns *string - _jsii_.Get( - j, - "otherProperty", - &returns, + _jsii_.RegisterStruct( + "jsii-calc.LevelOne.PropBooleanValue", + reflect.TypeOf((*LevelOne_PropBooleanValue)(nil)).Elem(), ) - return returns -} - -func (j *jsiiProxy_SyncVirtualMethods) ReadonlyProperty() *string { - var returns *string - _jsii_.Get( - j, - "readonlyProperty", - &returns, + _jsii_.RegisterStruct( + "jsii-calc.LevelOne.PropProperty", + reflect.TypeOf((*LevelOne_PropProperty)(nil)).Elem(), ) - return returns -} - -func (j *jsiiProxy_SyncVirtualMethods) TheProperty() *string { - var returns *string - _jsii_.Get( - j, - "theProperty", - &returns, + _jsii_.RegisterStruct( + "jsii-calc.LevelOneProps", + reflect.TypeOf((*LevelOneProps)(nil)).Elem(), ) - return returns -} - -func (j *jsiiProxy_SyncVirtualMethods) ValueOfOtherProperty() *string { - var returns *string - _jsii_.Get( - j, - "valueOfOtherProperty", - &returns, + _jsii_.RegisterStruct( + "jsii-calc.LoadBalancedFargateServiceProps", + reflect.TypeOf((*LoadBalancedFargateServiceProps)(nil)).Elem(), ) - return returns -} - - -func NewSyncVirtualMethods() SyncVirtualMethods { - _init_.Initialize() - - j := jsiiProxy_SyncVirtualMethods{} - - _jsii_.Create( - "jsii-calc.SyncVirtualMethods", - nil, // no parameters - &j, + _jsii_.RegisterClass( + "jsii-calc.MethodNamedProperty", + reflect.TypeOf((*MethodNamedProperty)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "elite", GoGetter: "Elite"}, + _jsii_.MemberMethod{JsiiMethod: "property", GoMethod: "Property"}, + }, + func() interface{} { + return &jsiiProxy_MethodNamedProperty{} + }, ) - - return &j -} - -func NewSyncVirtualMethods_Override(s SyncVirtualMethods) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.SyncVirtualMethods", - nil, // no parameters - s, + _jsii_.RegisterClass( + "jsii-calc.Multiply", + reflect.TypeOf((*Multiply)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "farewell", GoMethod: "Farewell"}, + _jsii_.MemberMethod{JsiiMethod: "goodbye", GoMethod: "Goodbye"}, + _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, + _jsii_.MemberProperty{JsiiProperty: "lhs", GoGetter: "Lhs"}, + _jsii_.MemberMethod{JsiiMethod: "next", GoMethod: "Next"}, + _jsii_.MemberProperty{JsiiProperty: "rhs", GoGetter: "Rhs"}, + _jsii_.MemberMethod{JsiiMethod: "toString", GoMethod: "ToString"}, + _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, + _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, + }, + func() interface{} { + j := jsiiProxy_Multiply{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_BinaryOperation) + _jsii_.InitJsiiProxy(&j.jsiiProxy_IFriendlier) + _jsii_.InitJsiiProxy(&j.jsiiProxy_IRandomNumberGenerator) + return &j + }, ) -} - -func (j *jsiiProxy_SyncVirtualMethods)SetA(val *float64) { - _jsii_.Set( - j, - "a", - val, + _jsii_.RegisterClass( + "jsii-calc.Negate", + reflect.TypeOf((*Negate)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "farewell", GoMethod: "Farewell"}, + _jsii_.MemberMethod{JsiiMethod: "goodbye", GoMethod: "Goodbye"}, + _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, + _jsii_.MemberProperty{JsiiProperty: "operand", GoGetter: "Operand"}, + _jsii_.MemberMethod{JsiiMethod: "toString", GoMethod: "ToString"}, + _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, + _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, + }, + func() interface{} { + j := jsiiProxy_Negate{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_UnaryOperation) + _jsii_.InitJsiiProxy(&j.jsiiProxy_IFriendlier) + return &j + }, ) -} - -func (j *jsiiProxy_SyncVirtualMethods)SetCallerIsProperty(val *float64) { - _jsii_.Set( - j, - "callerIsProperty", - val, + _jsii_.RegisterClass( + "jsii-calc.NestedClassInstance", + reflect.TypeOf((*NestedClassInstance)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_NestedClassInstance{} + }, ) -} - -func (j *jsiiProxy_SyncVirtualMethods)SetOtherProperty(val *string) { - _jsii_.Set( - j, - "otherProperty", - val, + _jsii_.RegisterStruct( + "jsii-calc.NestedStruct", + reflect.TypeOf((*NestedStruct)(nil)).Elem(), ) -} - -func (j *jsiiProxy_SyncVirtualMethods)SetTheProperty(val *string) { - _jsii_.Set( - j, - "theProperty", - val, + _jsii_.RegisterClass( + "jsii-calc.NodeStandardLibrary", + reflect.TypeOf((*NodeStandardLibrary)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "cryptoSha256", GoMethod: "CryptoSha256"}, + _jsii_.MemberMethod{JsiiMethod: "fsReadFile", GoMethod: "FsReadFile"}, + _jsii_.MemberMethod{JsiiMethod: "fsReadFileSync", GoMethod: "FsReadFileSync"}, + _jsii_.MemberProperty{JsiiProperty: "osPlatform", GoGetter: "OsPlatform"}, + }, + func() interface{} { + return &jsiiProxy_NodeStandardLibrary{} + }, ) -} - -func (j *jsiiProxy_SyncVirtualMethods)SetValueOfOtherProperty(val *string) { - _jsii_.Set( - j, - "valueOfOtherProperty", - val, + _jsii_.RegisterClass( + "jsii-calc.NullShouldBeTreatedAsUndefined", + reflect.TypeOf((*NullShouldBeTreatedAsUndefined)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "changeMeToUndefined", GoGetter: "ChangeMeToUndefined"}, + _jsii_.MemberMethod{JsiiMethod: "giveMeUndefined", GoMethod: "GiveMeUndefined"}, + _jsii_.MemberMethod{JsiiMethod: "giveMeUndefinedInsideAnObject", GoMethod: "GiveMeUndefinedInsideAnObject"}, + _jsii_.MemberMethod{JsiiMethod: "verifyPropertyIsUndefined", GoMethod: "VerifyPropertyIsUndefined"}, + }, + func() interface{} { + return &jsiiProxy_NullShouldBeTreatedAsUndefined{} + }, ) -} - -func (s *jsiiProxy_SyncVirtualMethods) CallerIsAsync() *float64 { - var returns *float64 - - _jsii_.Invoke( - s, - "callerIsAsync", - nil, // no parameters - &returns, + _jsii_.RegisterStruct( + "jsii-calc.NullShouldBeTreatedAsUndefinedData", + reflect.TypeOf((*NullShouldBeTreatedAsUndefinedData)(nil)).Elem(), ) - - return returns -} - -func (s *jsiiProxy_SyncVirtualMethods) CallerIsMethod() *float64 { - var returns *float64 - - _jsii_.Invoke( - s, - "callerIsMethod", - nil, // no parameters - &returns, + _jsii_.RegisterClass( + "jsii-calc.NumberGenerator", + reflect.TypeOf((*NumberGenerator)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "generator", GoGetter: "Generator"}, + _jsii_.MemberMethod{JsiiMethod: "isSameGenerator", GoMethod: "IsSameGenerator"}, + _jsii_.MemberMethod{JsiiMethod: "nextTimes100", GoMethod: "NextTimes100"}, + }, + func() interface{} { + return &jsiiProxy_NumberGenerator{} + }, ) - - return returns -} - -func (s *jsiiProxy_SyncVirtualMethods) ModifyOtherProperty(value *string) { - _jsii_.InvokeVoid( - s, - "modifyOtherProperty", - []interface{}{value}, + _jsii_.RegisterClass( + "jsii-calc.ObjectRefsInCollections", + reflect.TypeOf((*ObjectRefsInCollections)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "sumFromArray", GoMethod: "SumFromArray"}, + _jsii_.MemberMethod{JsiiMethod: "sumFromMap", GoMethod: "SumFromMap"}, + }, + func() interface{} { + return &jsiiProxy_ObjectRefsInCollections{} + }, ) -} - -func (s *jsiiProxy_SyncVirtualMethods) ModifyValueOfTheProperty(value *string) { - _jsii_.InvokeVoid( - s, - "modifyValueOfTheProperty", - []interface{}{value}, + _jsii_.RegisterClass( + "jsii-calc.ObjectWithPropertyProvider", + reflect.TypeOf((*ObjectWithPropertyProvider)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_ObjectWithPropertyProvider{} + }, ) -} - -func (s *jsiiProxy_SyncVirtualMethods) ReadA() *float64 { - var returns *float64 - - _jsii_.Invoke( - s, - "readA", - nil, // no parameters - &returns, + _jsii_.RegisterClass( + "jsii-calc.Old", + reflect.TypeOf((*Old)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "doAThing", GoMethod: "DoAThing"}, + }, + func() interface{} { + return &jsiiProxy_Old{} + }, ) - - return returns -} - -func (s *jsiiProxy_SyncVirtualMethods) RetrieveOtherProperty() *string { - var returns *string - - _jsii_.Invoke( - s, - "retrieveOtherProperty", - nil, // no parameters - &returns, + _jsii_.RegisterClass( + "jsii-calc.OptionalArgumentInvoker", + reflect.TypeOf((*OptionalArgumentInvoker)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "invokeWithOptional", GoMethod: "InvokeWithOptional"}, + _jsii_.MemberMethod{JsiiMethod: "invokeWithoutOptional", GoMethod: "InvokeWithoutOptional"}, + }, + func() interface{} { + return &jsiiProxy_OptionalArgumentInvoker{} + }, ) - - return returns -} - -func (s *jsiiProxy_SyncVirtualMethods) RetrieveReadOnlyProperty() *string { - var returns *string - - _jsii_.Invoke( - s, - "retrieveReadOnlyProperty", - nil, // no parameters - &returns, + _jsii_.RegisterClass( + "jsii-calc.OptionalConstructorArgument", + reflect.TypeOf((*OptionalConstructorArgument)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "arg1", GoGetter: "Arg1"}, + _jsii_.MemberProperty{JsiiProperty: "arg2", GoGetter: "Arg2"}, + _jsii_.MemberProperty{JsiiProperty: "arg3", GoGetter: "Arg3"}, + }, + func() interface{} { + return &jsiiProxy_OptionalConstructorArgument{} + }, ) - - return returns -} - -func (s *jsiiProxy_SyncVirtualMethods) RetrieveValueOfTheProperty() *string { - var returns *string - - _jsii_.Invoke( - s, - "retrieveValueOfTheProperty", - nil, // no parameters - &returns, + _jsii_.RegisterStruct( + "jsii-calc.OptionalStruct", + reflect.TypeOf((*OptionalStruct)(nil)).Elem(), ) - - return returns -} - -func (s *jsiiProxy_SyncVirtualMethods) VirtualMethod(n *float64) *float64 { - var returns *float64 - - _jsii_.Invoke( - s, - "virtualMethod", - []interface{}{n}, - &returns, + _jsii_.RegisterClass( + "jsii-calc.OptionalStructConsumer", + reflect.TypeOf((*OptionalStructConsumer)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "fieldValue", GoGetter: "FieldValue"}, + _jsii_.MemberProperty{JsiiProperty: "parameterWasUndefined", GoGetter: "ParameterWasUndefined"}, + }, + func() interface{} { + return &jsiiProxy_OptionalStructConsumer{} + }, ) - - return returns -} - -func (s *jsiiProxy_SyncVirtualMethods) WriteA(value *float64) { - _jsii_.InvokeVoid( - s, - "writeA", - []interface{}{value}, + _jsii_.RegisterClass( + "jsii-calc.OverridableProtectedMember", + reflect.TypeOf((*OverridableProtectedMember)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "overrideMe", GoMethod: "OverrideMe"}, + _jsii_.MemberProperty{JsiiProperty: "overrideReadOnly", GoGetter: "OverrideReadOnly"}, + _jsii_.MemberProperty{JsiiProperty: "overrideReadWrite", GoGetter: "OverrideReadWrite"}, + _jsii_.MemberMethod{JsiiMethod: "switchModes", GoMethod: "SwitchModes"}, + _jsii_.MemberMethod{JsiiMethod: "valueFromProtected", GoMethod: "ValueFromProtected"}, + }, + func() interface{} { + return &jsiiProxy_OverridableProtectedMember{} + }, ) -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_TestStructWithEnum.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -type TestStructWithEnum interface { - // Returns \`foo: StringEnum.A\`. - StructWithFoo() *StructWithEnum - // Returns \`foo: StringEnum.C\` and \`bar: AllTypesEnum.MY_ENUM_VALUE\`. - StructWithFooBar() *StructWithEnum - // Returns true if \`foo\` is \`StringEnum.A\`. - IsStringEnumA(input *StructWithEnum) *bool - // Returns true if \`foo\` is \`StringEnum.B\` and \`bar\` is \`AllTypesEnum.THIS_IS_GREAT\`. - IsStringEnumB(input *StructWithEnum) *bool -} - -// The jsii proxy struct for TestStructWithEnum -type jsiiProxy_TestStructWithEnum struct { - _ byte // padding -} - -func (j *jsiiProxy_TestStructWithEnum) StructWithFoo() *StructWithEnum { - var returns *StructWithEnum - _jsii_.Get( - j, - "structWithFoo", - &returns, + _jsii_.RegisterClass( + "jsii-calc.OverrideReturnsObject", + reflect.TypeOf((*OverrideReturnsObject)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "test", GoMethod: "Test"}, + }, + func() interface{} { + return &jsiiProxy_OverrideReturnsObject{} + }, ) - return returns -} - -func (j *jsiiProxy_TestStructWithEnum) StructWithFooBar() *StructWithEnum { - var returns *StructWithEnum - _jsii_.Get( - j, - "structWithFooBar", - &returns, + _jsii_.RegisterClass( + "jsii-calc.ParamShadowsBuiltins", + reflect.TypeOf((*ParamShadowsBuiltins)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_ParamShadowsBuiltins{} + }, ) - return returns -} - - -func NewTestStructWithEnum() TestStructWithEnum { - _init_.Initialize() - - j := jsiiProxy_TestStructWithEnum{} - - _jsii_.Create( - "jsii-calc.TestStructWithEnum", - nil, // no parameters - &j, + _jsii_.RegisterStruct( + "jsii-calc.ParamShadowsBuiltinsProps", + reflect.TypeOf((*ParamShadowsBuiltinsProps)(nil)).Elem(), ) - - return &j -} - -func NewTestStructWithEnum_Override(t TestStructWithEnum) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.TestStructWithEnum", - nil, // no parameters - t, + _jsii_.RegisterClass( + "jsii-calc.ParamShadowsScope", + reflect.TypeOf((*ParamShadowsScope)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "useScope", GoMethod: "UseScope"}, + }, + func() interface{} { + return &jsiiProxy_ParamShadowsScope{} + }, ) -} - -func (t *jsiiProxy_TestStructWithEnum) IsStringEnumA(input *StructWithEnum) *bool { - var returns *bool - - _jsii_.Invoke( - t, - "isStringEnumA", - []interface{}{input}, - &returns, + _jsii_.RegisterStruct( + "jsii-calc.ParentStruct982", + reflect.TypeOf((*ParentStruct982)(nil)).Elem(), ) - - return returns -} - -func (t *jsiiProxy_TestStructWithEnum) IsStringEnumB(input *StructWithEnum) *bool { - var returns *bool - - _jsii_.Invoke( - t, - "isStringEnumB", - []interface{}{input}, - &returns, + _jsii_.RegisterClass( + "jsii-calc.PartiallyInitializedThisConsumer", + reflect.TypeOf((*PartiallyInitializedThisConsumer)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "consumePartiallyInitializedThis", GoMethod: "ConsumePartiallyInitializedThis"}, + }, + func() interface{} { + return &jsiiProxy_PartiallyInitializedThisConsumer{} + }, ) - - return returns -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_Thrower.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -type Thrower interface { - ThrowError() -} - -// The jsii proxy struct for Thrower -type jsiiProxy_Thrower struct { - _ byte // padding -} - -func NewThrower() Thrower { - _init_.Initialize() - - j := jsiiProxy_Thrower{} - - _jsii_.Create( - "jsii-calc.Thrower", - nil, // no parameters - &j, + _jsii_.RegisterClass( + "jsii-calc.Polymorphism", + reflect.TypeOf((*Polymorphism)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "sayHello", GoMethod: "SayHello"}, + }, + func() interface{} { + return &jsiiProxy_Polymorphism{} + }, ) - - return &j -} - -func NewThrower_Override(t Thrower) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.Thrower", - nil, // no parameters - t, + _jsii_.RegisterClass( + "jsii-calc.Power", + reflect.TypeOf((*Power)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "base", GoGetter: "Base"}, + _jsii_.MemberProperty{JsiiProperty: "decorationPostfixes", GoGetter: "DecorationPostfixes"}, + _jsii_.MemberProperty{JsiiProperty: "decorationPrefixes", GoGetter: "DecorationPrefixes"}, + _jsii_.MemberProperty{JsiiProperty: "expression", GoGetter: "Expression"}, + _jsii_.MemberProperty{JsiiProperty: "pow", GoGetter: "Pow"}, + _jsii_.MemberProperty{JsiiProperty: "stringStyle", GoGetter: "StringStyle"}, + _jsii_.MemberMethod{JsiiMethod: "toString", GoMethod: "ToString"}, + _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, + _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, + }, + func() interface{} { + j := jsiiProxy_Power{} + _jsii_.InitJsiiProxy(&j.Type__compositionCompositeOperation) + return &j + }, ) -} - -func (t *jsiiProxy_Thrower) ThrowError() { - _jsii_.InvokeVoid( - t, - "throwError", - nil, // no parameters + _jsii_.RegisterClass( + "jsii-calc.PromiseNothing", + reflect.TypeOf((*PromiseNothing)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "instancePromiseIt", GoMethod: "InstancePromiseIt"}, + }, + func() interface{} { + return &jsiiProxy_PromiseNothing{} + }, ) -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_TopLevelStruct.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -type TopLevelStruct struct { - // This is a required field. - Required *string \`field:"required" json:"required" yaml:"required"\` - // A union to really stress test our serialization. - SecondLevel interface{} \`field:"required" json:"secondLevel" yaml:"secondLevel"\` - // You don't have to pass this. - Optional *string \`field:"optional" json:"optional" yaml:"optional"\` -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_TwoMethodsWithSimilarCapitalization.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -// In TypeScript it is possible to have two methods with the same name but different capitalization. -// See: https://github.com/aws/jsii/issues/2508 -// -type TwoMethodsWithSimilarCapitalization interface { - FooBar() *float64 - // Deprecated: YES. - FooBAR() *float64 - ToIsoString() *string - // Deprecated: python requires that all alternatives are deprecated. - ToIsOString() *string - // Deprecated: python requires that all alternatives are deprecated. - ToISOString() *string -} - -// The jsii proxy struct for TwoMethodsWithSimilarCapitalization -type jsiiProxy_TwoMethodsWithSimilarCapitalization struct { - _ byte // padding -} - -func (j *jsiiProxy_TwoMethodsWithSimilarCapitalization) FooBar() *float64 { - var returns *float64 - _jsii_.Get( - j, - "fooBar", - &returns, + _jsii_.RegisterClass( + "jsii-calc.PropertyNamedProperty", + reflect.TypeOf((*PropertyNamedProperty)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "property", GoGetter: "Property"}, + _jsii_.MemberProperty{JsiiProperty: "yetAnoterOne", GoGetter: "YetAnoterOne"}, + }, + func() interface{} { + return &jsiiProxy_PropertyNamedProperty{} + }, ) - return returns -} - -func (j *jsiiProxy_TwoMethodsWithSimilarCapitalization) FooBAR() *float64 { - var returns *float64 - _jsii_.Get( - j, - "fooBAR", - &returns, + _jsii_.RegisterClass( + "jsii-calc.PublicClass", + reflect.TypeOf((*PublicClass)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, + }, + func() interface{} { + return &jsiiProxy_PublicClass{} + }, ) - return returns -} - - -func NewTwoMethodsWithSimilarCapitalization() TwoMethodsWithSimilarCapitalization { - _init_.Initialize() - - j := jsiiProxy_TwoMethodsWithSimilarCapitalization{} - - _jsii_.Create( - "jsii-calc.TwoMethodsWithSimilarCapitalization", - nil, // no parameters - &j, + _jsii_.RegisterClass( + "jsii-calc.PythonReservedWords", + reflect.TypeOf((*PythonReservedWords)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "and", GoMethod: "And"}, + _jsii_.MemberMethod{JsiiMethod: "as", GoMethod: "As"}, + _jsii_.MemberMethod{JsiiMethod: "assert", GoMethod: "Assert"}, + _jsii_.MemberMethod{JsiiMethod: "async", GoMethod: "Async"}, + _jsii_.MemberMethod{JsiiMethod: "await", GoMethod: "Await"}, + _jsii_.MemberMethod{JsiiMethod: "break", GoMethod: "Break"}, + _jsii_.MemberMethod{JsiiMethod: "class", GoMethod: "Class"}, + _jsii_.MemberMethod{JsiiMethod: "continue", GoMethod: "Continue"}, + _jsii_.MemberMethod{JsiiMethod: "def", GoMethod: "Def"}, + _jsii_.MemberMethod{JsiiMethod: "del", GoMethod: "Del"}, + _jsii_.MemberMethod{JsiiMethod: "elif", GoMethod: "Elif"}, + _jsii_.MemberMethod{JsiiMethod: "else", GoMethod: "Else"}, + _jsii_.MemberMethod{JsiiMethod: "except", GoMethod: "Except"}, + _jsii_.MemberMethod{JsiiMethod: "finally", GoMethod: "Finally"}, + _jsii_.MemberMethod{JsiiMethod: "for", GoMethod: "For"}, + _jsii_.MemberMethod{JsiiMethod: "from", GoMethod: "From"}, + _jsii_.MemberMethod{JsiiMethod: "global", GoMethod: "Global"}, + _jsii_.MemberMethod{JsiiMethod: "if", GoMethod: "If"}, + _jsii_.MemberMethod{JsiiMethod: "import", GoMethod: "Import"}, + _jsii_.MemberMethod{JsiiMethod: "in", GoMethod: "In"}, + _jsii_.MemberMethod{JsiiMethod: "is", GoMethod: "Is"}, + _jsii_.MemberMethod{JsiiMethod: "lambda", GoMethod: "Lambda"}, + _jsii_.MemberMethod{JsiiMethod: "nonlocal", GoMethod: "Nonlocal"}, + _jsii_.MemberMethod{JsiiMethod: "not", GoMethod: "Not"}, + _jsii_.MemberMethod{JsiiMethod: "or", GoMethod: "Or"}, + _jsii_.MemberMethod{JsiiMethod: "pass", GoMethod: "Pass"}, + _jsii_.MemberMethod{JsiiMethod: "raise", GoMethod: "Raise"}, + _jsii_.MemberMethod{JsiiMethod: "return", GoMethod: "Return"}, + _jsii_.MemberMethod{JsiiMethod: "try", GoMethod: "Try"}, + _jsii_.MemberMethod{JsiiMethod: "while", GoMethod: "While"}, + _jsii_.MemberMethod{JsiiMethod: "with", GoMethod: "With"}, + _jsii_.MemberMethod{JsiiMethod: "yield", GoMethod: "Yield"}, + }, + func() interface{} { + return &jsiiProxy_PythonReservedWords{} + }, ) - - return &j -} - -func NewTwoMethodsWithSimilarCapitalization_Override(t TwoMethodsWithSimilarCapitalization) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.TwoMethodsWithSimilarCapitalization", - nil, // no parameters - t, + _jsii_.RegisterClass( + "jsii-calc.ReferenceEnumFromScopedPackage", + reflect.TypeOf((*ReferenceEnumFromScopedPackage)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "foo", GoGetter: "Foo"}, + _jsii_.MemberMethod{JsiiMethod: "loadFoo", GoMethod: "LoadFoo"}, + _jsii_.MemberMethod{JsiiMethod: "saveFoo", GoMethod: "SaveFoo"}, + }, + func() interface{} { + return &jsiiProxy_ReferenceEnumFromScopedPackage{} + }, ) -} - -func (t *jsiiProxy_TwoMethodsWithSimilarCapitalization) ToIsoString() *string { - var returns *string - - _jsii_.Invoke( - t, - "toIsoString", - nil, // no parameters - &returns, + _jsii_.RegisterClass( + "jsii-calc.ReturnsPrivateImplementationOfInterface", + reflect.TypeOf((*ReturnsPrivateImplementationOfInterface)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "privateImplementation", GoGetter: "PrivateImplementation"}, + }, + func() interface{} { + return &jsiiProxy_ReturnsPrivateImplementationOfInterface{} + }, ) - - return returns -} - -func (t *jsiiProxy_TwoMethodsWithSimilarCapitalization) ToIsOString() *string { - var returns *string - - _jsii_.Invoke( - t, - "toIsOString", - nil, // no parameters - &returns, + _jsii_.RegisterStruct( + "jsii-calc.RootStruct", + reflect.TypeOf((*RootStruct)(nil)).Elem(), ) - - return returns -} - -func (t *jsiiProxy_TwoMethodsWithSimilarCapitalization) ToISOString() *string { - var returns *string - - _jsii_.Invoke( - t, - "toISOString", - nil, // no parameters - &returns, + _jsii_.RegisterClass( + "jsii-calc.RootStructValidator", + reflect.TypeOf((*RootStructValidator)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_RootStructValidator{} + }, ) - - return returns -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_UmaskCheck.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -// Checks the current file permissions are cool (no funky UMASK down-scoping happened). -// See: https://github.com/aws/jsii/issues/1765 -// -type UmaskCheck interface { -} - -// The jsii proxy struct for UmaskCheck -type jsiiProxy_UmaskCheck struct { - _ byte // padding -} - -// This should return 0o644 (-rw-r--r--). -func UmaskCheck_Mode() *float64 { - _init_.Initialize() - - var returns *float64 - - _jsii_.StaticInvoke( - "jsii-calc.UmaskCheck", - "mode", - nil, // no parameters - &returns, + _jsii_.RegisterClass( + "jsii-calc.RuntimeTypeChecking", + reflect.TypeOf((*RuntimeTypeChecking)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "methodWithDefaultedArguments", GoMethod: "MethodWithDefaultedArguments"}, + _jsii_.MemberMethod{JsiiMethod: "methodWithOptionalAnyArgument", GoMethod: "MethodWithOptionalAnyArgument"}, + _jsii_.MemberMethod{JsiiMethod: "methodWithOptionalArguments", GoMethod: "MethodWithOptionalArguments"}, + }, + func() interface{} { + return &jsiiProxy_RuntimeTypeChecking{} + }, ) - - return returns -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_UnaryOperation.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" - - "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/internal" - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" -) - -// An operation on a single operand. -type UnaryOperation interface { - scopejsiicalclib.Operation - Operand() scopejsiicalclib.NumericValue - // The value. - // Deprecated. - Value() *float64 - // String representation of the value. - // Deprecated. - ToString() *string - // Returns: the name of the class (to verify native type names are created for derived classes). - TypeName() interface{} -} - -// The jsii proxy struct for UnaryOperation -type jsiiProxy_UnaryOperation struct { - internal.Type__scopejsiicalclibOperation -} - -func (j *jsiiProxy_UnaryOperation) Operand() scopejsiicalclib.NumericValue { - var returns scopejsiicalclib.NumericValue - _jsii_.Get( - j, - "operand", - &returns, + _jsii_.RegisterStruct( + "jsii-calc.SecondLevelStruct", + reflect.TypeOf((*SecondLevelStruct)(nil)).Elem(), ) - return returns -} - -func (j *jsiiProxy_UnaryOperation) Value() *float64 { - var returns *float64 - _jsii_.Get( - j, - "value", - &returns, + _jsii_.RegisterClass( + "jsii-calc.SingleInstanceTwoTypes", + reflect.TypeOf((*SingleInstanceTwoTypes)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "interface1", GoMethod: "Interface1"}, + _jsii_.MemberMethod{JsiiMethod: "interface2", GoMethod: "Interface2"}, + }, + func() interface{} { + return &jsiiProxy_SingleInstanceTwoTypes{} + }, ) - return returns -} - - -func NewUnaryOperation_Override(u UnaryOperation, operand scopejsiicalclib.NumericValue) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.UnaryOperation", - []interface{}{operand}, - u, + _jsii_.RegisterClass( + "jsii-calc.SingletonInt", + reflect.TypeOf((*SingletonInt)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "isSingletonInt", GoMethod: "IsSingletonInt"}, + }, + func() interface{} { + return &jsiiProxy_SingletonInt{} + }, ) -} - -func (u *jsiiProxy_UnaryOperation) ToString() *string { - var returns *string - - _jsii_.Invoke( - u, - "toString", - nil, // no parameters - &returns, + _jsii_.RegisterEnum( + "jsii-calc.SingletonIntEnum", + reflect.TypeOf((*SingletonIntEnum)(nil)).Elem(), + map[string]interface{}{ + "SINGLETON_INT": SingletonIntEnum_SINGLETON_INT, + }, ) - - return returns -} - -func (u *jsiiProxy_UnaryOperation) TypeName() interface{} { - var returns interface{} - - _jsii_.Invoke( - u, - "typeName", - nil, // no parameters - &returns, + _jsii_.RegisterClass( + "jsii-calc.SingletonString", + reflect.TypeOf((*SingletonString)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "isSingletonString", GoMethod: "IsSingletonString"}, + }, + func() interface{} { + return &jsiiProxy_SingletonString{} + }, ) - - return returns -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_UnionProperties.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - - -type UnionProperties struct { - Bar interface{} \`field:"required" json:"bar" yaml:"bar"\` - Foo interface{} \`field:"optional" json:"foo" yaml:"foo"\` -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_UpcasingReflectable.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" - - "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/internal" - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib/customsubmodulename" -) - -// Ensures submodule-imported types from dependencies can be used correctly. -type UpcasingReflectable interface { - customsubmodulename.IReflectable - Entries() *[]*customsubmodulename.ReflectableEntry -} - -// The jsii proxy struct for UpcasingReflectable -type jsiiProxy_UpcasingReflectable struct { - internal.Type__customsubmodulenameIReflectable -} - -func (j *jsiiProxy_UpcasingReflectable) Entries() *[]*customsubmodulename.ReflectableEntry { - var returns *[]*customsubmodulename.ReflectableEntry - _jsii_.Get( - j, - "entries", - &returns, + _jsii_.RegisterEnum( + "jsii-calc.SingletonStringEnum", + reflect.TypeOf((*SingletonStringEnum)(nil)).Elem(), + map[string]interface{}{ + "SINGLETON_STRING": SingletonStringEnum_SINGLETON_STRING, + }, ) - return returns -} - - -func NewUpcasingReflectable(delegate *map[string]interface{}) UpcasingReflectable { - _init_.Initialize() - - j := jsiiProxy_UpcasingReflectable{} - - _jsii_.Create( - "jsii-calc.UpcasingReflectable", - []interface{}{delegate}, - &j, + _jsii_.RegisterStruct( + "jsii-calc.SmellyStruct", + reflect.TypeOf((*SmellyStruct)(nil)).Elem(), ) - - return &j -} - -func NewUpcasingReflectable_Override(u UpcasingReflectable, delegate *map[string]interface{}) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.UpcasingReflectable", - []interface{}{delegate}, - u, + _jsii_.RegisterClass( + "jsii-calc.SomeTypeJsii976", + reflect.TypeOf((*SomeTypeJsii976)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_SomeTypeJsii976{} + }, ) -} - -func UpcasingReflectable_Reflector() customsubmodulename.Reflector { - _init_.Initialize() - var returns customsubmodulename.Reflector - _jsii_.StaticGet( - "jsii-calc.UpcasingReflectable", - "reflector", - &returns, + _jsii_.RegisterClass( + "jsii-calc.StableClass", + reflect.TypeOf((*StableClass)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, + _jsii_.MemberProperty{JsiiProperty: "mutableProperty", GoGetter: "MutableProperty"}, + _jsii_.MemberProperty{JsiiProperty: "readonlyProperty", GoGetter: "ReadonlyProperty"}, + }, + func() interface{} { + return &jsiiProxy_StableClass{} + }, ) - return returns -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_UseBundledDependency.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -type UseBundledDependency interface { - Value() interface{} -} - -// The jsii proxy struct for UseBundledDependency -type jsiiProxy_UseBundledDependency struct { - _ byte // padding -} - -func NewUseBundledDependency() UseBundledDependency { - _init_.Initialize() - - j := jsiiProxy_UseBundledDependency{} - - _jsii_.Create( - "jsii-calc.UseBundledDependency", - nil, // no parameters - &j, + _jsii_.RegisterEnum( + "jsii-calc.StableEnum", + reflect.TypeOf((*StableEnum)(nil)).Elem(), + map[string]interface{}{ + "OPTION_A": StableEnum_OPTION_A, + "OPTION_B": StableEnum_OPTION_B, + }, ) - - return &j -} - -func NewUseBundledDependency_Override(u UseBundledDependency) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.UseBundledDependency", - nil, // no parameters - u, + _jsii_.RegisterStruct( + "jsii-calc.StableStruct", + reflect.TypeOf((*StableStruct)(nil)).Elem(), ) -} - -func (u *jsiiProxy_UseBundledDependency) Value() interface{} { - var returns interface{} - - _jsii_.Invoke( - u, - "value", - nil, // no parameters - &returns, + _jsii_.RegisterClass( + "jsii-calc.StaticContext", + reflect.TypeOf((*StaticContext)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_StaticContext{} + }, ) - - return returns -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_UseCalcBase.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" - - "github.com/aws/jsii/jsii-calc/go/jcb" -) - -// Depend on a type from jsii-calc-base as a test for awslabs/jsii#128. -type UseCalcBase interface { - Hello() jcb.Base -} - -// The jsii proxy struct for UseCalcBase -type jsiiProxy_UseCalcBase struct { - _ byte // padding -} - -func NewUseCalcBase() UseCalcBase { - _init_.Initialize() - - j := jsiiProxy_UseCalcBase{} - - _jsii_.Create( - "jsii-calc.UseCalcBase", - nil, // no parameters - &j, + _jsii_.RegisterClass( + "jsii-calc.StaticHelloChild", + reflect.TypeOf((*StaticHelloChild)(nil)).Elem(), + nil, // no members + func() interface{} { + j := jsiiProxy_StaticHelloChild{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_StaticHelloParent) + return &j + }, ) - - return &j -} - -func NewUseCalcBase_Override(u UseCalcBase) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.UseCalcBase", - nil, // no parameters - u, + _jsii_.RegisterClass( + "jsii-calc.StaticHelloParent", + reflect.TypeOf((*StaticHelloParent)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_StaticHelloParent{} + }, ) -} - -func (u *jsiiProxy_UseCalcBase) Hello() jcb.Base { - var returns jcb.Base - - _jsii_.Invoke( - u, - "hello", - nil, // no parameters - &returns, + _jsii_.RegisterClass( + "jsii-calc.Statics", + reflect.TypeOf((*Statics)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "justMethod", GoMethod: "JustMethod"}, + _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, + }, + func() interface{} { + return &jsiiProxy_Statics{} + }, ) - - return returns -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_UsesInterfaceWithProperties.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -type UsesInterfaceWithProperties interface { - Obj() IInterfaceWithProperties - JustRead() *string - ReadStringAndNumber(ext IInterfaceWithPropertiesExtension) *string - WriteAndRead(value *string) *string -} - -// The jsii proxy struct for UsesInterfaceWithProperties -type jsiiProxy_UsesInterfaceWithProperties struct { - _ byte // padding -} - -func (j *jsiiProxy_UsesInterfaceWithProperties) Obj() IInterfaceWithProperties { - var returns IInterfaceWithProperties - _jsii_.Get( - j, - "obj", - &returns, + _jsii_.RegisterEnum( + "jsii-calc.StringEnum", + reflect.TypeOf((*StringEnum)(nil)).Elem(), + map[string]interface{}{ + "A": StringEnum_A, + "B": StringEnum_B, + "C": StringEnum_C, + }, ) - return returns -} - - -func NewUsesInterfaceWithProperties(obj IInterfaceWithProperties) UsesInterfaceWithProperties { - _init_.Initialize() - - j := jsiiProxy_UsesInterfaceWithProperties{} - - _jsii_.Create( - "jsii-calc.UsesInterfaceWithProperties", - []interface{}{obj}, - &j, + _jsii_.RegisterClass( + "jsii-calc.StripInternal", + reflect.TypeOf((*StripInternal)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "youSeeMe", GoGetter: "YouSeeMe"}, + }, + func() interface{} { + return &jsiiProxy_StripInternal{} + }, ) - - return &j -} - -func NewUsesInterfaceWithProperties_Override(u UsesInterfaceWithProperties, obj IInterfaceWithProperties) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.UsesInterfaceWithProperties", - []interface{}{obj}, - u, + _jsii_.RegisterStruct( + "jsii-calc.StructA", + reflect.TypeOf((*StructA)(nil)).Elem(), ) -} - -func (u *jsiiProxy_UsesInterfaceWithProperties) JustRead() *string { - var returns *string - - _jsii_.Invoke( - u, - "justRead", - nil, // no parameters - &returns, + _jsii_.RegisterStruct( + "jsii-calc.StructB", + reflect.TypeOf((*StructB)(nil)).Elem(), ) - - return returns -} - -func (u *jsiiProxy_UsesInterfaceWithProperties) ReadStringAndNumber(ext IInterfaceWithPropertiesExtension) *string { - var returns *string - - _jsii_.Invoke( - u, - "readStringAndNumber", - []interface{}{ext}, - &returns, + _jsii_.RegisterStruct( + "jsii-calc.StructParameterType", + reflect.TypeOf((*StructParameterType)(nil)).Elem(), ) - - return returns -} - -func (u *jsiiProxy_UsesInterfaceWithProperties) WriteAndRead(value *string) *string { - var returns *string - - _jsii_.Invoke( - u, - "writeAndRead", - []interface{}{value}, - &returns, + _jsii_.RegisterClass( + "jsii-calc.StructPassing", + reflect.TypeOf((*StructPassing)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_StructPassing{} + }, ) - - return returns -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_VariadicInvoker.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -type VariadicInvoker interface { - AsArray(values ...*float64) *[]*float64 -} - -// The jsii proxy struct for VariadicInvoker -type jsiiProxy_VariadicInvoker struct { - _ byte // padding -} - -func NewVariadicInvoker(method VariadicMethod) VariadicInvoker { - _init_.Initialize() - - j := jsiiProxy_VariadicInvoker{} - - _jsii_.Create( - "jsii-calc.VariadicInvoker", - []interface{}{method}, - &j, + _jsii_.RegisterClass( + "jsii-calc.StructUnionConsumer", + reflect.TypeOf((*StructUnionConsumer)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_StructUnionConsumer{} + }, ) - - return &j -} - -func NewVariadicInvoker_Override(v VariadicInvoker, method VariadicMethod) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.VariadicInvoker", - []interface{}{method}, - v, + _jsii_.RegisterStruct( + "jsii-calc.StructWithCollectionOfUnionts", + reflect.TypeOf((*StructWithCollectionOfUnionts)(nil)).Elem(), ) -} - -func (v *jsiiProxy_VariadicInvoker) AsArray(values ...*float64) *[]*float64 { - args := []interface{}{} - for _, a := range values { - args = append(args, a) - } - - var returns *[]*float64 - - _jsii_.Invoke( - v, - "asArray", - args, - &returns, + _jsii_.RegisterStruct( + "jsii-calc.StructWithEnum", + reflect.TypeOf((*StructWithEnum)(nil)).Elem(), ) - - return returns -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_VariadicMethod.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -type VariadicMethod interface { - AsArray(first *float64, others ...*float64) *[]*float64 -} - -// The jsii proxy struct for VariadicMethod -type jsiiProxy_VariadicMethod struct { - _ byte // padding -} - -func NewVariadicMethod(prefix ...*float64) VariadicMethod { - _init_.Initialize() - - args := []interface{}{} - for _, a := range prefix { - args = append(args, a) - } - - j := jsiiProxy_VariadicMethod{} - - _jsii_.Create( - "jsii-calc.VariadicMethod", - args, - &j, + _jsii_.RegisterStruct( + "jsii-calc.StructWithJavaReservedWords", + reflect.TypeOf((*StructWithJavaReservedWords)(nil)).Elem(), ) - - return &j -} - -func NewVariadicMethod_Override(v VariadicMethod, prefix ...*float64) { - _init_.Initialize() - - args := []interface{}{} - for _, a := range prefix { - args = append(args, a) - } - - _jsii_.Create( - "jsii-calc.VariadicMethod", - args, - v, + _jsii_.RegisterClass( + "jsii-calc.Sum", + reflect.TypeOf((*Sum)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "decorationPostfixes", GoGetter: "DecorationPostfixes"}, + _jsii_.MemberProperty{JsiiProperty: "decorationPrefixes", GoGetter: "DecorationPrefixes"}, + _jsii_.MemberProperty{JsiiProperty: "expression", GoGetter: "Expression"}, + _jsii_.MemberProperty{JsiiProperty: "parts", GoGetter: "Parts"}, + _jsii_.MemberProperty{JsiiProperty: "stringStyle", GoGetter: "StringStyle"}, + _jsii_.MemberMethod{JsiiMethod: "toString", GoMethod: "ToString"}, + _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, + _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, + }, + func() interface{} { + j := jsiiProxy_Sum{} + _jsii_.InitJsiiProxy(&j.Type__compositionCompositeOperation) + return &j + }, ) -} - -func (v *jsiiProxy_VariadicMethod) AsArray(first *float64, others ...*float64) *[]*float64 { - args := []interface{}{first} - for _, a := range others { - args = append(args, a) - } - - var returns *[]*float64 - - _jsii_.Invoke( - v, - "asArray", - args, - &returns, + _jsii_.RegisterClass( + "jsii-calc.SupportsNiceJavaBuilder", + reflect.TypeOf((*SupportsNiceJavaBuilder)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "bar", GoGetter: "Bar"}, + _jsii_.MemberProperty{JsiiProperty: "id", GoGetter: "Id"}, + _jsii_.MemberProperty{JsiiProperty: "propId", GoGetter: "PropId"}, + _jsii_.MemberProperty{JsiiProperty: "rest", GoGetter: "Rest"}, + }, + func() interface{} { + j := jsiiProxy_SupportsNiceJavaBuilder{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_SupportsNiceJavaBuilderWithRequiredProps) + return &j + }, ) - - return returns -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_VariadicTypeUnion.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -type VariadicTypeUnion interface { - Union() *[]interface{} - SetUnion(val *[]interface{}) -} - -// The jsii proxy struct for VariadicTypeUnion -type jsiiProxy_VariadicTypeUnion struct { - _ byte // padding -} - -func (j *jsiiProxy_VariadicTypeUnion) Union() *[]interface{} { - var returns *[]interface{} - _jsii_.Get( - j, - "union", - &returns, + _jsii_.RegisterStruct( + "jsii-calc.SupportsNiceJavaBuilderProps", + reflect.TypeOf((*SupportsNiceJavaBuilderProps)(nil)).Elem(), ) - return returns -} - - -func NewVariadicTypeUnion(union ...interface{}) VariadicTypeUnion { - _init_.Initialize() - - args := []interface{}{} - for _, a := range union { - args = append(args, a) - } - - j := jsiiProxy_VariadicTypeUnion{} - - _jsii_.Create( - "jsii-calc.VariadicTypeUnion", - args, - &j, + _jsii_.RegisterClass( + "jsii-calc.SupportsNiceJavaBuilderWithRequiredProps", + reflect.TypeOf((*SupportsNiceJavaBuilderWithRequiredProps)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "bar", GoGetter: "Bar"}, + _jsii_.MemberProperty{JsiiProperty: "id", GoGetter: "Id"}, + _jsii_.MemberProperty{JsiiProperty: "propId", GoGetter: "PropId"}, + }, + func() interface{} { + return &jsiiProxy_SupportsNiceJavaBuilderWithRequiredProps{} + }, ) - - return &j -} - -func NewVariadicTypeUnion_Override(v VariadicTypeUnion, union ...interface{}) { - _init_.Initialize() - - args := []interface{}{} - for _, a := range union { - args = append(args, a) - } - - _jsii_.Create( - "jsii-calc.VariadicTypeUnion", - args, - v, + _jsii_.RegisterClass( + "jsii-calc.SyncVirtualMethods", + reflect.TypeOf((*SyncVirtualMethods)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "a", GoGetter: "A"}, + _jsii_.MemberMethod{JsiiMethod: "callerIsAsync", GoMethod: "CallerIsAsync"}, + _jsii_.MemberMethod{JsiiMethod: "callerIsMethod", GoMethod: "CallerIsMethod"}, + _jsii_.MemberProperty{JsiiProperty: "callerIsProperty", GoGetter: "CallerIsProperty"}, + _jsii_.MemberMethod{JsiiMethod: "modifyOtherProperty", GoMethod: "ModifyOtherProperty"}, + _jsii_.MemberMethod{JsiiMethod: "modifyValueOfTheProperty", GoMethod: "ModifyValueOfTheProperty"}, + _jsii_.MemberProperty{JsiiProperty: "otherProperty", GoGetter: "OtherProperty"}, + _jsii_.MemberMethod{JsiiMethod: "readA", GoMethod: "ReadA"}, + _jsii_.MemberProperty{JsiiProperty: "readonlyProperty", GoGetter: "ReadonlyProperty"}, + _jsii_.MemberMethod{JsiiMethod: "retrieveOtherProperty", GoMethod: "RetrieveOtherProperty"}, + _jsii_.MemberMethod{JsiiMethod: "retrieveReadOnlyProperty", GoMethod: "RetrieveReadOnlyProperty"}, + _jsii_.MemberMethod{JsiiMethod: "retrieveValueOfTheProperty", GoMethod: "RetrieveValueOfTheProperty"}, + _jsii_.MemberProperty{JsiiProperty: "theProperty", GoGetter: "TheProperty"}, + _jsii_.MemberProperty{JsiiProperty: "valueOfOtherProperty", GoGetter: "ValueOfOtherProperty"}, + _jsii_.MemberMethod{JsiiMethod: "virtualMethod", GoMethod: "VirtualMethod"}, + _jsii_.MemberMethod{JsiiMethod: "writeA", GoMethod: "WriteA"}, + }, + func() interface{} { + return &jsiiProxy_SyncVirtualMethods{} + }, ) -} - -func (j *jsiiProxy_VariadicTypeUnion)SetUnion(val *[]interface{}) { - _jsii_.Set( - j, - "union", - val, + _jsii_.RegisterClass( + "jsii-calc.TestStructWithEnum", + reflect.TypeOf((*TestStructWithEnum)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "isStringEnumA", GoMethod: "IsStringEnumA"}, + _jsii_.MemberMethod{JsiiMethod: "isStringEnumB", GoMethod: "IsStringEnumB"}, + _jsii_.MemberProperty{JsiiProperty: "structWithFoo", GoGetter: "StructWithFoo"}, + _jsii_.MemberProperty{JsiiProperty: "structWithFooBar", GoGetter: "StructWithFooBar"}, + }, + func() interface{} { + return &jsiiProxy_TestStructWithEnum{} + }, ) -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_VirtualMethodPlayground.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -type VirtualMethodPlayground interface { - OverrideMeAsync(index *float64) *float64 - OverrideMeSync(index *float64) *float64 - ParallelSumAsync(count *float64) *float64 - SerialSumAsync(count *float64) *float64 - SumSync(count *float64) *float64 -} - -// The jsii proxy struct for VirtualMethodPlayground -type jsiiProxy_VirtualMethodPlayground struct { - _ byte // padding -} - -func NewVirtualMethodPlayground() VirtualMethodPlayground { - _init_.Initialize() - - j := jsiiProxy_VirtualMethodPlayground{} - - _jsii_.Create( - "jsii-calc.VirtualMethodPlayground", - nil, // no parameters - &j, + _jsii_.RegisterClass( + "jsii-calc.Thrower", + reflect.TypeOf((*Thrower)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "throwError", GoMethod: "ThrowError"}, + }, + func() interface{} { + return &jsiiProxy_Thrower{} + }, ) - - return &j -} - -func NewVirtualMethodPlayground_Override(v VirtualMethodPlayground) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.VirtualMethodPlayground", - nil, // no parameters - v, + _jsii_.RegisterStruct( + "jsii-calc.TopLevelStruct", + reflect.TypeOf((*TopLevelStruct)(nil)).Elem(), ) -} - -func (v *jsiiProxy_VirtualMethodPlayground) OverrideMeAsync(index *float64) *float64 { - var returns *float64 - - _jsii_.Invoke( - v, - "overrideMeAsync", - []interface{}{index}, - &returns, + _jsii_.RegisterClass( + "jsii-calc.TwoMethodsWithSimilarCapitalization", + reflect.TypeOf((*TwoMethodsWithSimilarCapitalization)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "fooBar", GoGetter: "FooBar"}, + _jsii_.MemberProperty{JsiiProperty: "fooBAR", GoGetter: "FooBAR"}, + _jsii_.MemberMethod{JsiiMethod: "toIsoString", GoMethod: "ToIsoString"}, + _jsii_.MemberMethod{JsiiMethod: "toIsOString", GoMethod: "ToIsOString"}, + _jsii_.MemberMethod{JsiiMethod: "toISOString", GoMethod: "ToISOString"}, + }, + func() interface{} { + return &jsiiProxy_TwoMethodsWithSimilarCapitalization{} + }, ) - - return returns -} - -func (v *jsiiProxy_VirtualMethodPlayground) OverrideMeSync(index *float64) *float64 { - var returns *float64 - - _jsii_.Invoke( - v, - "overrideMeSync", - []interface{}{index}, - &returns, + _jsii_.RegisterClass( + "jsii-calc.UmaskCheck", + reflect.TypeOf((*UmaskCheck)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_UmaskCheck{} + }, ) - - return returns -} - -func (v *jsiiProxy_VirtualMethodPlayground) ParallelSumAsync(count *float64) *float64 { - var returns *float64 - - _jsii_.Invoke( - v, - "parallelSumAsync", - []interface{}{count}, - &returns, + _jsii_.RegisterClass( + "jsii-calc.UnaryOperation", + reflect.TypeOf((*UnaryOperation)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "operand", GoGetter: "Operand"}, + _jsii_.MemberMethod{JsiiMethod: "toString", GoMethod: "ToString"}, + _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, + _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, + }, + func() interface{} { + j := jsiiProxy_UnaryOperation{} + _jsii_.InitJsiiProxy(&j.Type__scopejsiicalclibOperation) + return &j + }, ) - - return returns -} - -func (v *jsiiProxy_VirtualMethodPlayground) SerialSumAsync(count *float64) *float64 { - var returns *float64 - - _jsii_.Invoke( - v, - "serialSumAsync", - []interface{}{count}, - &returns, + _jsii_.RegisterStruct( + "jsii-calc.UnionProperties", + reflect.TypeOf((*UnionProperties)(nil)).Elem(), ) - - return returns -} - -func (v *jsiiProxy_VirtualMethodPlayground) SumSync(count *float64) *float64 { - var returns *float64 - - _jsii_.Invoke( - v, - "sumSync", - []interface{}{count}, - &returns, + _jsii_.RegisterClass( + "jsii-calc.UpcasingReflectable", + reflect.TypeOf((*UpcasingReflectable)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "entries", GoGetter: "Entries"}, + }, + func() interface{} { + j := jsiiProxy_UpcasingReflectable{} + _jsii_.InitJsiiProxy(&j.Type__customsubmodulenameIReflectable) + return &j + }, ) - - return returns -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_VoidCallback.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -// This test is used to validate the runtimes can return correctly from a void callback. -// -// - Implement \`overrideMe\` (method does not have to do anything). -// - Invoke \`callMe\` -// - Verify that \`methodWasCalled\` is \`true\`. -type VoidCallback interface { - MethodWasCalled() *bool - CallMe() - OverrideMe() -} - -// The jsii proxy struct for VoidCallback -type jsiiProxy_VoidCallback struct { - _ byte // padding -} - -func (j *jsiiProxy_VoidCallback) MethodWasCalled() *bool { - var returns *bool - _jsii_.Get( - j, - "methodWasCalled", - &returns, + _jsii_.RegisterClass( + "jsii-calc.UseBundledDependency", + reflect.TypeOf((*UseBundledDependency)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "value", GoMethod: "Value"}, + }, + func() interface{} { + return &jsiiProxy_UseBundledDependency{} + }, ) - return returns -} - - -func NewVoidCallback_Override(v VoidCallback) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.VoidCallback", - nil, // no parameters - v, + _jsii_.RegisterClass( + "jsii-calc.UseCalcBase", + reflect.TypeOf((*UseCalcBase)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, + }, + func() interface{} { + return &jsiiProxy_UseCalcBase{} + }, ) -} - -func (v *jsiiProxy_VoidCallback) CallMe() { - _jsii_.InvokeVoid( - v, - "callMe", - nil, // no parameters + _jsii_.RegisterClass( + "jsii-calc.UsesInterfaceWithProperties", + reflect.TypeOf((*UsesInterfaceWithProperties)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "justRead", GoMethod: "JustRead"}, + _jsii_.MemberProperty{JsiiProperty: "obj", GoGetter: "Obj"}, + _jsii_.MemberMethod{JsiiMethod: "readStringAndNumber", GoMethod: "ReadStringAndNumber"}, + _jsii_.MemberMethod{JsiiMethod: "writeAndRead", GoMethod: "WriteAndRead"}, + }, + func() interface{} { + return &jsiiProxy_UsesInterfaceWithProperties{} + }, ) -} - -func (v *jsiiProxy_VoidCallback) OverrideMe() { - _jsii_.InvokeVoid( - v, - "overrideMe", - nil, // no parameters + _jsii_.RegisterClass( + "jsii-calc.VariadicInvoker", + reflect.TypeOf((*VariadicInvoker)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "asArray", GoMethod: "AsArray"}, + }, + func() interface{} { + return &jsiiProxy_VariadicInvoker{} + }, ) -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_WithPrivatePropertyInConstructor.go 1`] = ` -// A simple calcuator built on JSII. -package jsiicalc - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -) - -// Verifies that private property declarations in constructor arguments are hidden. -type WithPrivatePropertyInConstructor interface { - Success() *bool -} - -// The jsii proxy struct for WithPrivatePropertyInConstructor -type jsiiProxy_WithPrivatePropertyInConstructor struct { - _ byte // padding -} - -func (j *jsiiProxy_WithPrivatePropertyInConstructor) Success() *bool { - var returns *bool - _jsii_.Get( - j, - "success", - &returns, + _jsii_.RegisterClass( + "jsii-calc.VariadicMethod", + reflect.TypeOf((*VariadicMethod)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "asArray", GoMethod: "AsArray"}, + }, + func() interface{} { + return &jsiiProxy_VariadicMethod{} + }, ) - return returns -} - - -func NewWithPrivatePropertyInConstructor(privateField *string) WithPrivatePropertyInConstructor { - _init_.Initialize() - - j := jsiiProxy_WithPrivatePropertyInConstructor{} - - _jsii_.Create( - "jsii-calc.WithPrivatePropertyInConstructor", - []interface{}{privateField}, - &j, + _jsii_.RegisterClass( + "jsii-calc.VariadicTypeUnion", + reflect.TypeOf((*VariadicTypeUnion)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "union", GoGetter: "Union"}, + }, + func() interface{} { + return &jsiiProxy_VariadicTypeUnion{} + }, ) - - return &j -} - -func NewWithPrivatePropertyInConstructor_Override(w WithPrivatePropertyInConstructor, privateField *string) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.WithPrivatePropertyInConstructor", - []interface{}{privateField}, - w, + _jsii_.RegisterClass( + "jsii-calc.VirtualMethodPlayground", + reflect.TypeOf((*VirtualMethodPlayground)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "overrideMeAsync", GoMethod: "OverrideMeAsync"}, + _jsii_.MemberMethod{JsiiMethod: "overrideMeSync", GoMethod: "OverrideMeSync"}, + _jsii_.MemberMethod{JsiiMethod: "parallelSumAsync", GoMethod: "ParallelSumAsync"}, + _jsii_.MemberMethod{JsiiMethod: "serialSumAsync", GoMethod: "SerialSumAsync"}, + _jsii_.MemberMethod{JsiiMethod: "sumSync", GoMethod: "SumSync"}, + }, + func() interface{} { + return &jsiiProxy_VirtualMethodPlayground{} + }, ) -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2530/module2530.go 1`] = ` -package module2530 - -import ( - "reflect" - - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -func init() { _jsii_.RegisterClass( - "jsii-calc.module2530.MyClass", - reflect.TypeOf((*MyClass)(nil)).Elem(), + "jsii-calc.VoidCallback", + reflect.TypeOf((*VoidCallback)(nil)).Elem(), []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, + _jsii_.MemberMethod{JsiiMethod: "callMe", GoMethod: "CallMe"}, + _jsii_.MemberProperty{JsiiProperty: "methodWasCalled", GoGetter: "MethodWasCalled"}, + _jsii_.MemberMethod{JsiiMethod: "overrideMe", GoMethod: "OverrideMe"}, }, func() interface{} { - return &jsiiProxy_MyClass{} + return &jsiiProxy_VoidCallback{} + }, + ) + _jsii_.RegisterClass( + "jsii-calc.WithPrivatePropertyInConstructor", + reflect.TypeOf((*WithPrivatePropertyInConstructor)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "success", GoGetter: "Success"}, + }, + func() interface{} { + return &jsiiProxy_WithPrivatePropertyInConstructor{} }, ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2530/module2530_MyClass.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2530/MyClass.go 1`] = ` package module2530 import ( @@ -21879,8 +21855,8 @@ func (m *jsiiProxy_MyClass) Foo(_arg *string) { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2617/module2617.go 1`] = ` -package module2617 +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2530/main.go 1`] = ` +package module2530 import ( "reflect" @@ -21890,18 +21866,20 @@ import ( func init() { _jsii_.RegisterClass( - "jsii-calc.module2617.OnlyStatics", - reflect.TypeOf((*OnlyStatics)(nil)).Elem(), - nil, // no members + "jsii-calc.module2530.MyClass", + reflect.TypeOf((*MyClass)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, + }, func() interface{} { - return &jsiiProxy_OnlyStatics{} + return &jsiiProxy_MyClass{} }, ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2617/module2617_OnlyStatics.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2617/OnlyStatics.go 1`] = ` package module2617 import ( @@ -21940,18 +21918,8 @@ func OnlyStatics_Foo() { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2647/internal/types.go 1`] = ` -package internal -import ( - "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" -) -type Type__scopejsiicalclibBaseFor2647 = scopejsiicalclib.BaseFor2647 -type Type__scopejsiicalclibIFriendly = scopejsiicalclib.IFriendly - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2647/module2647.go 1`] = ` -package module2647 +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2617/main.go 1`] = ` +package module2617 import ( "reflect" @@ -21961,25 +21929,18 @@ import ( func init() { _jsii_.RegisterClass( - "jsii-calc.module2647.ExtendAndImplement", - reflect.TypeOf((*ExtendAndImplement)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, - _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, - _jsii_.MemberMethod{JsiiMethod: "localMethod", GoMethod: "LocalMethod"}, - }, + "jsii-calc.module2617.OnlyStatics", + reflect.TypeOf((*OnlyStatics)(nil)).Elem(), + nil, // no members func() interface{} { - j := jsiiProxy_ExtendAndImplement{} - _jsii_.InitJsiiProxy(&j.Type__scopejsiicalclibBaseFor2647) - _jsii_.InitJsiiProxy(&j.Type__scopejsiicalclibIFriendly) - return &j + return &jsiiProxy_OnlyStatics{} }, ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2647/module2647_ExtendAndImplement.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2647/ExtendAndImplement.go 1`] = ` package module2647 import ( @@ -22074,8 +22035,18 @@ func (e *jsiiProxy_ExtendAndImplement) LocalMethod() *string { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2689/methods/methods.go 1`] = ` -package methods +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2647/internal/types.go 1`] = ` +package internal +import ( + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" +) +type Type__scopejsiicalclibBaseFor2647 = scopejsiicalclib.BaseFor2647 +type Type__scopejsiicalclibIFriendly = scopejsiicalclib.IFriendly + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2647/main.go 1`] = ` +package module2647 import ( "reflect" @@ -22085,21 +22056,25 @@ import ( func init() { _jsii_.RegisterClass( - "jsii-calc.module2689.methods.MyClass", - reflect.TypeOf((*MyClass)(nil)).Elem(), + "jsii-calc.module2647.ExtendAndImplement", + reflect.TypeOf((*ExtendAndImplement)(nil)).Elem(), []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "bar", GoMethod: "Bar"}, _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, + _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, + _jsii_.MemberMethod{JsiiMethod: "localMethod", GoMethod: "LocalMethod"}, }, func() interface{} { - return &jsiiProxy_MyClass{} + j := jsiiProxy_ExtendAndImplement{} + _jsii_.InitJsiiProxy(&j.Type__scopejsiicalclibBaseFor2647) + _jsii_.InitJsiiProxy(&j.Type__scopejsiicalclibIFriendly) + return &j }, ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2689/methods/methods_MyClass.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2689/methods/MyClass.go 1`] = ` package methods import ( @@ -22163,8 +22138,8 @@ func (m *jsiiProxy_MyClass) Foo(_values *[]scopejsiicalclib.Number) { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2689/props/props.go 1`] = ` -package props +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2689/methods/main.go 1`] = ` +package methods import ( "reflect" @@ -22174,11 +22149,11 @@ import ( func init() { _jsii_.RegisterClass( - "jsii-calc.module2689.props.MyClass", + "jsii-calc.module2689.methods.MyClass", reflect.TypeOf((*MyClass)(nil)).Elem(), []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "bar", GoGetter: "Bar"}, - _jsii_.MemberProperty{JsiiProperty: "foo", GoGetter: "Foo"}, + _jsii_.MemberMethod{JsiiMethod: "bar", GoMethod: "Bar"}, + _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, }, func() interface{} { return &jsiiProxy_MyClass{} @@ -22188,7 +22163,7 @@ func init() { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2689/props/props_MyClass.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2689/props/MyClass.go 1`] = ` package props import ( @@ -22257,8 +22232,8 @@ func NewMyClass_Override(m MyClass) { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2689/retval/retval.go 1`] = ` -package retval +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2689/props/main.go 1`] = ` +package props import ( "reflect" @@ -22268,11 +22243,11 @@ import ( func init() { _jsii_.RegisterClass( - "jsii-calc.module2689.retval.MyClass", + "jsii-calc.module2689.props.MyClass", reflect.TypeOf((*MyClass)(nil)).Elem(), []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "bar", GoMethod: "Bar"}, - _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, + _jsii_.MemberProperty{JsiiProperty: "bar", GoGetter: "Bar"}, + _jsii_.MemberProperty{JsiiProperty: "foo", GoGetter: "Foo"}, }, func() interface{} { return &jsiiProxy_MyClass{} @@ -22282,7 +22257,7 @@ func init() { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2689/retval/retval_MyClass.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2689/retval/MyClass.go 1`] = ` package retval import ( @@ -22356,8 +22331,8 @@ func (m *jsiiProxy_MyClass) Foo() *[]scopejsiicalclib.Number { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2689/structs/structs.go 1`] = ` -package structs +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2689/retval/main.go 1`] = ` +package retval import ( "reflect" @@ -22366,15 +22341,22 @@ import ( ) func init() { - _jsii_.RegisterStruct( - "jsii-calc.module2689.structs.MyStruct", - reflect.TypeOf((*MyStruct)(nil)).Elem(), + _jsii_.RegisterClass( + "jsii-calc.module2689.retval.MyClass", + reflect.TypeOf((*MyClass)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "bar", GoMethod: "Bar"}, + _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, + }, + func() interface{} { + return &jsiiProxy_MyClass{} + }, ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2689/structs/structs_MyStruct.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2689/structs/MyStruct.go 1`] = ` package structs import ( @@ -22390,8 +22372,8 @@ type MyStruct struct { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2692/submodule1/submodule1.go 1`] = ` -package submodule1 +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2689/structs/main.go 1`] = ` +package structs import ( "reflect" @@ -22401,14 +22383,14 @@ import ( func init() { _jsii_.RegisterStruct( - "jsii-calc.module2692.submodule1.Bar", - reflect.TypeOf((*Bar)(nil)).Elem(), + "jsii-calc.module2689.structs.MyStruct", + reflect.TypeOf((*MyStruct)(nil)).Elem(), ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2692/submodule1/submodule1_Bar.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2692/submodule1/Bar.go 1`] = ` package submodule1 @@ -22419,8 +22401,8 @@ type Bar struct { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2692/submodule2/submodule2.go 1`] = ` -package submodule2 +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2692/submodule1/main.go 1`] = ` +package submodule1 import ( "reflect" @@ -22430,18 +22412,14 @@ import ( func init() { _jsii_.RegisterStruct( - "jsii-calc.module2692.submodule2.Bar", + "jsii-calc.module2692.submodule1.Bar", reflect.TypeOf((*Bar)(nil)).Elem(), ) - _jsii_.RegisterStruct( - "jsii-calc.module2692.submodule2.Foo", - reflect.TypeOf((*Foo)(nil)).Elem(), - ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2692/submodule2/submodule2_Bar.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2692/submodule2/Bar.go 1`] = ` package submodule2 @@ -22452,7 +22430,7 @@ type Bar struct { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2692/submodule2/submodule2_Foo.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2692/submodule2/Foo.go 1`] = ` package submodule2 @@ -22465,8 +22443,8 @@ type Foo struct { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2700/module2700.go 1`] = ` -package module2700 +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2692/submodule2/main.go 1`] = ` +package submodule2 import ( "reflect" @@ -22475,50 +22453,19 @@ import ( ) func init() { - _jsii_.RegisterClass( - "jsii-calc.module2700.Base", - reflect.TypeOf((*Base)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "bar", GoMethod: "Bar"}, - _jsii_.MemberProperty{JsiiProperty: "baz", GoGetter: "Baz"}, - }, - func() interface{} { - j := jsiiProxy_Base{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_IFoo) - return &j - }, - ) - _jsii_.RegisterClass( - "jsii-calc.module2700.Derived", - reflect.TypeOf((*Derived)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "bar", GoMethod: "Bar"}, - _jsii_.MemberProperty{JsiiProperty: "baz", GoGetter: "Baz"}, - _jsii_.MemberMethod{JsiiMethod: "zoo", GoMethod: "Zoo"}, - }, - func() interface{} { - j := jsiiProxy_Derived{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_Base) - _jsii_.InitJsiiProxy(&j.jsiiProxy_IFoo) - return &j - }, + _jsii_.RegisterStruct( + "jsii-calc.module2692.submodule2.Bar", + reflect.TypeOf((*Bar)(nil)).Elem(), ) - _jsii_.RegisterInterface( - "jsii-calc.module2700.IFoo", - reflect.TypeOf((*IFoo)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "bar", GoMethod: "Bar"}, - _jsii_.MemberProperty{JsiiProperty: "baz", GoGetter: "Baz"}, - }, - func() interface{} { - return &jsiiProxy_IFoo{} - }, + _jsii_.RegisterStruct( + "jsii-calc.module2692.submodule2.Foo", + reflect.TypeOf((*Foo)(nil)).Elem(), ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2700/module2700_Base.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2700/Base.go 1`] = ` package module2700 import ( @@ -22588,7 +22535,7 @@ func (b *jsiiProxy_Base) Bar() *string { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2700/module2700_Derived.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2700/Derived.go 1`] = ` package module2700 import ( @@ -22674,7 +22621,7 @@ func (d *jsiiProxy_Derived) Zoo() *string { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2700/module2700_IFoo.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2700/IFoo.go 1`] = ` package module2700 import ( @@ -22717,18 +22664,8 @@ func (j *jsiiProxy_IFoo) Baz() *float64 { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/internal/types.go 1`] = ` -package internal -import ( - "github.com/aws/jsii/jsii-calc/go/jcb" -) -type Type__jcbBase = jcb.Base -type Type__jcbIBaseInterface = jcb.IBaseInterface - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/module2702.go 1`] = ` -package module2702 +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2700/main.go 1`] = ` +package module2700 import ( "reflect" @@ -22738,172 +22675,49 @@ import ( func init() { _jsii_.RegisterClass( - "jsii-calc.module2702.Baz", - reflect.TypeOf((*Baz)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "bar", GoMethod: "Bar"}, - _jsii_.MemberMethod{JsiiMethod: "bazMethod", GoMethod: "BazMethod"}, - _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, - _jsii_.MemberMethod{JsiiMethod: "iBaseInterface", GoMethod: "IBaseInterface"}, - }, - func() interface{} { - j := jsiiProxy_Baz{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_Class3) - _jsii_.InitJsiiProxy(&j.jsiiProxy_IBaz) - return &j - }, - ) - _jsii_.RegisterClass( - "jsii-calc.module2702.Class1", - reflect.TypeOf((*Class1)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "base", GoMethod: "Base"}, - _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, - }, - func() interface{} { - j := jsiiProxy_Class1{} - _jsii_.InitJsiiProxy(&j.Type__jcbBase) - return &j - }, - ) - _jsii_.RegisterClass( - "jsii-calc.module2702.Class2", - reflect.TypeOf((*Class2)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "base", GoGetter: "Base"}, - _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, - }, - func() interface{} { - j := jsiiProxy_Class2{} - _jsii_.InitJsiiProxy(&j.Type__jcbBase) - return &j - }, - ) - _jsii_.RegisterClass( - "jsii-calc.module2702.Class3", - reflect.TypeOf((*Class3)(nil)).Elem(), + "jsii-calc.module2700.Base", + reflect.TypeOf((*Base)(nil)).Elem(), []_jsii_.Member{ _jsii_.MemberMethod{JsiiMethod: "bar", GoMethod: "Bar"}, - _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, - _jsii_.MemberMethod{JsiiMethod: "iBaseInterface", GoMethod: "IBaseInterface"}, + _jsii_.MemberProperty{JsiiProperty: "baz", GoGetter: "Baz"}, }, func() interface{} { - j := jsiiProxy_Class3{} - _jsii_.InitJsiiProxy(&j.Type__jcbIBaseInterface) + j := jsiiProxy_Base{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_IFoo) return &j }, ) _jsii_.RegisterClass( - "jsii-calc.module2702.Construct", - reflect.TypeOf((*Construct)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "constructMethod", GoMethod: "ConstructMethod"}, - }, - func() interface{} { - j := jsiiProxy_Construct{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_IConstruct) - return &j - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.module2702.IBaz", - reflect.TypeOf((*IBaz)(nil)).Elem(), + "jsii-calc.module2700.Derived", + reflect.TypeOf((*Derived)(nil)).Elem(), []_jsii_.Member{ _jsii_.MemberMethod{JsiiMethod: "bar", GoMethod: "Bar"}, - _jsii_.MemberMethod{JsiiMethod: "bazMethod", GoMethod: "BazMethod"}, - _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, + _jsii_.MemberProperty{JsiiProperty: "baz", GoGetter: "Baz"}, + _jsii_.MemberMethod{JsiiMethod: "zoo", GoMethod: "Zoo"}, }, func() interface{} { - j := jsiiProxy_IBaz{} - _jsii_.InitJsiiProxy(&j.Type__jcbIBaseInterface) + j := jsiiProxy_Derived{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_Base) + _jsii_.InitJsiiProxy(&j.jsiiProxy_IFoo) return &j }, ) _jsii_.RegisterInterface( - "jsii-calc.module2702.IConstruct", - reflect.TypeOf((*IConstruct)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "constructMethod", GoMethod: "ConstructMethod"}, - }, - func() interface{} { - return &jsiiProxy_IConstruct{} - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.module2702.IFoo", + "jsii-calc.module2700.IFoo", reflect.TypeOf((*IFoo)(nil)).Elem(), []_jsii_.Member{ _jsii_.MemberMethod{JsiiMethod: "bar", GoMethod: "Bar"}, - _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, - _jsii_.MemberProperty{JsiiProperty: "iBaseInterface", GoGetter: "IBaseInterface"}, - }, - func() interface{} { - j := jsiiProxy_IFoo{} - _jsii_.InitJsiiProxy(&j.Type__jcbIBaseInterface) - return &j - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.module2702.IResource", - reflect.TypeOf((*IResource)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "constructMethod", GoMethod: "ConstructMethod"}, - _jsii_.MemberMethod{JsiiMethod: "resourceMethod", GoMethod: "ResourceMethod"}, - }, - func() interface{} { - j := jsiiProxy_IResource{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_IConstruct) - return &j - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.module2702.IVpc", - reflect.TypeOf((*IVpc)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "constructMethod", GoMethod: "ConstructMethod"}, - _jsii_.MemberMethod{JsiiMethod: "resourceMethod", GoMethod: "ResourceMethod"}, - _jsii_.MemberMethod{JsiiMethod: "vpcMethod", GoMethod: "VpcMethod"}, - }, - func() interface{} { - j := jsiiProxy_IVpc{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_IResource) - return &j - }, - ) - _jsii_.RegisterClass( - "jsii-calc.module2702.Resource", - reflect.TypeOf((*Resource)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "constructMethod", GoMethod: "ConstructMethod"}, - _jsii_.MemberMethod{JsiiMethod: "resourceMethod", GoMethod: "ResourceMethod"}, - }, - func() interface{} { - j := jsiiProxy_Resource{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_Construct) - _jsii_.InitJsiiProxy(&j.jsiiProxy_IResource) - return &j - }, - ) - _jsii_.RegisterClass( - "jsii-calc.module2702.Vpc", - reflect.TypeOf((*Vpc)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "constructMethod", GoMethod: "ConstructMethod"}, - _jsii_.MemberMethod{JsiiMethod: "resourceMethod", GoMethod: "ResourceMethod"}, - _jsii_.MemberMethod{JsiiMethod: "vpcMethod", GoMethod: "VpcMethod"}, + _jsii_.MemberProperty{JsiiProperty: "baz", GoGetter: "Baz"}, }, func() interface{} { - j := jsiiProxy_Vpc{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_Resource) - _jsii_.InitJsiiProxy(&j.jsiiProxy_IVpc) - return &j + return &jsiiProxy_IFoo{} }, ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/module2702_Baz.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/Baz.go 1`] = ` package module2702 import ( @@ -22985,7 +22799,7 @@ func (b *jsiiProxy_Baz) IBaseInterface() { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/module2702_Class1.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/Class1.go 1`] = ` package module2702 import ( @@ -23056,7 +22870,7 @@ func (c *jsiiProxy_Class1) TypeName() interface{} { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/module2702_Class2.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/Class2.go 1`] = ` package module2702 import ( @@ -23130,7 +22944,7 @@ func (c *jsiiProxy_Class2) TypeName() interface{} { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/module2702_Class3.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/Class3.go 1`] = ` package module2702 import ( @@ -23204,7 +23018,7 @@ func (c *jsiiProxy_Class3) IBaseInterface() { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/module2702_Construct.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/Construct.go 1`] = ` package module2702 import ( @@ -23257,7 +23071,7 @@ func (c *jsiiProxy_Construct) ConstructMethod() { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/module2702_IBaz.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/IBaz.go 1`] = ` package module2702 import ( @@ -23288,7 +23102,7 @@ func (i *jsiiProxy_IBaz) BazMethod() { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/module2702_IConstruct.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/IConstruct.go 1`] = ` package module2702 import ( @@ -23315,7 +23129,7 @@ func (i *jsiiProxy_IConstruct) ConstructMethod() { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/module2702_IFoo.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/IFoo.go 1`] = ` package module2702 import ( @@ -23348,7 +23162,7 @@ func (j *jsiiProxy_IFoo) IBaseInterface() *string { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/module2702_IResource.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/IResource.go 1`] = ` package module2702 import ( @@ -23376,7 +23190,7 @@ func (i *jsiiProxy_IResource) ResourceMethod() { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/module2702_IVpc.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/IVpc.go 1`] = ` package module2702 import ( @@ -23404,7 +23218,7 @@ func (i *jsiiProxy_IVpc) VpcMethod() { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/module2702_Resource.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/Resource.go 1`] = ` package module2702 import ( @@ -23454,7 +23268,7 @@ func (r *jsiiProxy_Resource) ResourceMethod() { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/module2702_Vpc.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/Vpc.go 1`] = ` package module2702 import ( @@ -23527,8 +23341,18 @@ func (v *jsiiProxy_Vpc) VpcMethod() { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/nodirect/sub1/sub1.go 1`] = ` -package sub1 +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/internal/types.go 1`] = ` +package internal +import ( + "github.com/aws/jsii/jsii-calc/go/jcb" +) +type Type__jcbBase = jcb.Base +type Type__jcbIBaseInterface = jcb.IBaseInterface + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2702/main.go 1`] = ` +package module2702 import ( "reflect" @@ -23538,20 +23362,172 @@ import ( func init() { _jsii_.RegisterClass( - "jsii-calc.nodirect.sub1.TypeFromSub1", - reflect.TypeOf((*TypeFromSub1)(nil)).Elem(), + "jsii-calc.module2702.Baz", + reflect.TypeOf((*Baz)(nil)).Elem(), []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "sub1", GoMethod: "Sub1"}, + _jsii_.MemberMethod{JsiiMethod: "bar", GoMethod: "Bar"}, + _jsii_.MemberMethod{JsiiMethod: "bazMethod", GoMethod: "BazMethod"}, + _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, + _jsii_.MemberMethod{JsiiMethod: "iBaseInterface", GoMethod: "IBaseInterface"}, }, func() interface{} { - return &jsiiProxy_TypeFromSub1{} + j := jsiiProxy_Baz{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_Class3) + _jsii_.InitJsiiProxy(&j.jsiiProxy_IBaz) + return &j + }, + ) + _jsii_.RegisterClass( + "jsii-calc.module2702.Class1", + reflect.TypeOf((*Class1)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "base", GoMethod: "Base"}, + _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, + }, + func() interface{} { + j := jsiiProxy_Class1{} + _jsii_.InitJsiiProxy(&j.Type__jcbBase) + return &j + }, + ) + _jsii_.RegisterClass( + "jsii-calc.module2702.Class2", + reflect.TypeOf((*Class2)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "base", GoGetter: "Base"}, + _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, + }, + func() interface{} { + j := jsiiProxy_Class2{} + _jsii_.InitJsiiProxy(&j.Type__jcbBase) + return &j + }, + ) + _jsii_.RegisterClass( + "jsii-calc.module2702.Class3", + reflect.TypeOf((*Class3)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "bar", GoMethod: "Bar"}, + _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, + _jsii_.MemberMethod{JsiiMethod: "iBaseInterface", GoMethod: "IBaseInterface"}, + }, + func() interface{} { + j := jsiiProxy_Class3{} + _jsii_.InitJsiiProxy(&j.Type__jcbIBaseInterface) + return &j + }, + ) + _jsii_.RegisterClass( + "jsii-calc.module2702.Construct", + reflect.TypeOf((*Construct)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "constructMethod", GoMethod: "ConstructMethod"}, + }, + func() interface{} { + j := jsiiProxy_Construct{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_IConstruct) + return &j + }, + ) + _jsii_.RegisterInterface( + "jsii-calc.module2702.IBaz", + reflect.TypeOf((*IBaz)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "bar", GoMethod: "Bar"}, + _jsii_.MemberMethod{JsiiMethod: "bazMethod", GoMethod: "BazMethod"}, + _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, + }, + func() interface{} { + j := jsiiProxy_IBaz{} + _jsii_.InitJsiiProxy(&j.Type__jcbIBaseInterface) + return &j + }, + ) + _jsii_.RegisterInterface( + "jsii-calc.module2702.IConstruct", + reflect.TypeOf((*IConstruct)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "constructMethod", GoMethod: "ConstructMethod"}, + }, + func() interface{} { + return &jsiiProxy_IConstruct{} + }, + ) + _jsii_.RegisterInterface( + "jsii-calc.module2702.IFoo", + reflect.TypeOf((*IFoo)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "bar", GoMethod: "Bar"}, + _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, + _jsii_.MemberProperty{JsiiProperty: "iBaseInterface", GoGetter: "IBaseInterface"}, + }, + func() interface{} { + j := jsiiProxy_IFoo{} + _jsii_.InitJsiiProxy(&j.Type__jcbIBaseInterface) + return &j + }, + ) + _jsii_.RegisterInterface( + "jsii-calc.module2702.IResource", + reflect.TypeOf((*IResource)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "constructMethod", GoMethod: "ConstructMethod"}, + _jsii_.MemberMethod{JsiiMethod: "resourceMethod", GoMethod: "ResourceMethod"}, + }, + func() interface{} { + j := jsiiProxy_IResource{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_IConstruct) + return &j + }, + ) + _jsii_.RegisterInterface( + "jsii-calc.module2702.IVpc", + reflect.TypeOf((*IVpc)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "constructMethod", GoMethod: "ConstructMethod"}, + _jsii_.MemberMethod{JsiiMethod: "resourceMethod", GoMethod: "ResourceMethod"}, + _jsii_.MemberMethod{JsiiMethod: "vpcMethod", GoMethod: "VpcMethod"}, + }, + func() interface{} { + j := jsiiProxy_IVpc{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_IResource) + return &j + }, + ) + _jsii_.RegisterClass( + "jsii-calc.module2702.Resource", + reflect.TypeOf((*Resource)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "constructMethod", GoMethod: "ConstructMethod"}, + _jsii_.MemberMethod{JsiiMethod: "resourceMethod", GoMethod: "ResourceMethod"}, + }, + func() interface{} { + j := jsiiProxy_Resource{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_Construct) + _jsii_.InitJsiiProxy(&j.jsiiProxy_IResource) + return &j + }, + ) + _jsii_.RegisterClass( + "jsii-calc.module2702.Vpc", + reflect.TypeOf((*Vpc)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "constructMethod", GoMethod: "ConstructMethod"}, + _jsii_.MemberMethod{JsiiMethod: "resourceMethod", GoMethod: "ResourceMethod"}, + _jsii_.MemberMethod{JsiiMethod: "vpcMethod", GoMethod: "VpcMethod"}, + }, + func() interface{} { + j := jsiiProxy_Vpc{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_Resource) + _jsii_.InitJsiiProxy(&j.jsiiProxy_IVpc) + return &j }, ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/nodirect/sub1/sub1_TypeFromSub1.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/nodirect/sub1/TypeFromSub1.go 1`] = ` package sub1 import ( @@ -23608,8 +23584,8 @@ func (t *jsiiProxy_TypeFromSub1) Sub1() *string { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/nodirect/sub2/sub2.go 1`] = ` -package sub2 +exports[`Generated code for "jsii-calc": /go/jsiicalc/nodirect/sub1/main.go 1`] = ` +package sub1 import ( "reflect" @@ -23619,20 +23595,20 @@ import ( func init() { _jsii_.RegisterClass( - "jsii-calc.nodirect.sub2.TypeFromSub2", - reflect.TypeOf((*TypeFromSub2)(nil)).Elem(), + "jsii-calc.nodirect.sub1.TypeFromSub1", + reflect.TypeOf((*TypeFromSub1)(nil)).Elem(), []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "sub2", GoMethod: "Sub2"}, + _jsii_.MemberMethod{JsiiMethod: "sub1", GoMethod: "Sub1"}, }, func() interface{} { - return &jsiiProxy_TypeFromSub2{} + return &jsiiProxy_TypeFromSub1{} }, ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/nodirect/sub2/sub2_TypeFromSub2.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/nodirect/sub2/TypeFromSub2.go 1`] = ` package sub2 import ( @@ -23689,8 +23665,8 @@ func (t *jsiiProxy_TypeFromSub2) Sub2() *string { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/onlystatic/onlystatic.go 1`] = ` -package onlystatic +exports[`Generated code for "jsii-calc": /go/jsiicalc/nodirect/sub2/main.go 1`] = ` +package sub2 import ( "reflect" @@ -23700,18 +23676,20 @@ import ( func init() { _jsii_.RegisterClass( - "jsii-calc.onlystatic.OnlyStaticMethods", - reflect.TypeOf((*OnlyStaticMethods)(nil)).Elem(), - nil, // no members + "jsii-calc.nodirect.sub2.TypeFromSub2", + reflect.TypeOf((*TypeFromSub2)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "sub2", GoMethod: "Sub2"}, + }, func() interface{} { - return &jsiiProxy_OnlyStaticMethods{} + return &jsiiProxy_TypeFromSub2{} }, ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/onlystatic/onlystatic_OnlyStaticMethods.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/onlystatic/OnlyStaticMethods.go 1`] = ` package onlystatic import ( @@ -23746,8 +23724,8 @@ func OnlyStaticMethods_StaticMethod() *string { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/pythonself.go 1`] = ` -package pythonself +exports[`Generated code for "jsii-calc": /go/jsiicalc/onlystatic/main.go 1`] = ` +package onlystatic import ( "reflect" @@ -23757,45 +23735,18 @@ import ( func init() { _jsii_.RegisterClass( - "jsii-calc.PythonSelf.ClassWithSelf", - reflect.TypeOf((*ClassWithSelf)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, - _jsii_.MemberProperty{JsiiProperty: "self", GoGetter: "Self"}, - }, - func() interface{} { - return &jsiiProxy_ClassWithSelf{} - }, - ) - _jsii_.RegisterClass( - "jsii-calc.PythonSelf.ClassWithSelfKwarg", - reflect.TypeOf((*ClassWithSelfKwarg)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "props", GoGetter: "Props"}, - }, - func() interface{} { - return &jsiiProxy_ClassWithSelfKwarg{} - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.PythonSelf.IInterfaceWithSelf", - reflect.TypeOf((*IInterfaceWithSelf)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, - }, + "jsii-calc.onlystatic.OnlyStaticMethods", + reflect.TypeOf((*OnlyStaticMethods)(nil)).Elem(), + nil, // no members func() interface{} { - return &jsiiProxy_IInterfaceWithSelf{} + return &jsiiProxy_OnlyStaticMethods{} }, ) - _jsii_.RegisterStruct( - "jsii-calc.PythonSelf.StructWithSelf", - reflect.TypeOf((*StructWithSelf)(nil)).Elem(), - ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/pythonself_ClassWithSelf.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/ClassWithSelf.go 1`] = ` package pythonself import ( @@ -23864,7 +23815,7 @@ func (c *jsiiProxy_ClassWithSelf) Method(self *float64) *string { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/pythonself_ClassWithSelfKwarg.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/ClassWithSelfKwarg.go 1`] = ` package pythonself import ( @@ -23919,7 +23870,7 @@ func NewClassWithSelfKwarg_Override(c ClassWithSelfKwarg, props *StructWithSelf) `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/pythonself_IInterfaceWithSelf.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/IInterfaceWithSelf.go 1`] = ` package pythonself import ( @@ -23935,13 +23886,216 @@ type jsiiProxy_IInterfaceWithSelf struct { _ byte // padding } -func (i *jsiiProxy_IInterfaceWithSelf) Method(self *float64) *string { +func (i *jsiiProxy_IInterfaceWithSelf) Method(self *float64) *string { + var returns *string + + _jsii_.Invoke( + i, + "method", + []interface{}{self}, + &returns, + ) + + return returns +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/StructWithSelf.go 1`] = ` +package pythonself + + +type StructWithSelf struct { + Self *string \`field:"required" json:"self" yaml:"self"\` +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/main.go 1`] = ` +package pythonself + +import ( + "reflect" + + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +func init() { + _jsii_.RegisterClass( + "jsii-calc.PythonSelf.ClassWithSelf", + reflect.TypeOf((*ClassWithSelf)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, + _jsii_.MemberProperty{JsiiProperty: "self", GoGetter: "Self"}, + }, + func() interface{} { + return &jsiiProxy_ClassWithSelf{} + }, + ) + _jsii_.RegisterClass( + "jsii-calc.PythonSelf.ClassWithSelfKwarg", + reflect.TypeOf((*ClassWithSelfKwarg)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "props", GoGetter: "Props"}, + }, + func() interface{} { + return &jsiiProxy_ClassWithSelfKwarg{} + }, + ) + _jsii_.RegisterInterface( + "jsii-calc.PythonSelf.IInterfaceWithSelf", + reflect.TypeOf((*IInterfaceWithSelf)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, + }, + func() interface{} { + return &jsiiProxy_IInterfaceWithSelf{} + }, + ) + _jsii_.RegisterStruct( + "jsii-calc.PythonSelf.StructWithSelf", + reflect.TypeOf((*StructWithSelf)(nil)).Elem(), + ) +} + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/Default.go 1`] = ` +package submodule + + +// A struct named "Default". +// See: https://github.com/aws/jsii/issues/2637 +// +type Default struct { + Foo *float64 \`field:"required" json:"foo" yaml:"foo"\` +} + + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/MyClass.go 1`] = ` +package submodule + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" + + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3" + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/submodule/child" + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/submodule/internal" + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/submodule/nestedsubmodule/deeplynested" + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/submodule/param" +) + +type MyClass interface { + deeplynested.INamespaced + AllTypes() jsiicalc.AllTypes + SetAllTypes(val jsiicalc.AllTypes) + Awesomeness() child.Awesomeness + DefinedAt() *string + Goodness() child.Goodness + Props() *child.SomeStruct + MethodWithSpecialParam(param *param.SpecialParameter) *string +} + +// The jsii proxy struct for MyClass +type jsiiProxy_MyClass struct { + internal.Type__deeplynestedINamespaced +} + +func (j *jsiiProxy_MyClass) AllTypes() jsiicalc.AllTypes { + var returns jsiicalc.AllTypes + _jsii_.Get( + j, + "allTypes", + &returns, + ) + return returns +} + +func (j *jsiiProxy_MyClass) Awesomeness() child.Awesomeness { + var returns child.Awesomeness + _jsii_.Get( + j, + "awesomeness", + &returns, + ) + return returns +} + +func (j *jsiiProxy_MyClass) DefinedAt() *string { + var returns *string + _jsii_.Get( + j, + "definedAt", + &returns, + ) + return returns +} + +func (j *jsiiProxy_MyClass) Goodness() child.Goodness { + var returns child.Goodness + _jsii_.Get( + j, + "goodness", + &returns, + ) + return returns +} + +func (j *jsiiProxy_MyClass) Props() *child.SomeStruct { + var returns *child.SomeStruct + _jsii_.Get( + j, + "props", + &returns, + ) + return returns +} + + +func NewMyClass(props *child.SomeStruct) MyClass { + _init_.Initialize() + + j := jsiiProxy_MyClass{} + + _jsii_.Create( + "jsii-calc.submodule.MyClass", + []interface{}{props}, + &j, + ) + + return &j +} + +func NewMyClass_Override(m MyClass, props *child.SomeStruct) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.submodule.MyClass", + []interface{}{props}, + m, + ) +} + +func (j *jsiiProxy_MyClass)SetAllTypes(val jsiicalc.AllTypes) { + _jsii_.Set( + j, + "allTypes", + val, + ) +} + +func (m *jsiiProxy_MyClass) MethodWithSpecialParam(param *param.SpecialParameter) *string { var returns *string _jsii_.Invoke( - i, - "method", - []interface{}{self}, + m, + "methodWithSpecialParam", + []interface{}{param}, &returns, ) @@ -23949,17 +24103,6 @@ func (i *jsiiProxy_IInterfaceWithSelf) Method(self *float64) *string { } -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/pythonself_StructWithSelf.go 1`] = ` -package pythonself - - -type StructWithSelf struct { - Self *string \`field:"required" json:"self" yaml:"self"\` -} - - `; exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/README.md 1`] = ` @@ -23969,25 +24112,7 @@ This is the readme of the \`jsii-calc.submodule\` module. `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/backreferences/backreferences.go 1`] = ` -package backreferences - -import ( - "reflect" - - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -func init() { - _jsii_.RegisterStruct( - "jsii-calc.submodule.back_references.MyClassReference", - reflect.TypeOf((*MyClassReference)(nil)).Elem(), - ) -} - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/backreferences/backreferences_MyClassReference.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/backreferences/MyClassReference.go 1`] = ` package backreferences import ( @@ -24001,8 +24126,8 @@ type MyClassReference struct { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/child/child.go 1`] = ` -package child +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/backreferences/main.go 1`] = ` +package backreferences import ( "reflect" @@ -24011,64 +24136,15 @@ import ( ) func init() { - _jsii_.RegisterEnum( - "jsii-calc.submodule.child.Awesomeness", - reflect.TypeOf((*Awesomeness)(nil)).Elem(), - map[string]interface{}{ - "AWESOME": Awesomeness_AWESOME, - }, - ) - _jsii_.RegisterEnum( - "jsii-calc.submodule.child.Goodness", - reflect.TypeOf((*Goodness)(nil)).Elem(), - map[string]interface{}{ - "PRETTY_GOOD": Goodness_PRETTY_GOOD, - "REALLY_GOOD": Goodness_REALLY_GOOD, - "AMAZINGLY_GOOD": Goodness_AMAZINGLY_GOOD, - }, - ) - _jsii_.RegisterClass( - "jsii-calc.submodule.child.InnerClass", - reflect.TypeOf((*InnerClass)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_InnerClass{} - }, - ) - _jsii_.RegisterStruct( - "jsii-calc.submodule.child.KwargsProps", - reflect.TypeOf((*KwargsProps)(nil)).Elem(), - ) - _jsii_.RegisterClass( - "jsii-calc.submodule.child.OuterClass", - reflect.TypeOf((*OuterClass)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "innerClass", GoGetter: "InnerClass"}, - }, - func() interface{} { - return &jsiiProxy_OuterClass{} - }, - ) - _jsii_.RegisterEnum( - "jsii-calc.submodule.child.SomeEnum", - reflect.TypeOf((*SomeEnum)(nil)).Elem(), - map[string]interface{}{ - "SOME": SomeEnum_SOME, - }, - ) - _jsii_.RegisterStruct( - "jsii-calc.submodule.child.SomeStruct", - reflect.TypeOf((*SomeStruct)(nil)).Elem(), - ) _jsii_.RegisterStruct( - "jsii-calc.submodule.child.Structure", - reflect.TypeOf((*Structure)(nil)).Elem(), + "jsii-calc.submodule.back_references.MyClassReference", + reflect.TypeOf((*MyClassReference)(nil)).Elem(), ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/child/child_Awesomeness.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/child/Awesomeness.go 1`] = ` package child @@ -24082,7 +24158,7 @@ const ( `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/child/child_Goodness.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/child/Goodness.go 1`] = ` package child @@ -24100,7 +24176,7 @@ const ( `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/child/child_InnerClass.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/child/InnerClass.go 1`] = ` package child import ( @@ -24154,7 +24230,7 @@ func InnerClass_StaticProp() *SomeStruct { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/child/child_KwargsProps.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/child/KwargsProps.go 1`] = ` package child @@ -24166,7 +24242,7 @@ type KwargsProps struct { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/child/child_OuterClass.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/child/OuterClass.go 1`] = ` package child import ( @@ -24224,7 +24300,7 @@ func NewOuterClass_Override(o OuterClass) { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/child/child_SomeEnum.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/child/SomeEnum.go 1`] = ` package child @@ -24237,7 +24313,7 @@ const ( `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/child/child_SomeStruct.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/child/SomeStruct.go 1`] = ` package child @@ -24248,7 +24324,7 @@ type SomeStruct struct { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/child/child_Structure.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/child/Structure.go 1`] = ` package child @@ -24259,24 +24335,8 @@ type Structure struct { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/internal/types.go 1`] = ` -package internal -import ( - "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/submodule/nestedsubmodule/deeplynested" -) -type Type__deeplynestedINamespaced = deeplynested.INamespaced - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/isolated/README.md 1`] = ` -# Read you, read me - -This is the readme of the \`jsii-calc.submodule.isolated\` module. - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/isolated/isolated.go 1`] = ` -package isolated +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/child/main.go 1`] = ` +package child import ( "reflect" @@ -24285,19 +24345,73 @@ import ( ) func init() { + _jsii_.RegisterEnum( + "jsii-calc.submodule.child.Awesomeness", + reflect.TypeOf((*Awesomeness)(nil)).Elem(), + map[string]interface{}{ + "AWESOME": Awesomeness_AWESOME, + }, + ) + _jsii_.RegisterEnum( + "jsii-calc.submodule.child.Goodness", + reflect.TypeOf((*Goodness)(nil)).Elem(), + map[string]interface{}{ + "PRETTY_GOOD": Goodness_PRETTY_GOOD, + "REALLY_GOOD": Goodness_REALLY_GOOD, + "AMAZINGLY_GOOD": Goodness_AMAZINGLY_GOOD, + }, + ) _jsii_.RegisterClass( - "jsii-calc.submodule.isolated.Kwargs", - reflect.TypeOf((*Kwargs)(nil)).Elem(), + "jsii-calc.submodule.child.InnerClass", + reflect.TypeOf((*InnerClass)(nil)).Elem(), nil, // no members func() interface{} { - return &jsiiProxy_Kwargs{} + return &jsiiProxy_InnerClass{} + }, + ) + _jsii_.RegisterStruct( + "jsii-calc.submodule.child.KwargsProps", + reflect.TypeOf((*KwargsProps)(nil)).Elem(), + ) + _jsii_.RegisterClass( + "jsii-calc.submodule.child.OuterClass", + reflect.TypeOf((*OuterClass)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "innerClass", GoGetter: "InnerClass"}, + }, + func() interface{} { + return &jsiiProxy_OuterClass{} + }, + ) + _jsii_.RegisterEnum( + "jsii-calc.submodule.child.SomeEnum", + reflect.TypeOf((*SomeEnum)(nil)).Elem(), + map[string]interface{}{ + "SOME": SomeEnum_SOME, }, ) + _jsii_.RegisterStruct( + "jsii-calc.submodule.child.SomeStruct", + reflect.TypeOf((*SomeStruct)(nil)).Elem(), + ) + _jsii_.RegisterStruct( + "jsii-calc.submodule.child.Structure", + reflect.TypeOf((*Structure)(nil)).Elem(), + ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/isolated/isolated_Kwargs.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/internal/types.go 1`] = ` +package internal +import ( + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/submodule/nestedsubmodule/deeplynested" +) +type Type__deeplynestedINamespaced = deeplynested.INamespaced + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/isolated/Kwargs.go 1`] = ` package isolated import ( @@ -24334,8 +24448,15 @@ func Kwargs_Method(props *child.KwargsProps) *bool { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/nestedsubmodule/deeplynested/deeplynested.go 1`] = ` -package deeplynested +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/isolated/README.md 1`] = ` +# Read you, read me + +This is the readme of the \`jsii-calc.submodule.isolated\` module. + +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/isolated/main.go 1`] = ` +package isolated import ( "reflect" @@ -24344,60 +24465,20 @@ import ( ) func init() { - _jsii_.RegisterInterface( - "jsii-calc.submodule.nested_submodule.deeplyNested.INamespaced", - reflect.TypeOf((*INamespaced)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "definedAt", GoGetter: "DefinedAt"}, - }, + _jsii_.RegisterClass( + "jsii-calc.submodule.isolated.Kwargs", + reflect.TypeOf((*Kwargs)(nil)).Elem(), + nil, // no members func() interface{} { - return &jsiiProxy_INamespaced{} + return &jsiiProxy_Kwargs{} }, ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/nestedsubmodule/deeplynested/deeplynested_INamespaced.go 1`] = ` -package deeplynested - -import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -type INamespaced interface { - DefinedAt() *string -} - -// The jsii proxy for INamespaced -type jsiiProxy_INamespaced struct { - _ byte // padding -} - -func (j *jsiiProxy_INamespaced) DefinedAt() *string { - var returns *string - _jsii_.Get( - j, - "definedAt", - &returns, - ) - return returns -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/nestedsubmodule/internal/types.go 1`] = ` -package internal -import ( - "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/submodule/nestedsubmodule/deeplynested" -) -type Type__deeplynestedINamespaced = deeplynested.INamespaced - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/nestedsubmodule/nestedsubmodule.go 1`] = ` -package nestedsubmodule +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/main.go 1`] = ` +package submodule import ( "reflect" @@ -24406,15 +24487,23 @@ import ( ) func init() { + _jsii_.RegisterStruct( + "jsii-calc.submodule.Default", + reflect.TypeOf((*Default)(nil)).Elem(), + ) _jsii_.RegisterClass( - "jsii-calc.submodule.nested_submodule.Namespaced", - reflect.TypeOf((*Namespaced)(nil)).Elem(), + "jsii-calc.submodule.MyClass", + reflect.TypeOf((*MyClass)(nil)).Elem(), []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "allTypes", GoGetter: "AllTypes"}, + _jsii_.MemberProperty{JsiiProperty: "awesomeness", GoGetter: "Awesomeness"}, _jsii_.MemberProperty{JsiiProperty: "definedAt", GoGetter: "DefinedAt"}, _jsii_.MemberProperty{JsiiProperty: "goodness", GoGetter: "Goodness"}, + _jsii_.MemberMethod{JsiiMethod: "methodWithSpecialParam", GoMethod: "MethodWithSpecialParam"}, + _jsii_.MemberProperty{JsiiProperty: "props", GoGetter: "Props"}, }, func() interface{} { - j := jsiiProxy_Namespaced{} + j := jsiiProxy_MyClass{} _jsii_.InitJsiiProxy(&j.Type__deeplynestedINamespaced) return &j }, @@ -24423,7 +24512,7 @@ func init() { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/nestedsubmodule/nestedsubmodule_Namespaced.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/nestedsubmodule/Namespaced.go 1`] = ` package nestedsubmodule import ( @@ -24469,37 +24558,37 @@ func (j *jsiiProxy_Namespaced) Goodness() child.Goodness { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/param/param.go 1`] = ` -package param +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/nestedsubmodule/deeplynested/INamespaced.go 1`] = ` +package deeplynested import ( - "reflect" - _jsii_ "github.com/aws/jsii-runtime-go/runtime" ) -func init() { - _jsii_.RegisterStruct( - "jsii-calc.submodule.param.SpecialParameter", - reflect.TypeOf((*SpecialParameter)(nil)).Elem(), - ) +type INamespaced interface { + DefinedAt() *string } -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/param/param_SpecialParameter.go 1`] = ` -package param - +// The jsii proxy for INamespaced +type jsiiProxy_INamespaced struct { + _ byte // padding +} -type SpecialParameter struct { - Value *string \`field:"required" json:"value" yaml:"value"\` +func (j *jsiiProxy_INamespaced) DefinedAt() *string { + var returns *string + _jsii_.Get( + j, + "definedAt", + &returns, + ) + return returns } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/returnsparam/returnsparam.go 1`] = ` -package returnsparam +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/nestedsubmodule/deeplynested/main.go 1`] = ` +package deeplynested import ( "reflect" @@ -24508,81 +24597,31 @@ import ( ) func init() { - _jsii_.RegisterClass( - "jsii-calc.submodule.returnsparam.ReturnsSpecialParameter", - reflect.TypeOf((*ReturnsSpecialParameter)(nil)).Elem(), + _jsii_.RegisterInterface( + "jsii-calc.submodule.nested_submodule.deeplyNested.INamespaced", + reflect.TypeOf((*INamespaced)(nil)).Elem(), []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "returnsSpecialParam", GoMethod: "ReturnsSpecialParam"}, + _jsii_.MemberProperty{JsiiProperty: "definedAt", GoGetter: "DefinedAt"}, }, func() interface{} { - return &jsiiProxy_ReturnsSpecialParameter{} + return &jsiiProxy_INamespaced{} }, ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/returnsparam/returnsparam_ReturnsSpecialParameter.go 1`] = ` -package returnsparam - +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/nestedsubmodule/internal/types.go 1`] = ` +package internal import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" - - "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/submodule/param" + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/submodule/nestedsubmodule/deeplynested" ) - -type ReturnsSpecialParameter interface { - ReturnsSpecialParam() *param.SpecialParameter -} - -// The jsii proxy struct for ReturnsSpecialParameter -type jsiiProxy_ReturnsSpecialParameter struct { - _ byte // padding -} - -func NewReturnsSpecialParameter() ReturnsSpecialParameter { - _init_.Initialize() - - j := jsiiProxy_ReturnsSpecialParameter{} - - _jsii_.Create( - "jsii-calc.submodule.returnsparam.ReturnsSpecialParameter", - nil, // no parameters - &j, - ) - - return &j -} - -func NewReturnsSpecialParameter_Override(r ReturnsSpecialParameter) { - _init_.Initialize() - - _jsii_.Create( - "jsii-calc.submodule.returnsparam.ReturnsSpecialParameter", - nil, // no parameters - r, - ) -} - -func (r *jsiiProxy_ReturnsSpecialParameter) ReturnsSpecialParam() *param.SpecialParameter { - var returns *param.SpecialParameter - - _jsii_.Invoke( - r, - "returnsSpecialParam", - nil, // no parameters - &returns, - ) - - return returns -} - +type Type__deeplynestedINamespaced = deeplynested.INamespaced `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/submodule.go 1`] = ` -package submodule +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/nestedsubmodule/main.go 1`] = ` +package nestedsubmodule import ( "reflect" @@ -24591,23 +24630,15 @@ import ( ) func init() { - _jsii_.RegisterStruct( - "jsii-calc.submodule.Default", - reflect.TypeOf((*Default)(nil)).Elem(), - ) _jsii_.RegisterClass( - "jsii-calc.submodule.MyClass", - reflect.TypeOf((*MyClass)(nil)).Elem(), + "jsii-calc.submodule.nested_submodule.Namespaced", + reflect.TypeOf((*Namespaced)(nil)).Elem(), []_jsii_.Member{ - _jsii_.MemberProperty{JsiiProperty: "allTypes", GoGetter: "AllTypes"}, - _jsii_.MemberProperty{JsiiProperty: "awesomeness", GoGetter: "Awesomeness"}, _jsii_.MemberProperty{JsiiProperty: "definedAt", GoGetter: "DefinedAt"}, _jsii_.MemberProperty{JsiiProperty: "goodness", GoGetter: "Goodness"}, - _jsii_.MemberMethod{JsiiMethod: "methodWithSpecialParam", GoMethod: "MethodWithSpecialParam"}, - _jsii_.MemberProperty{JsiiProperty: "props", GoGetter: "Props"}, }, func() interface{} { - j := jsiiProxy_MyClass{} + j := jsiiProxy_Namespaced{} _jsii_.InitJsiiProxy(&j.Type__deeplynestedINamespaced) return &j }, @@ -24616,140 +24647,85 @@ func init() { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/submodule_Default.go 1`] = ` -package submodule +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/param/SpecialParameter.go 1`] = ` +package param -// A struct named "Default". -// See: https://github.com/aws/jsii/issues/2637 -// -type Default struct { - Foo *float64 \`field:"required" json:"foo" yaml:"foo"\` +type SpecialParameter struct { + Value *string \`field:"required" json:"value" yaml:"value"\` } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/submodule_MyClass.go 1`] = ` -package submodule +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/param/main.go 1`] = ` +package param import ( - _jsii_ "github.com/aws/jsii-runtime-go/runtime" - _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" + "reflect" - "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3" - "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/submodule/child" - "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/submodule/internal" - "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/submodule/nestedsubmodule/deeplynested" - "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/submodule/param" + _jsii_ "github.com/aws/jsii-runtime-go/runtime" ) -type MyClass interface { - deeplynested.INamespaced - AllTypes() jsiicalc.AllTypes - SetAllTypes(val jsiicalc.AllTypes) - Awesomeness() child.Awesomeness - DefinedAt() *string - Goodness() child.Goodness - Props() *child.SomeStruct - MethodWithSpecialParam(param *param.SpecialParameter) *string +func init() { + _jsii_.RegisterStruct( + "jsii-calc.submodule.param.SpecialParameter", + reflect.TypeOf((*SpecialParameter)(nil)).Elem(), + ) } -// The jsii proxy struct for MyClass -type jsiiProxy_MyClass struct { - internal.Type__deeplynestedINamespaced -} +`; -func (j *jsiiProxy_MyClass) AllTypes() jsiicalc.AllTypes { - var returns jsiicalc.AllTypes - _jsii_.Get( - j, - "allTypes", - &returns, - ) - return returns -} +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/returnsparam/ReturnsSpecialParameter.go 1`] = ` +package returnsparam -func (j *jsiiProxy_MyClass) Awesomeness() child.Awesomeness { - var returns child.Awesomeness - _jsii_.Get( - j, - "awesomeness", - &returns, - ) - return returns -} +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/jsii" -func (j *jsiiProxy_MyClass) DefinedAt() *string { - var returns *string - _jsii_.Get( - j, - "definedAt", - &returns, - ) - return returns -} + "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/submodule/param" +) -func (j *jsiiProxy_MyClass) Goodness() child.Goodness { - var returns child.Goodness - _jsii_.Get( - j, - "goodness", - &returns, - ) - return returns +type ReturnsSpecialParameter interface { + ReturnsSpecialParam() *param.SpecialParameter } -func (j *jsiiProxy_MyClass) Props() *child.SomeStruct { - var returns *child.SomeStruct - _jsii_.Get( - j, - "props", - &returns, - ) - return returns +// The jsii proxy struct for ReturnsSpecialParameter +type jsiiProxy_ReturnsSpecialParameter struct { + _ byte // padding } - -func NewMyClass(props *child.SomeStruct) MyClass { +func NewReturnsSpecialParameter() ReturnsSpecialParameter { _init_.Initialize() - j := jsiiProxy_MyClass{} + j := jsiiProxy_ReturnsSpecialParameter{} _jsii_.Create( - "jsii-calc.submodule.MyClass", - []interface{}{props}, + "jsii-calc.submodule.returnsparam.ReturnsSpecialParameter", + nil, // no parameters &j, ) return &j } -func NewMyClass_Override(m MyClass, props *child.SomeStruct) { +func NewReturnsSpecialParameter_Override(r ReturnsSpecialParameter) { _init_.Initialize() _jsii_.Create( - "jsii-calc.submodule.MyClass", - []interface{}{props}, - m, - ) -} - -func (j *jsiiProxy_MyClass)SetAllTypes(val jsiicalc.AllTypes) { - _jsii_.Set( - j, - "allTypes", - val, + "jsii-calc.submodule.returnsparam.ReturnsSpecialParameter", + nil, // no parameters + r, ) } -func (m *jsiiProxy_MyClass) MethodWithSpecialParam(param *param.SpecialParameter) *string { - var returns *string +func (r *jsiiProxy_ReturnsSpecialParameter) ReturnsSpecialParam() *param.SpecialParameter { + var returns *param.SpecialParameter _jsii_.Invoke( - m, - "methodWithSpecialParam", - []interface{}{param}, + r, + "returnsSpecialParam", + nil, // no parameters &returns, ) @@ -24759,51 +24735,31 @@ func (m *jsiiProxy_MyClass) MethodWithSpecialParam(param *param.SpecialParameter `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/union/union.go 1`] = ` -package union +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/returnsparam/main.go 1`] = ` +package returnsparam import ( - "reflect" - - _jsii_ "github.com/aws/jsii-runtime-go/runtime" -) - -func init() { - _jsii_.RegisterClass( - "jsii-calc.union.ConsumesUnion", - reflect.TypeOf((*ConsumesUnion)(nil)).Elem(), - nil, // no members - func() interface{} { - return &jsiiProxy_ConsumesUnion{} - }, - ) - _jsii_.RegisterInterface( - "jsii-calc.union.IResolvable", - reflect.TypeOf((*IResolvable)(nil)).Elem(), - []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "resolve", GoMethod: "Resolve"}, - }, - func() interface{} { - return &jsiiProxy_IResolvable{} - }, - ) + "reflect" + + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +func init() { _jsii_.RegisterClass( - "jsii-calc.union.Resolvable", - reflect.TypeOf((*Resolvable)(nil)).Elem(), + "jsii-calc.submodule.returnsparam.ReturnsSpecialParameter", + reflect.TypeOf((*ReturnsSpecialParameter)(nil)).Elem(), []_jsii_.Member{ - _jsii_.MemberMethod{JsiiMethod: "resolve", GoMethod: "Resolve"}, + _jsii_.MemberMethod{JsiiMethod: "returnsSpecialParam", GoMethod: "ReturnsSpecialParam"}, }, func() interface{} { - j := jsiiProxy_Resolvable{} - _jsii_.InitJsiiProxy(&j.jsiiProxy_IResolvable) - return &j + return &jsiiProxy_ReturnsSpecialParameter{} }, ) } `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/union/union_ConsumesUnion.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/union/ConsumesUnion.go 1`] = ` package union import ( @@ -24832,7 +24788,7 @@ func ConsumesUnion_UnionType(param interface{}) { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/union/union_IResolvable.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/union/IResolvable.go 1`] = ` package union import ( @@ -24864,7 +24820,7 @@ func (i *jsiiProxy_IResolvable) Resolve() interface{} { `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/union/union_Resolvable.go 1`] = ` +exports[`Generated code for "jsii-calc": /go/jsiicalc/union/Resolvable.go 1`] = ` package union import ( @@ -24879,1121 +24835,437 @@ type Resolvable interface { // The jsii proxy struct for Resolvable type jsiiProxy_Resolvable struct { jsiiProxy_IResolvable -} - -func (r *jsiiProxy_Resolvable) Resolve() interface{} { - var returns interface{} - - _jsii_.Invoke( - r, - "resolve", - nil, // no parameters - &returns, - ) - - return returns -} - - -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/version 1`] = ` -3.20.120 - -`; - -exports[`Generated code for "jsii-calc": / 1`] = ` - - ┗━ 📁 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 - ┣━ 📁 cdk22369 - ┃ ┣━ 🆕 cdk22369_AcceptsPath__no_runtime_type_checking.go - ┃ ┣━ 🆕 cdk22369_AcceptsPath__runtime_type_checks.go - ┃ ┗━ 📄 cdk22369_AcceptsPath.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 - ┣━ 📁 homonymousforwardreferences - ┃ ┣━ 📁 bar - ┃ ┃ ┣━ 🆕 bar_Consumer__no_runtime_type_checking.go - ┃ ┃ ┣━ 🆕 bar_Consumer__runtime_type_checks.go - ┃ ┃ ┗━ 📄 bar_Consumer.go.diff - ┃ ┗━ 📁 foo - ┃ ┣━ 🆕 foo_Consumer__no_runtime_type_checking.go - ┃ ┣━ 🆕 foo_Consumer__runtime_type_checks.go - ┃ ┗━ 📄 foo_Consumer.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_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_ParamShadowsBuiltins__no_runtime_type_checking.go - ┣━ 🆕 jsiicalc_ParamShadowsBuiltins__runtime_type_checks.go - ┣━ 📄 jsiicalc_ParamShadowsBuiltins.go.diff - ┣━ 🆕 jsiicalc_ParamShadowsScope__no_runtime_type_checking.go - ┣━ 🆕 jsiicalc_ParamShadowsScope__runtime_type_checks.go - ┣━ 📄 jsiicalc_ParamShadowsScope.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_VariadicTypeUnion__no_runtime_type_checking.go - ┣━ 🆕 jsiicalc_VariadicTypeUnion__runtime_type_checks.go - ┣━ 📄 jsiicalc_VariadicTypeUnion.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 - ┗━ 📁 union - ┣━ 🆕 union_ConsumesUnion__no_runtime_type_checking.go - ┣━ 🆕 union_ConsumesUnion__runtime_type_checks.go - ┗━ 📄 union_ConsumesUnion.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,18 @@ -+//go: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,44 @@ -+//go: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,10 @@ -+//go: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,18 @@ -+//go: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,10 @@ -+//go: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,16 @@ -+//go: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/cdk22369/cdk22369_AcceptsPath.go.diff 1`] = ` ---- go/jsiicalc/cdk22369/cdk22369_AcceptsPath.go --no-runtime-type-checking -+++ go/jsiicalc/cdk22369/cdk22369_AcceptsPath.go --runtime-type-checking -@@ -14,10 +14,13 @@ - } - - func NewAcceptsPath(props *AcceptsPathProps) AcceptsPath { - _init_.Initialize() - -+ if err := validateNewAcceptsPathParameters(props); err != nil { -+ panic(err) -+ } - j := jsiiProxy_AcceptsPath{} - - _jsii_.Create( - "jsii-calc.cdk22369.AcceptsPath", - []interface{}{props}, -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk22369/cdk22369_AcceptsPath__no_runtime_type_checking.go.diff 1`] = ` ---- go/jsiicalc/cdk22369/cdk22369_AcceptsPath__no_runtime_type_checking.go --no-runtime-type-checking -+++ go/jsiicalc/cdk22369/cdk22369_AcceptsPath__no_runtime_type_checking.go --runtime-type-checking -@@ -0,0 +1,10 @@ -+//go:build no_runtime_type_checking -+ -+package cdk22369 -+ -+// Building without runtime type checking enabled, so all the below just return nil -+ -+func validateNewAcceptsPathParameters(props *AcceptsPathProps) error { -+ return nil -+} -+ -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk22369/cdk22369_AcceptsPath__runtime_type_checks.go.diff 1`] = ` ---- go/jsiicalc/cdk22369/cdk22369_AcceptsPath__runtime_type_checks.go --no-runtime-type-checking -+++ go/jsiicalc/cdk22369/cdk22369_AcceptsPath__runtime_type_checks.go --runtime-type-checking -@@ -0,0 +1,21 @@ -+//go:build !no_runtime_type_checking -+ -+package cdk22369 -+ -+import ( -+ "fmt" -+ -+ _jsii_ "github.com/aws/jsii-runtime-go/runtime" -+) -+ -+func validateNewAcceptsPathParameters(props *AcceptsPathProps) 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/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,18 @@ -+//go: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,32 @@ -+//go: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,10 @@ -+//go: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,16 @@ -+//go: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,10 @@ -+//go: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,16 @@ -+//go: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/homonymousforwardreferences/bar/bar_Consumer.go.diff 1`] = ` ---- go/jsiicalc/homonymousforwardreferences/bar/bar_Consumer.go --no-runtime-type-checking -+++ go/jsiicalc/homonymousforwardreferences/bar/bar_Consumer.go --runtime-type-checking -@@ -14,10 +14,13 @@ - } - - func Consumer_Consume(props *ConsumerProps) *Homonymous { - _init_.Initialize() - -+ if err := validateConsumer_ConsumeParameters(props); err != nil { -+ panic(err) -+ } - var returns *Homonymous - - _jsii_.StaticInvoke( - "jsii-calc.homonymousForwardReferences.bar.Consumer", - "consume", -`; +func (r *jsiiProxy_Resolvable) Resolve() interface{} { + var returns interface{} -exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/bar/bar_Consumer__no_runtime_type_checking.go.diff 1`] = ` ---- go/jsiicalc/homonymousforwardreferences/bar/bar_Consumer__no_runtime_type_checking.go --no-runtime-type-checking -+++ go/jsiicalc/homonymousforwardreferences/bar/bar_Consumer__no_runtime_type_checking.go --runtime-type-checking -@@ -0,0 +1,10 @@ -+//go:build no_runtime_type_checking -+ -+package bar -+ -+// Building without runtime type checking enabled, so all the below just return nil -+ -+func validateConsumer_ConsumeParameters(props *ConsumerProps) error { -+ return nil -+} -+ -`; + _jsii_.Invoke( + r, + "resolve", + nil, // no parameters + &returns, + ) -exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/bar/bar_Consumer__runtime_type_checks.go.diff 1`] = ` ---- go/jsiicalc/homonymousforwardreferences/bar/bar_Consumer__runtime_type_checks.go --no-runtime-type-checking -+++ go/jsiicalc/homonymousforwardreferences/bar/bar_Consumer__runtime_type_checks.go --runtime-type-checking -@@ -0,0 +1,21 @@ -+//go:build !no_runtime_type_checking -+ -+package bar -+ -+import ( -+ "fmt" -+ -+ _jsii_ "github.com/aws/jsii-runtime-go/runtime" -+) -+ -+func validateConsumer_ConsumeParameters(props *ConsumerProps) 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 -+} -+ -`; + return returns +} -exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/foo/foo_Consumer.go.diff 1`] = ` ---- go/jsiicalc/homonymousforwardreferences/foo/foo_Consumer.go --no-runtime-type-checking -+++ go/jsiicalc/homonymousforwardreferences/foo/foo_Consumer.go --runtime-type-checking -@@ -14,10 +14,13 @@ - } - - func Consumer_Consume(props *ConsumerProps) *Homonymous { - _init_.Initialize() - -+ if err := validateConsumer_ConsumeParameters(props); err != nil { -+ panic(err) -+ } - var returns *Homonymous - - _jsii_.StaticInvoke( - "jsii-calc.homonymousForwardReferences.foo.Consumer", - "consume", -`; -exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/foo/foo_Consumer__no_runtime_type_checking.go.diff 1`] = ` ---- go/jsiicalc/homonymousforwardreferences/foo/foo_Consumer__no_runtime_type_checking.go --no-runtime-type-checking -+++ go/jsiicalc/homonymousforwardreferences/foo/foo_Consumer__no_runtime_type_checking.go --runtime-type-checking -@@ -0,0 +1,10 @@ -+//go:build no_runtime_type_checking -+ -+package foo -+ -+// Building without runtime type checking enabled, so all the below just return nil -+ -+func validateConsumer_ConsumeParameters(props *ConsumerProps) error { -+ return nil -+} -+ `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/foo/foo_Consumer__runtime_type_checks.go.diff 1`] = ` ---- go/jsiicalc/homonymousforwardreferences/foo/foo_Consumer__runtime_type_checks.go --no-runtime-type-checking -+++ go/jsiicalc/homonymousforwardreferences/foo/foo_Consumer__runtime_type_checks.go --runtime-type-checking -@@ -0,0 +1,21 @@ -+//go:build !no_runtime_type_checking -+ -+package foo -+ -+import ( -+ "fmt" -+ -+ _jsii_ "github.com/aws/jsii-runtime-go/runtime" -+) -+ -+func validateConsumer_ConsumeParameters(props *ConsumerProps) 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/union/main.go 1`] = ` +package union -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", -`; +import ( + "reflect" + + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +func init() { + _jsii_.RegisterClass( + "jsii-calc.union.ConsumesUnion", + reflect.TypeOf((*ConsumesUnion)(nil)).Elem(), + nil, // no members + func() interface{} { + return &jsiiProxy_ConsumesUnion{} + }, + ) + _jsii_.RegisterInterface( + "jsii-calc.union.IResolvable", + reflect.TypeOf((*IResolvable)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "resolve", GoMethod: "Resolve"}, + }, + func() interface{} { + return &jsiiProxy_IResolvable{} + }, + ) + _jsii_.RegisterClass( + "jsii-calc.union.Resolvable", + reflect.TypeOf((*Resolvable)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "resolve", GoMethod: "Resolve"}, + }, + func() interface{} { + j := jsiiProxy_Resolvable{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_IResolvable) + return &j + }, + ) +} -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,14 @@ -+//go: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,29 @@ -+//go: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/version 1`] = ` +3.20.120 + `; -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 +exports[`Generated code for "jsii-calc": / 1`] = ` + + ┗━ 📁 go + ┗━ 📁 jsiicalc + ┣━ 🆕 AbstractClass__checks.go + ┣━ 🆕 AbstractClass__no_checks.go + ┣━ 📄 AbstractClass.go.diff + ┣━ 🆕 AbstractSuite__checks.go + ┣━ 🆕 AbstractSuite__no_checks.go + ┣━ 📄 AbstractSuite.go.diff + ┣━ 🆕 Add__checks.go + ┣━ 🆕 Add__no_checks.go + ┣━ 📄 Add.go.diff + ┣━ 🆕 AllowedMethodNames__checks.go + ┣━ 🆕 AllowedMethodNames__no_checks.go + ┣━ 📄 AllowedMethodNames.go.diff + ┣━ 🆕 AllTypes__checks.go + ┣━ 🆕 AllTypes__no_checks.go + ┣━ 📄 AllTypes.go.diff + ┣━ 🆕 AmbiguousParameters__checks.go + ┣━ 🆕 AmbiguousParameters__no_checks.go + ┣━ 📄 AmbiguousParameters.go.diff + ┣━ 📁 anonymous + ┃ ┣━ 🆕 UseOptions__checks.go + ┃ ┣━ 🆕 UseOptions__no_checks.go + ┃ ┗━ 📄 UseOptions.go.diff + ┣━ 🆕 AsyncVirtualMethods__checks.go + ┣━ 🆕 AsyncVirtualMethods__no_checks.go + ┣━ 📄 AsyncVirtualMethods.go.diff + ┣━ 🆕 Bell__checks.go + ┣━ 🆕 Bell__no_checks.go + ┣━ 📄 Bell.go.diff + ┣━ 🆕 BinaryOperation__checks.go + ┣━ 🆕 BinaryOperation__no_checks.go + ┣━ 🆕 BurriedAnonymousObject__checks.go + ┣━ 🆕 BurriedAnonymousObject__no_checks.go + ┣━ 📄 BurriedAnonymousObject.go.diff + ┣━ 🆕 Calculator__checks.go + ┣━ 🆕 Calculator__no_checks.go + ┣━ 📄 Calculator.go.diff + ┣━ 📁 cdk16625 + ┃ ┣━ 🆕 Cdk16625__checks.go + ┃ ┣━ 🆕 Cdk16625__no_checks.go + ┃ ┣━ 📄 Cdk16625.go.diff + ┃ ┗━ 📁 donotimport + ┃ ┣━ 🆕 UnimportedSubmoduleType__checks.go + ┃ ┣━ 🆕 UnimportedSubmoduleType__no_checks.go + ┃ ┗━ 📄 UnimportedSubmoduleType.go.diff + ┣━ 📁 cdk22369 + ┃ ┣━ 🆕 AcceptsPath__checks.go + ┃ ┣━ 🆕 AcceptsPath__no_checks.go + ┃ ┗━ 📄 AcceptsPath.go.diff + ┣━ 🆕 ClassThatImplementsTheInternalInterface__checks.go + ┣━ 🆕 ClassThatImplementsTheInternalInterface__no_checks.go + ┣━ 📄 ClassThatImplementsTheInternalInterface.go.diff + ┣━ 🆕 ClassThatImplementsThePrivateInterface__checks.go + ┣━ 🆕 ClassThatImplementsThePrivateInterface__no_checks.go + ┣━ 📄 ClassThatImplementsThePrivateInterface.go.diff + ┣━ 🆕 ClassWithCollectionOfUnions__checks.go + ┣━ 🆕 ClassWithCollectionOfUnions__no_checks.go + ┣━ 📄 ClassWithCollectionOfUnions.go.diff + ┣━ 🆕 ClassWithCollections__checks.go + ┣━ 🆕 ClassWithCollections__no_checks.go + ┣━ 📄 ClassWithCollections.go.diff + ┣━ 🆕 ClassWithContainerTypes__checks.go + ┣━ 🆕 ClassWithContainerTypes__no_checks.go + ┣━ 📄 ClassWithContainerTypes.go.diff + ┣━ 🆕 ClassWithJavaReservedWords__checks.go + ┣━ 🆕 ClassWithJavaReservedWords__no_checks.go + ┣━ 📄 ClassWithJavaReservedWords.go.diff + ┣━ 🆕 ClassWithMutableObjectLiteralProperty__checks.go + ┣━ 🆕 ClassWithMutableObjectLiteralProperty__no_checks.go + ┣━ 📄 ClassWithMutableObjectLiteralProperty.go.diff + ┣━ 🆕 ClassWithNestedUnion__checks.go + ┣━ 🆕 ClassWithNestedUnion__no_checks.go + ┣━ 📄 ClassWithNestedUnion.go.diff + ┣━ 🆕 ClassWithPrivateConstructorAndAutomaticProperties__checks.go + ┣━ 🆕 ClassWithPrivateConstructorAndAutomaticProperties__no_checks.go + ┣━ 📄 ClassWithPrivateConstructorAndAutomaticProperties.go.diff + ┣━ 📁 composition + ┃ ┣━ 🆕 CompositeOperation__checks.go + ┃ ┣━ 🆕 CompositeOperation__no_checks.go + ┃ ┗━ 📄 CompositeOperation.go.diff + ┣━ 🆕 ConfusingToJackson__checks.go + ┣━ 🆕 ConfusingToJackson__no_checks.go + ┣━ 📄 ConfusingToJackson.go.diff + ┣━ 🆕 ConstructorPassesThisOut__checks.go + ┣━ 🆕 ConstructorPassesThisOut__no_checks.go + ┣━ 📄 ConstructorPassesThisOut.go.diff + ┣━ 🆕 ConsumePureInterface__checks.go + ┣━ 🆕 ConsumePureInterface__no_checks.go + ┣━ 📄 ConsumePureInterface.go.diff + ┣━ 🆕 ConsumerCanRingBell__checks.go + ┣━ 🆕 ConsumerCanRingBell__no_checks.go + ┣━ 📄 ConsumerCanRingBell.go.diff + ┣━ 🆕 ConsumersOfThisCrazyTypeSystem__checks.go + ┣━ 🆕 ConsumersOfThisCrazyTypeSystem__no_checks.go + ┣━ 📄 ConsumersOfThisCrazyTypeSystem.go.diff + ┣━ 🆕 DataRenderer__checks.go + ┣━ 🆕 DataRenderer__no_checks.go + ┣━ 📄 DataRenderer.go.diff + ┣━ 🆕 DeprecatedClass__checks.go + ┣━ 🆕 DeprecatedClass__no_checks.go + ┣━ 📄 DeprecatedClass.go.diff + ┣━ 📁 derivedclasshasnoproperties + ┃ ┣━ 🆕 Base__checks.go + ┃ ┣━ 🆕 Base__no_checks.go + ┃ ┣━ 📄 Base.go.diff + ┃ ┣━ 🆕 Derived__checks.go + ┃ ┣━ 🆕 Derived__no_checks.go + ┃ ┗━ 📄 Derived.go.diff + ┣━ 🆕 DocumentedClass__checks.go + ┣━ 🆕 DocumentedClass__no_checks.go + ┣━ 📄 DocumentedClass.go.diff + ┣━ 🆕 DoNotOverridePrivates__checks.go + ┣━ 🆕 DoNotOverridePrivates__no_checks.go + ┣━ 📄 DoNotOverridePrivates.go.diff + ┣━ 🆕 DoNotRecognizeAnyAsOptional__checks.go + ┣━ 🆕 DoNotRecognizeAnyAsOptional__no_checks.go + ┣━ 📄 DoNotRecognizeAnyAsOptional.go.diff + ┣━ 🆕 DynamicPropertyBearer__checks.go + ┣━ 🆕 DynamicPropertyBearer__no_checks.go + ┣━ 📄 DynamicPropertyBearer.go.diff + ┣━ 🆕 DynamicPropertyBearerChild__checks.go + ┣━ 🆕 DynamicPropertyBearerChild__no_checks.go + ┣━ 📄 DynamicPropertyBearerChild.go.diff + ┣━ 🆕 Entropy__checks.go + ┣━ 🆕 Entropy__no_checks.go + ┣━ 📄 Entropy.go.diff + ┣━ 🆕 EraseUndefinedHashValues__checks.go + ┣━ 🆕 EraseUndefinedHashValues__no_checks.go + ┣━ 📄 EraseUndefinedHashValues.go.diff + ┣━ 🆕 ExperimentalClass__checks.go + ┣━ 🆕 ExperimentalClass__no_checks.go + ┣━ 📄 ExperimentalClass.go.diff + ┣━ 🆕 ExportedBaseClass__checks.go + ┣━ 🆕 ExportedBaseClass__no_checks.go + ┣━ 📄 ExportedBaseClass.go.diff + ┣━ 🆕 ExternalClass__checks.go + ┣━ 🆕 ExternalClass__no_checks.go + ┣━ 📄 ExternalClass.go.diff + ┣━ 🆕 GiveMeStructs__checks.go + ┣━ 🆕 GiveMeStructs__no_checks.go + ┣━ 📄 GiveMeStructs.go.diff + ┣━ 🆕 GreetingAugmenter__checks.go + ┣━ 🆕 GreetingAugmenter__no_checks.go + ┣━ 📄 GreetingAugmenter.go.diff + ┣━ 📁 homonymousforwardreferences + ┃ ┣━ 📁 bar + ┃ ┃ ┣━ 🆕 Consumer__checks.go + ┃ ┃ ┣━ 🆕 Consumer__no_checks.go + ┃ ┃ ┗━ 📄 Consumer.go.diff + ┃ ┗━ 📁 foo + ┃ ┣━ 🆕 Consumer__checks.go + ┃ ┣━ 🆕 Consumer__no_checks.go + ┃ ┗━ 📄 Consumer.go.diff + ┣━ 🆕 IAnotherPublicInterface__checks.go + ┣━ 🆕 IAnotherPublicInterface__no_checks.go + ┣━ 📄 IAnotherPublicInterface.go.diff + ┣━ 🆕 IBellRinger__checks.go + ┣━ 🆕 IBellRinger__no_checks.go + ┣━ 📄 IBellRinger.go.diff + ┣━ 🆕 IConcreteBellRinger__checks.go + ┣━ 🆕 IConcreteBellRinger__no_checks.go + ┣━ 📄 IConcreteBellRinger.go.diff + ┣━ 🆕 IExtendsPrivateInterface__checks.go + ┣━ 🆕 IExtendsPrivateInterface__no_checks.go + ┣━ 📄 IExtendsPrivateInterface.go.diff + ┣━ 🆕 IInterfaceWithOptionalMethodArguments__checks.go + ┣━ 🆕 IInterfaceWithOptionalMethodArguments__no_checks.go + ┣━ 📄 IInterfaceWithOptionalMethodArguments.go.diff + ┣━ 🆕 IInterfaceWithProperties__checks.go + ┣━ 🆕 IInterfaceWithProperties__no_checks.go + ┣━ 📄 IInterfaceWithProperties.go.diff + ┣━ 🆕 IInterfaceWithPropertiesExtension__checks.go + ┣━ 🆕 IInterfaceWithPropertiesExtension__no_checks.go + ┣━ 📄 IInterfaceWithPropertiesExtension.go.diff + ┣━ 🆕 ImplementInternalInterface__checks.go + ┣━ 🆕 ImplementInternalInterface__no_checks.go + ┣━ 📄 ImplementInternalInterface.go.diff + ┣━ 🆕 ImplementsPrivateInterface__checks.go + ┣━ 🆕 ImplementsPrivateInterface__no_checks.go + ┣━ 📄 ImplementsPrivateInterface.go.diff + ┣━ 🆕 IMutableObjectLiteral__checks.go + ┣━ 🆕 IMutableObjectLiteral__no_checks.go + ┣━ 📄 IMutableObjectLiteral.go.diff + ┣━ 🆕 INonInternalInterface__checks.go + ┣━ 🆕 INonInternalInterface__no_checks.go + ┣━ 📄 INonInternalInterface.go.diff + ┣━ 🆕 InterfacesMaker__checks.go + ┣━ 🆕 InterfacesMaker__no_checks.go + ┣━ 📄 InterfacesMaker.go.diff + ┣━ 🆕 IObjectWithProperty__checks.go + ┣━ 🆕 IObjectWithProperty__no_checks.go + ┣━ 📄 IObjectWithProperty.go.diff + ┣━ 🆕 JavaReservedWords__checks.go + ┣━ 🆕 JavaReservedWords__no_checks.go + ┣━ 📄 JavaReservedWords.go.diff + ┣━ 📁 jsii3656 + ┃ ┣━ 🆕 OverrideMe__checks.go + ┃ ┣━ 🆕 OverrideMe__no_checks.go + ┃ ┗━ 📄 OverrideMe.go.diff + ┣━ 🆕 JSII417Derived__checks.go + ┣━ 🆕 JSII417Derived__no_checks.go + ┣━ 📄 JSII417Derived.go.diff + ┣━ 🆕 JSObjectLiteralToNativeClass__checks.go + ┣━ 🆕 JSObjectLiteralToNativeClass__no_checks.go + ┣━ 📄 JSObjectLiteralToNativeClass.go.diff + ┣━ 🆕 LevelOne__checks.go + ┣━ 🆕 LevelOne__no_checks.go + ┣━ 📄 LevelOne.go.diff + ┣━ 📁 module2530 + ┃ ┣━ 🆕 MyClass__checks.go + ┃ ┣━ 🆕 MyClass__no_checks.go + ┃ ┗━ 📄 MyClass.go.diff + ┣━ 📁 module2647 + ┃ ┣━ 🆕 ExtendAndImplement__checks.go + ┃ ┣━ 🆕 ExtendAndImplement__no_checks.go + ┃ ┗━ 📄 ExtendAndImplement.go.diff + ┣━ 📁 module2689 + ┃ ┗━ 📁 methods + ┃ ┣━ 🆕 MyClass__checks.go + ┃ ┣━ 🆕 MyClass__no_checks.go + ┃ ┗━ 📄 MyClass.go.diff + ┣━ 🆕 Multiply__checks.go + ┣━ 🆕 Multiply__no_checks.go + ┣━ 📄 Multiply.go.diff + ┣━ 🆕 Negate__checks.go + ┣━ 🆕 Negate__no_checks.go + ┣━ 📄 Negate.go.diff + ┣━ 🆕 NullShouldBeTreatedAsUndefined__checks.go + ┣━ 🆕 NullShouldBeTreatedAsUndefined__no_checks.go + ┣━ 📄 NullShouldBeTreatedAsUndefined.go.diff + ┣━ 🆕 NumberGenerator__checks.go + ┣━ 🆕 NumberGenerator__no_checks.go + ┣━ 📄 NumberGenerator.go.diff + ┣━ 🆕 ObjectRefsInCollections__checks.go + ┣━ 🆕 ObjectRefsInCollections__no_checks.go + ┣━ 📄 ObjectRefsInCollections.go.diff + ┣━ 🆕 OptionalArgumentInvoker__checks.go + ┣━ 🆕 OptionalArgumentInvoker__no_checks.go + ┣━ 📄 OptionalArgumentInvoker.go.diff + ┣━ 🆕 OptionalConstructorArgument__checks.go + ┣━ 🆕 OptionalConstructorArgument__no_checks.go + ┣━ 📄 OptionalConstructorArgument.go.diff + ┣━ 🆕 OptionalStructConsumer__checks.go + ┣━ 🆕 OptionalStructConsumer__no_checks.go + ┣━ 📄 OptionalStructConsumer.go.diff + ┣━ 🆕 OverridableProtectedMember__checks.go + ┣━ 🆕 OverridableProtectedMember__no_checks.go + ┣━ 📄 OverridableProtectedMember.go.diff + ┣━ 🆕 OverrideReturnsObject__checks.go + ┣━ 🆕 OverrideReturnsObject__no_checks.go + ┣━ 📄 OverrideReturnsObject.go.diff + ┣━ 🆕 ParamShadowsBuiltins__checks.go + ┣━ 🆕 ParamShadowsBuiltins__no_checks.go + ┣━ 📄 ParamShadowsBuiltins.go.diff + ┣━ 🆕 ParamShadowsScope__checks.go + ┣━ 🆕 ParamShadowsScope__no_checks.go + ┣━ 📄 ParamShadowsScope.go.diff + ┣━ 🆕 PartiallyInitializedThisConsumer__checks.go + ┣━ 🆕 PartiallyInitializedThisConsumer__no_checks.go + ┣━ 📄 PartiallyInitializedThisConsumer.go.diff + ┣━ 🆕 Polymorphism__checks.go + ┣━ 🆕 Polymorphism__no_checks.go + ┣━ 📄 Polymorphism.go.diff + ┣━ 🆕 Power__checks.go + ┣━ 🆕 Power__no_checks.go + ┣━ 📄 Power.go.diff + ┣━ 📁 pythonself + ┃ ┣━ 🆕 ClassWithSelf__checks.go + ┃ ┣━ 🆕 ClassWithSelf__no_checks.go + ┃ ┣━ 📄 ClassWithSelf.go.diff + ┃ ┣━ 🆕 ClassWithSelfKwarg__checks.go + ┃ ┣━ 🆕 ClassWithSelfKwarg__no_checks.go + ┃ ┣━ 📄 ClassWithSelfKwarg.go.diff + ┃ ┣━ 🆕 IInterfaceWithSelf__checks.go + ┃ ┣━ 🆕 IInterfaceWithSelf__no_checks.go + ┃ ┗━ 📄 IInterfaceWithSelf.go.diff + ┣━ 🆕 ReferenceEnumFromScopedPackage__checks.go + ┣━ 🆕 ReferenceEnumFromScopedPackage__no_checks.go + ┣━ 📄 ReferenceEnumFromScopedPackage.go.diff + ┣━ 🆕 RootStructValidator__checks.go + ┣━ 🆕 RootStructValidator__no_checks.go + ┣━ 📄 RootStructValidator.go.diff + ┣━ 🆕 RuntimeTypeChecking__checks.go + ┣━ 🆕 RuntimeTypeChecking__no_checks.go + ┣━ 📄 RuntimeTypeChecking.go.diff + ┣━ 🆕 SingletonInt__checks.go + ┣━ 🆕 SingletonInt__no_checks.go + ┣━ 📄 SingletonInt.go.diff + ┣━ 🆕 SingletonString__checks.go + ┣━ 🆕 SingletonString__no_checks.go + ┣━ 📄 SingletonString.go.diff + ┣━ 🆕 StableClass__checks.go + ┣━ 🆕 StableClass__no_checks.go + ┣━ 📄 StableClass.go.diff + ┣━ 🆕 StaticContext__checks.go + ┣━ 🆕 StaticContext__no_checks.go + ┣━ 📄 StaticContext.go.diff + ┣━ 🆕 Statics__checks.go + ┣━ 🆕 Statics__no_checks.go + ┣━ 📄 Statics.go.diff + ┣━ 🆕 StripInternal__checks.go + ┣━ 🆕 StripInternal__no_checks.go + ┣━ 📄 StripInternal.go.diff + ┣━ 🆕 StructPassing__checks.go + ┣━ 🆕 StructPassing__no_checks.go + ┣━ 📄 StructPassing.go.diff + ┣━ 🆕 StructUnionConsumer__checks.go + ┣━ 🆕 StructUnionConsumer__no_checks.go + ┣━ 📄 StructUnionConsumer.go.diff + ┣━ 📁 submodule + ┃ ┣━ 📁 isolated + ┃ ┃ ┣━ 🆕 Kwargs__checks.go + ┃ ┃ ┣━ 🆕 Kwargs__no_checks.go + ┃ ┃ ┗━ 📄 Kwargs.go.diff + ┃ ┣━ 🆕 MyClass__checks.go + ┃ ┣━ 🆕 MyClass__no_checks.go + ┃ ┗━ 📄 MyClass.go.diff + ┣━ 🆕 Sum__checks.go + ┣━ 🆕 Sum__no_checks.go + ┣━ 📄 Sum.go.diff + ┣━ 🆕 SupportsNiceJavaBuilder__checks.go + ┣━ 🆕 SupportsNiceJavaBuilder__no_checks.go + ┣━ 📄 SupportsNiceJavaBuilder.go.diff + ┣━ 🆕 SupportsNiceJavaBuilderWithRequiredProps__checks.go + ┣━ 🆕 SupportsNiceJavaBuilderWithRequiredProps__no_checks.go + ┣━ 📄 SupportsNiceJavaBuilderWithRequiredProps.go.diff + ┣━ 🆕 SyncVirtualMethods__checks.go + ┣━ 🆕 SyncVirtualMethods__no_checks.go + ┣━ 📄 SyncVirtualMethods.go.diff + ┣━ 🆕 TestStructWithEnum__checks.go + ┣━ 🆕 TestStructWithEnum__no_checks.go + ┣━ 📄 TestStructWithEnum.go.diff + ┣━ 🆕 UnaryOperation__checks.go + ┣━ 🆕 UnaryOperation__no_checks.go + ┣━ 📁 union + ┃ ┣━ 🆕 ConsumesUnion__checks.go + ┃ ┣━ 🆕 ConsumesUnion__no_checks.go + ┃ ┗━ 📄 ConsumesUnion.go.diff + ┣━ 🆕 UpcasingReflectable__checks.go + ┣━ 🆕 UpcasingReflectable__no_checks.go + ┣━ 📄 UpcasingReflectable.go.diff + ┣━ 🆕 UsesInterfaceWithProperties__checks.go + ┣━ 🆕 UsesInterfaceWithProperties__no_checks.go + ┣━ 📄 UsesInterfaceWithProperties.go.diff + ┣━ 🆕 VariadicInvoker__checks.go + ┣━ 🆕 VariadicInvoker__no_checks.go + ┣━ 📄 VariadicInvoker.go.diff + ┣━ 🆕 VariadicMethod__checks.go + ┣━ 🆕 VariadicMethod__no_checks.go + ┣━ 📄 VariadicMethod.go.diff + ┣━ 🆕 VariadicTypeUnion__checks.go + ┣━ 🆕 VariadicTypeUnion__no_checks.go + ┣━ 📄 VariadicTypeUnion.go.diff + ┣━ 🆕 VirtualMethodPlayground__checks.go + ┣━ 🆕 VirtualMethodPlayground__no_checks.go + ┗━ 📄 VirtualMethodPlayground.go.diff +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/AbstractClass.go.diff 1`] = ` +--- go/jsiicalc/AbstractClass.go --no-runtime-type-checking ++++ go/jsiicalc/AbstractClass.go --runtime-type-checking @@ -51,10 +51,13 @@ a, ) @@ -26010,49 +25282,49 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j "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,11 @@ -+//go:build no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/AbstractClass__checks.go.diff 1`] = ` +--- go/jsiicalc/AbstractClass__checks.go --no-runtime-type-checking ++++ go/jsiicalc/AbstractClass__checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ ++//go: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 ++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_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,17 @@ -+//go:build !no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/AbstractClass__no_checks.go.diff 1`] = ` +--- go/jsiicalc/AbstractClass__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/AbstractClass__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go:build no_runtime_type_checking + +// A simple calcuator built on JSII. +package jsiicalc + -+import ( -+ "fmt" -+) ++// Building without runtime type checking enabled, so all the below just return nil + +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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/AbstractSuite.go.diff 1`] = ` +--- go/jsiicalc/AbstractSuite.go --no-runtime-type-checking ++++ go/jsiicalc/AbstractSuite.go --runtime-type-checking @@ -40,18 +40,24 @@ a, ) @@ -26094,73 +25366,73 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j "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,19 @@ -+//go:build no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/AbstractSuite__checks.go.diff 1`] = ` +--- go/jsiicalc/AbstractSuite__checks.go --no-runtime-type-checking ++++ go/jsiicalc/AbstractSuite__checks.go --runtime-type-checking +@@ -0,0 +1,33 @@ ++//go: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 ++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_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,33 @@ -+//go:build !no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/AbstractSuite__no_checks.go.diff 1`] = ` +--- go/jsiicalc/AbstractSuite__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/AbstractSuite__no_checks.go --runtime-type-checking +@@ -0,0 +1,19 @@ ++//go:build no_runtime_type_checking + +// A simple calcuator built on JSII. +package jsiicalc + -+import ( -+ "fmt" -+) ++// Building without runtime type checking enabled, so all the below just return nil + +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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/Add.go.diff 1`] = ` +--- go/jsiicalc/Add.go --no-runtime-type-checking ++++ go/jsiicalc/Add.go --runtime-type-checking @@ -63,10 +63,13 @@ // Creates a BinaryOperation. @@ -26177,26 +25449,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j []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,11 @@ -+//go: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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/Add__checks.go.diff 1`] = ` +--- go/jsiicalc/Add__checks.go --no-runtime-type-checking ++++ go/jsiicalc/Add__checks.go --runtime-type-checking @@ -0,0 +1,23 @@ +//go:build !no_runtime_type_checking + @@ -26223,9 +25478,26 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/Add__no_checks.go.diff 1`] = ` +--- go/jsiicalc/Add__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/Add__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go: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/AllTypes.go.diff 1`] = ` +--- go/jsiicalc/AllTypes.go --no-runtime-type-checking ++++ go/jsiicalc/AllTypes.go --runtime-type-checking @@ -276,82 +276,112 @@ a, ) @@ -26446,98 +25718,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j "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,83 @@ -+//go: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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/AllTypes__checks.go.diff 1`] = ` +--- go/jsiicalc/AllTypes__checks.go --no-runtime-type-checking ++++ go/jsiicalc/AllTypes__checks.go --runtime-type-checking @@ -0,0 +1,336 @@ +//go:build !no_runtime_type_checking + @@ -26877,9 +26060,98 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/AllTypes__no_checks.go.diff 1`] = ` +--- go/jsiicalc/AllTypes__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/AllTypes__no_checks.go --runtime-type-checking +@@ -0,0 +1,83 @@ ++//go: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/AllowedMethodNames.go.diff 1`] = ` +--- go/jsiicalc/AllowedMethodNames.go --no-runtime-type-checking ++++ go/jsiicalc/AllowedMethodNames.go --runtime-type-checking @@ -43,18 +43,24 @@ a, ) @@ -26932,38 +26204,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j ) `; -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,23 @@ -+//go: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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/AllowedMethodNames__checks.go.diff 1`] = ` +--- go/jsiicalc/AllowedMethodNames__checks.go --no-runtime-type-checking ++++ go/jsiicalc/AllowedMethodNames__checks.go --runtime-type-checking @@ -0,0 +1,57 @@ +//go:build !no_runtime_type_checking + @@ -27024,9 +26267,38 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/AllowedMethodNames__no_checks.go.diff 1`] = ` +--- go/jsiicalc/AllowedMethodNames__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/AllowedMethodNames__no_checks.go --runtime-type-checking +@@ -0,0 +1,23 @@ ++//go: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/AmbiguousParameters.go.diff 1`] = ` +--- go/jsiicalc/AmbiguousParameters.go --no-runtime-type-checking ++++ go/jsiicalc/AmbiguousParameters.go --runtime-type-checking @@ -38,10 +38,13 @@ @@ -27043,26 +26315,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j []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,11 @@ -+//go: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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/AmbiguousParameters__checks.go.diff 1`] = ` +--- go/jsiicalc/AmbiguousParameters__checks.go --no-runtime-type-checking ++++ go/jsiicalc/AmbiguousParameters__checks.go --runtime-type-checking @@ -0,0 +1,26 @@ +//go:build !no_runtime_type_checking + @@ -27092,9 +26347,26 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/AmbiguousParameters__no_checks.go.diff 1`] = ` +--- go/jsiicalc/AmbiguousParameters__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/AmbiguousParameters__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go: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/AsyncVirtualMethods.go.diff 1`] = ` +--- go/jsiicalc/AsyncVirtualMethods.go --no-runtime-type-checking ++++ go/jsiicalc/AsyncVirtualMethods.go --runtime-type-checking @@ -101,10 +101,13 @@ return returns @@ -27111,49 +26383,49 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j "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,11 @@ -+//go:build no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/AsyncVirtualMethods__checks.go.diff 1`] = ` +--- go/jsiicalc/AsyncVirtualMethods__checks.go --no-runtime-type-checking ++++ go/jsiicalc/AsyncVirtualMethods__checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ ++//go: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 ++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_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,17 @@ -+//go:build !no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/AsyncVirtualMethods__no_checks.go.diff 1`] = ` +--- go/jsiicalc/AsyncVirtualMethods__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/AsyncVirtualMethods__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go:build no_runtime_type_checking + +// A simple calcuator built on JSII. +package jsiicalc + -+import ( -+ "fmt" -+) ++// Building without runtime type checking enabled, so all the below just return nil + +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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/Bell.go.diff 1`] = ` +--- go/jsiicalc/Bell.go --no-runtime-type-checking ++++ go/jsiicalc/Bell.go --runtime-type-checking @@ -52,10 +52,13 @@ b, ) @@ -27170,26 +26442,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j ) `; -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,11 @@ -+//go: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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/Bell__checks.go.diff 1`] = ` +--- go/jsiicalc/Bell__checks.go --no-runtime-type-checking ++++ go/jsiicalc/Bell__checks.go --runtime-type-checking @@ -0,0 +1,17 @@ +//go:build !no_runtime_type_checking + @@ -27210,9 +26465,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/Bell__no_checks.go.diff 1`] = ` +--- go/jsiicalc/Bell__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/Bell__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -27221,15 +26476,15 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func validateNewBinaryOperationParameters(lhs scopejsiicalclib.NumericValue, rhs scopejsiicalclib.NumericValue) error { ++func (j *jsiiProxy_Bell) validateSetRungParameters(val *bool) 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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/BinaryOperation__checks.go.diff 1`] = ` +--- go/jsiicalc/BinaryOperation__checks.go --no-runtime-type-checking ++++ go/jsiicalc/BinaryOperation__checks.go --runtime-type-checking @@ -0,0 +1,23 @@ +//go:build !no_runtime_type_checking + @@ -27256,9 +26511,26 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/BinaryOperation__no_checks.go.diff 1`] = ` +--- go/jsiicalc/BinaryOperation__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/BinaryOperation__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go: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/BurriedAnonymousObject.go.diff 1`] = ` +--- go/jsiicalc/BurriedAnonymousObject.go --no-runtime-type-checking ++++ go/jsiicalc/BurriedAnonymousObject.go --runtime-type-checking @@ -42,10 +42,13 @@ return returns @@ -27275,49 +26547,49 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j "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,11 @@ -+//go:build no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/BurriedAnonymousObject__checks.go.diff 1`] = ` +--- go/jsiicalc/BurriedAnonymousObject__checks.go --no-runtime-type-checking ++++ go/jsiicalc/BurriedAnonymousObject__checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ ++//go: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 ++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_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,17 @@ -+//go:build !no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/BurriedAnonymousObject__no_checks.go.diff 1`] = ` +--- go/jsiicalc/BurriedAnonymousObject__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/BurriedAnonymousObject__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go:build no_runtime_type_checking + +// A simple calcuator built on JSII. +package jsiicalc + -+import ( -+ "fmt" -+) ++// Building without runtime type checking enabled, so all the below just return nil + +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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/Calculator.go.diff 1`] = ` +--- go/jsiicalc/Calculator.go --no-runtime-type-checking ++++ go/jsiicalc/Calculator.go --runtime-type-checking @@ -181,10 +181,13 @@ // Creates a Calculator object. @@ -27431,58 +26703,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j ) `; -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,43 @@ -+//go: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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/Calculator__checks.go.diff 1`] = ` +--- go/jsiicalc/Calculator__checks.go --no-runtime-type-checking ++++ go/jsiicalc/Calculator__checks.go --runtime-type-checking @@ -0,0 +1,95 @@ +//go:build !no_runtime_type_checking + @@ -27581,9 +26804,58 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/Calculator__no_checks.go.diff 1`] = ` +--- go/jsiicalc/Calculator__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/Calculator__no_checks.go --runtime-type-checking +@@ -0,0 +1,43 @@ ++//go: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/ClassThatImplementsTheInternalInterface.go.diff 1`] = ` +--- go/jsiicalc/ClassThatImplementsTheInternalInterface.go --no-runtime-type-checking ++++ go/jsiicalc/ClassThatImplementsTheInternalInterface.go --runtime-type-checking @@ -87,34 +87,46 @@ c, ) @@ -27633,38 +26905,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j ) `; -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,23 @@ -+//go: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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassThatImplementsTheInternalInterface__checks.go.diff 1`] = ` +--- go/jsiicalc/ClassThatImplementsTheInternalInterface__checks.go --no-runtime-type-checking ++++ go/jsiicalc/ClassThatImplementsTheInternalInterface__checks.go --runtime-type-checking @@ -0,0 +1,41 @@ +//go:build !no_runtime_type_checking + @@ -27709,9 +26952,38 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassThatImplementsTheInternalInterface__no_checks.go.diff 1`] = ` +--- go/jsiicalc/ClassThatImplementsTheInternalInterface__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/ClassThatImplementsTheInternalInterface__no_checks.go --runtime-type-checking +@@ -0,0 +1,23 @@ ++//go: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/ClassThatImplementsThePrivateInterface.go.diff 1`] = ` +--- go/jsiicalc/ClassThatImplementsThePrivateInterface.go --no-runtime-type-checking ++++ go/jsiicalc/ClassThatImplementsThePrivateInterface.go --runtime-type-checking @@ -87,34 +87,46 @@ c, ) @@ -27761,85 +27033,85 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j ) `; -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,23 @@ -+//go:build no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassThatImplementsThePrivateInterface__checks.go.diff 1`] = ` +--- go/jsiicalc/ClassThatImplementsThePrivateInterface__checks.go --no-runtime-type-checking ++++ go/jsiicalc/ClassThatImplementsThePrivateInterface__checks.go --runtime-type-checking +@@ -0,0 +1,41 @@ ++//go: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 ++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_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,41 @@ -+//go:build !no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassThatImplementsThePrivateInterface__no_checks.go.diff 1`] = ` +--- go/jsiicalc/ClassThatImplementsThePrivateInterface__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/ClassThatImplementsThePrivateInterface__no_checks.go --runtime-type-checking +@@ -0,0 +1,23 @@ ++//go:build no_runtime_type_checking + +// A simple calcuator built on JSII. +package jsiicalc + -+import ( -+ "fmt" -+) ++// Building without runtime type checking enabled, so all the below just return nil + +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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassWithCollectionOfUnions.go.diff 1`] = ` +--- go/jsiicalc/ClassWithCollectionOfUnions.go --no-runtime-type-checking ++++ go/jsiicalc/ClassWithCollectionOfUnions.go --runtime-type-checking @@ -28,10 +28,13 @@ @@ -27870,30 +27142,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j ) `; -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,15 @@ -+//go: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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassWithCollectionOfUnions__checks.go.diff 1`] = ` +--- go/jsiicalc/ClassWithCollectionOfUnions__checks.go --no-runtime-type-checking ++++ go/jsiicalc/ClassWithCollectionOfUnions__checks.go --runtime-type-checking @@ -0,0 +1,91 @@ +//go:build !no_runtime_type_checking + @@ -27988,9 +27239,30 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassWithCollectionOfUnions__no_checks.go.diff 1`] = ` +--- go/jsiicalc/ClassWithCollectionOfUnions__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/ClassWithCollectionOfUnions__no_checks.go --runtime-type-checking +@@ -0,0 +1,15 @@ ++//go: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/ClassWithCollections.go.diff 1`] = ` +--- go/jsiicalc/ClassWithCollections.go --no-runtime-type-checking ++++ go/jsiicalc/ClassWithCollections.go --runtime-type-checking @@ -40,10 +40,13 @@ @@ -28060,42 +27332,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j ) `; -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,27 @@ -+//go: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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassWithCollections__checks.go.diff 1`] = ` +--- go/jsiicalc/ClassWithCollections__checks.go --no-runtime-type-checking ++++ go/jsiicalc/ClassWithCollections__checks.go --runtime-type-checking @@ -0,0 +1,53 @@ +//go:build !no_runtime_type_checking + @@ -28152,9 +27391,42 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassWithCollections__no_checks.go.diff 1`] = ` +--- go/jsiicalc/ClassWithCollections__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/ClassWithCollections__no_checks.go --runtime-type-checking +@@ -0,0 +1,27 @@ ++//go: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/ClassWithContainerTypes.go.diff 1`] = ` +--- go/jsiicalc/ClassWithContainerTypes.go --no-runtime-type-checking ++++ go/jsiicalc/ClassWithContainerTypes.go --runtime-type-checking @@ -60,10 +60,13 @@ @@ -28171,26 +27443,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j []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,11 @@ -+//go: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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassWithContainerTypes__checks.go.diff 1`] = ` +--- go/jsiicalc/ClassWithContainerTypes__checks.go --no-runtime-type-checking ++++ go/jsiicalc/ClassWithContainerTypes__checks.go --runtime-type-checking @@ -0,0 +1,46 @@ +//go:build !no_runtime_type_checking + @@ -28240,9 +27495,26 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassWithContainerTypes__no_checks.go.diff 1`] = ` +--- go/jsiicalc/ClassWithContainerTypes__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/ClassWithContainerTypes__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go: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/ClassWithJavaReservedWords.go.diff 1`] = ` +--- go/jsiicalc/ClassWithJavaReservedWords.go --no-runtime-type-checking ++++ go/jsiicalc/ClassWithJavaReservedWords.go --runtime-type-checking @@ -28,10 +28,13 @@ @@ -28273,61 +27545,61 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j "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,15 @@ -+//go:build no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassWithJavaReservedWords__checks.go.diff 1`] = ` +--- go/jsiicalc/ClassWithJavaReservedWords__checks.go --no-runtime-type-checking ++++ go/jsiicalc/ClassWithJavaReservedWords__checks.go --runtime-type-checking +@@ -0,0 +1,25 @@ ++//go: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 ++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_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,25 @@ -+//go:build !no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassWithJavaReservedWords__no_checks.go.diff 1`] = ` +--- go/jsiicalc/ClassWithJavaReservedWords__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/ClassWithJavaReservedWords__no_checks.go --runtime-type-checking +@@ -0,0 +1,15 @@ ++//go:build no_runtime_type_checking + +// A simple calcuator built on JSII. +package jsiicalc + -+import ( -+ "fmt" -+) ++// Building without runtime type checking enabled, so all the below just return nil + +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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassWithMutableObjectLiteralProperty.go.diff 1`] = ` +--- go/jsiicalc/ClassWithMutableObjectLiteralProperty.go --no-runtime-type-checking ++++ go/jsiicalc/ClassWithMutableObjectLiteralProperty.go --runtime-type-checking @@ -50,10 +50,13 @@ c, ) @@ -28344,49 +27616,49 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j ) `; -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,11 @@ -+//go:build no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassWithMutableObjectLiteralProperty__checks.go.diff 1`] = ` +--- go/jsiicalc/ClassWithMutableObjectLiteralProperty__checks.go --no-runtime-type-checking ++++ go/jsiicalc/ClassWithMutableObjectLiteralProperty__checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ ++//go: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 ++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_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,17 @@ -+//go:build !no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassWithMutableObjectLiteralProperty__no_checks.go.diff 1`] = ` +--- go/jsiicalc/ClassWithMutableObjectLiteralProperty__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/ClassWithMutableObjectLiteralProperty__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go:build no_runtime_type_checking + +// A simple calcuator built on JSII. +package jsiicalc + -+import ( -+ "fmt" -+) ++// Building without runtime type checking enabled, so all the below just return nil + +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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassWithNestedUnion.go.diff 1`] = ` +--- go/jsiicalc/ClassWithNestedUnion.go --no-runtime-type-checking ++++ go/jsiicalc/ClassWithNestedUnion.go --runtime-type-checking @@ -28,10 +28,13 @@ @@ -28409,38 +27681,17 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j 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,15 @@ -+//go: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 -+} -+ ++ } + _jsii_.Set( + j, + "unionProperty", + val, + ) `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassWithNestedUnion__checks.go.diff 1`] = ` +--- go/jsiicalc/ClassWithNestedUnion__checks.go --no-runtime-type-checking ++++ go/jsiicalc/ClassWithNestedUnion__checks.go --runtime-type-checking @@ -0,0 +1,299 @@ +//go:build !no_runtime_type_checking + @@ -28743,41 +27994,638 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/ClassWithNestedUnion__no_checks.go.diff 1`] = ` +--- go/jsiicalc/ClassWithNestedUnion__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/ClassWithNestedUnion__no_checks.go --runtime-type-checking +@@ -0,0 +1,15 @@ ++//go: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/ClassWithPrivateConstructorAndAutomaticProperties.go.diff 1`] = ` +--- go/jsiicalc/ClassWithPrivateConstructorAndAutomaticProperties.go --no-runtime-type-checking ++++ go/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/ClassWithPrivateConstructorAndAutomaticProperties__checks.go.diff 1`] = ` +--- go/jsiicalc/ClassWithPrivateConstructorAndAutomaticProperties__checks.go --no-runtime-type-checking ++++ go/jsiicalc/ClassWithPrivateConstructorAndAutomaticProperties__checks.go --runtime-type-checking +@@ -0,0 +1,29 @@ ++//go: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/ClassWithPrivateConstructorAndAutomaticProperties__no_checks.go.diff 1`] = ` +--- go/jsiicalc/ClassWithPrivateConstructorAndAutomaticProperties__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/ClassWithPrivateConstructorAndAutomaticProperties__no_checks.go --runtime-type-checking +@@ -0,0 +1,15 @@ ++//go: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/ConfusingToJackson.go.diff 1`] = ` +--- go/jsiicalc/ConfusingToJackson.go --no-runtime-type-checking ++++ go/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/ConfusingToJackson__checks.go.diff 1`] = ` +--- go/jsiicalc/ConfusingToJackson__checks.go --no-runtime-type-checking ++++ go/jsiicalc/ConfusingToJackson__checks.go --runtime-type-checking +@@ -0,0 +1,55 @@ ++//go: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/ConfusingToJackson__no_checks.go.diff 1`] = ` +--- go/jsiicalc/ConfusingToJackson__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/ConfusingToJackson__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go: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/ConstructorPassesThisOut.go.diff 1`] = ` +--- go/jsiicalc/ConstructorPassesThisOut.go --no-runtime-type-checking ++++ go/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/ConstructorPassesThisOut__checks.go.diff 1`] = ` +--- go/jsiicalc/ConstructorPassesThisOut__checks.go --no-runtime-type-checking ++++ go/jsiicalc/ConstructorPassesThisOut__checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ ++//go: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/ConstructorPassesThisOut__no_checks.go.diff 1`] = ` +--- go/jsiicalc/ConstructorPassesThisOut__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/ConstructorPassesThisOut__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go: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/ConsumePureInterface.go.diff 1`] = ` +--- go/jsiicalc/ConsumePureInterface.go --no-runtime-type-checking ++++ go/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/ConsumePureInterface__checks.go.diff 1`] = ` +--- go/jsiicalc/ConsumePureInterface__checks.go --no-runtime-type-checking ++++ go/jsiicalc/ConsumePureInterface__checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ ++//go: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/ConsumePureInterface__no_checks.go.diff 1`] = ` +--- go/jsiicalc/ConsumePureInterface__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/ConsumePureInterface__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go: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/ConsumerCanRingBell.go.diff 1`] = ` +--- go/jsiicalc/ConsumerCanRingBell.go --no-runtime-type-checking ++++ go/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/ConsumerCanRingBell__checks.go.diff 1`] = ` +--- go/jsiicalc/ConsumerCanRingBell__checks.go --no-runtime-type-checking ++++ go/jsiicalc/ConsumerCanRingBell__checks.go --runtime-type-checking +@@ -0,0 +1,73 @@ ++//go: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/ConsumerCanRingBell__no_checks.go.diff 1`] = ` +--- go/jsiicalc/ConsumerCanRingBell__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/ConsumerCanRingBell__no_checks.go --runtime-type-checking +@@ -0,0 +1,39 @@ ++//go: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/ConsumersOfThisCrazyTypeSystem.go.diff 1`] = ` +--- go/jsiicalc/ConsumersOfThisCrazyTypeSystem.go --no-runtime-type-checking ++++ go/jsiicalc/ConsumersOfThisCrazyTypeSystem.go --runtime-type-checking +@@ -39,10 +39,13 @@ + c, + ) } - - func (j *jsiiProxy_ClassWithPrivateConstructorAndAutomaticProperties)SetReadWriteString(val *string) { -+ if err := j.validateSetReadWriteStringParameters(val); err != nil { + func (c *jsiiProxy_ConsumersOfThisCrazyTypeSystem) ConsumeAnotherPublicInterface(obj IAnotherPublicInterface) *string { ++ if err := c.validateConsumeAnotherPublicInterfaceParameters(obj); err != nil { + panic(err) + } - _jsii_.Set( - j, - "readWriteString", - val, - ) - } + var returns *string - func ClassWithPrivateConstructorAndAutomaticProperties_Create(readOnlyString *string, readWriteString *string) ClassWithPrivateConstructorAndAutomaticProperties { - _init_.Initialize() + _jsii_.Invoke( + c, + "consumeAnotherPublicInterface", +@@ -52,10 +55,13 @@ -+ if err := validateClassWithPrivateConstructorAndAutomaticProperties_CreateParameters(readOnlyString, readWriteString); err != nil { + return returns + } + + func (c *jsiiProxy_ConsumersOfThisCrazyTypeSystem) ConsumeNonInternalInterface(obj INonInternalInterface) interface{} { ++ if err := c.validateConsumeNonInternalInterfaceParameters(obj); err != nil { + panic(err) + } - var returns ClassWithPrivateConstructorAndAutomaticProperties + var returns interface{} - _jsii_.StaticInvoke( - "jsii-calc.ClassWithPrivateConstructorAndAutomaticProperties", - "create", + _jsii_.Invoke( + c, + "consumeNonInternalInterface", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ConsumersOfThisCrazyTypeSystem__checks.go.diff 1`] = ` +--- go/jsiicalc/ConsumersOfThisCrazyTypeSystem__checks.go --no-runtime-type-checking ++++ go/jsiicalc/ConsumersOfThisCrazyTypeSystem__checks.go --runtime-type-checking +@@ -0,0 +1,25 @@ ++//go: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_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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/ConsumersOfThisCrazyTypeSystem__no_checks.go.diff 1`] = ` +--- go/jsiicalc/ConsumersOfThisCrazyTypeSystem__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/ConsumersOfThisCrazyTypeSystem__no_checks.go --runtime-type-checking @@ -0,0 +1,15 @@ +//go:build no_runtime_type_checking + @@ -28786,20 +28634,67 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func validateClassWithPrivateConstructorAndAutomaticProperties_CreateParameters(readOnlyString *string, readWriteString *string) error { ++func (c *jsiiProxy_ConsumersOfThisCrazyTypeSystem) validateConsumeAnotherPublicInterfaceParameters(obj IAnotherPublicInterface) error { + return nil +} + -+func (j *jsiiProxy_ClassWithPrivateConstructorAndAutomaticProperties) validateSetReadWriteStringParameters(val *string) error { ++func (c *jsiiProxy_ConsumersOfThisCrazyTypeSystem) validateConsumeNonInternalInterfaceParameters(obj INonInternalInterface) 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,29 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/DataRenderer.go.diff 1`] = ` +--- go/jsiicalc/DataRenderer.go --no-runtime-type-checking ++++ go/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/DataRenderer__checks.go.diff 1`] = ` +--- go/jsiicalc/DataRenderer__checks.go --no-runtime-type-checking ++++ go/jsiicalc/DataRenderer__checks.go --runtime-type-checking +@@ -0,0 +1,37 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -28807,23 +28702,31 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +import ( + "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++ ++ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" +) + -+func validateClassWithPrivateConstructorAndAutomaticProperties_CreateParameters(readOnlyString *string, readWriteString *string) error { -+ if readOnlyString == nil { -+ return fmt.Errorf("parameter readOnlyString is required, but nil was provided") ++func (d *jsiiProxy_DataRenderer) validateRenderParameters(data *scopejsiicalclib.MyFirstStruct) error { ++ if err := _jsii_.ValidateStruct(data, func() string { return "parameter data" }); err != nil { ++ return err + } + -+ if readWriteString == nil { -+ return fmt.Errorf("parameter readWriteString is required, but nil was provided") ++ 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 (j *jsiiProxy_ClassWithPrivateConstructorAndAutomaticProperties) validateSetReadWriteStringParameters(val *string) error { -+ if val == nil { -+ return fmt.Errorf("parameter val is required, but nil was provided") ++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 @@ -28831,29 +28734,10 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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,11 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/DataRenderer__no_checks.go.diff 1`] = ` +--- go/jsiicalc/DataRenderer__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/DataRenderer__no_checks.go --runtime-type-checking +@@ -0,0 +1,19 @@ +//go:build no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -28861,16 +28745,43 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func (j *jsiiProxy_ConfusingToJackson) validateSetUnionPropertyParameters(val interface{}) error { ++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_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,55 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/DeprecatedClass.go.diff 1`] = ` +--- go/jsiicalc/DeprecatedClass.go --no-runtime-type-checking ++++ go/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/DeprecatedClass__checks.go.diff 1`] = ` +--- go/jsiicalc/DeprecatedClass__checks.go --no-runtime-type-checking ++++ go/jsiicalc/DeprecatedClass__checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -28878,49 +28789,11 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +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) -+ } ++func validateNewDeprecatedClassParameters(readonlyString *string) error { ++ if readonlyString == nil { ++ return fmt.Errorf("parameter readonlyString is required, but nil was provided") + } + + return nil @@ -28928,28 +28801,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/DeprecatedClass__no_checks.go.diff 1`] = ` +--- go/jsiicalc/DeprecatedClass__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/DeprecatedClass__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -28958,15 +28812,34 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func validateNewConstructorPassesThisOutParameters(consumer PartiallyInitializedThisConsumer) error { ++func validateNewDeprecatedClassParameters(readonlyString *string) 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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/DoNotOverridePrivates.go.diff 1`] = ` +--- go/jsiicalc/DoNotOverridePrivates.go --no-runtime-type-checking ++++ go/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/DoNotOverridePrivates__checks.go.diff 1`] = ` +--- go/jsiicalc/DoNotOverridePrivates__checks.go --no-runtime-type-checking ++++ go/jsiicalc/DoNotOverridePrivates__checks.go --runtime-type-checking @@ -0,0 +1,17 @@ +//go:build !no_runtime_type_checking + @@ -28977,9 +28850,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "fmt" +) + -+func validateNewConstructorPassesThisOutParameters(consumer PartiallyInitializedThisConsumer) error { -+ if consumer == nil { -+ return fmt.Errorf("parameter consumer is required, but nil was provided") ++func (d *jsiiProxy_DoNotOverridePrivates) validateChangePrivatePropertyValueParameters(newValue *string) error { ++ if newValue == nil { ++ return fmt.Errorf("parameter newValue is required, but nil was provided") + } + + return nil @@ -28987,28 +28860,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/DoNotOverridePrivates__no_checks.go.diff 1`] = ` +--- go/jsiicalc/DoNotOverridePrivates__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/DoNotOverridePrivates__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -29017,15 +28871,34 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func validateNewConsumePureInterfaceParameters(delegate IStructReturningDelegate) error { ++func (d *jsiiProxy_DoNotOverridePrivates) validateChangePrivatePropertyValueParameters(newValue *string) 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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/DoNotRecognizeAnyAsOptional.go.diff 1`] = ` +--- go/jsiicalc/DoNotRecognizeAnyAsOptional.go --no-runtime-type-checking ++++ go/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/DoNotRecognizeAnyAsOptional__checks.go.diff 1`] = ` +--- go/jsiicalc/DoNotRecognizeAnyAsOptional__checks.go --no-runtime-type-checking ++++ go/jsiicalc/DoNotRecognizeAnyAsOptional__checks.go --runtime-type-checking @@ -0,0 +1,17 @@ +//go:build !no_runtime_type_checking + @@ -29036,9 +28909,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "fmt" +) + -+func validateNewConsumePureInterfaceParameters(delegate IStructReturningDelegate) error { -+ if delegate == nil { -+ return fmt.Errorf("parameter delegate is required, but nil was provided") ++func (d *jsiiProxy_DoNotRecognizeAnyAsOptional) validateMethodParameters(_requiredAny interface{}) error { ++ if _requiredAny == nil { ++ return fmt.Errorf("parameter _requiredAny is required, but nil was provided") + } + + return nil @@ -29046,172 +28919,249 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/DoNotRecognizeAnyAsOptional__no_checks.go.diff 1`] = ` +--- go/jsiicalc/DoNotRecognizeAnyAsOptional__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/DoNotRecognizeAnyAsOptional__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go: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/DocumentedClass.go.diff 1`] = ` +--- go/jsiicalc/DocumentedClass.go --no-runtime-type-checking ++++ go/jsiicalc/DocumentedClass.go --runtime-type-checking @@ -62,10 +62,13 @@ - // - // Returns whether the bell was rung. - func ConsumerCanRingBell_StaticImplementedByObjectLiteral(ringer IBellRinger) *bool { - _init_.Initialize() + d, + ) + } -+ if err := validateConsumerCanRingBell_StaticImplementedByObjectLiteralParameters(ringer); err != nil { + func (d *jsiiProxy_DocumentedClass) Greet(greetee *Greetee) *float64 { ++ if err := d.validateGreetParameters(greetee); 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() + var returns *float64 -+ if err := validateConsumerCanRingBell_StaticImplementedByPrivateClassParameters(ringer); err != nil { -+ panic(err) + _jsii_.Invoke( + d, + "greet", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/DocumentedClass__checks.go.diff 1`] = ` +--- go/jsiicalc/DocumentedClass__checks.go --no-runtime-type-checking ++++ go/jsiicalc/DocumentedClass__checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ ++//go: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 + } - 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() ++ ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/DocumentedClass__no_checks.go.diff 1`] = ` +--- go/jsiicalc/DocumentedClass__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/DocumentedClass__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go: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/DynamicPropertyBearer.go.diff 1`] = ` +--- go/jsiicalc/DynamicPropertyBearer.go --no-runtime-type-checking ++++ go/jsiicalc/DynamicPropertyBearer.go --runtime-type-checking +@@ -41,10 +41,13 @@ -+ 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 { + func NewDynamicPropertyBearer(valueStore *string) DynamicPropertyBearer { _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 { ++ if err := validateNewDynamicPropertyBearerParameters(valueStore); err != nil { + panic(err) + } - var returns *bool - - _jsii_.Invoke( - c, - "implementedByPrivateClass", -@@ -155,10 +173,13 @@ + j := jsiiProxy_DynamicPropertyBearer{} - return returns + _jsii_.Create( + "jsii-calc.DynamicPropertyBearer", + []interface{}{valueStore}, +@@ -63,18 +66,24 @@ + d, + ) } - func (c *jsiiProxy_ConsumerCanRingBell) ImplementedByPublicClass(ringer IBellRinger) *bool { -+ if err := c.validateImplementedByPublicClassParameters(ringer); err != nil { + func (j *jsiiProxy_DynamicPropertyBearer)SetDynamicProperty(val *string) { ++ if err := j.validateSetDynamicPropertyParameters(val); err != nil { + panic(err) + } - var returns *bool - - _jsii_.Invoke( - c, - "implementedByPublicClass", -@@ -168,10 +189,13 @@ - - return returns + _jsii_.Set( + j, + "dynamicProperty", + val, + ) } - func (c *jsiiProxy_ConsumerCanRingBell) WhenTypedAsClass(ringer IConcreteBellRinger) *bool { -+ if err := c.validateWhenTypedAsClassParameters(ringer); err != nil { + func (j *jsiiProxy_DynamicPropertyBearer)SetValueStore(val *string) { ++ if err := j.validateSetValueStoreParameters(val); err != nil { + panic(err) + } - var returns *bool - - _jsii_.Invoke( - c, - "whenTypedAsClass", + _jsii_.Set( + j, + "valueStore", + val, + ) `; -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,39 @@ -+//go:build no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/DynamicPropertyBearer__checks.go.diff 1`] = ` +--- go/jsiicalc/DynamicPropertyBearer__checks.go --no-runtime-type-checking ++++ go/jsiicalc/DynamicPropertyBearer__checks.go --runtime-type-checking +@@ -0,0 +1,33 @@ ++//go: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 ++import ( ++ "fmt" ++) ++ ++func (j *jsiiProxy_DynamicPropertyBearer) validateSetDynamicPropertyParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } + -+func (c *jsiiProxy_ConsumerCanRingBell) validateImplementedByObjectLiteralParameters(ringer IBellRinger) error { + return nil +} + -+func (c *jsiiProxy_ConsumerCanRingBell) validateImplementedByPrivateClassParameters(ringer IBellRinger) error { ++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 (c *jsiiProxy_ConsumerCanRingBell) validateImplementedByPublicClassParameters(ringer IBellRinger) error { -+ return nil -+} ++func validateNewDynamicPropertyBearerParameters(valueStore *string) error { ++ if valueStore == nil { ++ return fmt.Errorf("parameter valueStore is required, but nil was provided") ++ } + -+func (c *jsiiProxy_ConsumerCanRingBell) validateWhenTypedAsClassParameters(ringer IConcreteBellRinger) error { + return nil +} + -+func validateConsumerCanRingBell_StaticImplementedByObjectLiteralParameters(ringer IBellRinger) error { -+ return nil -+} +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/DynamicPropertyBearer__no_checks.go.diff 1`] = ` +--- go/jsiicalc/DynamicPropertyBearer__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/DynamicPropertyBearer__no_checks.go --runtime-type-checking +@@ -0,0 +1,19 @@ ++//go:build no_runtime_type_checking + -+func validateConsumerCanRingBell_StaticImplementedByPrivateClassParameters(ringer IBellRinger) error { ++// 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 validateConsumerCanRingBell_StaticImplementedByPublicClassParameters(ringer IBellRinger) error { ++func (j *jsiiProxy_DynamicPropertyBearer) validateSetValueStoreParameters(val *string) error { + return nil +} + -+func validateConsumerCanRingBell_StaticWhenTypedAsClassParameters(ringer IConcreteBellRinger) error { ++func validateNewDynamicPropertyBearerParameters(valueStore *string) 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,73 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/DynamicPropertyBearerChild.go.diff 1`] = ` +--- go/jsiicalc/DynamicPropertyBearerChild.go --no-runtime-type-checking ++++ go/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/DynamicPropertyBearerChild__checks.go.diff 1`] = ` +--- go/jsiicalc/DynamicPropertyBearerChild__checks.go --no-runtime-type-checking ++++ go/jsiicalc/DynamicPropertyBearerChild__checks.go --runtime-type-checking +@@ -0,0 +1,41 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -29221,129 +29171,91 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "fmt" +) + -+func (c *jsiiProxy_ConsumerCanRingBell) validateImplementedByObjectLiteralParameters(ringer IBellRinger) error { -+ if ringer == nil { -+ return fmt.Errorf("parameter ringer is required, but nil was provided") ++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 (c *jsiiProxy_ConsumerCanRingBell) validateImplementedByPrivateClassParameters(ringer IBellRinger) error { -+ if ringer == nil { -+ return fmt.Errorf("parameter ringer is required, but nil was provided") ++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 (c *jsiiProxy_ConsumerCanRingBell) validateImplementedByPublicClassParameters(ringer IBellRinger) error { -+ if ringer == nil { -+ return fmt.Errorf("parameter ringer is required, but nil was provided") ++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 (c *jsiiProxy_ConsumerCanRingBell) validateWhenTypedAsClassParameters(ringer IConcreteBellRinger) error { -+ if ringer == nil { -+ return fmt.Errorf("parameter ringer is required, but nil was provided") ++func validateNewDynamicPropertyBearerChildParameters(originalValue *string) error { ++ if originalValue == nil { ++ return fmt.Errorf("parameter originalValue 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") -+ } +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/DynamicPropertyBearerChild__no_checks.go.diff 1`] = ` +--- go/jsiicalc/DynamicPropertyBearerChild__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/DynamicPropertyBearerChild__no_checks.go --runtime-type-checking +@@ -0,0 +1,23 @@ ++//go:build no_runtime_type_checking + -+ return nil -+} ++// A simple calcuator built on JSII. ++package jsiicalc + -+func validateConsumerCanRingBell_StaticImplementedByPrivateClassParameters(ringer IBellRinger) error { -+ if ringer == nil { -+ return fmt.Errorf("parameter ringer is required, but nil was provided") -+ } ++// Building without runtime type checking enabled, so all the below just return nil + ++func (d *jsiiProxy_DynamicPropertyBearerChild) validateOverrideValueParameters(newValue *string) error { + return nil +} + -+func validateConsumerCanRingBell_StaticImplementedByPublicClassParameters(ringer IBellRinger) error { -+ if ringer == nil { -+ return fmt.Errorf("parameter ringer is required, but nil was provided") -+ } -+ ++func (j *jsiiProxy_DynamicPropertyBearerChild) validateSetDynamicPropertyParameters(val *string) error { + return nil +} + -+func validateConsumerCanRingBell_StaticWhenTypedAsClassParameters(ringer IConcreteBellRinger) error { -+ if ringer == nil { -+ return fmt.Errorf("parameter ringer is required, but nil was provided") -+ } ++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_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 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/Entropy.go.diff 1`] = ` +--- go/jsiicalc/Entropy.go --no-runtime-type-checking ++++ go/jsiicalc/Entropy.go --runtime-type-checking +@@ -46,10 +46,13 @@ return returns } - func (c *jsiiProxy_ConsumersOfThisCrazyTypeSystem) ConsumeNonInternalInterface(obj INonInternalInterface) interface{} { -+ if err := c.validateConsumeNonInternalInterfaceParameters(obj); err != nil { + func (e *jsiiProxy_Entropy) Repeat(word *string) *string { ++ if err := e.validateRepeatParameters(word); err != nil { + panic(err) + } - var returns interface{} + var returns *string _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,15 @@ -+//go: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 -+} -+ + e, + "repeat", `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/Entropy__checks.go.diff 1`] = ` +--- go/jsiicalc/Entropy__checks.go --no-runtime-type-checking ++++ go/jsiicalc/Entropy__checks.go --runtime-type-checking @@ -0,0 +1,25 @@ +//go:build !no_runtime_type_checking + @@ -29354,17 +29266,17 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "fmt" +) + -+func (c *jsiiProxy_ConsumersOfThisCrazyTypeSystem) validateConsumeAnotherPublicInterfaceParameters(obj IAnotherPublicInterface) error { -+ if obj == nil { -+ return fmt.Errorf("parameter obj is required, but nil was provided") ++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 (c *jsiiProxy_ConsumersOfThisCrazyTypeSystem) validateConsumeNonInternalInterfaceParameters(obj INonInternalInterface) error { -+ if obj == nil { -+ return fmt.Errorf("parameter obj is required, but nil was provided") ++func validateNewEntropyParameters(clock IWallClock) error { ++ if clock == nil { ++ return fmt.Errorf("parameter clock is required, but nil was provided") + } + + return nil @@ -29372,57 +29284,10 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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,19 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/Entropy__no_checks.go.diff 1`] = ` +--- go/jsiicalc/Entropy__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/Entropy__no_checks.go --runtime-type-checking +@@ -0,0 +1,15 @@ +//go:build no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -29430,24 +29295,39 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// 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 { ++func (e *jsiiProxy_Entropy) validateRepeatParameters(word *string) error { + return nil +} + -+func (d *jsiiProxy_DataRenderer) validateRenderMapParameters(map_ *map[string]interface{}) error { ++func validateNewEntropyParameters(clock IWallClock) 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,37 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/EraseUndefinedHashValues.go.diff 1`] = ` +--- go/jsiicalc/EraseUndefinedHashValues.go --no-runtime-type-checking ++++ go/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/EraseUndefinedHashValues__checks.go.diff 1`] = ` +--- go/jsiicalc/EraseUndefinedHashValues__checks.go --no-runtime-type-checking ++++ go/jsiicalc/EraseUndefinedHashValues__checks.go --runtime-type-checking +@@ -0,0 +1,26 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -29457,75 +29337,64 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "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 { ++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 + } + -+ 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") ++ if key == nil { ++ return fmt.Errorf("parameter key 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") -+ } +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/EraseUndefinedHashValues__no_checks.go.diff 1`] = ` +--- go/jsiicalc/EraseUndefinedHashValues__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/EraseUndefinedHashValues__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go: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_DeprecatedClass.go.diff 1`] = ` ---- go/jsiicalc/jsiicalc_DeprecatedClass.go --no-runtime-type-checking -+++ go/jsiicalc/jsiicalc_DeprecatedClass.go --runtime-type-checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/ExperimentalClass.go.diff 1`] = ` +--- go/jsiicalc/ExperimentalClass.go --no-runtime-type-checking ++++ go/jsiicalc/ExperimentalClass.go --runtime-type-checking @@ -46,10 +46,13 @@ - // Deprecated: this constructor is "just" okay. - func NewDeprecatedClass(readonlyString *string, mutableNumber *float64) DeprecatedClass { + // Experimental. + func NewExperimentalClass(readonlyString *string, mutableNumber *float64) ExperimentalClass { _init_.Initialize() -+ if err := validateNewDeprecatedClassParameters(readonlyString); err != nil { ++ if err := validateNewExperimentalClassParameters(readonlyString); err != nil { + panic(err) + } - j := jsiiProxy_DeprecatedClass{} + j := jsiiProxy_ExperimentalClass{} _jsii_.Create( - "jsii-calc.DeprecatedClass", + "jsii-calc.ExperimentalClass", []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,11 @@ -+//go: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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/ExperimentalClass__checks.go.diff 1`] = ` +--- go/jsiicalc/ExperimentalClass__checks.go --no-runtime-type-checking ++++ go/jsiicalc/ExperimentalClass__checks.go --runtime-type-checking @@ -0,0 +1,17 @@ +//go:build !no_runtime_type_checking + @@ -29536,7 +29405,7 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "fmt" +) + -+func validateNewDeprecatedClassParameters(readonlyString *string) error { ++func validateNewExperimentalClassParameters(readonlyString *string) error { + if readonlyString == nil { + return fmt.Errorf("parameter readonlyString is required, but nil was provided") + } @@ -29546,28 +29415,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/ExperimentalClass__no_checks.go.diff 1`] = ` +--- go/jsiicalc/ExperimentalClass__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/ExperimentalClass__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -29576,15 +29426,34 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func (d *jsiiProxy_DoNotOverridePrivates) validateChangePrivatePropertyValueParameters(newValue *string) error { ++func validateNewExperimentalClassParameters(readonlyString *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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/ExportedBaseClass.go.diff 1`] = ` +--- go/jsiicalc/ExportedBaseClass.go --no-runtime-type-checking ++++ go/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/ExportedBaseClass__checks.go.diff 1`] = ` +--- go/jsiicalc/ExportedBaseClass__checks.go --no-runtime-type-checking ++++ go/jsiicalc/ExportedBaseClass__checks.go --runtime-type-checking @@ -0,0 +1,17 @@ +//go:build !no_runtime_type_checking + @@ -29595,9 +29464,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "fmt" +) + -+func (d *jsiiProxy_DoNotOverridePrivates) validateChangePrivatePropertyValueParameters(newValue *string) error { -+ if newValue == nil { -+ return fmt.Errorf("parameter newValue is required, but nil was provided") ++func validateNewExportedBaseClassParameters(success *bool) error { ++ if success == nil { ++ return fmt.Errorf("parameter success is required, but nil was provided") + } + + return nil @@ -29605,28 +29474,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/ExportedBaseClass__no_checks.go.diff 1`] = ` +--- go/jsiicalc/ExportedBaseClass__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/ExportedBaseClass__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -29635,15 +29485,34 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func (d *jsiiProxy_DoNotRecognizeAnyAsOptional) validateMethodParameters(_requiredAny interface{}) error { ++func validateNewExportedBaseClassParameters(success *bool) 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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/ExternalClass.go.diff 1`] = ` +--- go/jsiicalc/ExternalClass.go --no-runtime-type-checking ++++ go/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/ExternalClass__checks.go.diff 1`] = ` +--- go/jsiicalc/ExternalClass__checks.go --no-runtime-type-checking ++++ go/jsiicalc/ExternalClass__checks.go --runtime-type-checking @@ -0,0 +1,17 @@ +//go:build !no_runtime_type_checking + @@ -29654,9 +29523,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "fmt" +) + -+func (d *jsiiProxy_DoNotRecognizeAnyAsOptional) validateMethodParameters(_requiredAny interface{}) error { -+ if _requiredAny == nil { -+ return fmt.Errorf("parameter _requiredAny is required, but nil was provided") ++func validateNewExternalClassParameters(readonlyString *string) error { ++ if readonlyString == nil { ++ return fmt.Errorf("parameter readonlyString is required, but nil was provided") + } + + return nil @@ -29664,28 +29533,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 -@@ -62,10 +62,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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/ExternalClass__no_checks.go.diff 1`] = ` +--- go/jsiicalc/ExternalClass__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/ExternalClass__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -29694,82 +29544,114 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func (d *jsiiProxy_DocumentedClass) validateGreetParameters(greetee *Greetee) error { ++func validateNewExternalClassParameters(readonlyString *string) 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,17 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/GiveMeStructs.go.diff 1`] = ` +--- go/jsiicalc/GiveMeStructs.go --no-runtime-type-checking ++++ go/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/GiveMeStructs__checks.go.diff 1`] = ` +--- go/jsiicalc/GiveMeStructs__checks.go --no-runtime-type-checking ++++ go/jsiicalc/GiveMeStructs__checks.go --runtime-type-checking +@@ -0,0 +1,46 @@ +//go: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_DocumentedClass) validateGreetParameters(greetee *Greetee) error { -+ if err := _jsii_.ValidateStruct(greetee, func() string { return "parameter greetee" }); err != nil { ++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 +} + -`; - -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) ++func (g *jsiiProxy_GiveMeStructs) validateReadDerivedNonPrimitiveParameters(derived *DerivedStruct) error { ++ if derived == nil { ++ return fmt.Errorf("parameter derived is required, but nil was provided") + } - 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) ++ 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") + } - _jsii_.Set( - j, - "dynamicProperty", - val, - ) - } - - func (j *jsiiProxy_DynamicPropertyBearer)SetValueStore(val *string) { -+ if err := j.validateSetValueStoreParameters(val); err != nil { -+ panic(err) ++ if err := _jsii_.ValidateStruct(first, func() string { return "parameter first" }); err != nil { ++ return err + } - _jsii_.Set( - j, - "valueStore", - val, - ) ++ ++ return nil ++} ++ `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/GiveMeStructs__no_checks.go.diff 1`] = ` +--- go/jsiicalc/GiveMeStructs__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/GiveMeStructs__no_checks.go --runtime-type-checking @@ -0,0 +1,19 @@ +//go:build no_runtime_type_checking + @@ -29778,24 +29660,43 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func (j *jsiiProxy_DynamicPropertyBearer) validateSetDynamicPropertyParameters(val *string) error { ++func (g *jsiiProxy_GiveMeStructs) validateDerivedToFirstParameters(derived *DerivedStruct) error { + return nil +} + -+func (j *jsiiProxy_DynamicPropertyBearer) validateSetValueStoreParameters(val *string) error { ++func (g *jsiiProxy_GiveMeStructs) validateReadDerivedNonPrimitiveParameters(derived *DerivedStruct) error { + return nil +} + -+func validateNewDynamicPropertyBearerParameters(valueStore *string) error { ++func (g *jsiiProxy_GiveMeStructs) validateReadFirstNumberParameters(first *scopejsiicalclib.MyFirstStruct) 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,33 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/GreetingAugmenter.go.diff 1`] = ` +--- go/jsiicalc/GreetingAugmenter.go --no-runtime-type-checking ++++ go/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/GreetingAugmenter__checks.go.diff 1`] = ` +--- go/jsiicalc/GreetingAugmenter__checks.go --no-runtime-type-checking ++++ go/jsiicalc/GreetingAugmenter__checks.go --runtime-type-checking +@@ -0,0 +1,19 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -29803,122 +29704,119 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +import ( + "fmt" ++ ++ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" +) + -+func (j *jsiiProxy_DynamicPropertyBearer) validateSetDynamicPropertyParameters(val *string) error { -+ if val == nil { -+ return fmt.Errorf("parameter val is required, but nil was provided") ++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 +} + -+func (j *jsiiProxy_DynamicPropertyBearer) validateSetValueStoreParameters(val *string) error { -+ if val == nil { -+ return fmt.Errorf("parameter val is required, but nil was provided") -+ } +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/GreetingAugmenter__no_checks.go.diff 1`] = ` +--- go/jsiicalc/GreetingAugmenter__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/GreetingAugmenter__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go:build no_runtime_type_checking + -+ return nil -+} ++// A simple calcuator built on JSII. ++package jsiicalc + -+func validateNewDynamicPropertyBearerParameters(valueStore *string) error { -+ if valueStore == nil { -+ return fmt.Errorf("parameter valueStore is required, but nil was provided") -+ } ++// 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_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, +exports[`Generated code for "jsii-calc": /go/jsiicalc/IAnotherPublicInterface.go.diff 1`] = ` +--- go/jsiicalc/IAnotherPublicInterface.go --no-runtime-type-checking ++++ go/jsiicalc/IAnotherPublicInterface.go --runtime-type-checking +@@ -24,10 +24,13 @@ ) + return returns } - func (j *jsiiProxy_DynamicPropertyBearerChild)SetValueStore(val *string) { -+ if err := j.validateSetValueStoreParameters(val); err != nil { + func (j *jsiiProxy_IAnotherPublicInterface)SetA(val *string) { ++ if err := j.validateSetAParameters(val); err != nil { + panic(err) + } _jsii_.Set( j, - "valueStore", + "a", 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,23 @@ -+//go:build no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/IAnotherPublicInterface__checks.go.diff 1`] = ` +--- go/jsiicalc/IAnotherPublicInterface__checks.go --no-runtime-type-checking ++++ go/jsiicalc/IAnotherPublicInterface__checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ ++//go: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 ++import ( ++ "fmt" ++) + -+func (d *jsiiProxy_DynamicPropertyBearerChild) validateOverrideValueParameters(newValue *string) error { -+ return nil -+} ++func (j *jsiiProxy_IAnotherPublicInterface) validateSetAParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } + -+func (j *jsiiProxy_DynamicPropertyBearerChild) validateSetDynamicPropertyParameters(val *string) error { + return nil +} + -+func (j *jsiiProxy_DynamicPropertyBearerChild) validateSetValueStoreParameters(val *string) error { -+ return nil -+} +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/IAnotherPublicInterface__no_checks.go.diff 1`] = ` +--- go/jsiicalc/IAnotherPublicInterface__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/IAnotherPublicInterface__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go:build no_runtime_type_checking + -+func validateNewDynamicPropertyBearerChildParameters(originalValue *string) error { ++// 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_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,41 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/IBellRinger.go.diff 1`] = ` +--- go/jsiicalc/IBellRinger.go --no-runtime-type-checking ++++ go/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/IBellRinger__checks.go.diff 1`] = ` +--- go/jsiicalc/IBellRinger__checks.go --no-runtime-type-checking ++++ go/jsiicalc/IBellRinger__checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -29928,84 +29826,115 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "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") ++func (i *jsiiProxy_IBellRinger) validateYourTurnParameters(bell IBell) error { ++ if bell == nil { ++ return fmt.Errorf("parameter bell 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") -+ } +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/IBellRinger__no_checks.go.diff 1`] = ` +--- go/jsiicalc/IBellRinger__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/IBellRinger__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go:build no_runtime_type_checking + -+ return nil -+} ++// A simple calcuator built on JSII. ++package jsiicalc + -+func validateNewDynamicPropertyBearerChildParameters(originalValue *string) error { -+ if originalValue == nil { -+ return fmt.Errorf("parameter originalValue is required, but nil was provided") -+ } ++// 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_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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/IConcreteBellRinger.go.diff 1`] = ` +--- go/jsiicalc/IConcreteBellRinger.go --no-runtime-type-checking ++++ go/jsiicalc/IConcreteBellRinger.go --runtime-type-checking +@@ -14,10 +14,13 @@ + type jsiiProxy_IConcreteBellRinger struct { + _ byte // padding } - func (e *jsiiProxy_Entropy) Repeat(word *string) *string { -+ if err := e.validateRepeatParameters(word); err != nil { + func (i *jsiiProxy_IConcreteBellRinger) YourTurn(bell Bell) { ++ if err := i.validateYourTurnParameters(bell); err != nil { + panic(err) + } - var returns *string - - _jsii_.Invoke( - e, - "repeat", + _jsii_.InvokeVoid( + i, + "yourTurn", + []interface{}{bell}, + ) `; -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,15 @@ -+//go:build no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/IConcreteBellRinger__checks.go.diff 1`] = ` +--- go/jsiicalc/IConcreteBellRinger__checks.go --no-runtime-type-checking ++++ go/jsiicalc/IConcreteBellRinger__checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ ++//go: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 ++import ( ++ "fmt" ++) ++ ++func (i *jsiiProxy_IConcreteBellRinger) validateYourTurnParameters(bell Bell) error { ++ if bell == nil { ++ return fmt.Errorf("parameter bell is required, but nil was provided") ++ } + -+func (e *jsiiProxy_Entropy) validateRepeatParameters(word *string) error { + return nil +} + -+func validateNewEntropyParameters(clock IWallClock) error { +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/IConcreteBellRinger__no_checks.go.diff 1`] = ` +--- go/jsiicalc/IConcreteBellRinger__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/IConcreteBellRinger__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go: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_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,25 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/IExtendsPrivateInterface.go.diff 1`] = ` +--- go/jsiicalc/IExtendsPrivateInterface.go --no-runtime-type-checking ++++ go/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/IExtendsPrivateInterface__checks.go.diff 1`] = ` +--- go/jsiicalc/IExtendsPrivateInterface__checks.go --no-runtime-type-checking ++++ go/jsiicalc/IExtendsPrivateInterface__checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -30015,17 +29944,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "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") ++func (j *jsiiProxy_IExtendsPrivateInterface) validateSetPrivateParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") + } + + return nil @@ -30033,28 +29954,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/IExtendsPrivateInterface__no_checks.go.diff 1`] = ` +--- go/jsiicalc/IExtendsPrivateInterface__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/IExtendsPrivateInterface__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -30063,16 +29965,35 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func validateEraseUndefinedHashValues_DoesKeyExistParameters(opts *EraseUndefinedHashValuesOptions, key *string) error { ++func (j *jsiiProxy_IExtendsPrivateInterface) validateSetPrivateParameters(val *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,26 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/IInterfaceWithOptionalMethodArguments.go.diff 1`] = ` +--- go/jsiicalc/IInterfaceWithOptionalMethodArguments.go --no-runtime-type-checking ++++ go/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/IInterfaceWithOptionalMethodArguments__checks.go.diff 1`] = ` +--- go/jsiicalc/IInterfaceWithOptionalMethodArguments__checks.go --no-runtime-type-checking ++++ go/jsiicalc/IInterfaceWithOptionalMethodArguments__checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -30080,20 +30001,11 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +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") ++func (i *jsiiProxy_IInterfaceWithOptionalMethodArguments) validateHelloParameters(arg1 *string) error { ++ if arg1 == nil { ++ return fmt.Errorf("parameter arg1 is required, but nil was provided") + } + + return nil @@ -30101,28 +30013,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/IInterfaceWithOptionalMethodArguments__no_checks.go.diff 1`] = ` +--- go/jsiicalc/IInterfaceWithOptionalMethodArguments__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/IInterfaceWithOptionalMethodArguments__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -30131,15 +30024,34 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func validateNewExperimentalClassParameters(readonlyString *string) error { ++func (i *jsiiProxy_IInterfaceWithOptionalMethodArguments) validateHelloParameters(arg1 *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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/IInterfaceWithProperties.go.diff 1`] = ` +--- go/jsiicalc/IInterfaceWithProperties.go --no-runtime-type-checking ++++ go/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/IInterfaceWithProperties__checks.go.diff 1`] = ` +--- go/jsiicalc/IInterfaceWithProperties__checks.go --no-runtime-type-checking ++++ go/jsiicalc/IInterfaceWithProperties__checks.go --runtime-type-checking @@ -0,0 +1,17 @@ +//go:build !no_runtime_type_checking + @@ -30150,9 +30062,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "fmt" +) + -+func validateNewExperimentalClassParameters(readonlyString *string) error { -+ if readonlyString == nil { -+ return fmt.Errorf("parameter readonlyString is required, but nil was provided") ++func (j *jsiiProxy_IInterfaceWithProperties) validateSetReadWriteStringParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") + } + + return nil @@ -30160,28 +30072,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/IInterfaceWithProperties__no_checks.go.diff 1`] = ` +--- go/jsiicalc/IInterfaceWithProperties__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/IInterfaceWithProperties__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -30190,15 +30083,34 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func validateNewExportedBaseClassParameters(success *bool) error { ++func (j *jsiiProxy_IInterfaceWithProperties) validateSetReadWriteStringParameters(val *string) 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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/IInterfaceWithPropertiesExtension.go.diff 1`] = ` +--- go/jsiicalc/IInterfaceWithPropertiesExtension.go --no-runtime-type-checking ++++ go/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/IInterfaceWithPropertiesExtension__checks.go.diff 1`] = ` +--- go/jsiicalc/IInterfaceWithPropertiesExtension__checks.go --no-runtime-type-checking ++++ go/jsiicalc/IInterfaceWithPropertiesExtension__checks.go --runtime-type-checking @@ -0,0 +1,17 @@ +//go:build !no_runtime_type_checking + @@ -30209,9 +30121,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "fmt" +) + -+func validateNewExportedBaseClassParameters(success *bool) error { -+ if success == nil { -+ return fmt.Errorf("parameter success is required, but nil was provided") ++func (j *jsiiProxy_IInterfaceWithPropertiesExtension) validateSetFooParameters(val *float64) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") + } + + return nil @@ -30219,28 +30131,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/IInterfaceWithPropertiesExtension__no_checks.go.diff 1`] = ` +--- go/jsiicalc/IInterfaceWithPropertiesExtension__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/IInterfaceWithPropertiesExtension__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -30249,15 +30142,34 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func validateNewExternalClassParameters(readonlyString *string) error { ++func (j *jsiiProxy_IInterfaceWithPropertiesExtension) validateSetFooParameters(val *float64) 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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/IMutableObjectLiteral.go.diff 1`] = ` +--- go/jsiicalc/IMutableObjectLiteral.go --no-runtime-type-checking ++++ go/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/IMutableObjectLiteral__checks.go.diff 1`] = ` +--- go/jsiicalc/IMutableObjectLiteral__checks.go --no-runtime-type-checking ++++ go/jsiicalc/IMutableObjectLiteral__checks.go --runtime-type-checking @@ -0,0 +1,17 @@ +//go:build !no_runtime_type_checking + @@ -30268,9 +30180,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "fmt" +) + -+func validateNewExternalClassParameters(readonlyString *string) error { -+ if readonlyString == nil { -+ return fmt.Errorf("parameter readonlyString is required, but nil was provided") ++func (j *jsiiProxy_IMutableObjectLiteral) validateSetValueParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") + } + + return nil @@ -30278,57 +30190,91 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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, +exports[`Generated code for "jsii-calc": /go/jsiicalc/IMutableObjectLiteral__no_checks.go.diff 1`] = ` +--- go/jsiicalc/IMutableObjectLiteral__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/IMutableObjectLiteral__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go: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/INonInternalInterface.go.diff 1`] = ` +--- go/jsiicalc/INonInternalInterface.go --no-runtime-type-checking ++++ go/jsiicalc/INonInternalInterface.go --runtime-type-checking +@@ -27,10 +27,13 @@ ) - } - - 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 { + func (j *jsiiProxy_INonInternalInterface)SetB(val *string) { ++ if err := j.validateSetBParameters(val); err != nil { + panic(err) + } - var returns DoubleTrouble - - _jsii_.Invoke( - g, - "readDerivedNonPrimitive", -@@ -83,10 +89,13 @@ - + _jsii_.Set( + j, + "b", + val, + ) +@@ -45,10 +48,13 @@ + ) return returns } - func (g *jsiiProxy_GiveMeStructs) ReadFirstNumber(first *scopejsiicalclib.MyFirstStruct) *float64 { -+ if err := g.validateReadFirstNumberParameters(first); err != nil { + func (j *jsiiProxy_INonInternalInterface)SetC(val *string) { ++ if err := j.validateSetCParameters(val); err != nil { + panic(err) + } - var returns *float64 - - _jsii_.Invoke( - g, - "readFirstNumber", + _jsii_.Set( + j, + "c", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/INonInternalInterface__checks.go.diff 1`] = ` +--- go/jsiicalc/INonInternalInterface__checks.go --no-runtime-type-checking ++++ go/jsiicalc/INonInternalInterface__checks.go --runtime-type-checking +@@ -0,0 +1,25 @@ ++//go: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_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,19 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/INonInternalInterface__no_checks.go.diff 1`] = ` +--- go/jsiicalc/INonInternalInterface__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/INonInternalInterface__no_checks.go --runtime-type-checking +@@ -0,0 +1,15 @@ +//go:build no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -30336,24 +30282,39 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// 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 { ++func (j *jsiiProxy_INonInternalInterface) validateSetBParameters(val *string) error { + return nil +} + -+func (g *jsiiProxy_GiveMeStructs) validateReadFirstNumberParameters(first *scopejsiicalclib.MyFirstStruct) error { ++func (j *jsiiProxy_INonInternalInterface) validateSetCParameters(val *string) 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,46 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/IObjectWithProperty.go.diff 1`] = ` +--- go/jsiicalc/IObjectWithProperty.go --no-runtime-type-checking ++++ go/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/IObjectWithProperty__checks.go.diff 1`] = ` +--- go/jsiicalc/IObjectWithProperty__checks.go --no-runtime-type-checking ++++ go/jsiicalc/IObjectWithProperty__checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -30361,130 +30322,139 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +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 ++func (j *jsiiProxy_IObjectWithProperty) validateSetPropertyParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") + } + + 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 -+ } +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/IObjectWithProperty__no_checks.go.diff 1`] = ` +--- go/jsiicalc/IObjectWithProperty__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/IObjectWithProperty__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go:build no_runtime_type_checking + -+ return nil -+} ++// A simple calcuator built on JSII. ++package jsiicalc + -+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 -+ } ++// 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_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, +exports[`Generated code for "jsii-calc": /go/jsiicalc/ImplementInternalInterface.go.diff 1`] = ` +--- go/jsiicalc/ImplementInternalInterface.go --no-runtime-type-checking ++++ go/jsiicalc/ImplementInternalInterface.go --runtime-type-checking +@@ -50,10 +50,13 @@ + i, ) } - func (g *jsiiProxy_GreetingAugmenter) BetterGreeting(friendly scopejsiicalclib.IFriendly) *string { -+ if err := g.validateBetterGreetingParameters(friendly); err != nil { + func (j *jsiiProxy_ImplementInternalInterface)SetProp(val *string) { ++ if err := j.validateSetPropParameters(val); err != nil { + panic(err) + } - var returns *string - - _jsii_.Invoke( - g, - "betterGreeting", + _jsii_.Set( + j, + "prop", + val, + ) `; -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,11 @@ -+//go:build no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/ImplementInternalInterface__checks.go.diff 1`] = ` +--- go/jsiicalc/ImplementInternalInterface__checks.go --no-runtime-type-checking ++++ go/jsiicalc/ImplementInternalInterface__checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ ++//go: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 ++import ( ++ "fmt" ++) ++ ++func (j *jsiiProxy_ImplementInternalInterface) validateSetPropParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } + -+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,19 @@ -+//go:build !no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/ImplementInternalInterface__no_checks.go.diff 1`] = ` +--- go/jsiicalc/ImplementInternalInterface__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/ImplementInternalInterface__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go: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") -+ } ++// 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_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 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/ImplementsPrivateInterface.go.diff 1`] = ` +--- go/jsiicalc/ImplementsPrivateInterface.go --no-runtime-type-checking ++++ go/jsiicalc/ImplementsPrivateInterface.go --runtime-type-checking +@@ -50,10 +50,13 @@ + i, ) - return returns } - func (j *jsiiProxy_IAnotherPublicInterface)SetA(val *string) { -+ if err := j.validateSetAParameters(val); err != nil { + func (j *jsiiProxy_ImplementsPrivateInterface)SetPrivate(val *string) { ++ if err := j.validateSetPrivateParameters(val); err != nil { + panic(err) + } _jsii_.Set( j, - "a", + "private", 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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/ImplementsPrivateInterface__checks.go.diff 1`] = ` +--- go/jsiicalc/ImplementsPrivateInterface__checks.go --no-runtime-type-checking ++++ go/jsiicalc/ImplementsPrivateInterface__checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ ++//go: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/ImplementsPrivateInterface__no_checks.go.diff 1`] = ` +--- go/jsiicalc/ImplementsPrivateInterface__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/ImplementsPrivateInterface__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -30493,15 +30463,34 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func (j *jsiiProxy_IAnotherPublicInterface) validateSetAParameters(val *string) error { ++func (j *jsiiProxy_ImplementsPrivateInterface) validateSetPrivateParameters(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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/InterfacesMaker.go.diff 1`] = ` +--- go/jsiicalc/InterfacesMaker.go --no-runtime-type-checking ++++ go/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/InterfacesMaker__checks.go.diff 1`] = ` +--- go/jsiicalc/InterfacesMaker__checks.go --no-runtime-type-checking ++++ go/jsiicalc/InterfacesMaker__checks.go --runtime-type-checking @@ -0,0 +1,17 @@ +//go:build !no_runtime_type_checking + @@ -30512,9 +30501,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "fmt" +) + -+func (j *jsiiProxy_IAnotherPublicInterface) validateSetAParameters(val *string) error { -+ if val == nil { -+ return fmt.Errorf("parameter val is required, but nil was provided") ++func validateInterfacesMaker_MakeInterfacesParameters(count *float64) error { ++ if count == nil { ++ return fmt.Errorf("parameter count is required, but nil was provided") + } + + return nil @@ -30522,28 +30511,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/InterfacesMaker__no_checks.go.diff 1`] = ` +--- go/jsiicalc/InterfacesMaker__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/InterfacesMaker__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -30552,15 +30522,34 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func (i *jsiiProxy_IBellRinger) validateYourTurnParameters(bell IBell) error { ++func validateInterfacesMaker_MakeInterfacesParameters(count *float64) 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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/JSII417Derived.go.diff 1`] = ` +--- go/jsiicalc/JSII417Derived.go --no-runtime-type-checking ++++ go/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/JSII417Derived__checks.go.diff 1`] = ` +--- go/jsiicalc/JSII417Derived__checks.go --no-runtime-type-checking ++++ go/jsiicalc/JSII417Derived__checks.go --runtime-type-checking @@ -0,0 +1,17 @@ +//go:build !no_runtime_type_checking + @@ -30571,9 +30560,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "fmt" +) + -+func (i *jsiiProxy_IBellRinger) validateYourTurnParameters(bell IBell) error { -+ if bell == nil { -+ return fmt.Errorf("parameter bell is required, but nil was provided") ++func validateNewJSII417DerivedParameters(property *string) error { ++ if property == nil { ++ return fmt.Errorf("parameter property is required, but nil was provided") + } + + return nil @@ -30581,28 +30570,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/JSII417Derived__no_checks.go.diff 1`] = ` +--- go/jsiicalc/JSII417Derived__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/JSII417Derived__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -30611,16 +30581,46 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func (i *jsiiProxy_IConcreteBellRinger) validateYourTurnParameters(bell Bell) error { ++func validateNewJSII417DerivedParameters(property *string) 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,17 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/JSObjectLiteralToNativeClass.go.diff 1`] = ` +--- go/jsiicalc/JSObjectLiteralToNativeClass.go --no-runtime-type-checking ++++ go/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/JSObjectLiteralToNativeClass__checks.go.diff 1`] = ` +--- go/jsiicalc/JSObjectLiteralToNativeClass__checks.go --no-runtime-type-checking ++++ go/jsiicalc/JSObjectLiteralToNativeClass__checks.go --runtime-type-checking +@@ -0,0 +1,25 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -30630,9 +30630,17 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "fmt" +) + -+func (i *jsiiProxy_IConcreteBellRinger) validateYourTurnParameters(bell Bell) error { -+ if bell == nil { -+ return fmt.Errorf("parameter bell is required, but nil was provided") ++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 @@ -30640,28 +30648,72 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/JSObjectLiteralToNativeClass__no_checks.go.diff 1`] = ` +--- go/jsiicalc/JSObjectLiteralToNativeClass__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/JSObjectLiteralToNativeClass__no_checks.go --runtime-type-checking +@@ -0,0 +1,15 @@ ++//go: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/JavaReservedWords.go.diff 1`] = ` +--- go/jsiicalc/JavaReservedWords.go --no-runtime-type-checking ++++ go/jsiicalc/JavaReservedWords.go --runtime-type-checking +@@ -102,10 +102,13 @@ + j, ) - return returns } - func (j *jsiiProxy_IExtendsPrivateInterface)SetPrivate(val *string) { -+ if err := j.validateSetPrivateParameters(val); err != nil { + func (j *jsiiProxy_JavaReservedWords)SetWhile(val *string) { ++ if err := j.validateSetWhileParameters(val); err != nil { + panic(err) + } _jsii_.Set( j, - "private", + "while", 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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/JavaReservedWords__checks.go.diff 1`] = ` +--- go/jsiicalc/JavaReservedWords__checks.go --no-runtime-type-checking ++++ go/jsiicalc/JavaReservedWords__checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ ++//go: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/JavaReservedWords__no_checks.go.diff 1`] = ` +--- go/jsiicalc/JavaReservedWords__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/JavaReservedWords__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -30670,16 +30722,35 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func (j *jsiiProxy_IExtendsPrivateInterface) validateSetPrivateParameters(val *string) error { ++func (j *jsiiProxy_JavaReservedWords) validateSetWhileParameters(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,17 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/LevelOne.go.diff 1`] = ` +--- go/jsiicalc/LevelOne.go --no-runtime-type-checking ++++ go/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/LevelOne__checks.go.diff 1`] = ` +--- go/jsiicalc/LevelOne__checks.go --no-runtime-type-checking ++++ go/jsiicalc/LevelOne__checks.go --runtime-type-checking +@@ -0,0 +1,22 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -30687,11 +30758,16 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +import ( + "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + -+func (j *jsiiProxy_IExtendsPrivateInterface) validateSetPrivateParameters(val *string) error { -+ if val == nil { -+ return fmt.Errorf("parameter val is required, but nil was provided") ++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 @@ -30699,28 +30775,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/LevelOne__no_checks.go.diff 1`] = ` +--- go/jsiicalc/LevelOne__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/LevelOne__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -30729,16 +30786,35 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func (i *jsiiProxy_IInterfaceWithOptionalMethodArguments) validateHelloParameters(arg1 *string) error { ++func validateNewLevelOneParameters(props *LevelOneProps) 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,17 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/Multiply.go.diff 1`] = ` +--- go/jsiicalc/Multiply.go --no-runtime-type-checking ++++ go/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/Multiply__checks.go.diff 1`] = ` +--- go/jsiicalc/Multiply__checks.go --no-runtime-type-checking ++++ go/jsiicalc/Multiply__checks.go --runtime-type-checking +@@ -0,0 +1,23 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -30746,11 +30822,17 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +import ( + "fmt" ++ ++ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" +) + -+func (i *jsiiProxy_IInterfaceWithOptionalMethodArguments) validateHelloParameters(arg1 *string) error { -+ if arg1 == nil { -+ return fmt.Errorf("parameter arg1 is required, but nil was provided") ++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 @@ -30758,28 +30840,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/Multiply__no_checks.go.diff 1`] = ` +--- go/jsiicalc/Multiply__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/Multiply__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -30788,16 +30851,35 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func (j *jsiiProxy_IInterfaceWithProperties) validateSetReadWriteStringParameters(val *string) error { ++func validateNewMultiplyParameters(lhs scopejsiicalclib.NumericValue, rhs scopejsiicalclib.NumericValue) 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,17 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/Negate.go.diff 1`] = ` +--- go/jsiicalc/Negate.go --no-runtime-type-checking ++++ go/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/Negate__checks.go.diff 1`] = ` +--- go/jsiicalc/Negate__checks.go --no-runtime-type-checking ++++ go/jsiicalc/Negate__checks.go --runtime-type-checking +@@ -0,0 +1,19 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -30805,11 +30887,13 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +import ( + "fmt" ++ ++ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" +) + -+func (j *jsiiProxy_IInterfaceWithProperties) validateSetReadWriteStringParameters(val *string) error { -+ if val == nil { -+ return fmt.Errorf("parameter val is required, but nil was provided") ++func validateNewNegateParameters(operand scopejsiicalclib.NumericValue) error { ++ if operand == nil { ++ return fmt.Errorf("parameter operand is required, but nil was provided") + } + + return nil @@ -30817,28 +30901,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/Negate__no_checks.go.diff 1`] = ` +--- go/jsiicalc/Negate__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/Negate__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -30847,16 +30912,49 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func (j *jsiiProxy_IInterfaceWithPropertiesExtension) validateSetFooParameters(val *float64) error { ++func validateNewNegateParameters(operand scopejsiicalclib.NumericValue) 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,17 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/NullShouldBeTreatedAsUndefined.go.diff 1`] = ` +--- go/jsiicalc/NullShouldBeTreatedAsUndefined.go --no-runtime-type-checking ++++ go/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/NullShouldBeTreatedAsUndefined__checks.go.diff 1`] = ` +--- go/jsiicalc/NullShouldBeTreatedAsUndefined__checks.go --no-runtime-type-checking ++++ go/jsiicalc/NullShouldBeTreatedAsUndefined__checks.go --runtime-type-checking +@@ -0,0 +1,30 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -30864,135 +30962,100 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +import ( + "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + -+func (j *jsiiProxy_IInterfaceWithPropertiesExtension) validateSetFooParameters(val *float64) error { -+ if val == nil { -+ return fmt.Errorf("parameter val is required, but nil was provided") ++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 +} + -`; - -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) ++func validateNewNullShouldBeTreatedAsUndefinedParameters(_param1 *string) error { ++ if _param1 == nil { ++ return fmt.Errorf("parameter _param1 is required, but nil was provided") + } - _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,11 @@ -+//go: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,17 @@ -+//go:build !no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/NullShouldBeTreatedAsUndefined__no_checks.go.diff 1`] = ` +--- go/jsiicalc/NullShouldBeTreatedAsUndefined__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/NullShouldBeTreatedAsUndefined__no_checks.go --runtime-type-checking +@@ -0,0 +1,15 @@ ++//go:build no_runtime_type_checking + +// A simple calcuator built on JSII. +package jsiicalc + -+import ( -+ "fmt" -+) ++// Building without runtime type checking enabled, so all the below just return nil + -+func (j *jsiiProxy_IMutableObjectLiteral) validateSetValueParameters(val *string) error { -+ if val == nil { -+ return fmt.Errorf("parameter val is required, but nil was provided") -+ } ++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_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 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/NumberGenerator.go.diff 1`] = ` +--- go/jsiicalc/NumberGenerator.go --no-runtime-type-checking ++++ go/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, ) - return returns } - func (j *jsiiProxy_INonInternalInterface)SetB(val *string) { -+ if err := j.validateSetBParameters(val); err != nil { + func (j *jsiiProxy_NumberGenerator)SetGenerator(val IRandomNumberGenerator) { ++ if err := j.validateSetGeneratorParameters(val); err != nil { + panic(err) + } _jsii_.Set( j, - "b", + "generator", val, ) -@@ -45,10 +48,13 @@ - ) - return returns } - func (j *jsiiProxy_INonInternalInterface)SetC(val *string) { -+ if err := j.validateSetCParameters(val); err != nil { + func (n *jsiiProxy_NumberGenerator) IsSameGenerator(gen IRandomNumberGenerator) *bool { ++ if err := n.validateIsSameGeneratorParameters(gen); 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,15 @@ -+//go: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 -+} -+ + var returns *bool + + _jsii_.Invoke( + n, + "isSameGenerator", `; -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,25 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/NumberGenerator__checks.go.diff 1`] = ` +--- go/jsiicalc/NumberGenerator__checks.go --no-runtime-type-checking ++++ go/jsiicalc/NumberGenerator__checks.go --runtime-type-checking +@@ -0,0 +1,33 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -31002,15 +31065,15 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "fmt" +) + -+func (j *jsiiProxy_INonInternalInterface) validateSetBParameters(val *string) error { -+ if val == nil { -+ return fmt.Errorf("parameter val is required, but nil was provided") ++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_INonInternalInterface) validateSetCParameters(val *string) error { ++func (j *jsiiProxy_NumberGenerator) validateSetGeneratorParameters(val IRandomNumberGenerator) error { + if val == nil { + return fmt.Errorf("parameter val is required, but nil was provided") + } @@ -31018,31 +31081,20 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + 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) ++func validateNewNumberGeneratorParameters(generator IRandomNumberGenerator) error { ++ if generator == nil { ++ return fmt.Errorf("parameter generator is required, but nil was provided") + } - _jsii_.Set( - j, - "property", - val, - ) ++ ++ return nil ++} ++ `; -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,11 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/NumberGenerator__no_checks.go.diff 1`] = ` +--- go/jsiicalc/NumberGenerator__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/NumberGenerator__no_checks.go --runtime-type-checking +@@ -0,0 +1,19 @@ +//go:build no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -31050,16 +31102,57 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func (j *jsiiProxy_IObjectWithProperty) validateSetPropertyParameters(val *string) error { ++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_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,17 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/ObjectRefsInCollections.go.diff 1`] = ` +--- go/jsiicalc/ObjectRefsInCollections.go --no-runtime-type-checking ++++ go/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/ObjectRefsInCollections__checks.go.diff 1`] = ` +--- go/jsiicalc/ObjectRefsInCollections__checks.go --no-runtime-type-checking ++++ go/jsiicalc/ObjectRefsInCollections__checks.go --runtime-type-checking +@@ -0,0 +1,27 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -31067,41 +31160,32 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +import ( + "fmt" ++ ++ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" +) + -+func (j *jsiiProxy_IObjectWithProperty) validateSetPropertyParameters(val *string) error { -+ if val == nil { -+ return fmt.Errorf("parameter val is required, but nil was provided") ++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 +} + -`; - -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) ++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") + } - _jsii_.Set( - j, - "prop", - val, - ) ++ ++ return nil ++} ++ `; -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,11 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/ObjectRefsInCollections__no_checks.go.diff 1`] = ` +--- go/jsiicalc/ObjectRefsInCollections__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/ObjectRefsInCollections__no_checks.go --runtime-type-checking +@@ -0,0 +1,15 @@ +//go:build no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -31109,15 +31193,38 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func (j *jsiiProxy_ImplementInternalInterface) validateSetPropParameters(val *string) error { ++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_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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/OptionalArgumentInvoker.go.diff 1`] = ` +--- go/jsiicalc/OptionalArgumentInvoker.go --no-runtime-type-checking ++++ go/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/OptionalArgumentInvoker__checks.go.diff 1`] = ` +--- go/jsiicalc/OptionalArgumentInvoker__checks.go --no-runtime-type-checking ++++ go/jsiicalc/OptionalArgumentInvoker__checks.go --runtime-type-checking @@ -0,0 +1,17 @@ +//go:build !no_runtime_type_checking + @@ -31128,9 +31235,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "fmt" +) + -+func (j *jsiiProxy_ImplementInternalInterface) validateSetPropParameters(val *string) error { -+ if val == nil { -+ return fmt.Errorf("parameter val is required, but nil was provided") ++func validateNewOptionalArgumentInvokerParameters(delegate IInterfaceWithOptionalMethodArguments) error { ++ if delegate == nil { ++ return fmt.Errorf("parameter delegate is required, but nil was provided") + } + + return nil @@ -31138,28 +31245,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/OptionalArgumentInvoker__no_checks.go.diff 1`] = ` +--- go/jsiicalc/OptionalArgumentInvoker__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/OptionalArgumentInvoker__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -31168,16 +31256,35 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func (j *jsiiProxy_ImplementsPrivateInterface) validateSetPrivateParameters(val *string) error { ++func validateNewOptionalArgumentInvokerParameters(delegate IInterfaceWithOptionalMethodArguments) 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,17 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/OptionalConstructorArgument.go.diff 1`] = ` +--- go/jsiicalc/OptionalConstructorArgument.go --no-runtime-type-checking ++++ go/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/OptionalConstructorArgument__checks.go.diff 1`] = ` +--- go/jsiicalc/OptionalConstructorArgument__checks.go --no-runtime-type-checking ++++ go/jsiicalc/OptionalConstructorArgument__checks.go --runtime-type-checking +@@ -0,0 +1,21 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -31187,9 +31294,13 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "fmt" +) + -+func (j *jsiiProxy_ImplementsPrivateInterface) validateSetPrivateParameters(val *string) error { -+ if val == nil { -+ return fmt.Errorf("parameter val is required, but nil was provided") ++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 @@ -31197,28 +31308,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/OptionalConstructorArgument__no_checks.go.diff 1`] = ` +--- go/jsiicalc/OptionalConstructorArgument__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/OptionalConstructorArgument__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -31227,149 +31319,94 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// 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,17 @@ -+//go: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") -+ } -+ ++func validateNewOptionalConstructorArgumentParameters(arg1 *float64, arg2 *string) error { + 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 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/OptionalStructConsumer.go.diff 1`] = ` +--- go/jsiicalc/OptionalStructConsumer.go --no-runtime-type-checking ++++ go/jsiicalc/OptionalStructConsumer.go --runtime-type-checking +@@ -38,10 +38,13 @@ - func NewJSII417Derived(property *string) JSII417Derived { + func NewOptionalStructConsumer(optionalStruct *OptionalStruct) OptionalStructConsumer { _init_.Initialize() -+ if err := validateNewJSII417DerivedParameters(property); err != nil { ++ if err := validateNewOptionalStructConsumerParameters(optionalStruct); err != nil { + panic(err) + } - j := jsiiProxy_JSII417Derived{} + j := jsiiProxy_OptionalStructConsumer{} _jsii_.Create( - "jsii-calc.JSII417Derived", - []interface{}{property}, + "jsii-calc.OptionalStructConsumer", + []interface{}{optionalStruct}, `; -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,11 @@ -+//go:build no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/OptionalStructConsumer__checks.go.diff 1`] = ` +--- go/jsiicalc/OptionalStructConsumer__checks.go --no-runtime-type-checking ++++ go/jsiicalc/OptionalStructConsumer__checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ ++//go: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 ++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 ++ } + -+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,17 @@ -+//go:build !no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/OptionalStructConsumer__no_checks.go.diff 1`] = ` +--- go/jsiicalc/OptionalStructConsumer__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/OptionalStructConsumer__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go: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") -+ } ++// 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_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, +exports[`Generated code for "jsii-calc": /go/jsiicalc/OverridableProtectedMember.go.diff 1`] = ` +--- go/jsiicalc/OverridableProtectedMember.go --no-runtime-type-checking ++++ go/jsiicalc/OverridableProtectedMember.go --runtime-type-checking +@@ -66,10 +66,13 @@ + o, ) } - func (j *jsiiProxy_JSObjectLiteralToNativeClass)SetPropB(val *float64) { -+ if err := j.validateSetPropBParameters(val); err != nil { + func (j *jsiiProxy_OverridableProtectedMember)SetOverrideReadWrite(val *string) { ++ if err := j.validateSetOverrideReadWriteParameters(val); err != nil { + panic(err) + } _jsii_.Set( j, - "propB", + "overrideReadWrite", 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,15 @@ -+//go: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,25 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/OverridableProtectedMember__checks.go.diff 1`] = ` +--- go/jsiicalc/OverridableProtectedMember__checks.go --no-runtime-type-checking ++++ go/jsiicalc/OverridableProtectedMember__checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -31379,15 +31416,7 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "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 { ++func (j *jsiiProxy_OverridableProtectedMember) validateSetOverrideReadWriteParameters(val *string) error { + if val == nil { + return fmt.Errorf("parameter val is required, but nil was provided") + } @@ -31397,28 +31426,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/OverridableProtectedMember__no_checks.go.diff 1`] = ` +--- go/jsiicalc/OverridableProtectedMember__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/OverridableProtectedMember__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -31427,15 +31437,34 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func (j *jsiiProxy_JavaReservedWords) validateSetWhileParameters(val *string) error { ++func (j *jsiiProxy_OverridableProtectedMember) validateSetOverrideReadWriteParameters(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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/OverrideReturnsObject.go.diff 1`] = ` +--- go/jsiicalc/OverrideReturnsObject.go --no-runtime-type-checking ++++ go/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/OverrideReturnsObject__checks.go.diff 1`] = ` +--- go/jsiicalc/OverrideReturnsObject__checks.go --no-runtime-type-checking ++++ go/jsiicalc/OverrideReturnsObject__checks.go --runtime-type-checking @@ -0,0 +1,17 @@ +//go:build !no_runtime_type_checking + @@ -31446,9 +31475,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "fmt" +) + -+func (j *jsiiProxy_JavaReservedWords) validateSetWhileParameters(val *string) error { -+ if val == nil { -+ return fmt.Errorf("parameter val is required, but nil was provided") ++func (o *jsiiProxy_OverrideReturnsObject) validateTestParameters(obj IReturnsNumber) error { ++ if obj == nil { ++ return fmt.Errorf("parameter obj is required, but nil was provided") + } + + return nil @@ -31456,28 +31485,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/OverrideReturnsObject__no_checks.go.diff 1`] = ` +--- go/jsiicalc/OverrideReturnsObject__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/OverrideReturnsObject__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -31486,16 +31496,35 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func validateNewLevelOneParameters(props *LevelOneProps) error { ++func (o *jsiiProxy_OverrideReturnsObject) validateTestParameters(obj IReturnsNumber) 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,22 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/ParamShadowsBuiltins.go.diff 1`] = ` +--- go/jsiicalc/ParamShadowsBuiltins.go --no-runtime-type-checking ++++ go/jsiicalc/ParamShadowsBuiltins.go --runtime-type-checking +@@ -16,10 +16,13 @@ + } + + func NewParamShadowsBuiltins(builtins *string, str *string, props *ParamShadowsBuiltinsProps) ParamShadowsBuiltins { + _init_.Initialize() + ++ if err := validateNewParamShadowsBuiltinsParameters(builtins, str, props); err != nil { ++ panic(err) ++ } + j := jsiiProxy_ParamShadowsBuiltins{} + + _jsii_.Create( + "jsii-calc.ParamShadowsBuiltins", + []interface{}{builtins, str, props}, +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ParamShadowsBuiltins__checks.go.diff 1`] = ` +--- go/jsiicalc/ParamShadowsBuiltins__checks.go --no-runtime-type-checking ++++ go/jsiicalc/ParamShadowsBuiltins__checks.go --runtime-type-checking +@@ -0,0 +1,30 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -31507,7 +31536,15 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + -+func validateNewLevelOneParameters(props *LevelOneProps) error { ++func validateNewParamShadowsBuiltinsParameters(builtins *string, str *string, props *ParamShadowsBuiltinsProps) error { ++ if builtins == nil { ++ return fmt.Errorf("parameter builtins is required, but nil was provided") ++ } ++ ++ if str == nil { ++ return fmt.Errorf("parameter str is required, but nil was provided") ++ } ++ + if props == nil { + return fmt.Errorf("parameter props is required, but nil was provided") + } @@ -31520,28 +31557,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/ParamShadowsBuiltins__no_checks.go.diff 1`] = ` +--- go/jsiicalc/ParamShadowsBuiltins__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/ParamShadowsBuiltins__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -31550,16 +31568,35 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func validateNewMultiplyParameters(lhs scopejsiicalclib.NumericValue, rhs scopejsiicalclib.NumericValue) error { ++func validateNewParamShadowsBuiltinsParameters(builtins *string, str *string, props *ParamShadowsBuiltinsProps) 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,23 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/ParamShadowsScope.go.diff 1`] = ` +--- go/jsiicalc/ParamShadowsScope.go --no-runtime-type-checking ++++ go/jsiicalc/ParamShadowsScope.go --runtime-type-checking +@@ -43,10 +43,13 @@ + p, + ) + } + + func (p *jsiiProxy_ParamShadowsScope) UseScope(scope scopejsiicalclib.Number) scopejsiicalclib.Number { ++ if err := p.validateUseScopeParameters(scope); err != nil { ++ panic(err) ++ } + var returns scopejsiicalclib.Number + + _jsii_.Invoke( + p, + "useScope", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ParamShadowsScope__checks.go.diff 1`] = ` +--- go/jsiicalc/ParamShadowsScope__checks.go --no-runtime-type-checking ++++ go/jsiicalc/ParamShadowsScope__checks.go --runtime-type-checking +@@ -0,0 +1,19 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -31571,13 +31608,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "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") ++func (p *jsiiProxy_ParamShadowsScope) validateUseScopeParameters(scope scopejsiicalclib.Number) error { ++ if scope == nil { ++ return fmt.Errorf("parameter scope is required, but nil was provided") + } + + return nil @@ -31585,28 +31618,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/ParamShadowsScope__no_checks.go.diff 1`] = ` +--- go/jsiicalc/ParamShadowsScope__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/ParamShadowsScope__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -31615,16 +31629,35 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func validateNewNegateParameters(operand scopejsiicalclib.NumericValue) error { ++func (p *jsiiProxy_ParamShadowsScope) validateUseScopeParameters(scope scopejsiicalclib.Number) 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,19 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/PartiallyInitializedThisConsumer.go.diff 1`] = ` +--- go/jsiicalc/PartiallyInitializedThisConsumer.go --no-runtime-type-checking ++++ go/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/PartiallyInitializedThisConsumer__checks.go.diff 1`] = ` +--- go/jsiicalc/PartiallyInitializedThisConsumer__checks.go --no-runtime-type-checking ++++ go/jsiicalc/PartiallyInitializedThisConsumer__checks.go --runtime-type-checking +@@ -0,0 +1,26 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -31632,13 +31665,20 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +import ( + "fmt" -+ -+ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ++ "time" +) + -+func validateNewNegateParameters(operand scopejsiicalclib.NumericValue) error { -+ if operand == nil { -+ return fmt.Errorf("parameter operand is required, but nil was provided") ++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 @@ -31646,43 +31686,10 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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,15 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/PartiallyInitializedThisConsumer__no_checks.go.diff 1`] = ` +--- go/jsiicalc/PartiallyInitializedThisConsumer__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/PartiallyInitializedThisConsumer__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -31690,20 +31697,35 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// 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 { ++func (p *jsiiProxy_PartiallyInitializedThisConsumer) validateConsumePartiallyInitializedThisParameters(obj ConstructorPassesThisOut, dt *time.Time, ev AllTypesEnum) 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,30 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/Polymorphism.go.diff 1`] = ` +--- go/jsiicalc/Polymorphism.go --no-runtime-type-checking ++++ go/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/Polymorphism__checks.go.diff 1`] = ` +--- go/jsiicalc/Polymorphism__checks.go --no-runtime-type-checking ++++ go/jsiicalc/Polymorphism__checks.go --runtime-type-checking +@@ -0,0 +1,19 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -31712,196 +31734,258 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j +import ( + "fmt" + -+ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" +) + -+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 ++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 +} + -+func validateNewNullShouldBeTreatedAsUndefinedParameters(_param1 *string) error { -+ if _param1 == nil { -+ return fmt.Errorf("parameter _param1 is required, but nil was provided") -+ } +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/Polymorphism__no_checks.go.diff 1`] = ` +--- go/jsiicalc/Polymorphism__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/Polymorphism__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go: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_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 @@ - +exports[`Generated code for "jsii-calc": /go/jsiicalc/Power.go.diff 1`] = ` +--- go/jsiicalc/Power.go --no-runtime-type-checking ++++ go/jsiicalc/Power.go --runtime-type-checking +@@ -116,10 +116,13 @@ - func NewNumberGenerator(generator IRandomNumberGenerator) NumberGenerator { + // Creates a Power operation. + func NewPower(base scopejsiicalclib.NumericValue, pow scopejsiicalclib.NumericValue) Power { _init_.Initialize() -+ if err := validateNewNumberGeneratorParameters(generator); err != nil { ++ if err := validateNewPowerParameters(base, pow); err != nil { + panic(err) + } - j := jsiiProxy_NumberGenerator{} + j := jsiiProxy_Power{} _jsii_.Create( - "jsii-calc.NumberGenerator", - []interface{}{generator}, -@@ -53,18 +56,24 @@ - n, + "jsii-calc.Power", + []interface{}{base, pow}, +@@ -139,26 +142,35 @@ + p, ) } - func (j *jsiiProxy_NumberGenerator)SetGenerator(val IRandomNumberGenerator) { -+ if err := j.validateSetGeneratorParameters(val); err != nil { + func (j *jsiiProxy_Power)SetDecorationPostfixes(val *[]*string) { ++ if err := j.validateSetDecorationPostfixesParameters(val); err != nil { + panic(err) + } _jsii_.Set( j, - "generator", + "decorationPostfixes", val, ) } - func (n *jsiiProxy_NumberGenerator) IsSameGenerator(gen IRandomNumberGenerator) *bool { -+ if err := n.validateIsSameGeneratorParameters(gen); err != nil { + func (j *jsiiProxy_Power)SetDecorationPrefixes(val *[]*string) { ++ if err := j.validateSetDecorationPrefixesParameters(val); err != nil { + panic(err) + } - var returns *bool + _jsii_.Set( + j, + "decorationPrefixes", + val, + ) + } - _jsii_.Invoke( - n, - "isSameGenerator", + 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_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,19 @@ -+//go:build no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/Power__checks.go.diff 1`] = ` +--- go/jsiicalc/Power__checks.go --no-runtime-type-checking ++++ go/jsiicalc/Power__checks.go --runtime-type-checking +@@ -0,0 +1,48 @@ ++//go: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 ++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") ++ } + -+func (n *jsiiProxy_NumberGenerator) validateIsSameGeneratorParameters(gen IRandomNumberGenerator) error { + return nil +} + -+func (j *jsiiProxy_NumberGenerator) validateSetGeneratorParameters(val IRandomNumberGenerator) error { ++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 validateNewNumberGeneratorParameters(generator IRandomNumberGenerator) error { ++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_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,33 @@ -+//go:build !no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/Power__no_checks.go.diff 1`] = ` +--- go/jsiicalc/Power__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/Power__no_checks.go --runtime-type-checking +@@ -0,0 +1,23 @@ ++//go: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") -+ } ++// 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_NumberGenerator) validateSetGeneratorParameters(val IRandomNumberGenerator) error { -+ if val == nil { -+ return fmt.Errorf("parameter val is required, but nil was provided") -+ } -+ ++func (j *jsiiProxy_Power) validateSetDecorationPrefixesParameters(val *[]*string) error { + return nil +} + -+func validateNewNumberGeneratorParameters(generator IRandomNumberGenerator) error { -+ if generator == nil { -+ return fmt.Errorf("parameter generator is required, but nil was provided") -+ } ++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_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 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/ReferenceEnumFromScopedPackage.go.diff 1`] = ` +--- go/jsiicalc/ReferenceEnumFromScopedPackage.go --no-runtime-type-checking ++++ go/jsiicalc/ReferenceEnumFromScopedPackage.go --runtime-type-checking +@@ -76,10 +76,13 @@ return returns } - func (o *jsiiProxy_ObjectRefsInCollections) SumFromMap(values *map[string]scopejsiicalclib.NumericValue) *float64 { -+ if err := o.validateSumFromMapParameters(values); err != nil { + func (r *jsiiProxy_ReferenceEnumFromScopedPackage) SaveFoo(value scopejsiicalclib.EnumFromScopedModule) { ++ if err := r.validateSaveFooParameters(value); err != nil { + panic(err) + } - var returns *float64 - - _jsii_.Invoke( - o, - "sumFromMap", + _jsii_.InvokeVoid( + r, + "saveFoo", + []interface{}{value}, + ) `; -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,15 @@ -+//go:build no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/ReferenceEnumFromScopedPackage__checks.go.diff 1`] = ` +--- go/jsiicalc/ReferenceEnumFromScopedPackage__checks.go --no-runtime-type-checking ++++ go/jsiicalc/ReferenceEnumFromScopedPackage__checks.go --runtime-type-checking +@@ -0,0 +1,19 @@ ++//go: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 ++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") ++ } + -+func (o *jsiiProxy_ObjectRefsInCollections) validateSumFromArrayParameters(values *[]scopejsiicalclib.NumericValue) error { + return nil +} + -+func (o *jsiiProxy_ObjectRefsInCollections) validateSumFromMapParameters(values *map[string]scopejsiicalclib.NumericValue) error { +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/ReferenceEnumFromScopedPackage__no_checks.go.diff 1`] = ` +--- go/jsiicalc/ReferenceEnumFromScopedPackage__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/ReferenceEnumFromScopedPackage__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go: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_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,27 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/RootStructValidator.go.diff 1`] = ` +--- go/jsiicalc/RootStructValidator.go --no-runtime-type-checking ++++ go/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/RootStructValidator__checks.go.diff 1`] = ` +--- go/jsiicalc/RootStructValidator__checks.go --no-runtime-type-checking ++++ go/jsiicalc/RootStructValidator__checks.go --runtime-type-checking +@@ -0,0 +1,22 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -31910,49 +31994,88 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j +import ( + "fmt" + -+ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + -+func (o *jsiiProxy_ObjectRefsInCollections) validateSumFromArrayParameters(values *[]scopejsiicalclib.NumericValue) error { -+ if values == nil { -+ return fmt.Errorf("parameter values is required, but nil was provided") ++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 +} + -+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") -+ } +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/RootStructValidator__no_checks.go.diff 1`] = ` +--- go/jsiicalc/RootStructValidator__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/RootStructValidator__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go: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_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 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/RuntimeTypeChecking.go.diff 1`] = ` +--- go/jsiicalc/RuntimeTypeChecking.go --no-runtime-type-checking ++++ go/jsiicalc/RuntimeTypeChecking.go --runtime-type-checking +@@ -59,10 +59,13 @@ + []interface{}{arg}, + ) } - func NewOptionalArgumentInvoker(delegate IInterfaceWithOptionalMethodArguments) OptionalArgumentInvoker { - _init_.Initialize() - -+ if err := validateNewOptionalArgumentInvokerParameters(delegate); err != nil { + func (r *jsiiProxy_RuntimeTypeChecking) MethodWithOptionalArguments(arg1 *float64, arg2 *string, arg3 *time.Time) { ++ if err := r.validateMethodWithOptionalArgumentsParameters(arg1, arg2); err != nil { + panic(err) + } - j := jsiiProxy_OptionalArgumentInvoker{} - - _jsii_.Create( - "jsii-calc.OptionalArgumentInvoker", - []interface{}{delegate}, + _jsii_.InvokeVoid( + r, + "methodWithOptionalArguments", + []interface{}{arg1, arg2, arg3}, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/RuntimeTypeChecking__checks.go.diff 1`] = ` +--- go/jsiicalc/RuntimeTypeChecking__checks.go --no-runtime-type-checking ++++ go/jsiicalc/RuntimeTypeChecking__checks.go --runtime-type-checking +@@ -0,0 +1,21 @@ ++//go: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_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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/RuntimeTypeChecking__no_checks.go.diff 1`] = ` +--- go/jsiicalc/RuntimeTypeChecking__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/RuntimeTypeChecking__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -31961,15 +32084,34 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func validateNewOptionalArgumentInvokerParameters(delegate IInterfaceWithOptionalMethodArguments) error { ++func (r *jsiiProxy_RuntimeTypeChecking) validateMethodWithOptionalArgumentsParameters(arg1 *float64, arg2 *string) 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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/SingletonInt.go.diff 1`] = ` +--- go/jsiicalc/SingletonInt.go --no-runtime-type-checking ++++ go/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/SingletonInt__checks.go.diff 1`] = ` +--- go/jsiicalc/SingletonInt__checks.go --no-runtime-type-checking ++++ go/jsiicalc/SingletonInt__checks.go --runtime-type-checking @@ -0,0 +1,17 @@ +//go:build !no_runtime_type_checking + @@ -31980,9 +32122,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "fmt" +) + -+func validateNewOptionalArgumentInvokerParameters(delegate IInterfaceWithOptionalMethodArguments) error { -+ if delegate == nil { -+ return fmt.Errorf("parameter delegate is required, but nil was provided") ++func (s *jsiiProxy_SingletonInt) validateIsSingletonIntParameters(value *float64) error { ++ if value == nil { ++ return fmt.Errorf("parameter value is required, but nil was provided") + } + + return nil @@ -31990,28 +32132,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/SingletonInt__no_checks.go.diff 1`] = ` +--- go/jsiicalc/SingletonInt__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/SingletonInt__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -32020,16 +32143,35 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func validateNewOptionalConstructorArgumentParameters(arg1 *float64, arg2 *string) error { ++func (s *jsiiProxy_SingletonInt) validateIsSingletonIntParameters(value *float64) 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,21 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/SingletonString.go.diff 1`] = ` +--- go/jsiicalc/SingletonString.go --no-runtime-type-checking ++++ go/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/SingletonString__checks.go.diff 1`] = ` +--- go/jsiicalc/SingletonString__checks.go --no-runtime-type-checking ++++ go/jsiicalc/SingletonString__checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -32039,13 +32181,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "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") ++func (s *jsiiProxy_SingletonString) validateIsSingletonStringParameters(value *string) error { ++ if value == nil { ++ return fmt.Errorf("parameter value is required, but nil was provided") + } + + return nil @@ -32053,28 +32191,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/SingletonString__no_checks.go.diff 1`] = ` +--- go/jsiicalc/SingletonString__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/SingletonString__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -32083,15 +32202,34 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func validateNewOptionalStructConsumerParameters(optionalStruct *OptionalStruct) error { ++func (s *jsiiProxy_SingletonString) validateIsSingletonStringParameters(value *string) 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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/StableClass.go.diff 1`] = ` +--- go/jsiicalc/StableClass.go --no-runtime-type-checking ++++ go/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/StableClass__checks.go.diff 1`] = ` +--- go/jsiicalc/StableClass__checks.go --no-runtime-type-checking ++++ go/jsiicalc/StableClass__checks.go --runtime-type-checking @@ -0,0 +1,17 @@ +//go:build !no_runtime_type_checking + @@ -32099,12 +32237,12 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j +package jsiicalc + +import ( -+ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++ "fmt" +) + -+func validateNewOptionalStructConsumerParameters(optionalStruct *OptionalStruct) error { -+ if err := _jsii_.ValidateStruct(optionalStruct, func() string { return "parameter optionalStruct" }); err != nil { -+ return err ++func validateNewStableClassParameters(readonlyString *string) error { ++ if readonlyString == nil { ++ return fmt.Errorf("parameter readonlyString is required, but nil was provided") + } + + return nil @@ -32112,28 +32250,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/StableClass__no_checks.go.diff 1`] = ` +--- go/jsiicalc/StableClass__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/StableClass__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -32142,15 +32261,34 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func (j *jsiiProxy_OverridableProtectedMember) validateSetOverrideReadWriteParameters(val *string) error { ++func validateNewStableClassParameters(readonlyString *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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/StaticContext.go.diff 1`] = ` +--- go/jsiicalc/StaticContext.go --no-runtime-type-checking ++++ go/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/StaticContext__checks.go.diff 1`] = ` +--- go/jsiicalc/StaticContext__checks.go --no-runtime-type-checking ++++ go/jsiicalc/StaticContext__checks.go --runtime-type-checking @@ -0,0 +1,17 @@ +//go:build !no_runtime_type_checking + @@ -32161,7 +32299,7 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "fmt" +) + -+func (j *jsiiProxy_OverridableProtectedMember) validateSetOverrideReadWriteParameters(val *string) error { ++func validateStaticContext_SetStaticVariableParameters(val *bool) error { + if val == nil { + return fmt.Errorf("parameter val is required, but nil was provided") + } @@ -32171,28 +32309,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/StaticContext__no_checks.go.diff 1`] = ` +--- go/jsiicalc/StaticContext__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/StaticContext__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -32201,16 +32320,77 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func (o *jsiiProxy_OverrideReturnsObject) validateTestParameters(obj IReturnsNumber) error { ++func validateStaticContext_SetStaticVariableParameters(val *bool) 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,17 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/Statics.go.diff 1`] = ` +--- go/jsiicalc/Statics.go --no-runtime-type-checking ++++ go/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/Statics__checks.go.diff 1`] = ` +--- go/jsiicalc/Statics__checks.go --no-runtime-type-checking ++++ go/jsiicalc/Statics__checks.go --runtime-type-checking +@@ -0,0 +1,41 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -32220,39 +32400,44 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "fmt" +) + -+func (o *jsiiProxy_OverrideReturnsObject) validateTestParameters(obj IReturnsNumber) error { -+ if obj == nil { -+ return fmt.Errorf("parameter obj is required, but nil was provided") ++func validateStatics_StaticMethodParameters(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_ParamShadowsBuiltins.go.diff 1`] = ` ---- go/jsiicalc/jsiicalc_ParamShadowsBuiltins.go --no-runtime-type-checking -+++ go/jsiicalc/jsiicalc_ParamShadowsBuiltins.go --runtime-type-checking -@@ -16,10 +16,13 @@ - } - - func NewParamShadowsBuiltins(builtins *string, str *string, props *ParamShadowsBuiltinsProps) ParamShadowsBuiltins { - _init_.Initialize() - -+ if err := validateNewParamShadowsBuiltinsParameters(builtins, str, props); err != nil { -+ panic(err) ++func validateStatics_SetInstanceParameters(val Statics) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") + } - j := jsiiProxy_ParamShadowsBuiltins{} - - _jsii_.Create( - "jsii-calc.ParamShadowsBuiltins", - []interface{}{builtins, str, props}, ++ ++ 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_ParamShadowsBuiltins__no_runtime_type_checking.go.diff 1`] = ` ---- go/jsiicalc/jsiicalc_ParamShadowsBuiltins__no_runtime_type_checking.go --no-runtime-type-checking -+++ go/jsiicalc/jsiicalc_ParamShadowsBuiltins__no_runtime_type_checking.go --runtime-type-checking -@@ -0,0 +1,11 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/Statics__no_checks.go.diff 1`] = ` +--- go/jsiicalc/Statics__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/Statics__no_checks.go --runtime-type-checking +@@ -0,0 +1,23 @@ +//go:build no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -32260,16 +32445,47 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func validateNewParamShadowsBuiltinsParameters(builtins *string, str *string, props *ParamShadowsBuiltinsProps) error { ++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_ParamShadowsBuiltins__runtime_type_checks.go.diff 1`] = ` ---- go/jsiicalc/jsiicalc_ParamShadowsBuiltins__runtime_type_checks.go --no-runtime-type-checking -+++ go/jsiicalc/jsiicalc_ParamShadowsBuiltins__runtime_type_checks.go --runtime-type-checking -@@ -0,0 +1,30 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/StripInternal.go.diff 1`] = ` +--- go/jsiicalc/StripInternal.go --no-runtime-type-checking ++++ go/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/StripInternal__checks.go.diff 1`] = ` +--- go/jsiicalc/StripInternal__checks.go --no-runtime-type-checking ++++ go/jsiicalc/StripInternal__checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -32277,24 +32493,11 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +import ( + "fmt" -+ -+ _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + -+func validateNewParamShadowsBuiltinsParameters(builtins *string, str *string, props *ParamShadowsBuiltinsProps) error { -+ if builtins == nil { -+ return fmt.Errorf("parameter builtins is required, but nil was provided") -+ } -+ -+ if str == nil { -+ return fmt.Errorf("parameter str 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 ++func (j *jsiiProxy_StripInternal) validateSetYouSeeMeParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") + } + + return nil @@ -32302,28 +32505,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ParamShadowsScope.go.diff 1`] = ` ---- go/jsiicalc/jsiicalc_ParamShadowsScope.go --no-runtime-type-checking -+++ go/jsiicalc/jsiicalc_ParamShadowsScope.go --runtime-type-checking -@@ -43,10 +43,13 @@ - p, - ) - } - - func (p *jsiiProxy_ParamShadowsScope) UseScope(scope scopejsiicalclib.Number) scopejsiicalclib.Number { -+ if err := p.validateUseScopeParameters(scope); err != nil { -+ panic(err) -+ } - var returns scopejsiicalclib.Number - - _jsii_.Invoke( - p, - "useScope", -`; - -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ParamShadowsScope__no_runtime_type_checking.go.diff 1`] = ` ---- go/jsiicalc/jsiicalc_ParamShadowsScope__no_runtime_type_checking.go --no-runtime-type-checking -+++ go/jsiicalc/jsiicalc_ParamShadowsScope__no_runtime_type_checking.go --runtime-type-checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/StripInternal__no_checks.go.diff 1`] = ` +--- go/jsiicalc/StripInternal__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/StripInternal__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -32332,16 +32516,49 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func (p *jsiiProxy_ParamShadowsScope) validateUseScopeParameters(scope scopejsiicalclib.Number) error { ++func (j *jsiiProxy_StripInternal) validateSetYouSeeMeParameters(val *string) error { + return nil +} + `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_ParamShadowsScope__runtime_type_checks.go.diff 1`] = ` ---- go/jsiicalc/jsiicalc_ParamShadowsScope__runtime_type_checks.go --no-runtime-type-checking -+++ go/jsiicalc/jsiicalc_ParamShadowsScope__runtime_type_checks.go --runtime-type-checking -@@ -0,0 +1,19 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/StructPassing.go.diff 1`] = ` +--- go/jsiicalc/StructPassing.go --no-runtime-type-checking ++++ go/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/StructPassing__checks.go.diff 1`] = ` +--- go/jsiicalc/StructPassing__checks.go --no-runtime-type-checking ++++ go/jsiicalc/StructPassing__checks.go --runtime-type-checking +@@ -0,0 +1,40 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -32350,42 +32567,44 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j +import ( + "fmt" + -+ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + -+func (p *jsiiProxy_ParamShadowsScope) validateUseScopeParameters(scope scopejsiicalclib.Number) error { -+ if scope == nil { -+ return fmt.Errorf("parameter scope is required, but nil was provided") ++func validateStructPassing_HowManyVarArgsDidIPassParameters(_positional *float64, inputs *[]*TopLevelStruct) error { ++ if _positional == nil { ++ return fmt.Errorf("parameter _positional is required, but nil was provided") ++ } ++ ++ for idx_323815, v := range *inputs { ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter inputs[%#v]", idx_323815) }); err != nil { ++ return err ++ } + } + + 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) ++func validateStructPassing_RoundTripParameters(_positional *float64, input *TopLevelStruct) error { ++ if _positional == nil { ++ return fmt.Errorf("parameter _positional is required, but nil was provided") + } - var returns *string - - _jsii_.Invoke( - p, - "consumePartiallyInitializedThis", ++ ++ 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_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,11 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/StructPassing__no_checks.go.diff 1`] = ` +--- go/jsiicalc/StructPassing__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/StructPassing__no_checks.go --runtime-type-checking +@@ -0,0 +1,15 @@ +//go:build no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -32393,16 +32612,67 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// 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 { ++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_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,26 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/StructUnionConsumer.go.diff 1`] = ` +--- go/jsiicalc/StructUnionConsumer.go --no-runtime-type-checking ++++ go/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/StructUnionConsumer__checks.go.diff 1`] = ` +--- go/jsiicalc/StructUnionConsumer__checks.go --no-runtime-type-checking ++++ go/jsiicalc/StructUnionConsumer__checks.go --runtime-type-checking +@@ -0,0 +1,91 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -32410,111 +32680,126 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +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") -+ } ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++) + -+ if dt == nil { -+ return fmt.Errorf("parameter dt is required, but nil was provided") ++func validateStructUnionConsumer_IsStructAParameters(struct_ interface{}) error { ++ if struct_ == nil { ++ return fmt.Errorf("parameter struct_ is required, but nil was provided") + } -+ -+ if ev == "" { -+ return fmt.Errorf("parameter ev 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 +} + -`; - -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) ++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_) ++ } + } - 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,11 @@ -+//go:build no_runtime_type_checking + -+// A simple calcuator built on JSII. -+package jsiicalc ++ return nil ++} + -+// Building without runtime type checking enabled, so all the below just return nil ++func validateStructUnionConsumer_ProvideStructParameters(which *string) error { ++ if which == nil { ++ return fmt.Errorf("parameter which is required, but nil was provided") ++ } + -+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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/StructUnionConsumer__no_checks.go.diff 1`] = ` +--- go/jsiicalc/StructUnionConsumer__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/StructUnionConsumer__no_checks.go --runtime-type-checking @@ -0,0 +1,19 @@ -+//go:build !no_runtime_type_checking ++//go:build no_runtime_type_checking + +// A simple calcuator built on JSII. +package jsiicalc + -+import ( -+ "fmt" ++// Building without runtime type checking enabled, so all the below just return nil + -+ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" -+) ++func validateStructUnionConsumer_IsStructAParameters(struct_ interface{}) error { ++ return nil ++} + -+func (p *jsiiProxy_Polymorphism) validateSayHelloParameters(friendly scopejsiicalclib.IFriendly) error { -+ if friendly == nil { -+ return fmt.Errorf("parameter friendly is required, but nil was provided") -+ } ++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_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, +exports[`Generated code for "jsii-calc": /go/jsiicalc/Sum.go.diff 1`] = ` +--- go/jsiicalc/Sum.go --no-runtime-type-checking ++++ go/jsiicalc/Sum.go --runtime-type-checking +@@ -126,34 +126,46 @@ + s, ) } - func (j *jsiiProxy_Power)SetDecorationPostfixes(val *[]*string) { + func (j *jsiiProxy_Sum)SetDecorationPostfixes(val *[]*string) { + if err := j.validateSetDecorationPostfixesParameters(val); err != nil { + panic(err) + } @@ -32525,7 +32810,7 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j ) } - func (j *jsiiProxy_Power)SetDecorationPrefixes(val *[]*string) { + func (j *jsiiProxy_Sum)SetDecorationPrefixes(val *[]*string) { + if err := j.validateSetDecorationPrefixesParameters(val); err != nil { + panic(err) + } @@ -32536,7 +32821,18 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j ) } - func (j *jsiiProxy_Power)SetStringStyle(val composition.CompositeOperation_CompositionStringStyle) { + 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) + } @@ -32547,39 +32843,10 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j ) `; -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,23 @@ -+//go: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,48 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/Sum__checks.go.diff 1`] = ` +--- go/jsiicalc/Sum__checks.go --no-runtime-type-checking ++++ go/jsiicalc/Sum__checks.go --runtime-type-checking +@@ -0,0 +1,44 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -32592,7 +32859,7 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" +) + -+func (j *jsiiProxy_Power) validateSetDecorationPostfixesParameters(val *[]*string) error { ++func (j *jsiiProxy_Sum) validateSetDecorationPostfixesParameters(val *[]*string) error { + if val == nil { + return fmt.Errorf("parameter val is required, but nil was provided") + } @@ -32600,7 +32867,7 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + return nil +} + -+func (j *jsiiProxy_Power) validateSetDecorationPrefixesParameters(val *[]*string) error { ++func (j *jsiiProxy_Sum) validateSetDecorationPrefixesParameters(val *[]*string) error { + if val == nil { + return fmt.Errorf("parameter val is required, but nil was provided") + } @@ -32608,21 +32875,17 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + return nil +} + -+func (j *jsiiProxy_Power) validateSetStringStyleParameters(val composition.CompositeOperation_CompositionStringStyle) error { -+ if val == "" { ++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 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") ++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 @@ -32630,29 +32893,10 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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,11 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/Sum__no_checks.go.diff 1`] = ` +--- go/jsiicalc/Sum__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/Sum__no_checks.go --runtime-type-checking +@@ -0,0 +1,23 @@ +//go:build no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -32660,77 +32904,46 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func (r *jsiiProxy_ReferenceEnumFromScopedPackage) validateSaveFooParameters(value scopejsiicalclib.EnumFromScopedModule) error { ++func (j *jsiiProxy_Sum) validateSetDecorationPostfixesParameters(val *[]*string) 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,19 @@ -+//go:build !no_runtime_type_checking -+ -+// A simple calcuator built on JSII. -+package jsiicalc -+ -+import ( -+ "fmt" -+ -+ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" -+) ++func (j *jsiiProxy_Sum) validateSetDecorationPrefixesParameters(val *[]*string) error { ++ return nil ++} + -+func (r *jsiiProxy_ReferenceEnumFromScopedPackage) validateSaveFooParameters(value scopejsiicalclib.EnumFromScopedModule) error { -+ if value == "" { -+ return fmt.Errorf("parameter value is required, but nil was provided") -+ } ++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_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 @@ - } +exports[`Generated code for "jsii-calc": /go/jsiicalc/SupportsNiceJavaBuilder.go.diff 1`] = ` +--- go/jsiicalc/SupportsNiceJavaBuilder.go --no-runtime-type-checking ++++ go/jsiicalc/SupportsNiceJavaBuilder.go --runtime-type-checking +@@ -62,10 +62,13 @@ - func RootStructValidator_Validate(struct_ *RootStruct) { + + func NewSupportsNiceJavaBuilder(id *float64, defaultBar *float64, props *SupportsNiceJavaBuilderProps, rest ...*string) SupportsNiceJavaBuilder { _init_.Initialize() -+ if err := validateRootStructValidator_ValidateParameters(struct_); err != nil { ++ if err := validateNewSupportsNiceJavaBuilderParameters(id, props); 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,11 @@ -+//go: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 -+} -+ + args := []interface{}{id, defaultBar, props} + for _, a := range rest { + args = append(args, a) + } `; -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,22 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/SupportsNiceJavaBuilder__checks.go.diff 1`] = ` +--- go/jsiicalc/SupportsNiceJavaBuilder__checks.go --no-runtime-type-checking ++++ go/jsiicalc/SupportsNiceJavaBuilder__checks.go --runtime-type-checking +@@ -0,0 +1,23 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -32742,11 +32955,12 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + _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") ++func validateNewSupportsNiceJavaBuilderParameters(id *float64, props *SupportsNiceJavaBuilderProps) error { ++ if id == nil { ++ return fmt.Errorf("parameter id is required, but nil was provided") + } -+ if err := _jsii_.ValidateStruct(struct_, func() string { return "parameter struct_" }); err != nil { ++ ++ if err := _jsii_.ValidateStruct(props, func() string { return "parameter props" }); err != nil { + return err + } + @@ -32755,28 +32969,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/SupportsNiceJavaBuilder__no_checks.go.diff 1`] = ` +--- go/jsiicalc/SupportsNiceJavaBuilder__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/SupportsNiceJavaBuilder__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -32785,79 +32980,35 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// 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,21 @@ -+//go: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") -+ } -+ ++func validateNewSupportsNiceJavaBuilderParameters(id *float64, props *SupportsNiceJavaBuilderProps) error { + 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 - } +exports[`Generated code for "jsii-calc": /go/jsiicalc/SupportsNiceJavaBuilderWithRequiredProps.go.diff 1`] = ` +--- go/jsiicalc/SupportsNiceJavaBuilderWithRequiredProps.go --no-runtime-type-checking ++++ go/jsiicalc/SupportsNiceJavaBuilderWithRequiredProps.go --runtime-type-checking +@@ -51,10 +51,13 @@ - func (s *jsiiProxy_SingletonInt) IsSingletonInt(value *float64) *bool { -+ if err := s.validateIsSingletonIntParameters(value); err != nil { + + func NewSupportsNiceJavaBuilderWithRequiredProps(id *float64, props *SupportsNiceJavaBuilderProps) SupportsNiceJavaBuilderWithRequiredProps { + _init_.Initialize() + ++ if err := validateNewSupportsNiceJavaBuilderWithRequiredPropsParameters(id, props); err != nil { + panic(err) + } - var returns *bool + j := jsiiProxy_SupportsNiceJavaBuilderWithRequiredProps{} - _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,11 @@ -+//go: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 -+} -+ + _jsii_.Create( + "jsii-calc.SupportsNiceJavaBuilderWithRequiredProps", + []interface{}{id, props}, `; -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,17 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/SupportsNiceJavaBuilderWithRequiredProps__checks.go.diff 1`] = ` +--- go/jsiicalc/SupportsNiceJavaBuilderWithRequiredProps__checks.go --no-runtime-type-checking ++++ go/jsiicalc/SupportsNiceJavaBuilderWithRequiredProps__checks.go --runtime-type-checking +@@ -0,0 +1,26 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -32865,11 +33016,20 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +import ( + "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + -+func (s *jsiiProxy_SingletonInt) validateIsSingletonIntParameters(value *float64) error { -+ if value == nil { -+ return fmt.Errorf("parameter value is required, but nil was provided") ++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 @@ -32877,28 +33037,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/SupportsNiceJavaBuilderWithRequiredProps__no_checks.go.diff 1`] = ` +--- go/jsiicalc/SupportsNiceJavaBuilderWithRequiredProps__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/SupportsNiceJavaBuilderWithRequiredProps__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -32907,265 +33048,190 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// 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,17 @@ -+//go: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") -+ } -+ ++func validateNewSupportsNiceJavaBuilderWithRequiredPropsParameters(id *float64, props *SupportsNiceJavaBuilderProps) error { + 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() +exports[`Generated code for "jsii-calc": /go/jsiicalc/SyncVirtualMethods.go.diff 1`] = ` +--- go/jsiicalc/SyncVirtualMethods.go --no-runtime-type-checking ++++ go/jsiicalc/SyncVirtualMethods.go --runtime-type-checking +@@ -119,42 +119,57 @@ + s, + ) + } -+ if err := validateNewStableClassParameters(readonlyString); err != nil { + func (j *jsiiProxy_SyncVirtualMethods)SetA(val *float64) { ++ if err := j.validateSetAParameters(val); err != nil { + panic(err) + } - j := jsiiProxy_StableClass{} + _jsii_.Set( + j, + "a", + val, + ) + } - _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,11 @@ -+//go: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,17 @@ -+//go: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") + func (j *jsiiProxy_SyncVirtualMethods)SetCallerIsProperty(val *float64) { ++ if err := j.validateSetCallerIsPropertyParameters(val); err != nil { ++ panic(err) + } -+ -+ 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 + _jsii_.Set( + j, + "callerIsProperty", + val, + ) } - func StaticContext_SetStaticVariable(val *bool) { - _init_.Initialize() -+ if err := validateStaticContext_SetStaticVariableParameters(val); err != nil { + func (j *jsiiProxy_SyncVirtualMethods)SetOtherProperty(val *string) { ++ if err := j.validateSetOtherPropertyParameters(val); err != nil { + panic(err) + } - _jsii_.StaticSet( - "jsii-calc.StaticContext", - "staticVariable", + _jsii_.Set( + j, + "otherProperty", 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,11 @@ -+//go: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,17 @@ -+//go: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") + } + + func (j *jsiiProxy_SyncVirtualMethods)SetTheProperty(val *string) { ++ if err := j.validateSetThePropertyParameters(val); err != nil { ++ panic(err) + } -+ -+ 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 @@ + _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 @@ - func NewStatics(value *string) Statics { - _init_.Initialize() + return returns + } -+ if err := validateNewStaticsParameters(value); err != nil { + func (s *jsiiProxy_SyncVirtualMethods) ModifyOtherProperty(value *string) { ++ if err := s.validateModifyOtherPropertyParameters(value); err != nil { + panic(err) + } - j := jsiiProxy_Statics{} - - _jsii_.Create( - "jsii-calc.Statics", + _jsii_.InvokeVoid( + s, + "modifyOtherProperty", []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 { + func (s *jsiiProxy_SyncVirtualMethods) ModifyValueOfTheProperty(value *string) { ++ if err := s.validateModifyValueOfThePropertyParameters(value); err != nil { + panic(err) + } - var returns *string + _jsii_.InvokeVoid( + s, + "modifyValueOfTheProperty", + []interface{}{value}, + ) +@@ -253,10 +274,13 @@ - _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 { + func (s *jsiiProxy_SyncVirtualMethods) VirtualMethod(n *float64) *float64 { ++ if err := s.validateVirtualMethodParameters(n); err != nil { + panic(err) + } - _jsii_.StaticSet( - "jsii-calc.Statics", - "instance", - val, - ) -@@ -131,10 +140,13 @@ + var returns *float64 + + _jsii_.Invoke( + s, + "virtualMethod", +@@ -266,10 +290,13 @@ + return returns } - func Statics_SetNonConstStatic(val *float64) { - _init_.Initialize() -+ if err := validateStatics_SetNonConstStaticParameters(val); err != nil { + func (s *jsiiProxy_SyncVirtualMethods) WriteA(value *float64) { ++ if err := s.validateWriteAParameters(value); err != nil { + panic(err) + } - _jsii_.StaticSet( - "jsii-calc.Statics", - "nonConstStatic", - val, + _jsii_.InvokeVoid( + s, + "writeA", + []interface{}{value}, ) `; -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,23 @@ -+//go:build no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/SyncVirtualMethods__checks.go.diff 1`] = ` +--- go/jsiicalc/SyncVirtualMethods__checks.go --no-runtime-type-checking ++++ go/jsiicalc/SyncVirtualMethods__checks.go --runtime-type-checking +@@ -0,0 +1,81 @@ ++//go: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 ++import ( ++ "fmt" ++) ++ ++func (s *jsiiProxy_SyncVirtualMethods) validateModifyOtherPropertyParameters(value *string) error { ++ if value == nil { ++ return fmt.Errorf("parameter value is required, but nil was provided") ++ } + -+func validateStatics_StaticMethodParameters(name *string) error { + return nil +} + -+func validateStatics_SetInstanceParameters(val Statics) error { ++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 validateStatics_SetNonConstStaticParameters(val *float64) error { ++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 validateNewStaticsParameters(value *string) error { ++func (s *jsiiProxy_SyncVirtualMethods) validateWriteAParameters(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_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,41 @@ -+//go:build !no_runtime_type_checking -+ -+// A simple calcuator built on JSII. -+package jsiicalc ++func (j *jsiiProxy_SyncVirtualMethods) validateSetAParameters(val *float64) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } + -+import ( -+ "fmt" -+) ++ return nil ++} + -+func validateStatics_StaticMethodParameters(name *string) error { -+ if name == nil { -+ return fmt.Errorf("parameter name is required, but nil was provided") ++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 validateStatics_SetInstanceParameters(val Statics) error { ++func (j *jsiiProxy_SyncVirtualMethods) validateSetOtherPropertyParameters(val *string) error { + if val == nil { + return fmt.Errorf("parameter val is required, but nil was provided") + } @@ -33173,7 +33239,7 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + return nil +} + -+func validateStatics_SetNonConstStaticParameters(val *float64) error { ++func (j *jsiiProxy_SyncVirtualMethods) validateSetThePropertyParameters(val *string) error { + if val == nil { + return fmt.Errorf("parameter val is required, but nil was provided") + } @@ -33181,9 +33247,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + return nil +} + -+func validateNewStaticsParameters(value *string) error { -+ if value == nil { -+ return fmt.Errorf("parameter value is required, but nil was provided") ++func (j *jsiiProxy_SyncVirtualMethods) validateSetValueOfOtherPropertyParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") + } + + return nil @@ -33191,29 +33257,10 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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,11 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/SyncVirtualMethods__no_checks.go.diff 1`] = ` +--- go/jsiicalc/SyncVirtualMethods__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/SyncVirtualMethods__no_checks.go --runtime-type-checking +@@ -0,0 +1,43 @@ +//go:build no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -33221,93 +33268,81 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func (j *jsiiProxy_StripInternal) validateSetYouSeeMeParameters(val *string) error { ++func (s *jsiiProxy_SyncVirtualMethods) validateModifyOtherPropertyParameters(value *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,17 @@ -+//go:build !no_runtime_type_checking ++func (s *jsiiProxy_SyncVirtualMethods) validateModifyValueOfThePropertyParameters(value *string) error { ++ return nil ++} + -+// A simple calcuator built on JSII. -+package jsiicalc ++func (s *jsiiProxy_SyncVirtualMethods) validateVirtualMethodParameters(n *float64) error { ++ return nil ++} + -+import ( -+ "fmt" -+) ++func (s *jsiiProxy_SyncVirtualMethods) validateWriteAParameters(value *float64) error { ++ return nil ++} + -+func (j *jsiiProxy_StripInternal) validateSetYouSeeMeParameters(val *string) error { -+ if val == nil { -+ return fmt.Errorf("parameter val is required, but nil was provided") -+ } ++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_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 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/TestStructWithEnum.go.diff 1`] = ` +--- go/jsiicalc/TestStructWithEnum.go --no-runtime-type-checking ++++ go/jsiicalc/TestStructWithEnum.go --runtime-type-checking +@@ -66,10 +66,13 @@ + t, + ) } - func StructPassing_HowManyVarArgsDidIPass(_positional *float64, inputs ...*TopLevelStruct) *float64 { - _init_.Initialize() - -+ if err := validateStructPassing_HowManyVarArgsDidIPassParameters(_positional, &inputs); err != nil { + func (t *jsiiProxy_TestStructWithEnum) IsStringEnumA(input *StructWithEnum) *bool { ++ if err := t.validateIsStringEnumAParameters(input); err != nil { + panic(err) + } - args := []interface{}{_positional} - for _, a := range inputs { - args = append(args, a) - } + var returns *bool -@@ -60,10 +63,13 @@ - } + _jsii_.Invoke( + t, + "isStringEnumA", +@@ -79,10 +82,13 @@ - func StructPassing_RoundTrip(_positional *float64, input *TopLevelStruct) *TopLevelStruct { - _init_.Initialize() + return returns + } -+ if err := validateStructPassing_RoundTripParameters(_positional, input); err != nil { + func (t *jsiiProxy_TestStructWithEnum) IsStringEnumB(input *StructWithEnum) *bool { ++ if err := t.validateIsStringEnumBParameters(input); err != nil { + panic(err) + } - var returns *TopLevelStruct + var returns *bool - _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,15 @@ -+//go: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 -+} -+ + _jsii_.Invoke( + t, + "isStringEnumB", `; -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,40 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/TestStructWithEnum__checks.go.diff 1`] = ` +--- go/jsiicalc/TestStructWithEnum__checks.go --no-runtime-type-checking ++++ go/jsiicalc/TestStructWithEnum__checks.go --runtime-type-checking +@@ -0,0 +1,33 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -33319,25 +33354,18 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + _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") ++func (t *jsiiProxy_TestStructWithEnum) validateIsStringEnumAParameters(input *StructWithEnum) error { ++ if input == nil { ++ return fmt.Errorf("parameter input is required, but nil was provided") + } -+ -+ for idx_323815, v := range *inputs { -+ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter inputs[%#v]", idx_323815) }); err != nil { -+ return err -+ } ++ if err := _jsii_.ValidateStruct(input, func() string { return "parameter input" }); 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") -+ } -+ ++func (t *jsiiProxy_TestStructWithEnum) validateIsStringEnumBParameters(input *StructWithEnum) error { + if input == nil { + return fmt.Errorf("parameter input is required, but nil was provided") + } @@ -33350,57 +33378,10 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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,19 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/TestStructWithEnum__no_checks.go.diff 1`] = ` +--- go/jsiicalc/TestStructWithEnum__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/TestStructWithEnum__no_checks.go --runtime-type-checking +@@ -0,0 +1,15 @@ +//go:build no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -33408,24 +33389,20 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// 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 { ++func (t *jsiiProxy_TestStructWithEnum) validateIsStringEnumAParameters(input *StructWithEnum) error { + return nil +} + -+func validateStructUnionConsumer_ProvideStructParameters(which *string) error { ++func (t *jsiiProxy_TestStructWithEnum) validateIsStringEnumBParameters(input *StructWithEnum) 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,91 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/UnaryOperation__checks.go.diff 1`] = ` +--- go/jsiicalc/UnaryOperation__checks.go --no-runtime-type-checking ++++ go/jsiicalc/UnaryOperation__checks.go --runtime-type-checking +@@ -0,0 +1,19 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -33434,215 +33411,241 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j +import ( + "fmt" + -+ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++ "github.com/aws/jsii/jsii-calc/go/scopejsiicalclib" +) + -+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_) -+ } ++func validateNewUnaryOperationParameters(operand scopejsiicalclib.NumericValue) error { ++ if operand == nil { ++ return fmt.Errorf("parameter operand is required, but nil was provided") + } + + return nil +} + -+func validateStructUnionConsumer_IsStructBParameters(struct_ interface{}) error { -+ if struct_ == nil { -+ return fmt.Errorf("parameter struct_ is required, but nil was provided") +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/UnaryOperation__no_checks.go.diff 1`] = ` +--- go/jsiicalc/UnaryOperation__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/UnaryOperation__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go: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/UpcasingReflectable.go.diff 1`] = ` +--- go/jsiicalc/UpcasingReflectable.go --no-runtime-type-checking ++++ go/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) + } -+ 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_) -+ } + j := jsiiProxy_UpcasingReflectable{} + + _jsii_.Create( + "jsii-calc.UpcasingReflectable", + []interface{}{delegate}, +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/UpcasingReflectable__checks.go.diff 1`] = ` +--- go/jsiicalc/UpcasingReflectable__checks.go --no-runtime-type-checking ++++ go/jsiicalc/UpcasingReflectable__checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ ++//go: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 +} + -+func validateStructUnionConsumer_ProvideStructParameters(which *string) error { -+ if which == nil { -+ return fmt.Errorf("parameter which is required, but nil was provided") -+ } +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/UpcasingReflectable__no_checks.go.diff 1`] = ` +--- go/jsiicalc/UpcasingReflectable__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/UpcasingReflectable__no_checks.go --runtime-type-checking +@@ -0,0 +1,11 @@ ++//go: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_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, - ) - } +exports[`Generated code for "jsii-calc": /go/jsiicalc/UsesInterfaceWithProperties.go.diff 1`] = ` +--- go/jsiicalc/UsesInterfaceWithProperties.go --no-runtime-type-checking ++++ go/jsiicalc/UsesInterfaceWithProperties.go --runtime-type-checking +@@ -30,10 +30,13 @@ - 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 { + func NewUsesInterfaceWithProperties(obj IInterfaceWithProperties) UsesInterfaceWithProperties { + _init_.Initialize() + ++ if err := validateNewUsesInterfaceWithPropertiesParameters(obj); err != nil { + panic(err) + } - _jsii_.Set( - j, - "decorationPrefixes", - val, - ) + j := jsiiProxy_UsesInterfaceWithProperties{} + + _jsii_.Create( + "jsii-calc.UsesInterfaceWithProperties", + []interface{}{obj}, +@@ -65,10 +68,13 @@ + + return returns } - func (j *jsiiProxy_Sum)SetParts(val *[]scopejsiicalclib.NumericValue) { -+ if err := j.validateSetPartsParameters(val); err != nil { + func (u *jsiiProxy_UsesInterfaceWithProperties) ReadStringAndNumber(ext IInterfaceWithPropertiesExtension) *string { ++ if err := u.validateReadStringAndNumberParameters(ext); err != nil { + panic(err) + } - _jsii_.Set( - j, - "parts", - val, - ) + var returns *string + + _jsii_.Invoke( + u, + "readStringAndNumber", +@@ -78,10 +84,13 @@ + + return returns } - func (j *jsiiProxy_Sum)SetStringStyle(val composition.CompositeOperation_CompositionStringStyle) { -+ if err := j.validateSetStringStyleParameters(val); err != nil { + func (u *jsiiProxy_UsesInterfaceWithProperties) WriteAndRead(value *string) *string { ++ if err := u.validateWriteAndReadParameters(value); err != nil { + panic(err) + } - _jsii_.Set( - j, - "stringStyle", - val, - ) + var returns *string + + _jsii_.Invoke( + u, + "writeAndRead", `; -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,23 @@ -+//go:build no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/UsesInterfaceWithProperties__checks.go.diff 1`] = ` +--- go/jsiicalc/UsesInterfaceWithProperties__checks.go --no-runtime-type-checking ++++ go/jsiicalc/UsesInterfaceWithProperties__checks.go --runtime-type-checking +@@ -0,0 +1,33 @@ ++//go: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 ++import ( ++ "fmt" ++) + -+func (j *jsiiProxy_Sum) validateSetDecorationPostfixesParameters(val *[]*string) error { -+ return nil -+} ++func (u *jsiiProxy_UsesInterfaceWithProperties) validateReadStringAndNumberParameters(ext IInterfaceWithPropertiesExtension) error { ++ if ext == nil { ++ return fmt.Errorf("parameter ext is required, but nil was provided") ++ } + -+func (j *jsiiProxy_Sum) validateSetDecorationPrefixesParameters(val *[]*string) error { + return nil +} + -+func (j *jsiiProxy_Sum) validateSetPartsParameters(val *[]scopejsiicalclib.NumericValue) error { ++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 (j *jsiiProxy_Sum) validateSetStringStyleParameters(val composition.CompositeOperation_CompositionStringStyle) error { ++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_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,44 @@ -+//go:build !no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/UsesInterfaceWithProperties__no_checks.go.diff 1`] = ` +--- go/jsiicalc/UsesInterfaceWithProperties__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/UsesInterfaceWithProperties__no_checks.go --runtime-type-checking +@@ -0,0 +1,19 @@ ++//go: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") -+ } ++// Building without runtime type checking enabled, so all the below just return nil + ++func (u *jsiiProxy_UsesInterfaceWithProperties) validateReadStringAndNumberParameters(ext IInterfaceWithPropertiesExtension) error { + return nil +} + -+func (j *jsiiProxy_Sum) validateSetDecorationPrefixesParameters(val *[]*string) error { -+ if val == nil { -+ return fmt.Errorf("parameter val is required, but nil was provided") -+ } ++func (u *jsiiProxy_UsesInterfaceWithProperties) validateWriteAndReadParameters(value *string) error { ++ return nil ++} + ++func validateNewUsesInterfaceWithPropertiesParameters(obj IInterfaceWithProperties) error { + 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") -+ } +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/VariadicInvoker.go.diff 1`] = ` +--- go/jsiicalc/VariadicInvoker.go --no-runtime-type-checking ++++ go/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}, +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/VariadicInvoker__checks.go.diff 1`] = ` +--- go/jsiicalc/VariadicInvoker__checks.go --no-runtime-type-checking ++++ go/jsiicalc/VariadicInvoker__checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ ++//go:build !no_runtime_type_checking ++ ++// A simple calcuator built on JSII. ++package jsiicalc + -+ return nil -+} ++import ( ++ "fmt" ++) + -+func (j *jsiiProxy_Sum) validateSetStringStyleParameters(val composition.CompositeOperation_CompositionStringStyle) error { -+ if val == "" { -+ return fmt.Errorf("parameter val is required, but nil was provided") ++func validateNewVariadicInvokerParameters(method VariadicMethod) error { ++ if method == nil { ++ return fmt.Errorf("parameter method is required, but nil was provided") + } + + return nil @@ -33650,27 +33653,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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); 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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/VariadicInvoker__no_checks.go.diff 1`] = ` +--- go/jsiicalc/VariadicInvoker__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/VariadicInvoker__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -33679,16 +33664,34 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func validateNewSupportsNiceJavaBuilderParameters(id *float64, props *SupportsNiceJavaBuilderProps) error { ++func validateNewVariadicInvokerParameters(method VariadicMethod) 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,23 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/VariadicMethod.go.diff 1`] = ` +--- go/jsiicalc/VariadicMethod.go --no-runtime-type-checking ++++ go/jsiicalc/VariadicMethod.go --runtime-type-checking +@@ -48,10 +48,13 @@ + v, + ) + } + + func (v *jsiiProxy_VariadicMethod) AsArray(first *float64, others ...*float64) *[]*float64 { ++ if err := v.validateAsArrayParameters(first); err != nil { ++ panic(err) ++ } + args := []interface{}{first} + for _, a := range others { + args = append(args, a) + } +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/VariadicMethod__checks.go.diff 1`] = ` +--- go/jsiicalc/VariadicMethod__checks.go --no-runtime-type-checking ++++ go/jsiicalc/VariadicMethod__checks.go --runtime-type-checking +@@ -0,0 +1,17 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -33696,17 +33699,11 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +import ( + "fmt" -+ -+ _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + -+func validateNewSupportsNiceJavaBuilderParameters(id *float64, props *SupportsNiceJavaBuilderProps) 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 ++func (v *jsiiProxy_VariadicMethod) validateAsArrayParameters(first *float64) error { ++ if first == nil { ++ return fmt.Errorf("parameter first is required, but nil was provided") + } + + return nil @@ -33714,28 +33711,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/VariadicMethod__no_checks.go.diff 1`] = ` +--- go/jsiicalc/VariadicMethod__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/VariadicMethod__no_checks.go --runtime-type-checking @@ -0,0 +1,11 @@ +//go:build no_runtime_type_checking + @@ -33744,16 +33722,49 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + +// Building without runtime type checking enabled, so all the below just return nil + -+func validateNewSupportsNiceJavaBuilderWithRequiredPropsParameters(id *float64, props *SupportsNiceJavaBuilderProps) error { ++func (v *jsiiProxy_VariadicMethod) validateAsArrayParameters(first *float64) 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,26 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/VariadicTypeUnion.go.diff 1`] = ` +--- go/jsiicalc/VariadicTypeUnion.go --no-runtime-type-checking ++++ go/jsiicalc/VariadicTypeUnion.go --runtime-type-checking +@@ -28,10 +28,13 @@ + + + func NewVariadicTypeUnion(union ...interface{}) VariadicTypeUnion { + _init_.Initialize() + ++ if err := validateNewVariadicTypeUnionParameters(&union); err != nil { ++ panic(err) ++ } + args := []interface{}{} + for _, a := range union { + args = append(args, a) + } + +@@ -60,10 +63,13 @@ + v, + ) + } + + func (j *jsiiProxy_VariadicTypeUnion)SetUnion(val *[]interface{}) { ++ if err := j.validateSetUnionParameters(val); err != nil { ++ panic(err) ++ } + _jsii_.Set( + j, + "union", + val, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/VariadicTypeUnion__checks.go.diff 1`] = ` +--- go/jsiicalc/VariadicTypeUnion__checks.go --no-runtime-type-checking ++++ go/jsiicalc/VariadicTypeUnion__checks.go --runtime-type-checking +@@ -0,0 +1,84 @@ +//go:build !no_runtime_type_checking + +// A simple calcuator built on JSII. @@ -33765,16 +33776,74 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + _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") ++func (j *jsiiProxy_VariadicTypeUnion) validateSetUnionParameters(val *[]interface{}) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") + } -+ -+ if props == nil { -+ return fmt.Errorf("parameter props is required, but nil was provided") ++ for idx_97dfc6, v := range *val { ++ switch v.(type) { ++ case *StructA: ++ v := v.(*StructA) ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v]", idx_97dfc6) }); err != nil { ++ return err ++ } ++ case StructA: ++ v_ := v.(StructA) ++ v := &v_ ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v]", idx_97dfc6) }); err != nil { ++ return err ++ } ++ case *StructB: ++ v := v.(*StructB) ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v]", idx_97dfc6) }); err != nil { ++ return err ++ } ++ case StructB: ++ v_ := v.(StructB) ++ v := &v_ ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v]", idx_97dfc6) }); err != nil { ++ return err ++ } ++ default: ++ if !_jsii_.IsAnonymousProxy(v) { ++ return fmt.Errorf("parameter val[%#v] must be one of the allowed types: *StructA, *StructB; received %#v (a %T)", idx_97dfc6, v, v) ++ } ++ } + } -+ if err := _jsii_.ValidateStruct(props, func() string { return "parameter props" }); err != nil { -+ return err ++ ++ return nil ++} ++ ++func validateNewVariadicTypeUnionParameters(union *[]interface{}) error { ++ for idx_ef3ff7, v := range *union { ++ switch v.(type) { ++ case *StructA: ++ v := v.(*StructA) ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter union[%#v]", idx_ef3ff7) }); err != nil { ++ return err ++ } ++ case StructA: ++ v_ := v.(StructA) ++ v := &v_ ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter union[%#v]", idx_ef3ff7) }); err != nil { ++ return err ++ } ++ case *StructB: ++ v := v.(*StructB) ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter union[%#v]", idx_ef3ff7) }); err != nil { ++ return err ++ } ++ case StructB: ++ v_ := v.(StructB) ++ v := &v_ ++ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter union[%#v]", idx_ef3ff7) }); err != nil { ++ return err ++ } ++ default: ++ if !_jsii_.IsAnonymousProxy(v) { ++ return fmt.Errorf("parameter union[%#v] must be one of the allowed types: *StructA, *StructB; received %#v (a %T)", idx_ef3ff7, v, v) ++ } ++ } + } + + return nil @@ -33782,344 +33851,347 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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, +exports[`Generated code for "jsii-calc": /go/jsiicalc/VariadicTypeUnion__no_checks.go.diff 1`] = ` +--- go/jsiicalc/VariadicTypeUnion__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/VariadicTypeUnion__no_checks.go --runtime-type-checking +@@ -0,0 +1,15 @@ ++//go: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_VariadicTypeUnion) validateSetUnionParameters(val *[]interface{}) error { ++ return nil ++} ++ ++func validateNewVariadicTypeUnionParameters(union *[]interface{}) error { ++ return nil ++} ++ +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/VirtualMethodPlayground.go.diff 1`] = ` +--- go/jsiicalc/VirtualMethodPlayground.go --no-runtime-type-checking ++++ go/jsiicalc/VirtualMethodPlayground.go --runtime-type-checking +@@ -42,10 +42,13 @@ + v, ) } - func (j *jsiiProxy_SyncVirtualMethods)SetA(val *float64) { -+ if err := j.validateSetAParameters(val); err != nil { + func (v *jsiiProxy_VirtualMethodPlayground) OverrideMeAsync(index *float64) *float64 { ++ if err := v.validateOverrideMeAsyncParameters(index); err != nil { + panic(err) + } - _jsii_.Set( - j, - "a", - val, - ) - } + var returns *float64 - func (j *jsiiProxy_SyncVirtualMethods)SetCallerIsProperty(val *float64) { -+ if err := j.validateSetCallerIsPropertyParameters(val); err != nil { -+ panic(err) -+ } - _jsii_.Set( - j, - "callerIsProperty", - val, - ) - } + _jsii_.Invoke( + v, + "overrideMeAsync", +@@ -55,10 +58,13 @@ - func (j *jsiiProxy_SyncVirtualMethods)SetOtherProperty(val *string) { -+ if err := j.validateSetOtherPropertyParameters(val); err != nil { -+ panic(err) -+ } - _jsii_.Set( - j, - "otherProperty", - val, - ) + return returns } - func (j *jsiiProxy_SyncVirtualMethods)SetTheProperty(val *string) { -+ if err := j.validateSetThePropertyParameters(val); err != nil { + func (v *jsiiProxy_VirtualMethodPlayground) OverrideMeSync(index *float64) *float64 { ++ if err := v.validateOverrideMeSyncParameters(index); err != nil { + panic(err) + } - _jsii_.Set( - j, - "theProperty", - val, - ) - } + var returns *float64 - 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 @@ + _jsii_.Invoke( + v, + "overrideMeSync", +@@ -68,10 +74,13 @@ return returns } - func (s *jsiiProxy_SyncVirtualMethods) ModifyOtherProperty(value *string) { -+ if err := s.validateModifyOtherPropertyParameters(value); err != nil { + func (v *jsiiProxy_VirtualMethodPlayground) ParallelSumAsync(count *float64) *float64 { ++ if err := v.validateParallelSumAsyncParameters(count); err != nil { + panic(err) + } - _jsii_.InvokeVoid( - s, - "modifyOtherProperty", - []interface{}{value}, - ) - } + var returns *float64 - 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 @@ + _jsii_.Invoke( + v, + "parallelSumAsync", +@@ -81,10 +90,13 @@ return returns } - func (s *jsiiProxy_SyncVirtualMethods) VirtualMethod(n *float64) *float64 { -+ if err := s.validateVirtualMethodParameters(n); err != nil { + func (v *jsiiProxy_VirtualMethodPlayground) SerialSumAsync(count *float64) *float64 { ++ if err := v.validateSerialSumAsyncParameters(count); err != nil { + panic(err) + } var returns *float64 _jsii_.Invoke( - s, - "virtualMethod", -@@ -266,10 +290,13 @@ + v, + "serialSumAsync", +@@ -94,10 +106,13 @@ return returns } - func (s *jsiiProxy_SyncVirtualMethods) WriteA(value *float64) { -+ if err := s.validateWriteAParameters(value); err != nil { + func (v *jsiiProxy_VirtualMethodPlayground) SumSync(count *float64) *float64 { ++ if err := v.validateSumSyncParameters(count); err != nil { + panic(err) + } - _jsii_.InvokeVoid( - s, - "writeA", - []interface{}{value}, - ) + var returns *float64 + + _jsii_.Invoke( + v, + "sumSync", `; -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,43 @@ -+//go:build no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/VirtualMethodPlayground__checks.go.diff 1`] = ` +--- go/jsiicalc/VirtualMethodPlayground__checks.go --no-runtime-type-checking ++++ go/jsiicalc/VirtualMethodPlayground__checks.go --runtime-type-checking +@@ -0,0 +1,49 @@ ++//go: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 ++import ( ++ "fmt" ++) + -+func (s *jsiiProxy_SyncVirtualMethods) validateModifyOtherPropertyParameters(value *string) error { -+ return nil -+} ++func (v *jsiiProxy_VirtualMethodPlayground) validateOverrideMeAsyncParameters(index *float64) error { ++ if index == nil { ++ return fmt.Errorf("parameter index is required, but nil was provided") ++ } + -+func (s *jsiiProxy_SyncVirtualMethods) validateModifyValueOfThePropertyParameters(value *string) error { + return nil +} + -+func (s *jsiiProxy_SyncVirtualMethods) validateVirtualMethodParameters(n *float64) error { -+ return nil -+} ++func (v *jsiiProxy_VirtualMethodPlayground) validateOverrideMeSyncParameters(index *float64) error { ++ if index == nil { ++ return fmt.Errorf("parameter index is required, but nil was provided") ++ } + -+func (s *jsiiProxy_SyncVirtualMethods) validateWriteAParameters(value *float64) error { + return nil +} + -+func (j *jsiiProxy_SyncVirtualMethods) validateSetAParameters(val *float64) error { -+ return nil -+} ++func (v *jsiiProxy_VirtualMethodPlayground) validateParallelSumAsyncParameters(count *float64) error { ++ if count == nil { ++ return fmt.Errorf("parameter count is required, but nil was provided") ++ } + -+func (j *jsiiProxy_SyncVirtualMethods) validateSetCallerIsPropertyParameters(val *float64) error { + return nil +} + -+func (j *jsiiProxy_SyncVirtualMethods) validateSetOtherPropertyParameters(val *string) error { -+ return nil -+} ++func (v *jsiiProxy_VirtualMethodPlayground) validateSerialSumAsyncParameters(count *float64) error { ++ if count == nil { ++ return fmt.Errorf("parameter count is required, but nil was provided") ++ } + -+func (j *jsiiProxy_SyncVirtualMethods) validateSetThePropertyParameters(val *string) error { + return nil +} + -+func (j *jsiiProxy_SyncVirtualMethods) validateSetValueOfOtherPropertyParameters(val *string) error { ++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/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,81 @@ -+//go:build !no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/VirtualMethodPlayground__no_checks.go.diff 1`] = ` +--- go/jsiicalc/VirtualMethodPlayground__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/VirtualMethodPlayground__no_checks.go --runtime-type-checking +@@ -0,0 +1,27 @@ ++//go: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") -+ } ++// Building without runtime type checking enabled, so all the below just return nil + ++func (v *jsiiProxy_VirtualMethodPlayground) validateOverrideMeAsyncParameters(index *float64) error { + return nil +} + -+func (s *jsiiProxy_SyncVirtualMethods) validateModifyValueOfThePropertyParameters(value *string) error { -+ if value == nil { -+ return fmt.Errorf("parameter value is required, but nil was provided") -+ } -+ ++func (v *jsiiProxy_VirtualMethodPlayground) validateOverrideMeSyncParameters(index *float64) error { + return nil +} + -+func (s *jsiiProxy_SyncVirtualMethods) validateVirtualMethodParameters(n *float64) error { -+ if n == nil { -+ return fmt.Errorf("parameter n is required, but nil was provided") -+ } -+ ++func (v *jsiiProxy_VirtualMethodPlayground) validateParallelSumAsyncParameters(count *float64) error { + return nil +} + -+func (s *jsiiProxy_SyncVirtualMethods) validateWriteAParameters(value *float64) error { -+ if value == nil { -+ return fmt.Errorf("parameter value is required, but nil was provided") -+ } -+ ++func (v *jsiiProxy_VirtualMethodPlayground) validateSerialSumAsyncParameters(count *float64) error { + return nil +} + -+func (j *jsiiProxy_SyncVirtualMethods) validateSetAParameters(val *float64) error { -+ if val == nil { -+ return fmt.Errorf("parameter val is required, but nil was provided") -+ } -+ ++func (v *jsiiProxy_VirtualMethodPlayground) validateSumSyncParameters(count *float64) error { + return nil +} + -+func (j *jsiiProxy_SyncVirtualMethods) validateSetCallerIsPropertyParameters(val *float64) error { -+ if val == nil { -+ return fmt.Errorf("parameter val is required, but nil was provided") +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/anonymous/UseOptions.go.diff 1`] = ` +--- go/jsiicalc/anonymous/UseOptions.go --no-runtime-type-checking ++++ go/jsiicalc/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/UseOptions__checks.go.diff 1`] = ` +--- go/jsiicalc/anonymous/UseOptions__checks.go --no-runtime-type-checking ++++ go/jsiicalc/anonymous/UseOptions__checks.go --runtime-type-checking +@@ -0,0 +1,44 @@ ++//go:build !no_runtime_type_checking + -+ return nil -+} ++package anonymous + -+func (j *jsiiProxy_SyncVirtualMethods) validateSetOtherPropertyParameters(val *string) error { -+ if val == nil { -+ return fmt.Errorf("parameter val is required, but nil was provided") -+ } ++import ( ++ "fmt" + -+ return nil -+} ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++) + -+func (j *jsiiProxy_SyncVirtualMethods) validateSetThePropertyParameters(val *string) error { -+ if val == nil { -+ return fmt.Errorf("parameter val is required, but nil was provided") ++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 (j *jsiiProxy_SyncVirtualMethods) validateSetValueOfOtherPropertyParameters(val *string) error { -+ if val == nil { -+ return fmt.Errorf("parameter val is required, but nil was provided") ++func validateUseOptions_PrivideAsAnyParameters(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_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) ++func validateUseOptions_ProvideParameters(which *string) error { ++ if which == nil { ++ return fmt.Errorf("parameter which is required, but nil was provided") + } - var returns *bool - - _jsii_.Invoke( - t, - "isStringEnumB", ++ ++ return nil ++} ++ `; -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,15 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/anonymous/UseOptions__no_checks.go.diff 1`] = ` +--- go/jsiicalc/anonymous/UseOptions__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/anonymous/UseOptions__no_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ +//go:build no_runtime_type_checking + -+// A simple calcuator built on JSII. -+package jsiicalc ++package anonymous + +// Building without runtime type checking enabled, so all the below just return nil + -+func (t *jsiiProxy_TestStructWithEnum) validateIsStringEnumAParameters(input *StructWithEnum) error { ++func validateUseOptions_ConsumeParameters(option interface{}) error { + return nil +} + -+func (t *jsiiProxy_TestStructWithEnum) validateIsStringEnumBParameters(input *StructWithEnum) error { ++func validateUseOptions_PrivideAsAnyParameters(which *string) error { ++ return nil ++} ++ ++func validateUseOptions_ProvideParameters(which *string) 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,33 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk16625/Cdk16625.go.diff 1`] = ` +--- go/jsiicalc/cdk16625/Cdk16625.go --no-runtime-type-checking ++++ go/jsiicalc/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__checks.go.diff 1`] = ` +--- go/jsiicalc/cdk16625/Cdk16625__checks.go --no-runtime-type-checking ++++ go/jsiicalc/cdk16625/Cdk16625__checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ +//go:build !no_runtime_type_checking + -+// A simple calcuator built on JSII. -+package jsiicalc ++package cdk16625 + +import ( + "fmt" + -+ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++ "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3" +) + -+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 ++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 @@ -34127,41 +34199,56 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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,11 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk16625/Cdk16625__no_checks.go.diff 1`] = ` +--- go/jsiicalc/cdk16625/Cdk16625__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/cdk16625/Cdk16625__no_checks.go --runtime-type-checking +@@ -0,0 +1,10 @@ +//go:build no_runtime_type_checking + -+// A simple calcuator built on JSII. -+package jsiicalc ++package cdk16625 + +// Building without runtime type checking enabled, so all the below just return nil + -+func validateNewUnaryOperationParameters(operand scopejsiicalclib.NumericValue) error { ++func (c *jsiiProxy_Cdk16625) validateUnwrapParameters(gen jsiicalc.IRandomNumberGenerator) 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,19 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk16625/donotimport/UnimportedSubmoduleType.go.diff 1`] = ` +--- go/jsiicalc/cdk16625/donotimport/UnimportedSubmoduleType.go --no-runtime-type-checking ++++ go/jsiicalc/cdk16625/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/UnimportedSubmoduleType__checks.go.diff 1`] = ` +--- go/jsiicalc/cdk16625/donotimport/UnimportedSubmoduleType__checks.go --no-runtime-type-checking ++++ go/jsiicalc/cdk16625/donotimport/UnimportedSubmoduleType__checks.go --runtime-type-checking +@@ -0,0 +1,16 @@ +//go:build !no_runtime_type_checking + -+// A simple calcuator built on JSII. -+package jsiicalc ++package donotimport + +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") ++func validateNewUnimportedSubmoduleTypeParameters(value *float64) error { ++ if value == nil { ++ return fmt.Errorf("parameter value is required, but nil was provided") + } + + return nil @@ -34169,169 +34256,156 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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 @@ - +exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk16625/donotimport/UnimportedSubmoduleType__no_checks.go.diff 1`] = ` +--- go/jsiicalc/cdk16625/donotimport/UnimportedSubmoduleType__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/cdk16625/donotimport/UnimportedSubmoduleType__no_checks.go --runtime-type-checking +@@ -0,0 +1,10 @@ ++//go: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/cdk22369/AcceptsPath.go.diff 1`] = ` +--- go/jsiicalc/cdk22369/AcceptsPath.go --no-runtime-type-checking ++++ go/jsiicalc/cdk22369/AcceptsPath.go --runtime-type-checking +@@ -14,10 +14,13 @@ + } - func NewUpcasingReflectable(delegate *map[string]interface{}) UpcasingReflectable { + func NewAcceptsPath(props *AcceptsPathProps) AcceptsPath { _init_.Initialize() -+ if err := validateNewUpcasingReflectableParameters(delegate); err != nil { ++ if err := validateNewAcceptsPathParameters(props); err != nil { + panic(err) + } - j := jsiiProxy_UpcasingReflectable{} + j := jsiiProxy_AcceptsPath{} _jsii_.Create( - "jsii-calc.UpcasingReflectable", - []interface{}{delegate}, + "jsii-calc.cdk22369.AcceptsPath", + []interface{}{props}, `; -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,11 @@ -+//go:build no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk22369/AcceptsPath__checks.go.diff 1`] = ` +--- go/jsiicalc/cdk22369/AcceptsPath__checks.go --no-runtime-type-checking ++++ go/jsiicalc/cdk22369/AcceptsPath__checks.go --runtime-type-checking +@@ -0,0 +1,21 @@ ++//go:build !no_runtime_type_checking + -+// A simple calcuator built on JSII. -+package jsiicalc ++package cdk22369 + -+// Building without runtime type checking enabled, so all the below just return nil ++import ( ++ "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++) ++ ++func validateNewAcceptsPathParameters(props *AcceptsPathProps) 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 ++ } + -+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,17 @@ -+//go:build !no_runtime_type_checking -+ -+// A simple calcuator built on JSII. -+package jsiicalc +exports[`Generated code for "jsii-calc": /go/jsiicalc/cdk22369/AcceptsPath__no_checks.go.diff 1`] = ` +--- go/jsiicalc/cdk22369/AcceptsPath__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/cdk22369/AcceptsPath__no_checks.go --runtime-type-checking +@@ -0,0 +1,10 @@ ++//go:build no_runtime_type_checking + -+import ( -+ "fmt" -+) ++package cdk22369 + -+func validateNewUpcasingReflectableParameters(delegate *map[string]interface{}) error { -+ if delegate == nil { -+ return fmt.Errorf("parameter delegate is required, but nil was provided") -+ } ++// Building without runtime type checking enabled, so all the below just return nil + ++func validateNewAcceptsPathParameters(props *AcceptsPathProps) error { + 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() +exports[`Generated code for "jsii-calc": /go/jsiicalc/composition/CompositeOperation.go.diff 1`] = ` +--- go/jsiicalc/composition/CompositeOperation.go --no-runtime-type-checking ++++ go/jsiicalc/composition/CompositeOperation.go --runtime-type-checking +@@ -97,26 +97,35 @@ + c, + ) + } -+ if err := validateNewUsesInterfaceWithPropertiesParameters(obj); err != nil { + func (j *jsiiProxy_CompositeOperation)SetDecorationPostfixes(val *[]*string) { ++ if err := j.validateSetDecorationPostfixesParameters(val); err != nil { + panic(err) + } - j := jsiiProxy_UsesInterfaceWithProperties{} - - _jsii_.Create( - "jsii-calc.UsesInterfaceWithProperties", - []interface{}{obj}, -@@ -65,10 +68,13 @@ - - return returns + _jsii_.Set( + j, + "decorationPostfixes", + val, + ) } - func (u *jsiiProxy_UsesInterfaceWithProperties) ReadStringAndNumber(ext IInterfaceWithPropertiesExtension) *string { -+ if err := u.validateReadStringAndNumberParameters(ext); err != nil { + func (j *jsiiProxy_CompositeOperation)SetDecorationPrefixes(val *[]*string) { ++ if err := j.validateSetDecorationPrefixesParameters(val); err != nil { + panic(err) + } - var returns *string - - _jsii_.Invoke( - u, - "readStringAndNumber", -@@ -78,10 +84,13 @@ - - return returns + _jsii_.Set( + j, + "decorationPrefixes", + val, + ) } - func (u *jsiiProxy_UsesInterfaceWithProperties) WriteAndRead(value *string) *string { -+ if err := u.validateWriteAndReadParameters(value); err != nil { + func (j *jsiiProxy_CompositeOperation)SetStringStyle(val CompositeOperation_CompositionStringStyle) { ++ if err := j.validateSetStringStyleParameters(val); 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,19 @@ -+//go: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 -+} -+ + _jsii_.Set( + j, + "stringStyle", + val, + ) `; -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,33 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/composition/CompositeOperation__checks.go.diff 1`] = ` +--- go/jsiicalc/composition/CompositeOperation__checks.go --no-runtime-type-checking ++++ go/jsiicalc/composition/CompositeOperation__checks.go --runtime-type-checking +@@ -0,0 +1,32 @@ +//go:build !no_runtime_type_checking + -+// A simple calcuator built on JSII. -+package jsiicalc ++package composition + +import ( + "fmt" +) + -+func (u *jsiiProxy_UsesInterfaceWithProperties) validateReadStringAndNumberParameters(ext IInterfaceWithPropertiesExtension) error { -+ if ext == nil { -+ return fmt.Errorf("parameter ext is required, but nil was provided") ++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 (u *jsiiProxy_UsesInterfaceWithProperties) validateWriteAndReadParameters(value *string) error { -+ if value == nil { -+ return fmt.Errorf("parameter value is required, but nil was provided") ++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 validateNewUsesInterfaceWithPropertiesParameters(obj IInterfaceWithProperties) error { -+ if obj == nil { -+ return fmt.Errorf("parameter obj is required, but nil was provided") ++func (j *jsiiProxy_CompositeOperation) validateSetStringStyleParameters(val CompositeOperation_CompositionStringStyle) error { ++ if val == "" { ++ return fmt.Errorf("parameter val is required, but nil was provided") + } + + return nil @@ -34339,185 +34413,170 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + `; -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}, -`; - -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,11 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/composition/CompositeOperation__no_checks.go.diff 1`] = ` +--- go/jsiicalc/composition/CompositeOperation__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/composition/CompositeOperation__no_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ +//go:build no_runtime_type_checking + -+// A simple calcuator built on JSII. -+package jsiicalc ++package composition + +// Building without runtime type checking enabled, so all the below just return nil + -+func validateNewVariadicInvokerParameters(method VariadicMethod) error { ++func (j *jsiiProxy_CompositeOperation) validateSetDecorationPostfixesParameters(val *[]*string) 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,17 @@ -+//go:build !no_runtime_type_checking -+ -+// A simple calcuator built on JSII. -+package jsiicalc -+ -+import ( -+ "fmt" -+) -+ -+func validateNewVariadicInvokerParameters(method VariadicMethod) error { -+ if method == nil { -+ return fmt.Errorf("parameter method is required, but nil was provided") -+ } ++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/jsiicalc_VariadicMethod.go.diff 1`] = ` ---- go/jsiicalc/jsiicalc_VariadicMethod.go --no-runtime-type-checking -+++ go/jsiicalc/jsiicalc_VariadicMethod.go --runtime-type-checking -@@ -48,10 +48,13 @@ - v, +exports[`Generated code for "jsii-calc": /go/jsiicalc/derivedclasshasnoproperties/Base.go.diff 1`] = ` +--- go/jsiicalc/derivedclasshasnoproperties/Base.go --no-runtime-type-checking ++++ go/jsiicalc/derivedclasshasnoproperties/Base.go --runtime-type-checking +@@ -49,10 +49,13 @@ + b, ) } - func (v *jsiiProxy_VariadicMethod) AsArray(first *float64, others ...*float64) *[]*float64 { -+ if err := v.validateAsArrayParameters(first); err != nil { + func (j *jsiiProxy_Base)SetProp(val *string) { ++ if err := j.validateSetPropParameters(val); err != nil { + panic(err) + } - args := []interface{}{first} - for _, a := range others { - args = append(args, a) - } + _jsii_.Set( + j, + "prop", + val, + ) `; -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,11 @@ -+//go:build no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/derivedclasshasnoproperties/Base__checks.go.diff 1`] = ` +--- go/jsiicalc/derivedclasshasnoproperties/Base__checks.go --no-runtime-type-checking ++++ go/jsiicalc/derivedclasshasnoproperties/Base__checks.go --runtime-type-checking +@@ -0,0 +1,16 @@ ++//go:build !no_runtime_type_checking + -+// A simple calcuator built on JSII. -+package jsiicalc ++package derivedclasshasnoproperties + -+// Building without runtime type checking enabled, so all the below just return nil ++import ( ++ "fmt" ++) ++ ++func (j *jsiiProxy_Base) validateSetPropParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } + -+func (v *jsiiProxy_VariadicMethod) validateAsArrayParameters(first *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,17 @@ -+//go:build !no_runtime_type_checking -+ -+// A simple calcuator built on JSII. -+package jsiicalc +exports[`Generated code for "jsii-calc": /go/jsiicalc/derivedclasshasnoproperties/Base__no_checks.go.diff 1`] = ` +--- go/jsiicalc/derivedclasshasnoproperties/Base__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/derivedclasshasnoproperties/Base__no_checks.go --runtime-type-checking +@@ -0,0 +1,10 @@ ++//go:build no_runtime_type_checking + -+import ( -+ "fmt" -+) ++package derivedclasshasnoproperties + -+func (v *jsiiProxy_VariadicMethod) validateAsArrayParameters(first *float64) error { -+ if first == nil { -+ return fmt.Errorf("parameter first is required, but nil was provided") -+ } ++// 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/jsiicalc_VariadicTypeUnion.go.diff 1`] = ` ---- go/jsiicalc/jsiicalc_VariadicTypeUnion.go --no-runtime-type-checking -+++ go/jsiicalc/jsiicalc_VariadicTypeUnion.go --runtime-type-checking -@@ -28,10 +28,13 @@ - - - func NewVariadicTypeUnion(union ...interface{}) VariadicTypeUnion { - _init_.Initialize() - -+ if err := validateNewVariadicTypeUnionParameters(&union); err != nil { -+ panic(err) -+ } - args := []interface{}{} - for _, a := range union { - args = append(args, a) - } - -@@ -60,10 +63,13 @@ - v, +exports[`Generated code for "jsii-calc": /go/jsiicalc/derivedclasshasnoproperties/Derived.go.diff 1`] = ` +--- go/jsiicalc/derivedclasshasnoproperties/Derived.go --no-runtime-type-checking ++++ go/jsiicalc/derivedclasshasnoproperties/Derived.go --runtime-type-checking +@@ -50,10 +50,13 @@ + d, ) } - func (j *jsiiProxy_VariadicTypeUnion)SetUnion(val *[]interface{}) { -+ if err := j.validateSetUnionParameters(val); err != nil { + func (j *jsiiProxy_Derived)SetProp(val *string) { ++ if err := j.validateSetPropParameters(val); err != nil { + panic(err) + } _jsii_.Set( j, - "union", + "prop", val, ) `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/jsiicalc_VariadicTypeUnion__no_runtime_type_checking.go.diff 1`] = ` ---- go/jsiicalc/jsiicalc_VariadicTypeUnion__no_runtime_type_checking.go --no-runtime-type-checking -+++ go/jsiicalc/jsiicalc_VariadicTypeUnion__no_runtime_type_checking.go --runtime-type-checking -@@ -0,0 +1,15 @@ -+//go:build no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/derivedclasshasnoproperties/Derived__checks.go.diff 1`] = ` +--- go/jsiicalc/derivedclasshasnoproperties/Derived__checks.go --no-runtime-type-checking ++++ go/jsiicalc/derivedclasshasnoproperties/Derived__checks.go --runtime-type-checking +@@ -0,0 +1,16 @@ ++//go:build !no_runtime_type_checking + -+// A simple calcuator built on JSII. -+package jsiicalc ++package derivedclasshasnoproperties + -+// Building without runtime type checking enabled, so all the below just return nil ++import ( ++ "fmt" ++) ++ ++func (j *jsiiProxy_Derived) validateSetPropParameters(val *string) error { ++ if val == nil { ++ return fmt.Errorf("parameter val is required, but nil was provided") ++ } + -+func (j *jsiiProxy_VariadicTypeUnion) validateSetUnionParameters(val *[]interface{}) error { + return nil +} + -+func validateNewVariadicTypeUnionParameters(union *[]interface{}) error { +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/derivedclasshasnoproperties/Derived__no_checks.go.diff 1`] = ` +--- go/jsiicalc/derivedclasshasnoproperties/Derived__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/derivedclasshasnoproperties/Derived__no_checks.go --runtime-type-checking +@@ -0,0 +1,10 @@ ++//go: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/jsiicalc_VariadicTypeUnion__runtime_type_checks.go.diff 1`] = ` ---- go/jsiicalc/jsiicalc_VariadicTypeUnion__runtime_type_checks.go --no-runtime-type-checking -+++ go/jsiicalc/jsiicalc_VariadicTypeUnion__runtime_type_checks.go --runtime-type-checking -@@ -0,0 +1,84 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/bar/Consumer.go.diff 1`] = ` +--- go/jsiicalc/homonymousforwardreferences/bar/Consumer.go --no-runtime-type-checking ++++ go/jsiicalc/homonymousforwardreferences/bar/Consumer.go --runtime-type-checking +@@ -14,10 +14,13 @@ + } + + func Consumer_Consume(props *ConsumerProps) *Homonymous { + _init_.Initialize() + ++ if err := validateConsumer_ConsumeParameters(props); err != nil { ++ panic(err) ++ } + var returns *Homonymous + + _jsii_.StaticInvoke( + "jsii-calc.homonymousForwardReferences.bar.Consumer", + "consume", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/bar/Consumer__checks.go.diff 1`] = ` +--- go/jsiicalc/homonymousforwardreferences/bar/Consumer__checks.go --no-runtime-type-checking ++++ go/jsiicalc/homonymousforwardreferences/bar/Consumer__checks.go --runtime-type-checking +@@ -0,0 +1,21 @@ +//go:build !no_runtime_type_checking + -+// A simple calcuator built on JSII. -+package jsiicalc ++package bar + +import ( + "fmt" @@ -34525,247 +34584,188 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/j + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + -+func (j *jsiiProxy_VariadicTypeUnion) validateSetUnionParameters(val *[]interface{}) error { -+ if val == nil { -+ return fmt.Errorf("parameter val is required, but nil was provided") ++func validateConsumer_ConsumeParameters(props *ConsumerProps) error { ++ if props == nil { ++ return fmt.Errorf("parameter props is required, but nil was provided") + } -+ for idx_97dfc6, v := range *val { -+ switch v.(type) { -+ case *StructA: -+ v := v.(*StructA) -+ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v]", idx_97dfc6) }); err != nil { -+ return err -+ } -+ case StructA: -+ v_ := v.(StructA) -+ v := &v_ -+ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v]", idx_97dfc6) }); err != nil { -+ return err -+ } -+ case *StructB: -+ v := v.(*StructB) -+ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v]", idx_97dfc6) }); err != nil { -+ return err -+ } -+ case StructB: -+ v_ := v.(StructB) -+ v := &v_ -+ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v]", idx_97dfc6) }); err != nil { -+ return err -+ } -+ default: -+ if !_jsii_.IsAnonymousProxy(v) { -+ return fmt.Errorf("parameter val[%#v] must be one of the allowed types: *StructA, *StructB; received %#v (a %T)", idx_97dfc6, v, v) -+ } -+ } ++ if err := _jsii_.ValidateStruct(props, func() string { return "parameter props" }); err != nil { ++ return err + } + + return nil +} + -+func validateNewVariadicTypeUnionParameters(union *[]interface{}) error { -+ for idx_ef3ff7, v := range *union { -+ switch v.(type) { -+ case *StructA: -+ v := v.(*StructA) -+ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter union[%#v]", idx_ef3ff7) }); err != nil { -+ return err -+ } -+ case StructA: -+ v_ := v.(StructA) -+ v := &v_ -+ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter union[%#v]", idx_ef3ff7) }); err != nil { -+ return err -+ } -+ case *StructB: -+ v := v.(*StructB) -+ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter union[%#v]", idx_ef3ff7) }); err != nil { -+ return err -+ } -+ case StructB: -+ v_ := v.(StructB) -+ v := &v_ -+ if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter union[%#v]", idx_ef3ff7) }); err != nil { -+ return err -+ } -+ default: -+ if !_jsii_.IsAnonymousProxy(v) { -+ return fmt.Errorf("parameter union[%#v] must be one of the allowed types: *StructA, *StructB; received %#v (a %T)", idx_ef3ff7, v, v) -+ } -+ } -+ } +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/bar/Consumer__no_checks.go.diff 1`] = ` +--- go/jsiicalc/homonymousforwardreferences/bar/Consumer__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/homonymousforwardreferences/bar/Consumer__no_checks.go --runtime-type-checking +@@ -0,0 +1,10 @@ ++//go:build no_runtime_type_checking ++ ++package bar ++ ++// Building without runtime type checking enabled, so all the below just return nil + ++func validateConsumer_ConsumeParameters(props *ConsumerProps) error { + 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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/foo/Consumer.go.diff 1`] = ` +--- go/jsiicalc/homonymousforwardreferences/foo/Consumer.go --no-runtime-type-checking ++++ go/jsiicalc/homonymousforwardreferences/foo/Consumer.go --runtime-type-checking +@@ -14,10 +14,13 @@ } - 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 Consumer_Consume(props *ConsumerProps) *Homonymous { + _init_.Initialize() - func (v *jsiiProxy_VirtualMethodPlayground) SumSync(count *float64) *float64 { -+ if err := v.validateSumSyncParameters(count); err != nil { ++ if err := validateConsumer_ConsumeParameters(props); err != nil { + panic(err) + } - var returns *float64 + var returns *Homonymous - _jsii_.Invoke( - v, - "sumSync", + _jsii_.StaticInvoke( + "jsii-calc.homonymousForwardReferences.foo.Consumer", + "consume", `; -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,27 @@ -+//go:build no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/foo/Consumer__checks.go.diff 1`] = ` +--- go/jsiicalc/homonymousforwardreferences/foo/Consumer__checks.go --no-runtime-type-checking ++++ go/jsiicalc/homonymousforwardreferences/foo/Consumer__checks.go --runtime-type-checking +@@ -0,0 +1,21 @@ ++//go:build !no_runtime_type_checking + -+// A simple calcuator built on JSII. -+package jsiicalc ++package foo + -+// Building without runtime type checking enabled, so all the below just return nil ++import ( ++ "fmt" + -+func (v *jsiiProxy_VirtualMethodPlayground) validateOverrideMeAsyncParameters(index *float64) error { -+ return nil -+} ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" ++) + -+func (v *jsiiProxy_VirtualMethodPlayground) validateOverrideMeSyncParameters(index *float64) error { -+ return nil -+} ++func validateConsumer_ConsumeParameters(props *ConsumerProps) 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 ++ } + -+func (v *jsiiProxy_VirtualMethodPlayground) validateParallelSumAsyncParameters(count *float64) error { + return nil +} + -+func (v *jsiiProxy_VirtualMethodPlayground) validateSerialSumAsyncParameters(count *float64) error { -+ return nil -+} +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/homonymousforwardreferences/foo/Consumer__no_checks.go.diff 1`] = ` +--- go/jsiicalc/homonymousforwardreferences/foo/Consumer__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/homonymousforwardreferences/foo/Consumer__no_checks.go --runtime-type-checking +@@ -0,0 +1,10 @@ ++//go:build no_runtime_type_checking + -+func (v *jsiiProxy_VirtualMethodPlayground) validateSumSyncParameters(count *float64) error { ++package foo ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateConsumer_ConsumeParameters(props *ConsumerProps) 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,49 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsii3656/OverrideMe.go.diff 1`] = ` +--- go/jsiicalc/jsii3656/OverrideMe.go --no-runtime-type-checking ++++ go/jsiicalc/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/OverrideMe__checks.go.diff 1`] = ` +--- go/jsiicalc/jsii3656/OverrideMe__checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsii3656/OverrideMe__checks.go --runtime-type-checking +@@ -0,0 +1,29 @@ +//go:build !no_runtime_type_checking + -+// A simple calcuator built on JSII. -+package jsiicalc ++package jsii3656 + +import ( + "fmt" ++ ++ _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + -+func (v *jsiiProxy_VirtualMethodPlayground) validateOverrideMeAsyncParameters(index *float64) error { -+ if index == nil { -+ return fmt.Errorf("parameter index is required, but nil was provided") ++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 (v *jsiiProxy_VirtualMethodPlayground) validateOverrideMeSyncParameters(index *float64) error { -+ if index == nil { -+ return fmt.Errorf("parameter index is required, but nil was provided") ++func validateOverrideMe_CallAbstractParameters(receiver OverrideMe) error { ++ if receiver == nil { ++ return fmt.Errorf("parameter receiver 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") -+ } +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/jsii3656/OverrideMe__no_checks.go.diff 1`] = ` +--- go/jsiicalc/jsii3656/OverrideMe__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/jsii3656/OverrideMe__no_checks.go --runtime-type-checking +@@ -0,0 +1,14 @@ ++//go:build no_runtime_type_checking + -+ return nil -+} ++package jsii3656 + -+func (v *jsiiProxy_VirtualMethodPlayground) validateSerialSumAsyncParameters(count *float64) error { -+ if count == nil { -+ return fmt.Errorf("parameter count is required, but nil was provided") -+ } ++// Building without runtime type checking enabled, so all the below just return nil + ++func (o *jsiiProxy_OverrideMe) validateImplementMeParameters(opts *ImplementMeOpts) error { + return nil +} + -+func (v *jsiiProxy_VirtualMethodPlayground) validateSumSyncParameters(count *float64) error { -+ if count == nil { -+ return fmt.Errorf("parameter count is required, but nil was provided") -+ } -+ ++func validateOverrideMe_CallAbstractParameters(receiver OverrideMe) error { + 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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2530/MyClass.go.diff 1`] = ` +--- go/jsiicalc/module2530/MyClass.go --no-runtime-type-checking ++++ go/jsiicalc/module2530/MyClass.go --runtime-type-checking @@ -18,10 +18,13 @@ } @@ -34807,71 +34807,71 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/m ) `; -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,18 @@ -+//go:build no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2530/MyClass__checks.go.diff 1`] = ` +--- go/jsiicalc/module2530/MyClass__checks.go --no-runtime-type-checking ++++ go/jsiicalc/module2530/MyClass__checks.go --runtime-type-checking +@@ -0,0 +1,32 @@ ++//go:build !no_runtime_type_checking + +package module2530 + -+// Building without runtime type checking enabled, so all the below just return nil ++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/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,32 @@ -+//go:build !no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2530/MyClass__no_checks.go.diff 1`] = ` +--- go/jsiicalc/module2530/MyClass__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/module2530/MyClass__no_checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go:build no_runtime_type_checking + +package module2530 + -+import ( -+ "fmt" -+) ++// Building without runtime type checking enabled, so all the below just return nil + +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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2647/ExtendAndImplement.go.diff 1`] = ` +--- go/jsiicalc/module2647/ExtendAndImplement.go --no-runtime-type-checking ++++ go/jsiicalc/module2647/ExtendAndImplement.go --runtime-type-checking @@ -31,10 +31,13 @@ // Deprecated. @@ -34902,29 +34902,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/m ) `; -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,14 @@ -+//go: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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2647/ExtendAndImplement__checks.go.diff 1`] = ` +--- go/jsiicalc/module2647/ExtendAndImplement__checks.go --no-runtime-type-checking ++++ go/jsiicalc/module2647/ExtendAndImplement__checks.go --runtime-type-checking @@ -0,0 +1,27 @@ +//go:build !no_runtime_type_checking + @@ -34955,9 +34935,29 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/m + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2647/ExtendAndImplement__no_checks.go.diff 1`] = ` +--- go/jsiicalc/module2647/ExtendAndImplement__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/module2647/ExtendAndImplement__no_checks.go --runtime-type-checking +@@ -0,0 +1,14 @@ ++//go: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/module2689/methods/MyClass.go.diff 1`] = ` +--- go/jsiicalc/module2689/methods/MyClass.go --no-runtime-type-checking ++++ go/jsiicalc/module2689/methods/MyClass.go --runtime-type-checking @@ -41,18 +41,24 @@ m, ) @@ -34985,29 +34985,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/m ) `; -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,14 @@ -+//go: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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2689/methods/MyClass__checks.go.diff 1`] = ` +--- go/jsiicalc/module2689/methods/MyClass__checks.go --no-runtime-type-checking ++++ go/jsiicalc/module2689/methods/MyClass__checks.go --runtime-type-checking @@ -0,0 +1,34 @@ +//go:build !no_runtime_type_checking + @@ -35045,9 +35025,29 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/m + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/module2689/methods/MyClass__no_checks.go.diff 1`] = ` +--- go/jsiicalc/module2689/methods/MyClass__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/module2689/methods/MyClass__no_checks.go --runtime-type-checking +@@ -0,0 +1,14 @@ ++//go: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/pythonself/ClassWithSelf.go.diff 1`] = ` +--- go/jsiicalc/pythonself/ClassWithSelf.go --no-runtime-type-checking ++++ go/jsiicalc/pythonself/ClassWithSelf.go --runtime-type-checking @@ -27,10 +27,13 @@ @@ -35078,59 +35078,59 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/p "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,14 @@ -+//go:build no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/ClassWithSelf__checks.go.diff 1`] = ` +--- go/jsiicalc/pythonself/ClassWithSelf__checks.go --no-runtime-type-checking ++++ go/jsiicalc/pythonself/ClassWithSelf__checks.go --runtime-type-checking +@@ -0,0 +1,24 @@ ++//go:build !no_runtime_type_checking + +package pythonself + -+// Building without runtime type checking enabled, so all the below just return nil ++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_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,24 @@ -+//go:build !no_runtime_type_checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/ClassWithSelf__no_checks.go.diff 1`] = ` +--- go/jsiicalc/pythonself/ClassWithSelf__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/pythonself/ClassWithSelf__no_checks.go --runtime-type-checking +@@ -0,0 +1,14 @@ ++//go:build no_runtime_type_checking + +package pythonself + -+import ( -+ "fmt" -+) ++// Building without runtime type checking enabled, so all the below just return nil + +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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/ClassWithSelfKwarg.go.diff 1`] = ` +--- go/jsiicalc/pythonself/ClassWithSelfKwarg.go --no-runtime-type-checking ++++ go/jsiicalc/pythonself/ClassWithSelfKwarg.go --runtime-type-checking @@ -26,10 +26,13 @@ @@ -35147,25 +35147,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/p []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,10 @@ -+//go: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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/ClassWithSelfKwarg__checks.go.diff 1`] = ` +--- go/jsiicalc/pythonself/ClassWithSelfKwarg__checks.go --no-runtime-type-checking ++++ go/jsiicalc/pythonself/ClassWithSelfKwarg__checks.go --runtime-type-checking @@ -0,0 +1,21 @@ +//go:build !no_runtime_type_checking + @@ -35190,9 +35174,25 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/p + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/ClassWithSelfKwarg__no_checks.go.diff 1`] = ` +--- go/jsiicalc/pythonself/ClassWithSelfKwarg__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/pythonself/ClassWithSelfKwarg__no_checks.go --runtime-type-checking +@@ -0,0 +1,10 @@ ++//go: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/IInterfaceWithSelf.go.diff 1`] = ` +--- go/jsiicalc/pythonself/IInterfaceWithSelf.go --no-runtime-type-checking ++++ go/jsiicalc/pythonself/IInterfaceWithSelf.go --runtime-type-checking @@ -12,10 +12,13 @@ type jsiiProxy_IInterfaceWithSelf struct { _ byte // padding @@ -35209,25 +35209,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/p "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,10 @@ -+//go: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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/IInterfaceWithSelf__checks.go.diff 1`] = ` +--- go/jsiicalc/pythonself/IInterfaceWithSelf__checks.go --no-runtime-type-checking ++++ go/jsiicalc/pythonself/IInterfaceWithSelf__checks.go --runtime-type-checking @@ -0,0 +1,16 @@ +//go:build !no_runtime_type_checking + @@ -35247,68 +35231,25 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/p + `; -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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/pythonself/IInterfaceWithSelf__no_checks.go.diff 1`] = ` +--- go/jsiicalc/pythonself/IInterfaceWithSelf__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/pythonself/IInterfaceWithSelf__no_checks.go --runtime-type-checking @@ -0,0 +1,10 @@ +//go:build no_runtime_type_checking + -+package isolated ++package pythonself + +// 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,18 @@ -+//go: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 -+ } -+ ++func (i *jsiiProxy_IInterfaceWithSelf) validateMethodParameters(self *float64) error { + 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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/MyClass.go.diff 1`] = ` +--- go/jsiicalc/submodule/MyClass.go --no-runtime-type-checking ++++ go/jsiicalc/submodule/MyClass.go --runtime-type-checking @@ -79,10 +79,13 @@ @@ -35339,29 +35280,9 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/s "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,14 @@ -+//go: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 +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/MyClass__checks.go.diff 1`] = ` +--- go/jsiicalc/submodule/MyClass__checks.go --no-runtime-type-checking ++++ go/jsiicalc/submodule/MyClass__checks.go --runtime-type-checking @@ -0,0 +1,35 @@ +//go:build !no_runtime_type_checking + @@ -35400,44 +35321,107 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/s + `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/union/union_ConsumesUnion.go.diff 1`] = ` ---- go/jsiicalc/union/union_ConsumesUnion.go --no-runtime-type-checking -+++ go/jsiicalc/union/union_ConsumesUnion.go --runtime-type-checking -@@ -14,10 +14,13 @@ +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/MyClass__no_checks.go.diff 1`] = ` +--- go/jsiicalc/submodule/MyClass__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/submodule/MyClass__no_checks.go --runtime-type-checking +@@ -0,0 +1,14 @@ ++//go: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/isolated/Kwargs.go.diff 1`] = ` +--- go/jsiicalc/submodule/isolated/Kwargs.go --no-runtime-type-checking ++++ go/jsiicalc/submodule/isolated/Kwargs.go --runtime-type-checking +@@ -17,10 +17,13 @@ } - func ConsumesUnion_UnionType(param interface{}) { + func Kwargs_Method(props *child.KwargsProps) *bool { _init_.Initialize() -+ if err := validateConsumesUnion_UnionTypeParameters(param); err != nil { ++ if err := validateKwargs_MethodParameters(props); err != nil { + panic(err) + } - _jsii_.StaticInvokeVoid( - "jsii-calc.union.ConsumesUnion", - "unionType", - []interface{}{param}, - ) + var returns *bool + + _jsii_.StaticInvoke( + "jsii-calc.submodule.isolated.Kwargs", + "method", +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/isolated/Kwargs__checks.go.diff 1`] = ` +--- go/jsiicalc/submodule/isolated/Kwargs__checks.go --no-runtime-type-checking ++++ go/jsiicalc/submodule/isolated/Kwargs__checks.go --runtime-type-checking +@@ -0,0 +1,18 @@ ++//go: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/union/union_ConsumesUnion__no_runtime_type_checking.go.diff 1`] = ` ---- go/jsiicalc/union/union_ConsumesUnion__no_runtime_type_checking.go --no-runtime-type-checking -+++ go/jsiicalc/union/union_ConsumesUnion__no_runtime_type_checking.go --runtime-type-checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/submodule/isolated/Kwargs__no_checks.go.diff 1`] = ` +--- go/jsiicalc/submodule/isolated/Kwargs__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/submodule/isolated/Kwargs__no_checks.go --runtime-type-checking @@ -0,0 +1,10 @@ +//go:build no_runtime_type_checking + -+package union ++package isolated + +// Building without runtime type checking enabled, so all the below just return nil + -+func validateConsumesUnion_UnionTypeParameters(param interface{}) error { ++func validateKwargs_MethodParameters(props *child.KwargsProps) error { + return nil +} + `; -exports[`Generated code for "jsii-calc": /go/jsiicalc/union/union_ConsumesUnion__runtime_type_checks.go.diff 1`] = ` ---- go/jsiicalc/union/union_ConsumesUnion__runtime_type_checks.go --no-runtime-type-checking -+++ go/jsiicalc/union/union_ConsumesUnion__runtime_type_checks.go --runtime-type-checking +exports[`Generated code for "jsii-calc": /go/jsiicalc/union/ConsumesUnion.go.diff 1`] = ` +--- go/jsiicalc/union/ConsumesUnion.go --no-runtime-type-checking ++++ go/jsiicalc/union/ConsumesUnion.go --runtime-type-checking +@@ -14,10 +14,13 @@ + } + + func ConsumesUnion_UnionType(param interface{}) { + _init_.Initialize() + ++ if err := validateConsumesUnion_UnionTypeParameters(param); err != nil { ++ panic(err) ++ } + _jsii_.StaticInvokeVoid( + "jsii-calc.union.ConsumesUnion", + "unionType", + []interface{}{param}, + ) +`; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/union/ConsumesUnion__checks.go.diff 1`] = ` +--- go/jsiicalc/union/ConsumesUnion__checks.go --no-runtime-type-checking ++++ go/jsiicalc/union/ConsumesUnion__checks.go --runtime-type-checking @@ -0,0 +1,32 @@ +//go:build !no_runtime_type_checking + @@ -35472,3 +35456,19 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/u +} + `; + +exports[`Generated code for "jsii-calc": /go/jsiicalc/union/ConsumesUnion__no_checks.go.diff 1`] = ` +--- go/jsiicalc/union/ConsumesUnion__no_checks.go --no-runtime-type-checking ++++ go/jsiicalc/union/ConsumesUnion__no_checks.go --runtime-type-checking +@@ -0,0 +1,10 @@ ++//go:build no_runtime_type_checking ++ ++package union ++ ++// Building without runtime type checking enabled, so all the below just return nil ++ ++func validateConsumesUnion_UnionTypeParameters(param interface{}) error { ++ return nil ++} ++ +`;