diff --git a/.github/dependabot.yml b/.github/dependabot.yml index bcc121c738..33abf8c19a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -49,6 +49,30 @@ updates: - dependencies - language/python + - package-ecosystem: gomod + directory: '/packages/@jsii/go-runtime' + schedule: + interval: daily + labels: + - dependencies + - language/go + ignore: + - dependency-name: github.com/aws/jsii-runtime-go + - dependency-name: github.com/aws/jsii-runtime-go/* + - dependency-name: github.com/aws/jsii/jsii-calc/go/* + + - package-ecosystem: gomod + directory: '/packages/@jsii/go-runtime/jsii-runtime-go' + schedule: + interval: daily + labels: + - dependencies + - language/go + ignore: + - dependency-name: github.com/aws/jsii-runtime-go + - dependency-name: github.com/aws/jsii-runtime-go/* + - dependency-name: github.com/aws/jsii/jsii-calc/go/* + - package-ecosystem: github-actions directory: '/' schedule: diff --git a/.mergify/config.yml b/.mergify/config.yml index cdc9fb36a8..7a60dd0c26 100644 --- a/.mergify/config.yml +++ b/.mergify/config.yml @@ -28,7 +28,6 @@ pull_request_rules: - '#approved-reviews-by>=1' - '#review-requested=0' - '#changes-requested-reviews-by=0' - - status-success~=AWS CodeBuild us-east-1 - status-success=Semantic Pull Request # Docker image validation - status-success=jsii/superchain @@ -80,7 +79,6 @@ pull_request_rules: - '#approved-reviews-by>=1' - '#review-requested=0' - '#changes-requested-reviews-by=0' - - status-success~=AWS CodeBuild us-east-1 - status-success=Semantic Pull Request # Docker image validation - status-success=jsii/superchain @@ -132,7 +130,6 @@ pull_request_rules: - '#approved-reviews-by>=1' - '#review-requested=0' - '#changes-requested-reviews-by=0' - - status-success~=AWS CodeBuild us-east-1 - status-success=Semantic Pull Request # Docker image validation - status-success=jsii/superchain diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f5d109ef4..f42518207d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,20 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [1.24.0](https://github.com/aws/jsii/compare/v1.23.0...v1.24.0) (2021-03-03) + + +### Features + +* **go:** support direct implementation of jsii interfaces ([#2614](https://github.com/aws/jsii/issues/2614)) ([9da3282](https://github.com/aws/jsii/commit/9da32821676a9ed7ea6cd4744c06df4fb3551bc7)), closes [#2048](https://github.com/aws/jsii/issues/2048) + + +### Bug Fixes + +* **go:** enums inside structs are not properly serialized ([#2636](https://github.com/aws/jsii/issues/2636)) ([19cbd25](https://github.com/aws/jsii/commit/19cbd2532e6210f034e12299c5c1b00807a91b90)) +* **go:** invalid generated code for classes a keyword name ([#2641](https://github.com/aws/jsii/issues/2641)) ([8668f13](https://github.com/aws/jsii/commit/8668f13d7b74b3f2fecc0b02d241a1a6f9e2f648)), closes [#2637](https://github.com/aws/jsii/issues/2637) +* **go:** malformed multiline docstrings in constructors ([#2639](https://github.com/aws/jsii/issues/2639)) ([72f25af](https://github.com/aws/jsii/commit/72f25af24c47075d6faa3b624236dd0375e3acdb)), closes [#2638](https://github.com/aws/jsii/issues/2638) + ## [1.23.0](https://github.com/aws/jsii/compare/v1.22.0...v1.23.0) (2021-03-01) ### Features diff --git a/gh-pages/content/user-guides/lib-author/configuration/.pages.yml b/gh-pages/content/user-guides/lib-author/configuration/targets/.pages.yml similarity index 100% rename from gh-pages/content/user-guides/lib-author/configuration/.pages.yml rename to gh-pages/content/user-guides/lib-author/configuration/targets/.pages.yml diff --git a/gh-pages/requirements-dev.txt b/gh-pages/requirements-dev.txt index 71e8bf015c..2514bc0693 100644 --- a/gh-pages/requirements-dev.txt +++ b/gh-pages/requirements-dev.txt @@ -1,4 +1,4 @@ mkdocs~=1.1.2 mkdocs-awesome-pages-plugin~=2.5.0 -mkdocs-material~=6.2.8 +mkdocs-material~=7.0.3 mkdocs-git-revision-date-plugin~=0.3.1 diff --git a/lerna.json b/lerna.json index c6613bd272..0a4add465e 100644 --- a/lerna.json +++ b/lerna.json @@ -10,5 +10,5 @@ "rejectCycles": true } }, - "version": "1.23.0" + "version": "1.24.0" } diff --git a/packages/@jsii/Directory.Build.targets b/packages/@jsii/Directory.Build.targets index 4560114102..dbe665fd17 100644 --- a/packages/@jsii/Directory.Build.targets +++ b/packages/@jsii/Directory.Build.targets @@ -10,7 +10,7 @@ - + diff --git a/packages/@jsii/dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/Amazon.JSII.Runtime.IntegrationTests.csproj b/packages/@jsii/dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/Amazon.JSII.Runtime.IntegrationTests.csproj index 411ca0bdcb..4bf8b4a9c4 100644 --- a/packages/@jsii/dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/Amazon.JSII.Runtime.IntegrationTests.csproj +++ b/packages/@jsii/dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/Amazon.JSII.Runtime.IntegrationTests.csproj @@ -6,7 +6,6 @@ false true - AllEnabledByDefault enable true diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers.UnitTests/AssemblyInfo.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers.UnitTests/AssemblyInfo.cs new file mode 100644 index 0000000000..1492189a99 --- /dev/null +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers.UnitTests/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using System; + +[assembly:CLSCompliant(false)] \ No newline at end of file diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers.UnitTests/Helpers/DiagnosticResult.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers.UnitTests/Helpers/DiagnosticResult.cs index 7f93c45f85..2431681768 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers.UnitTests/Helpers/DiagnosticResult.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers.UnitTests/Helpers/DiagnosticResult.cs @@ -49,7 +49,7 @@ public bool Equals(DiagnosticResultLocation other) public override int GetHashCode() { - return Path.GetHashCode() + return Path.GetHashCode(StringComparison.InvariantCulture) ^ Line.GetHashCode() ^ Column.GetHashCode(); } @@ -70,13 +70,13 @@ public override int GetHashCode() /// public struct DiagnosticResult : IEquatable { - private IReadOnlyList _locations; + private IReadOnlyList? _locations; public IReadOnlyList Locations { get { - _locations ??= new DiagnosticResultLocation[] { }; + _locations ??= Array.Empty(); return _locations; } @@ -108,10 +108,10 @@ public override bool Equals(object? obj) public override int GetHashCode() { return Locations.GetHashCode() - ^ Id.GetHashCode() + ^ Id.GetHashCode(StringComparison.InvariantCulture) ^ Severity.GetHashCode() - ^ Message.GetHashCode() - ^ Path.GetHashCode() + ^ Message.GetHashCode(StringComparison.InvariantCulture) + ^ Path.GetHashCode(StringComparison.InvariantCulture) ^ Line.GetHashCode() ^ Column.GetHashCode(); } diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers.UnitTests/Verifiers/DiagnosticVerifier.Helper.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers.UnitTests/Verifiers/DiagnosticVerifier.Helper.cs index 9fc1cd917c..6ea24946ef 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers.UnitTests/Verifiers/DiagnosticVerifier.Helper.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers.UnitTests/Verifiers/DiagnosticVerifier.Helper.cs @@ -134,24 +134,28 @@ private static Project CreateProject(string[] sources, string language = Languag var projectId = ProjectId.CreateNewId(debugName: TestProjectName); - var solution = new AdhocWorkspace() + using var workspace = new AdhocWorkspace(); + var solution = workspace .CurrentSolution .AddProject(projectId, TestProjectName, TestProjectName, language) .AddMetadataReference(projectId, CorlibReference) .AddMetadataReference(projectId, SystemCoreReference) .AddMetadataReference(projectId, CSharpSymbolsReference) .AddMetadataReference(projectId, CodeAnalysisReference); - - int count = 0; - foreach (var source in sources) { - var newFileName = fileNamePrefix + count + "." + fileExt; - var documentId = DocumentId.CreateNewId(projectId, debugName: newFileName); - solution = solution.AddDocument(documentId, newFileName, SourceText.From(source)); - count++; + int count = 0; + foreach (var source in sources) + { + var newFileName = fileNamePrefix + count + "." + fileExt; + var documentId = DocumentId.CreateNewId(projectId, debugName: newFileName); + solution = solution.AddDocument(documentId, newFileName, SourceText.From(source)); + count++; + } + + return solution.GetProject(projectId)!; } - return solution.GetProject(projectId)!; } + #endregion } } diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers.UnitTests/Verifiers/DiagnosticVerifier.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers.UnitTests/Verifiers/DiagnosticVerifier.cs index 7f8b6cea81..2664d142dd 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers.UnitTests/Verifiers/DiagnosticVerifier.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers.UnitTests/Verifiers/DiagnosticVerifier.cs @@ -1,4 +1,5 @@ using System; +using System.Globalization; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; using System.Linq; @@ -87,7 +88,7 @@ private static void VerifyDiagnosticResults(Diagnostic[] actualResults, Diagnost } else { - VerifyDiagnosticLocation(analyzer, actual, actual.Location, expected.Locations.First()); + VerifyDiagnosticLocation(analyzer, actual, actual.Location, expected.Locations[0]); var additionalLocations = actual.AdditionalLocations.ToArray(); if (additionalLocations.Length != expected.Locations.Count - 1) @@ -133,7 +134,7 @@ private static void VerifyDiagnosticLocation(DiagnosticAnalyzer? analyzer, Diagn { var actualSpan = actual.GetLineSpan(); - Assert.True(actualSpan.Path == expected.Path || (actualSpan.Path != null && actualSpan.Path.Contains("Test0.") && expected.Path.Contains("Test.")), + Assert.True(actualSpan.Path == expected.Path || (actualSpan.Path != null && actualSpan.Path.Contains("Test0.", StringComparison.InvariantCulture) && expected.Path.Contains("Test.", StringComparison.InvariantCulture)), $"Expected diagnostic to be in file \"{expected.Path}\" was actually in file \"{actualSpan.Path}\"\r\n\r\nDiagnostic:\r\n {FormatDiagnostics(analyzer, diagnostic)}\r\n"); var actualLinePosition = actualSpan.StartLinePosition; @@ -187,18 +188,18 @@ private static string FormatDiagnostics(DiagnosticAnalyzer? analyzer, params Dia var location = diagnostics[i].Location; if (location == Location.None) { - builder.AppendFormat("GetGlobalResult({0}.{1})", analyzerType.Name, rule.Id); + builder.AppendFormat(CultureInfo.InvariantCulture, "GetGlobalResult({0}.{1})", analyzerType.Name, rule.Id); } else { Assert.True(location.IsInSource, $"Test base does not currently handle diagnostics in metadata locations. Diagnostic in metadata: {diagnostics[i]}\r\n"); - var fileIsCSharp = diagnostics[i].Location.SourceTree?.FilePath.EndsWith(".cs") ?? false; + var fileIsCSharp = diagnostics[i].Location.SourceTree?.FilePath.EndsWith(".cs", StringComparison.InvariantCulture) ?? false; var resultMethodName = fileIsCSharp ? "GetCSharpResultAt" : "GetBasicResultAt"; var linePosition = diagnostics[i].Location.GetLineSpan().StartLinePosition; - builder.AppendFormat("{0}({1}, {2}, {3}.{4})", + builder.AppendFormat(CultureInfo.InvariantCulture, "{0}({1}, {2}, {3}.{4})", resultMethodName, linePosition.Line + 1, linePosition.Character + 1, diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers/AssemblyInfo.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers/AssemblyInfo.cs new file mode 100644 index 0000000000..2a475317b1 --- /dev/null +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Analyzers/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using System; + +[assembly:CLSCompliant(true)] \ No newline at end of file diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.JsonModel/AssemblyInfo.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.JsonModel/AssemblyInfo.cs index 293c3b5476..0cfda9a408 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.JsonModel/AssemblyInfo.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.JsonModel/AssemblyInfo.cs @@ -1,5 +1,8 @@ +using System; using System.Runtime.CompilerServices; +[assembly:CLSCompliant(true)] + // All the types were folded into Amazon.JSII.Runtime now, so here's a bunch of type // forwarders to maintain backwards compatibility with previous versions. diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Amazon.JSII.Runtime.UnitTests.csproj b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Amazon.JSII.Runtime.UnitTests.csproj index 1a41780b23..9f4ae375ec 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Amazon.JSII.Runtime.UnitTests.csproj +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Amazon.JSII.Runtime.UnitTests.csproj @@ -12,6 +12,12 @@ true Major + + + CA1034, + CA1711, + CA1724, + diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/AssemblyInfo.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/AssemblyInfo.cs index 4b3f8a8d85..8523cc4a7a 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/AssemblyInfo.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/AssemblyInfo.cs @@ -1,7 +1,10 @@ -using System.Runtime.CompilerServices; +using System; +using System.Runtime.CompilerServices; using Castle.Core.Internal; using Xunit; +[assembly:CLSCompliant(false)] + // Each test in this assembly overrides the the global service provider, so they can't be run in parallel. [assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly)] diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Client/ClientTests.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Client/ClientTests.cs index a9c290a49e..3051cc7db3 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Client/ClientTests.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Client/ClientTests.cs @@ -1,4 +1,5 @@ -using Amazon.JSII.JsonModel.Api; +using System; +using Amazon.JSII.JsonModel.Api; using Amazon.JSII.JsonModel.Api.Request; using Amazon.JSII.JsonModel.Api.Response; using Amazon.JSII.JsonModel.FileSystem; @@ -45,8 +46,8 @@ protected ClientTestBase() _fileSystem.Directory.Returns(directory); } - internal string GetOkResponse(TResponse response) - where TResponse : IKernelResponse + internal static string GetOkResponse(TResponse response) + where TResponse : class, IKernelResponse { IDictionary okResponse = new Dictionary { @@ -69,7 +70,7 @@ internal IClient CreateClient() ); } - internal bool PlatformIndependentEqual(string expected, string actual) + internal static bool PlatformIndependentEqual(string expected, string actual) { try { @@ -99,7 +100,7 @@ public void LoadsBasicPackage() description: "", homepage: "", repository: new Assembly.AssemblyRepository(type: "", url: ""), - author: new Person(name: "", roles: new string[]{ }), + author: new Person(name: "", roles: Array.Empty()), fingerprint: "", license: "", targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget( @@ -132,7 +133,7 @@ public void DoesNotLoadPackageMultipleTimes() description: "", homepage: "", repository: new Assembly.AssemblyRepository(type: "", url: ""), - author: new Person(name: "", roles: new string[] { }), + author: new Person(name: "", roles: Array.Empty()), fingerprint: "", license: "", targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget( @@ -185,7 +186,7 @@ public void SendsAndReceives() description: "", homepage: "", repository: new Assembly.AssemblyRepository(type: "", url: ""), - author: new Person(name: "", roles: new string[] { }), + author: new Person(name: "", roles: Array.Empty()), fingerprint: "", license: "", targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget( diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Deputy/Converters/FrameworkToJsiiConverterTests.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Deputy/Converters/FrameworkToJsiiConverterTests.cs index 7301164fe5..32e43ec074 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Deputy/Converters/FrameworkToJsiiConverterTests.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Deputy/Converters/FrameworkToJsiiConverterTests.cs @@ -7,6 +7,7 @@ using NSubstitute; using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using Newtonsoft.Json.Converters; using Xunit; @@ -122,7 +123,7 @@ public void ConvertsDateValues() var expected = new JObject { - new JProperty("$jsii.date", now.ToString("yyyy-MM-ddTHH\\:mm\\:ss.fffffffzzz")) + new JProperty("$jsii.date", now.ToString("yyyy-MM-ddTHH\\:mm\\:ss.fffffffzzz", CultureInfo.InvariantCulture)) }; Assert.Equal(expected, actual); @@ -144,7 +145,7 @@ public void ConvertsOptionalDateValues() Assert.IsType(actual); var expected = new JObject { - new JProperty("$jsii.date", now.ToString("yyyy-MM-ddTHH\\:mm\\:ss.fffffffzzz")) + new JProperty("$jsii.date", now.ToString("yyyy-MM-ddTHH\\:mm\\:ss.fffffffzzz", CultureInfo.InvariantCulture)) }; Assert.Equal(expected, actual); @@ -652,7 +653,7 @@ public void ConvertsDate() var expected = new JObject { - new JProperty("$jsii.date", now.ToString("yyyy-MM-ddTHH\\:mm\\:ss.fffffffzzz")) + new JProperty("$jsii.date", now.ToString("yyyy-MM-ddTHH\\:mm\\:ss.fffffffzzz", CultureInfo.InvariantCulture)) }; Assert.Equal(expected, actual); } diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Deputy/Converters/JsiiToFrameworkConverterTests.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Deputy/Converters/JsiiToFrameworkConverterTests.cs index 01447eae8d..05d9fcc031 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Deputy/Converters/JsiiToFrameworkConverterTests.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Deputy/Converters/JsiiToFrameworkConverterTests.cs @@ -21,7 +21,7 @@ public abstract class TestBase internal readonly IReferenceMap _referenceMap; internal readonly JsiiToFrameworkConverter _converter; - public TestBase() + protected TestBase() { _typeCache = Substitute.For(); _referenceMap = Substitute.For(); diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Deputy/DeputyBaseTests.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Deputy/DeputyBaseTests.cs index 5c91886f0b..0dc2f712b4 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Deputy/DeputyBaseTests.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Deputy/DeputyBaseTests.cs @@ -22,9 +22,10 @@ public DeputyBaseTests() .BuildServiceProvider(); } - void IDisposable.Dispose() + public void Dispose() { ServiceContainer.ServiceProviderOverride = null; + _serviceProvider.Dispose(); } [Fact(DisplayName = Prefix + nameof(CanCastToAnyInterface))] diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/AssemblyTests.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/AssemblyTests.cs index d307cd9bac..d088abb2c6 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/AssemblyTests.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/AssemblyTests.cs @@ -7,7 +7,7 @@ namespace Amazon.JSII.Runtime.UnitTests.JsonModel { - public class AssemblyTests + public static class AssemblyTests { const string RootPrefix = nameof(JsonModel) + "." + nameof(Assembly) + "."; @@ -113,7 +113,7 @@ public void ShouldThrowOnMissingName() description: "", homepage: "", repository: new Assembly.AssemblyRepository(type: "", url: ""), - author: new Person(name: "", roles: new string[] { }), + author: new Person(name: "", roles: Array.Empty()), fingerprint: "", version: "", license: "", @@ -140,7 +140,7 @@ public void ShouldThrowOnMissingVersion() description: "", homepage: "", repository: new Assembly.AssemblyRepository(type: "", url: ""), - author: new Person(name: "", roles: new string[] { }), + author: new Person(name: "", roles: Array.Empty()), fingerprint: "", #pragma warning disable CS8625 version: null, @@ -169,7 +169,7 @@ public void ShouldNotSerializeMissingDependencies() description: "", homepage: "", repository: new Assembly.AssemblyRepository(type: "", url: ""), - author: new Person(name: "", roles: new string[] { }), + author: new Person(name: "", roles: Array.Empty()), fingerprint: "", version: "", license: "", @@ -229,7 +229,7 @@ public void ShouldNotSerializeMissingBundled() description: "", homepage: "", repository: new Assembly.AssemblyRepository(type: "", url: ""), - author: new Person(name: "", roles: new string[] { }), + author: new Person(name: "", roles: Array.Empty()), fingerprint: "", version: "", license: "", @@ -289,7 +289,7 @@ public void ShouldNotSerializeMissingDocs() description: "", homepage: "", repository: new Assembly.AssemblyRepository(type: "", url: ""), - author: new Person(name: "", roles: new string[] { }), + author: new Person(name: "", roles: Array.Empty()), fingerprint: "", version: "", license: "", diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/ClassTypeTests.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/ClassTypeTests.cs index 77211694ff..dcff399c28 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/ClassTypeTests.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/ClassTypeTests.cs @@ -6,7 +6,7 @@ namespace Amazon.JSII.Runtime.UnitTests.JsonModel { - public class ClassTypeTests + public static class ClassTypeTests { const string RootPrefix = nameof(JsonModel) + "." + nameof(ClassType) + "."; @@ -25,11 +25,11 @@ public void ShouldSerializeAllMembers() @namespace: "myNamespace", isAbstract: true, docs: new Docs(), - properties: new Property[] { }, - methods: new Method[] { }, + properties: Array.Empty(), + methods: Array.Empty(), @base: "myBaseFqn", initializer: new Initializer(), - interfaces: new string[] { } + interfaces: Array.Empty() ); string actual = ToJson(classType); @@ -64,11 +64,11 @@ public void ShouldThrowOnMissingFullyQualifiedName() @namespace: "myNamespace", isAbstract: true, docs: new Docs(), - properties: new Property[] { }, - methods: new Method[] { }, + properties: Array.Empty(), + methods: Array.Empty(), @base: "myBaseFqn", initializer: new Initializer(), - interfaces: new string[] { } + interfaces: Array.Empty() )); } @@ -85,11 +85,11 @@ public void ShouldThrowOnMissingAssembly() @namespace: "myNamespace", isAbstract: true, docs: new Docs(), - properties: new Property[] { }, - methods: new Method[] { }, + properties: Array.Empty(), + methods: Array.Empty(), @base: "myBaseFqn", initializer: new Initializer(), - interfaces: new string[] { } + interfaces: Array.Empty() )); } @@ -106,11 +106,11 @@ public void ShouldThrowOnMissingName() @namespace: "myNamespace", isAbstract: true, docs: new Docs(), - properties: new Property[] { }, - methods: new Method[] { }, + properties: Array.Empty(), + methods: Array.Empty(), @base: "myBaseFqn", initializer: new Initializer(), - interfaces: new string[] { } + interfaces: Array.Empty() )); } @@ -125,11 +125,11 @@ public void ShouldNotSerializeMissingNamespace() @namespace: null, isAbstract: true, docs: new Docs(), - properties: new Property[] { }, - methods: new Method[] { }, + properties: Array.Empty(), + methods: Array.Empty(), @base: "myBaseFqn", initializer: new Initializer(), - interfaces: new string[] { } + interfaces: Array.Empty() ); string actual = ToJson(classType); const string expected = @"{ @@ -158,11 +158,11 @@ public void ShouldNotSerializeMissingDocs() name: "myName", @namespace: "myNamespace", isAbstract: true, - properties: new Property[] { }, - methods: new Method[] { }, + properties: Array.Empty(), + methods: Array.Empty(), @base: "myBaseFqn", initializer: new Initializer(), - interfaces: new string[] { } + interfaces: Array.Empty() ); string actual = ToJson(classType); @@ -194,10 +194,10 @@ public void ShouldNotSerializeMissingProperties() @namespace: "myNamespace", isAbstract: true, docs: new Docs(), - methods: new Method[] { }, + methods: Array.Empty(), @base: "myBaseFqn", initializer: new Initializer(), - interfaces: new string[] { } + interfaces: Array.Empty() ); string actual = ToJson(classType); @@ -229,10 +229,10 @@ public void ShouldNotSerializeMissingMethods() @namespace: "myNamespace", isAbstract: true, docs: new Docs(), - properties: new Property[] { }, + properties: Array.Empty(), @base: "myBaseFqn", initializer: new Initializer(), - interfaces: new string[] { } + interfaces: Array.Empty() ); string actual = ToJson(classType); @@ -264,10 +264,10 @@ public void ShouldNotSerializeMissingBase() @namespace: "myNamespace", isAbstract: true, docs: new Docs(), - properties: new Property[] { }, - methods: new Method[] { }, + properties: Array.Empty(), + methods: Array.Empty(), initializer: new Initializer(), - interfaces: new string[] { } + interfaces: Array.Empty() ); string actual = ToJson(classType); @@ -299,10 +299,10 @@ public void ShouldNotSerializeMissingInitializer() @namespace: "myNamespace", isAbstract: true, docs: new Docs(), - properties: new Property[] { }, - methods: new Method[] { }, + properties: Array.Empty(), + methods: Array.Empty(), @base: "myBaseFqn", - interfaces: new string[] { } + interfaces: Array.Empty() ); string actual = ToJson(classType); @@ -334,8 +334,8 @@ public void ShouldNotSerializeMissingInterfaces() @namespace: "myNamespace", isAbstract: true, docs: new Docs(), - properties: new Property[] { }, - methods: new Method[] { }, + properties: Array.Empty(), + methods: Array.Empty(), @base: "myBaseFqn", initializer: new Initializer() ); diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/CollectionKindTests.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/CollectionKindTests.cs index 65656f30f9..8112be5f2a 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/CollectionKindTests.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/CollectionKindTests.cs @@ -5,7 +5,7 @@ namespace Amazon.JSII.Runtime.UnitTests.JsonModel { - public class CollectionKindTests + public static class CollectionKindTests { const string RootPrefix = nameof(JsonModel) + "." + nameof(CollectionKind) + "."; diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/CollectionTypeReferenceTests.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/CollectionTypeReferenceTests.cs index 7e4c2bd49a..6f848f5a50 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/CollectionTypeReferenceTests.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/CollectionTypeReferenceTests.cs @@ -5,7 +5,7 @@ namespace Amazon.JSII.Runtime.UnitTests.JsonModel { - public class CollectionTypeReferenceTests + public static class CollectionTypeReferenceTests { const string RootPrefix = nameof(JsonModel) + "." + nameof(CollectionTypeReference) + "."; diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/DocsTests.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/DocsTests.cs index 9af9860d3e..9a2759728e 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/DocsTests.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/DocsTests.cs @@ -6,7 +6,7 @@ namespace Amazon.JSII.Runtime.UnitTests.JsonModel { - public class DocsTests + public static class DocsTests { const string RootPrefix = nameof(JsonModel) + "." + nameof(Docs) + "."; diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/EnumMemberTests.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/EnumMemberTests.cs index 8f6ddd7be7..0e5e2e0690 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/EnumMemberTests.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/EnumMemberTests.cs @@ -5,7 +5,7 @@ namespace Amazon.JSII.Runtime.UnitTests.JsonModel { - public class EnumMemberTests + public static class EnumMemberTests { const string RootPrefix = nameof(JsonModel) + "." + nameof(EnumMember) + "."; diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/TestUtils.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/TestUtils.cs index 86c1184a36..cec8830938 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/TestUtils.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/JsonModel/TestUtils.cs @@ -9,7 +9,7 @@ public class TestUtils DefaultValueHandling = DefaultValueHandling.Ignore }; - protected string ToJson(object obj) + protected static string ToJson(object obj) { return JsonConvert.SerializeObject(obj, Formatting.Indented, SerializerSettings); } diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Amazon.JSII.Runtime.csproj b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Amazon.JSII.Runtime.csproj index 9a5afea231..78cacf4994 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Amazon.JSII.Runtime.csproj +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Amazon.JSII.Runtime.csproj @@ -8,10 +8,26 @@ icon.png true - AllEnabledByDefault enable true + + + CA1019, + CA1031, + CA1033, + CA1034, + CA1040, + CA1054, + CA1056, + CA1062, + CA1508, + CA1710, + CA1716, + CA1720, + CA1819, + CA2225, + diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/AssemblyInfo.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/AssemblyInfo.cs index 66eb8f6e0d..7af7d0a224 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/AssemblyInfo.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/AssemblyInfo.cs @@ -1,5 +1,8 @@ +using System; using System.Runtime.CompilerServices; +[assembly:CLSCompliant(false)] // among other things, array parameters are passed to attributes + [assembly:InternalsVisibleTo("Amazon.JSII.Runtime.IntegrationTests")] [assembly:InternalsVisibleTo("Amazon.JSII.Runtime.UnitTests")] [assembly:InternalsVisibleTo("DynamicProxyGenAssembly2")] diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Response/NamingResponse.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Response/NamingResponse.cs index 5209455e47..966a5abac2 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Response/NamingResponse.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Api/Response/NamingResponse.cs @@ -18,7 +18,7 @@ public NamingResponse(NamingData naming) [JsonObject(MemberSerialization = MemberSerialization.OptIn)] public class NamingData { - public NamingData(DotNetNaming dotnet, IDictionary? others = null) + public NamingData(DotNetNaming dotnet) { DotNet = dotnet ?? throw new ArgumentNullException(nameof(dotnet)); } diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Converters/TypeConverter.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Converters/TypeConverter.cs index 3a1742f250..40952a6f79 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Converters/TypeConverter.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Converters/TypeConverter.cs @@ -17,6 +17,10 @@ public sealed class TypeConverter : JsonConverter public override bool CanConvert(System.Type objectType) { + if (objectType == null) + { + throw new ArgumentNullException(nameof(objectType)); + } return objectType.IsAssignableFrom(typeof(EnumType)) || objectType.IsAssignableFrom(typeof(ClassType)); } diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/FileSystem/FileSystem.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/FileSystem/FileSystem.cs index 37c18ff4b7..9a9af8f26b 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/FileSystem/FileSystem.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/FileSystem/FileSystem.cs @@ -1,5 +1,7 @@ using System.IO; +#pragma warning disable CA1724 + namespace Amazon.JSII.JsonModel.FileSystem { public sealed class FileSystem : IFileSystem diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Spec/DependencyRoot.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Spec/DependencyRoot.cs index 27d0ffc313..2f14628fe3 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Spec/DependencyRoot.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/JsonModel/Spec/DependencyRoot.cs @@ -5,7 +5,7 @@ namespace Amazon.JSII.JsonModel.Spec { public abstract class DependencyRoot { - public DependencyRoot + protected DependencyRoot ( AssemblyTargets? targets = null, IDictionary? dependencies = null diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/ValueConverter.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/ValueConverter.cs index 5763a1cb1e..37df2d6e4a 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/ValueConverter.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/ValueConverter.cs @@ -37,12 +37,12 @@ public bool TryConvert(IOptionalValue? optionalValue, System.Type type, IReferen if (optionalValue.Type.Collection != null) { - return TryConvertCollection(referenceMap, value, optionalValue.IsOptional, optionalValue.Type.Collection, out result); + return TryConvertCollection(referenceMap, value, optionalValue.Type.Collection, out result); } if (optionalValue.Type.Union != null) { - return TryConvertUnion(type, referenceMap, value, optionalValue.IsOptional, optionalValue.Type.Union, out result); + return TryConvertUnion(type, referenceMap, value, optionalValue.Type.Union, out result); } throw new ArgumentException("Invalid type reference", nameof(optionalValue)); @@ -93,7 +93,7 @@ protected static bool IsNumeric(System.Type type) { if (!TryConvertClass(type, referenceMap, value, out var anonResult)) { - throw new Exception("Unable to convert AnonymousObject instance!"); + throw new NotSupportedException("Unable to convert AnonymousObject instance!"); } return anonResult; } @@ -159,7 +159,7 @@ bool TryConvertPrimitive(System.Type type, IReferenceMap referenceMap, object? v } } - bool TryConvertCollection(IReferenceMap referenceMap, object? value, bool isOptional, CollectionTypeReference collectionType, out object? result) + bool TryConvertCollection(IReferenceMap referenceMap, object? value, CollectionTypeReference collectionType, out object? result) { switch (collectionType.Kind) { @@ -172,7 +172,7 @@ bool TryConvertCollection(IReferenceMap referenceMap, object? value, bool isOpti } } - bool TryConvertUnion(System.Type type, IReferenceMap referenceMap, object? value, bool isOptional, UnionTypeReference unionType, out object? result) + bool TryConvertUnion(System.Type type, IReferenceMap referenceMap, object? value, UnionTypeReference unionType, out object? result) { foreach (var candidateType in unionType.Types) { diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/NodeProcess.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/NodeProcess.cs index 721debb878..50d836c05e 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/NodeProcess.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/NodeProcess.cs @@ -23,7 +23,7 @@ internal sealed class NodeProcess : INodeProcess private const string JsiiAgent = "JSII_AGENT"; private const string JsiiAgentVersionString = "DotNet/{0}/{1}/{2}"; - private bool Disposed = false; + private bool Disposed; public NodeProcess(IJsiiRuntimeProvider jsiiRuntimeProvider, ILoggerFactory loggerFactory) { diff --git a/packages/@jsii/go-runtime/.gitignore b/packages/@jsii/go-runtime/.gitignore index e8fdb5e2c4..bf1001874b 100644 --- a/packages/@jsii/go-runtime/.gitignore +++ b/packages/@jsii/go-runtime/.gitignore @@ -1,6 +1,9 @@ /jsii-calc/ -/jsii-runtime-go/embedded/resources/ +/jsii-runtime-go/internal/embedded/resources/ + *.generated.* *.js *.d.ts + +!jsii-runtime-go/internal/kernel/process/jsii-mock-runtime.js diff --git a/packages/@jsii/go-runtime/build-tools/all-go.ts b/packages/@jsii/go-runtime/build-tools/all-go.ts index cfc8df97aa..0ffdc7fa6d 100644 --- a/packages/@jsii/go-runtime/build-tools/all-go.ts +++ b/packages/@jsii/go-runtime/build-tools/all-go.ts @@ -28,10 +28,10 @@ function visit(dir: string): void { continue; } if (file === 'go.mod') { - const args = process.argv.slice(2); - console.error(`$ go ${args.join(' ')} # ${path}`); + const [cmd, ...args] = process.argv.slice(2); + console.error(`$ ${cmd} ${args.join(' ')} # ${path}`); try { - runCommand('go', args, { cwd: dir, stdio: 'inherit' }); + runCommand(cmd, args, { cwd: dir, stdio: 'inherit' }); } catch (e) { console.error(e.message); process.exit(-1); diff --git a/packages/@jsii/go-runtime/build-tools/gen.ts b/packages/@jsii/go-runtime/build-tools/gen.ts index 48b2b1a684..64e2be6acb 100644 --- a/packages/@jsii/go-runtime/build-tools/gen.ts +++ b/packages/@jsii/go-runtime/build-tools/gen.ts @@ -14,7 +14,12 @@ const EMBEDDED_RUNTIME_SOURCE_ROOT = resolve( const RUNTIME_ROOT = resolve(__dirname, '..', 'jsii-runtime-go'); -const EMBEDDED_RESOURCE_DIR = join(RUNTIME_ROOT, 'embedded', 'resources'); +const EMBEDDED_RESOURCE_DIR = join( + RUNTIME_ROOT, + 'internal', + 'embedded', + 'resources', +); mkdirpSync(EMBEDDED_RESOURCE_DIR); copySync(EMBEDDED_RUNTIME_SOURCE_ROOT, EMBEDDED_RESOURCE_DIR, { @@ -25,7 +30,7 @@ copySync(EMBEDDED_RUNTIME_SOURCE_ROOT, EMBEDDED_RESOURCE_DIR, { recursive: true, }); -const KERNEL_LIB_DIR = resolve(RUNTIME_ROOT, 'kernel'); +const KERNEL_LIB_DIR = resolve(RUNTIME_ROOT, 'internal', 'kernel'); const code = new CodeMaker({ indentationLevel: 1, indentCharacter: '\t' }); const VERSION_FILE = 'version.generated.go'; diff --git a/packages/@jsii/go-runtime/build-tools/go-run.ts b/packages/@jsii/go-runtime/build-tools/go-run.ts new file mode 100644 index 0000000000..8d8c79dd27 --- /dev/null +++ b/packages/@jsii/go-runtime/build-tools/go-run.ts @@ -0,0 +1,32 @@ +import { spawnSync } from 'child_process'; +import { constants } from 'os'; +import { join } from 'path'; +import { argv, exit } from 'process'; + +import { runCommand } from './_constants'; + +if (argv.length < 3) { + console.error(`Not enough arguments: ${argv[0]} ${argv[1]} [args]`); + exit(1); +} + +const [, , cmd, ...args] = argv; + +const result = spawnSync('go', ['env', 'GOPATH'], { + stdio: ['inherit', 'pipe', 'inherit'], +}); + +if (result.error) { + console.error('"go env GOPATH" failed:', result.error); + exit(-1); +} + +if (result.status !== 0) { + console.error('"go env GOPATH" failed:', result.status ?? result.signal); + exit( + result.status ?? 128 + constants.signals[result.signal as NodeJS.Signals], + ); +} + +const gopath = result.stdout.toString('utf8').trim(); +runCommand(join(gopath, 'bin', cmd), args); diff --git a/packages/@jsii/go-runtime/go.mod b/packages/@jsii/go-runtime/go.mod index 2a73c7aeeb..0240163ba9 100644 --- a/packages/@jsii/go-runtime/go.mod +++ b/packages/@jsii/go-runtime/go.mod @@ -6,6 +6,8 @@ require ( github.com/aws/jsii-runtime-go v0.0.0 github.com/aws/jsii/jsii-calc/go/jsiicalc/v3 v3.20.120 github.com/aws/jsii/jsii-calc/go/scopejsiicalclib v0.0.0 + golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 + golang.org/x/tools v0.1.0 ) replace ( diff --git a/packages/@jsii/go-runtime/go.sum b/packages/@jsii/go-runtime/go.sum new file mode 100644 index 0000000000..d1f39904fc --- /dev/null +++ b/packages/@jsii/go-runtime/go.sum @@ -0,0 +1,37 @@ +github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/yuin/goldmark v1.2.1 h1:ruQGxdhGHe7FWOJPT0mKs5+pD2Xs1Bm/kdGlHO04FmM= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/packages/@jsii/go-runtime/jsii-calc-test/callbacks_test.go b/packages/@jsii/go-runtime/jsii-calc-test/callbacks_test.go new file mode 100644 index 0000000000..3859470cef --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-calc-test/callbacks_test.go @@ -0,0 +1,26 @@ +package main + +import ( + "testing" + + calc "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3" +) + +func TestPureInterfacesCanBeUsedTransparently(t *testing.T) { + expected := calc.StructB{RequiredString: "It's Britney b**ch!"} + delegate := &StructReturningDelegate{expected: expected} + consumer := calc.NewConsumePureInterface(delegate) + actual := consumer.WorkItBaby() + + if actual != expected { + t.Errorf("Expected %v; actual: %v", expected, actual) + } +} + +type StructReturningDelegate struct { + expected calc.StructB +} + +func (o *StructReturningDelegate) ReturnStruct() calc.StructB { + return o.expected +} diff --git a/packages/@jsii/go-runtime/jsii-calc-test/main_test.go b/packages/@jsii/go-runtime/jsii-calc-test/main_test.go index 13320e9916..494b163518 100644 --- a/packages/@jsii/go-runtime/jsii-calc-test/main_test.go +++ b/packages/@jsii/go-runtime/jsii-calc-test/main_test.go @@ -195,6 +195,38 @@ func TestOptionalEnums(t *testing.T) { } } +func TestStructWithEnum(t *testing.T) { + obj := calc.NewTestStructWithEnum() + if !obj.IsStringEnumA(calc.StructWithEnum{Foo: calc.StringEnum_A}) { + t.Error("Failed") + } + + if !obj.IsStringEnumB(calc.StructWithEnum{ + Foo: calc.StringEnum_B, + Bar: calc.AllTypesEnum_THIS_IS_GREAT, + }) { + t.Error("Failed") + } + + ret1 := obj.StructWithFoo() + if ret1.Foo != calc.StringEnum_A { + t.Error("Expecting Foo to be A") + } + + if ret1.Bar != "" { + t.Error("Expecting Bar to be nil") + } + + ret2 := obj.StructWithFooBar() + if ret2.Foo != calc.StringEnum_C { + t.Error("Expecting Foo to be C") + } + + if ret2.Bar != calc.AllTypesEnum_MY_ENUM_VALUE { + t.Error("Expecting Foo to be MY_ENUM_VALUE") + } +} + func TestReturnsSpecialParam(t *testing.T) { retSpecialParam := returnsParam.NewReturnsSpecialParameter() val := retSpecialParam.ReturnsSpecialParam() diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/go.mod b/packages/@jsii/go-runtime/jsii-runtime-go/go.mod index 0faa5e7374..2fb26b01eb 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/go.mod +++ b/packages/@jsii/go-runtime/jsii-runtime-go/go.mod @@ -1,3 +1,5 @@ module github.com/aws/jsii-runtime-go go 1.16 + +require github.com/Masterminds/semver/v3 v3.1.1 diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/go.sum b/packages/@jsii/go-runtime/jsii-runtime-go/go.sum new file mode 100644 index 0000000000..471bde90bb --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/go.sum @@ -0,0 +1,2 @@ +github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/api/api.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/api/api.go similarity index 64% rename from packages/@jsii/go-runtime/jsii-runtime-go/api/api.go rename to packages/@jsii/go-runtime/jsii-runtime-go/internal/api/api.go index 6d455fe15c..96cc33ef8c 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/api/api.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/api/api.go @@ -22,8 +22,8 @@ func (o override) isOverride() { type MethodOverride struct { override - Method *string `json:"method"` - Cookie *string `json:"cookie"` + JsiiMethod string `json:"method"` + GoMethod string `json:"cookie"` } // PropertyOverride is used to register a "go-native" implementation to be @@ -31,8 +31,8 @@ type MethodOverride struct { type PropertyOverride struct { override - Property *string `json:"property"` - Cookie *string `json:"cookie"` + JsiiProperty string `json:"property"` + GoGetter string `json:"cookie"` } func IsMethodOverride(value Override) bool { @@ -65,27 +65,11 @@ type WireMap struct { MapData map[string]interface{} `json:"$jsii.map"` } -type Callback struct { - CallbackID *string `json:"cbid"` - Cookie *string `json:"cookie"` - Invoke InvokeCallback `json:"invoke"` - Get GetCallback `json:"get"` - Set SetCallback `json:"set"` +type WireStruct struct { + StructDescriptor `json:"$jsii.struct"` } -type InvokeCallback struct { - Method string `json:"method"` - Arguments []interface{} `json:"args"` - ObjRef ObjectRef `json:"objref"` -} - -type GetCallback struct { - Property string `json:"property"` - ObjRef ObjectRef `json:"objref"` -} - -type SetCallback struct { - Property string `json:"property"` - Value interface{} `json:"value"` - ObjRef ObjectRef `json:"objref"` +type StructDescriptor struct { + FQN FQN `json:"fqn"` + Fields map[string]interface{} `json:"data"` } diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/api/doc.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/api/doc.go similarity index 100% rename from packages/@jsii/go-runtime/jsii-runtime-go/api/doc.go rename to packages/@jsii/go-runtime/jsii-runtime-go/internal/api/doc.go diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/embedded/doc.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/embedded/doc.go new file mode 100644 index 0000000000..57f29f1886 --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/embedded/doc.go @@ -0,0 +1,3 @@ +// Package embedded contains the embedded @jsii/kernel code, which is used +// unless the JSII_RUNTIME environment variable is set to a different program. +package embedded diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/embedded/embedded.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/embedded/embedded.go similarity index 87% rename from packages/@jsii/go-runtime/jsii-runtime-go/embedded/embedded.go rename to packages/@jsii/go-runtime/jsii-runtime-go/internal/embedded/embedded.go index c5e47b181f..6b39b3cedf 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/embedded/embedded.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/embedded/embedded.go @@ -16,7 +16,8 @@ var embeddedFS embed.FS var entrypointName string = path.Join("bin", "jsii-runtime.js") // ExtractRuntime extracts a copy of the embedded runtime library into -// the designated directory. +// the designated directory, and returns the fully qualified path to the entry +// point to be used when starting the child process. func ExtractRuntime(into string) (entrypoint string, err error) { err = extractRuntime(into, embeddedRootDir) if err == nil { @@ -25,8 +26,8 @@ func ExtractRuntime(into string) (entrypoint string, err error) { return } -// extractRuntime copies the contents of embeddedFS at "from" to the provided "into" -// directory, recursively. +// extractRuntime copies the contents of embeddedFS at "from" to the provided +// "into" directory, recursively. func extractRuntime(into string, from string) error { files, err := embeddedFS.ReadDir(from) if err != nil { diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/embedded/embedded_test.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/embedded/embedded_test.go similarity index 100% rename from packages/@jsii/go-runtime/jsii-runtime-go/embedded/embedded_test.go rename to packages/@jsii/go-runtime/jsii-runtime-go/internal/embedded/embedded_test.go diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/begin.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/begin.go new file mode 100644 index 0000000000..5ec470c248 --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/begin.go @@ -0,0 +1,25 @@ +package kernel + +import ( + "github.com/aws/jsii-runtime-go/internal/api" +) + +type BeginProps struct { + Method *string `json:"method"` + Arguments []interface{} `json:"args"` + ObjRef api.ObjectRef `json:"objref"` +} + +type BeginResponse struct { + kernelResponse + PromiseID *string `json:"promise_id"` +} + +func (c *Client) Begin(props BeginProps) (response BeginResponse, err error) { + type request struct { + kernelRequest + BeginProps + } + err = c.request(request{kernelRequest{"begin"}, props}, &response) + return +} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/callbacks.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/callbacks.go new file mode 100644 index 0000000000..ba7b2f1d4d --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/callbacks.go @@ -0,0 +1,146 @@ +package kernel + +import ( + "fmt" + "reflect" + + "github.com/aws/jsii-runtime-go/internal/api" +) + +type callback struct { + CallbackID string `json:"cbid"` + Cookie string `json:"cookie"` + Invoke *invokeCallback `json:"invoke"` + Get *getCallback `json:"get"` + Set *setCallback `json:"set"` +} + +func (c *callback) handle(result kernelResponder) error { + var ( + retval reflect.Value + err error + ) + if c.Invoke != nil { + retval, err = c.Invoke.handle(c.Cookie) + } else if c.Get != nil { + retval, err = c.Get.handle(c.Cookie) + } else if c.Set != nil { + retval, err = c.Set.handle(c.Cookie) + } else { + return fmt.Errorf("invalid callback object: %v", c) + } + + type callbackResult struct { + CallbackID string `json:"cbid"` + Result interface{} `json:"result,omitempty"` + Error string `json:"err,omitempty"` + } + type completeRequest struct { + kernelRequester + callbackResult `json:"complete"` + } + + client := GetClient() + request := completeRequest{} + request.CallbackID = c.CallbackID + request.Result = client.CastPtrToRef(retval) + if err != nil { + request.Error = err.Error() + } + return client.request(request, result) +} + +type invokeCallback struct { + Method string `json:"method"` + Arguments []interface{} `json:"args"` + ObjRef api.ObjectRef `json:"objref"` +} + +func (i *invokeCallback) handle(cookie string) (retval reflect.Value, err error) { + client := GetClient() + + receiver := reflect.ValueOf(client.GetObject(i.ObjRef)) + method := receiver.MethodByName(cookie) + + return client.invoke(method, i.Arguments) +} + +type getCallback struct { + Property string `json:"property"` + ObjRef api.ObjectRef `json:"objref"` +} + +func (g *getCallback) handle(cookie string) (retval reflect.Value, err error) { + client := GetClient() + + receiver := reflect.ValueOf(client.GetObject(g.ObjRef)) + method := receiver.MethodByName(cookie) + + return client.invoke(method, nil) +} + +type setCallback struct { + Property string `json:"property"` + Value interface{} `json:"value"` + ObjRef api.ObjectRef `json:"objref"` +} + +func (s *setCallback) handle(cookie string) (retval reflect.Value, err error) { + client := GetClient() + + receiver := reflect.ValueOf(client.GetObject(s.ObjRef)) + method := receiver.MethodByName(fmt.Sprintf("Set%v", cookie)) + + return client.invoke(method, []interface{}{s.Value}) +} + +func (c *Client) invoke(method reflect.Value, args []interface{}) (retval reflect.Value, err error) { + if !method.IsValid() { + err = fmt.Errorf("invalid method") + return + } + + // Convert the arguments, if any... + callArgs := make([]reflect.Value, len(args)) + methodType := method.Type() + numIn := methodType.NumIn() + for i, arg := range args { + var argType reflect.Type + if i < numIn { + argType = methodType.In(i) + } else if methodType.IsVariadic() { + argType = methodType.In(i - 1) + } else { + err = fmt.Errorf("too many arguments received %d for %d", len(args), numIn) + return + } + callArgs[i] = reflect.New(argType) + c.CastAndSetToPtr(arg, callArgs[i].Interface()) + } + + // Ready to catch an error if the method panics... + defer func() { + if r := recover(); r != nil { + if err == nil { + var ok bool + if err, ok = r.(error); !ok { + err = fmt.Errorf("%v", r) + } + } else { + // This is not expected - so we panic! + panic(r) + } + } + }() + + result := method.Call(callArgs) + switch len(result) { + case 0: + retval = reflect.ValueOf(nil) + case 1: + retval = result[0] + default: + err = fmt.Errorf("too many return values: %v", result) + } + return +} \ No newline at end of file diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/client.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/client.go new file mode 100644 index 0000000000..99d7324ba4 --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/client.go @@ -0,0 +1,134 @@ +package kernel + +import ( + "fmt" + "reflect" + "runtime" + "sync" + + "github.com/aws/jsii-runtime-go/internal/api" + "github.com/aws/jsii-runtime-go/internal/kernel/process" + "github.com/aws/jsii-runtime-go/internal/objectstore" + "github.com/aws/jsii-runtime-go/internal/typeregistry" +) + +var ( + clientInstance *Client + clientInstanceMutex sync.Mutex + clientOnce sync.Once +) + +// The Client struct owns the jsii child process and its io interfaces. It also +// owns a map (objects) that tracks all object references by ID. This is used +// to call methods and access properties on objects passed by the runtime +// process by reference. +type Client struct { + process *process.Process + types *typeregistry.TypeRegistry + objects *objectstore.ObjectStore +} + +// GetClient returns a singleton Client instance, initializing one the first +// time it is called. +func GetClient() *Client { + clientOnce.Do(func() { + // Locking early to be safe with a concurrent Close execution + clientInstanceMutex.Lock() + defer clientInstanceMutex.Unlock() + + client, err := newClient() + if err != nil { + panic(err) + } + + clientInstance = client + }) + + return clientInstance +} + +// CloseClient finalizes the runtime process, signalling the end of the +// execution to the jsii kernel process, and waiting for graceful termination. +// +// If a jsii Client is used *after* CloseClient was called, a new jsii kernel +// process will be initialized, and CloseClient should be called again to +// correctly finalize that, too. +func CloseClient() { + // Locking early to be safe with a concurrent getClient execution + clientInstanceMutex.Lock() + defer clientInstanceMutex.Unlock() + + // Reset the "once" so a new Client would get initialized next time around + clientOnce = sync.Once{} + + if clientInstance != nil { + // Close the Client & reset it + clientInstance.close() + clientInstance = nil + } +} + +// newClient starts the kernel child process and verifies the "hello" message +// was correct. +func newClient() (*Client, error) { + if process, err := process.NewProcess(fmt.Sprintf("^%s", version)); err != nil { + return nil, err + } else { + result := &Client{ + process: process, + objects: objectstore.New(), + types: typeregistry.New(), + } + + // Register a finalizer to call Close() + runtime.SetFinalizer(result, func(c *Client) { + c.close() + }) + + return result, nil + } +} + +func (c *Client) Types() *typeregistry.TypeRegistry { + return c.types +} + +func (c *Client) RegisterInstance(instance reflect.Value, instanceID string) error { + return c.objects.Register(instance, instanceID) +} + +func (c *Client) request(req kernelRequester, res kernelResponder) error { + return c.process.Request(req, res) +} + +func (c *Client) FindObjectRef(obj reflect.Value) (string, bool) { + switch obj.Kind() { + case reflect.Struct: + // Structs can be checked only if they are addressable, meaning + // they are obtained from fields of an addressable struct. + if !obj.CanAddr() { + return "", false + } + obj = obj.Addr() + fallthrough + case reflect.Interface, reflect.Ptr: + return c.objects.InstanceID(obj) + default: + // Other types cannot possibly be object references! + return "", false + } +} + +func (c *Client) GetObject(objref api.ObjectRef) interface{} { + if obj, ok := c.objects.GetObject(objref.InstanceID); ok { + return obj.Interface() + } + panic(fmt.Errorf("no object found for ObjectRef %v", objref)) +} + +func (c *Client) close() { + c.process.Close() + + // We no longer need a finalizer to run + runtime.SetFinalizer(c, nil) +} \ No newline at end of file diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/client_test.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/client_test.go similarity index 74% rename from packages/@jsii/go-runtime/jsii-runtime-go/kernel/client_test.go rename to packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/client_test.go index a626701846..e8c9afb8a2 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/client_test.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/client_test.go @@ -13,13 +13,8 @@ func TestClient(t *testing.T) { } defer client.close() - if client.RuntimeVersion == "" { - t.Errorf("No client runtime version found. Client: %v", client) - } - t.Run("Client Load Error", func(t *testing.T) { - request := LoadRequest{ - API: "load", + request := LoadProps{ Name: "jsii-calc", Version: "0.0.0", Tarball: "jsii-calc-tarball.tgz", diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/complete.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/complete.go new file mode 100644 index 0000000000..93cf34964e --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/complete.go @@ -0,0 +1,21 @@ +package kernel + +type CompleteProps struct { + CallbackID *string `json:"cbid"` + Error *string `json:"err"` + Result interface{} `json:"result"` +} + +type CompleteResponse struct { + kernelResponse + CallbackID *string `json:"cbid"` +} + +func (c *Client) Complete(props CompleteProps) (response CompleteResponse, err error) { + type request struct { + kernelRequest + CompleteProps + } + err = c.request(request{kernelRequest{"complete"}, props}, &response) + return +} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/conversions.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/conversions.go new file mode 100644 index 0000000000..5e6fe0a267 --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/conversions.go @@ -0,0 +1,264 @@ +package kernel + +import ( + "reflect" + + "github.com/aws/jsii-runtime-go/internal/api" +) + +// CastAndSetToPtr accepts a pointer to any type and attempts to cast the value +// argument to be the same type. Then it sets the value of the pointer element +// to be the newly cast data. This is used to cast payloads from JSII to +// expected return types for Get and Invoke functions. +func (c *Client) CastAndSetToPtr(ptr interface{}, data interface{}) { + ptrVal := reflect.ValueOf(ptr).Elem() + dataVal := reflect.ValueOf(data) + + c.castAndSetToPtr(ptrVal, dataVal) +} + +// castAndSetToPtr is the same as CastAndSetToPtr except it operates on the +// reflect.Value representation of the pointer and data. +func (c *Client) castAndSetToPtr(ptr reflect.Value, data reflect.Value) { + if !data.IsValid() { + // data will not be valid if was made from a nil value, as there would + // not have been enough type information available to build a valid + // reflect.Value. In such cases, we must craft the correctly-typed zero + // value ourselves. + data = reflect.Zero(ptr.Type()) + } else if data.Kind() == reflect.Interface && !data.IsNil() { + // If data is a non-nil interface, unwrap it to get it's dynamic value + // type sorted out, so that further calls in this method don't have to + // worry about this edge-case when reasoning on kinds. + data = reflect.ValueOf(data.Interface()) + } + + if ref, isRef := castValToRef(data); isRef { + // If return data is a jsii struct passed by reference, de-reference it all. + if fields, _, isStruct := c.Types().StructFields(ptr.Type()); isStruct { + for _, field := range fields { + got, err := c.Get(GetProps{ + Property: field.Tag.Get("json"), + ObjRef: ref, + }) + if err != nil { + panic(err) + } + fieldVal := ptr.FieldByIndex(field.Index) + c.castAndSetToPtr(fieldVal, reflect.ValueOf(got.Value)) + } + return + } + + // If it's currently tracked, return the current instance + if object, ok := c.objects.GetObject(ref.InstanceID); ok { + ptr.Set(object) + return + } + + // If return data is jsii object references, add to objects table. + if err := c.Types().InitJsiiProxy(ptr); err == nil { + if err = c.RegisterInstance(ptr, ref.InstanceID); err != nil { + panic(err) + } + } else { + panic(err) + } + return + } + + if enumref, isEnum := castValToEnumRef(data); isEnum { + member, err := c.Types().EnumMemberForEnumRef(enumref) + if err != nil { + panic(err) + } + + ptr.Set(reflect.ValueOf(member)) + return + } + + // maps + if m, isMap := c.castValToMap(data, ptr.Type()); isMap { + ptr.Set(m) + return + } + + // arrays + if ptr.Kind() == reflect.Slice && data.Kind() == reflect.Slice { + len := data.Len() + ptr.Set(reflect.MakeSlice(ptr.Type(), len, len)) + + // If return type is a slice, recursively cast elements + for i := 0; i < len; i++ { + c.castAndSetToPtr(ptr.Index(i), data.Index(i)) + } + + return + } + + ptr.Set(data) +} + +// Accepts pointers to structs that implement interfaces and searches for an +// existing object reference in the kernel. If it exists, it casts it to an +// objref for the runtime. Recursively casts types that may contain nested +// object references. +func (c *Client) CastPtrToRef(dataVal reflect.Value) interface{} { + if (dataVal.Kind() == reflect.Interface || dataVal.Kind() == reflect.Ptr) && dataVal.IsNil() { + return nil + } + + switch dataVal.Kind() { + case reflect.Map: + result := api.WireMap{MapData: make(map[string]interface{})} + + iter := dataVal.MapRange() + for iter.Next() { + key := iter.Key().String() + val := iter.Value() + result.MapData[key] = c.CastPtrToRef(val) + } + + return result + + case reflect.Interface, reflect.Ptr: + if valref, valHasRef := c.FindObjectRef(dataVal); valHasRef { + return api.ObjectRef{InstanceID: valref} + } + + // In case we got a pointer to a map, slice, enum, ... + if elem := reflect.Indirect(dataVal.Elem()); elem.Kind() != reflect.Struct { + return c.CastPtrToRef(elem) + } + + if ref, err := c.ManageObject(dataVal); err != nil { + panic(err) + } else { + return ref + } + + case reflect.Struct: + if fields, fqn, isStruct := c.Types().StructFields(dataVal.Type()); isStruct { + data := make(map[string]interface{}) + for _, field := range fields { + fieldVal := dataVal.FieldByIndex(field.Index) + if (fieldVal.Kind() == reflect.Ptr || fieldVal.Kind() == reflect.Interface) && fieldVal.IsNil() { + continue + } + key := field.Tag.Get("json") + data[key] = c.CastPtrToRef(fieldVal) + } + + return api.WireStruct{ + StructDescriptor: api.StructDescriptor{ + FQN: fqn, + Fields: data, + }, + } + } + + case reflect.Slice: + refs := make([]interface{}, dataVal.Len()) + for i := 0; i < dataVal.Len(); i++ { + refs[i] = dataVal.Index(i).Interface() + } + return refs + + case reflect.String: + if enumRef, isEnumRef := c.Types().TryRenderEnumRef(dataVal); isEnumRef { + return enumRef + } + } + return dataVal.Interface() +} + +func castValToRef(data reflect.Value) (api.ObjectRef, bool) { + ref := api.ObjectRef{} + ok := false + + if data.Kind() == reflect.Map { + for _, k := range data.MapKeys() { + // Finding values type requires extracting from reflect.Value + // otherwise .Kind() returns `interface{}` + v := reflect.ValueOf(data.MapIndex(k).Interface()) + + if k.Kind() == reflect.String && k.String() == "$jsii.byref" && v.Kind() == reflect.String { + ref.InstanceID = v.String() + ok = true + } + + } + } + + return ref, ok +} + +func castValToEnumRef(data reflect.Value) (enum api.EnumRef, ok bool) { + ok = false + + if data.Kind() == reflect.Map { + for _, k := range data.MapKeys() { + // Finding values type requires extracting from reflect.Value + // otherwise .Kind() returns `interface{}` + v := reflect.ValueOf(data.MapIndex(k).Interface()) + + if k.Kind() == reflect.String && k.String() == "$jsii.enum" && v.Kind() == reflect.String { + enum.MemberFQN = v.String() + ok = true + return + } + } + } + + return +} + +// castValToMap attempts converting the provided jsii wire value to a +// go map. This recognizes the "$jsii.map" object and does the necessary +// recursive value conversion. +func (c *Client) castValToMap(data reflect.Value, mapType reflect.Type) (m reflect.Value, ok bool) { + ok = false + + if data.Kind() != reflect.Map || data.Type().Key().Kind() != reflect.String { + return + } + + if mapType.Kind() == reflect.Map && mapType.Key().Kind() != reflect.String { + return + } + anyType := reflect.TypeOf((*interface{})(nil)).Elem() + if mapType == anyType { + mapType = reflect.TypeOf((map[string]interface{})(nil)) + } + + dataIter := data.MapRange() + for dataIter.Next() { + key := dataIter.Key().String() + if key != "$jsii.map" { + continue + } + + // Finding value type requries extracting from reflect.Value + // otherwise .Kind() returns `interface{}` + val := reflect.ValueOf(dataIter.Value().Interface()) + if val.Kind() != reflect.Map { + return + } + + ok = true + + m = reflect.MakeMap(mapType) + + iter := val.MapRange() + for iter.Next() { + val := iter.Value() + // Note: reflect.New(t) returns a pointer to a newly allocated t + convertedVal := reflect.New(mapType.Elem()).Elem() + c.castAndSetToPtr(convertedVal, val) + + m.SetMapIndex(iter.Key(), convertedVal) + } + return + } + return +} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/create.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/create.go similarity index 60% rename from packages/@jsii/go-runtime/jsii-runtime-go/kernel/create.go rename to packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/create.go index 6db09aef31..e666dba928 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/create.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/create.go @@ -1,11 +1,8 @@ package kernel -import "github.com/aws/jsii-runtime-go/api" +import "github.com/aws/jsii-runtime-go/internal/api" -type CreateRequest struct { - kernelRequester - - API string `json:"api"` +type CreateProps struct { FQN api.FQN `json:"fqn"` Interfaces []api.FQN `json:"interfaces"` Arguments []interface{} `json:"args"` @@ -14,13 +11,16 @@ type CreateRequest struct { // TODO extends AnnotatedObjRef? type CreateResponse struct { - kernelResponder - + kernelResponse InstanceID string `json:"$jsii.byref"` } -func (c *client) Create(request CreateRequest) (response CreateResponse, err error) { - err = c.request(request, &response) +func (c *Client) Create(props CreateProps) (response CreateResponse, err error) { + type request struct { + kernelRequest + CreateProps + } + err = c.request(request{kernelRequest{"create"}, props}, &response) return } @@ -28,5 +28,5 @@ func (c *client) Create(request CreateRequest) (response CreateResponse, err err // structs. Creating new types is required in order to avoid infinite recursion. func (r *CreateResponse) UnmarshalJSON(data []byte) error { type response CreateResponse - return unmarshalKernelResponse(data, (*response)(r)) + return unmarshalKernelResponse(data, (*response)(r), r) } diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/del.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/del.go new file mode 100644 index 0000000000..62a2e9030d --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/del.go @@ -0,0 +1,20 @@ +package kernel + +import "github.com/aws/jsii-runtime-go/internal/api" + +type DelProps struct { + ObjRef api.ObjectRef `json:"objref"` +} + +type DelResponse struct { + kernelResponse +} + +func (c *Client) Del(props DelProps) (response DelResponse, err error) { + type request struct { + kernelRequest + DelProps + } + err = c.request(request{kernelRequest{"del"}, props}, &response) + return +} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/doc.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/doc.go similarity index 100% rename from packages/@jsii/go-runtime/jsii-runtime-go/kernel/doc.go rename to packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/doc.go diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/end.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/end.go new file mode 100644 index 0000000000..29fcebbb68 --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/end.go @@ -0,0 +1,19 @@ +package kernel + +type EndProps struct { + PromiseID *string `json:"promise_id"` +} + +type EndResponse struct { + kernelResponse + Result interface{} `json:"result"` +} + +func (c *Client) End(props EndProps) (response EndResponse, err error) { + type request struct { + kernelRequest + EndProps + } + err = c.request(request{kernelRequest{"end"}, props}, &response) + return +} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/get.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/get.go new file mode 100644 index 0000000000..32fc839613 --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/get.go @@ -0,0 +1,43 @@ +package kernel + +import "github.com/aws/jsii-runtime-go/internal/api" + +type GetProps struct { + Property string `json:"property"` + ObjRef api.ObjectRef `json:"objref"` +} + +type StaticGetProps struct { + FQN api.FQN `json:"fqn"` + Property string `json:"property"` +} + +type GetResponse struct { + kernelResponse + Value interface{} `json:"value"` +} + +func (c *Client) Get(props GetProps) (response GetResponse, err error) { + type request struct { + kernelRequest + GetProps + } + err = c.request(request{kernelRequest{"get"}, props}, &response) + return +} + +func (c *Client) SGet(props StaticGetProps) (response GetResponse, err error) { + type request struct { + kernelRequest + StaticGetProps + } + err = c.request(request{kernelRequest{"sget"}, props}, &response) + return +} + +// UnmarshalJSON provides custom unmarshalling implementation for response +// structs. Creating new types is required in order to avoid infinite recursion. +func (r *GetResponse) UnmarshalJSON(data []byte) error { + type response GetResponse + return unmarshalKernelResponse(data, (*response)(r), r) +} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/invoke.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/invoke.go new file mode 100644 index 0000000000..3dd677b05d --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/invoke.go @@ -0,0 +1,45 @@ +package kernel + +import "github.com/aws/jsii-runtime-go/internal/api" + +type InvokeProps struct { + Method string `json:"method"` + Arguments []interface{} `json:"args"` + ObjRef api.ObjectRef `json:"objref"` +} + +type StaticInvokeProps struct { + FQN api.FQN `json:"fqn"` + Method string `json:"method"` + Arguments []interface{} `json:"args"` +} + +type InvokeResponse struct { + kernelResponse + Result interface{} `json:"result"` +} + +func (c *Client) Invoke(props InvokeProps) (response InvokeResponse, err error) { + type request struct { + kernelRequest + InvokeProps + } + err = c.request(request{kernelRequest{"invoke"}, props}, &response) + return +} + +func (c *Client) SInvoke(props StaticInvokeProps) (response InvokeResponse, err error) { + type request struct { + kernelRequest + StaticInvokeProps + } + err = c.request(request{kernelRequest{"sinvoke"}, props}, &response) + return +} + +// UnmarshalJSON provides custom unmarshalling implementation for response +// structs. Creating new types is required in order to avoid infinite recursion. +func (r *InvokeResponse) UnmarshalJSON(data []byte) error { + type response InvokeResponse + return unmarshalKernelResponse(data, (*response)(r), r) +} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/json.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/json.go new file mode 100644 index 0000000000..487ced1a2c --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/json.go @@ -0,0 +1,40 @@ +package kernel + +import ( + "encoding/json" + "errors" +) + +// unmarshalKernelResponse performs custom unmarshaling for kernel responses, checks for presence of `error` key on json +// and returns if present. +// +// The uresult parameter may be passed to json.Unmarshal so if unmarshalKernelResponse is called within a custom +// UnmarshalJSON function, it must be a type alias (otherwise, this will recurse into itself until the stack is full). +// The result parameter must point to the original result (with the original type). This unfortunate duplication is +// necessary for the proper handling of in-line callbacks. +func unmarshalKernelResponse(data []byte, uresult kernelResponder, result kernelResponder) error { + datacopy := make([]byte, len(data)) + copy(datacopy, data) + + var response map[string]json.RawMessage + if err := json.Unmarshal(datacopy, &response); err != nil { + return err + } + + if err, ok := response["error"]; ok { + return errors.New(string(err)) + } + + // In-line callback requests interrupt the current flow, the callback handling + // logic will resume this handling once the callback request has been fulfilled. + if raw, ok := response["callback"]; ok { + callback := callback{} + if err := json.Unmarshal(raw, &callback); err != nil { + return err + } + + return callback.handle(result) + } + + return json.Unmarshal(response["ok"], uresult) +} \ No newline at end of file diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/load.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/load.go similarity index 62% rename from packages/@jsii/go-runtime/jsii-runtime-go/kernel/load.go rename to packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/load.go index 930e236c62..d3133c2620 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/load.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/load.go @@ -1,11 +1,8 @@ package kernel -// LoadRequest holds the necessary information to load a library into the +// LoadProps holds the necessary information to load a library into the // @jsii/kernel process through the Load method. -type LoadRequest struct { - kernelRequester - - API string `json:"api"` +type LoadProps struct { Name string `json:"name"` Version string `json:"version"` Tarball string `json:"tarball"` @@ -14,14 +11,17 @@ type LoadRequest struct { // LoadResponse contains the data returned by the @jsii/kernel process in // response to a load request. type LoadResponse struct { - kernelResponder - + kernelResponse Assembly string `json:"assembly"` Types float64 `json:"types"` } -func (c *client) Load(request LoadRequest) (response LoadResponse, err error) { - err = c.request(request, &response) +func (c *Client) Load(props LoadProps) (response LoadResponse, err error) { + type request struct { + kernelRequest + LoadProps + } + err = c.request(request{kernelRequest{"load"}, props}, &response) return } @@ -29,5 +29,5 @@ func (c *client) Load(request LoadRequest) (response LoadResponse, err error) { // structs. Creating new types is required in order to avoid infinite recursion. func (r *LoadResponse) UnmarshalJSON(data []byte) error { type response LoadResponse - return unmarshalKernelResponse(data, (*response)(r)) + return unmarshalKernelResponse(data, (*response)(r), r) } diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/manage-object.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/manage-object.go new file mode 100644 index 0000000000..fb5f46b843 --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/manage-object.go @@ -0,0 +1,30 @@ +package kernel + +import ( + "reflect" + + "github.com/aws/jsii-runtime-go/internal/api" +) + +const objectFQN = "Object" + +func (c *Client) ManageObject(v reflect.Value) (ref api.ObjectRef, err error) { + // Ensuring we use a pointer, so we can see pointer-receiver methods, too. + vt := reflect.Indirect(v).Addr().Type() + interfaces, overrides := c.Types().DiscoverImplementation(vt) + + var resp CreateResponse + resp, err = c.Create(CreateProps{ + FQN: objectFQN, + Interfaces: interfaces, + Overrides: overrides, + }) + + if err == nil { + if err = c.objects.Register(v, resp.InstanceID); err == nil { + ref.InstanceID = resp.InstanceID + } + } + + return +} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/naming.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/naming.go new file mode 100644 index 0000000000..adcb09adee --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/naming.go @@ -0,0 +1,21 @@ +package kernel + +type NamingProps struct { + Assembly string `json:"assembly"` +} + +type NamingResponse struct { + kernelResponse + // readonly naming: { + // readonly [language: string]: { readonly [key: string]: any } | undefined; + // }; +} + +func (c *Client) Naming(props NamingProps) (response NamingResponse, err error) { + type request struct { + kernelRequest + NamingProps + } + err = c.request(request{kernelRequest{"naming"}, props}, &response) + return +} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/consume-stderr.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/consume-stderr.go new file mode 100644 index 0000000000..dcda0c8d9e --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/consume-stderr.go @@ -0,0 +1,42 @@ +package process + +import ( + "bufio" + "encoding/json" + "io" + "os" +) + +type consoleMessage struct { + Stderr []byte `json:"stderr"` + Stdout []byte `json:"stdout"` +} + +// consumeStderr is intended to be used as a goroutine, and will consume this +// process' stderr stream until it reaches EOF. It reads the stream line-by-line +// and will decode any console messages per the jsii wire protocol specification. +// Once EOF has been reached, true will be sent to the done channel, allowing +// other goroutines to check whether the goroutine has reached EOF (and hence +// finished) or not. +func (p *Process) consumeStderr(done chan bool) { + reader := bufio.NewReader(p.stderr) + + for true { + line, err := reader.ReadBytes('\n') + if len(line) == 0 || err == io.EOF { + done <- true + return + } + var message consoleMessage + if err := json.Unmarshal(line, &message); err != nil { + os.Stderr.Write(line) + } else { + if message.Stderr != nil { + os.Stderr.Write(message.Stderr) + } + if message.Stdout != nil { + os.Stdout.Write(message.Stdout) + } + } + } +} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/handshake.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/handshake.go new file mode 100644 index 0000000000..8173655ad8 --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/handshake.go @@ -0,0 +1,25 @@ +package process + +import ( + "fmt" + "regexp" + + "github.com/Masterminds/semver/v3" +) + +type handshakeResponse struct { + Hello string `json:"hello"` +} + +func (h *handshakeResponse) runtimeVersion() (*semver.Version, error) { + re := regexp.MustCompile("@") + parts := re.Split(h.Hello, 3) + switch len(parts) { + case 2: + return semver.NewVersion(parts[1]) + case 3: + return semver.NewVersion(parts[2]) + default: + return nil, fmt.Errorf("invalid handshake payload: %s", h.Hello) + } +} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/jsii-mock-runtime.js b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/jsii-mock-runtime.js new file mode 100644 index 0000000000..c8aff66a72 --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/jsii-mock-runtime.js @@ -0,0 +1,34 @@ +const process = require('process'); + +/** + * Executes a pretend jsii runtime process that advertises the + * provided runtime version number. + * + * It response to any request except for "exit" by repeating it + * back to the parent process. The "exit" handling is "standard". + * + * @param version the version number to report in the HELLO message. + */ +function main(version) { + console.log(JSON.stringify({ hello: `@mock/jsii-runtime@${version}` })); + + let buffer = ""; + process.stdin.setEncoding('utf8'); + process.stdin.on('data', chunk => { + buffer = buffer + chunk; + nl = buffer.indexOf('\n'); + if (nl >= 0) { + const line = buffer.substring(0, nl + 1); + buffer = buffer.substring(nl + 1); + + const message = JSON.parse(line); + if (message.exit) { + process.exit(message.exit); + } else { + console.log(JSON.stringify(message)); + } + } + }); +} + +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/process.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/process.go new file mode 100644 index 0000000000..3ccecddaf6 --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/process.go @@ -0,0 +1,264 @@ +package process + +import ( + "encoding/json" + "fmt" + "io" + "io/ioutil" + "os" + "os/exec" + "runtime" + "strings" + "sync" + + "github.com/Masterminds/semver/v3" + "github.com/aws/jsii-runtime-go/internal/embedded" +) + +const JSII_RUNTIME string = "JSII_RUNTIME" + +// Process is a simple interface over the child process hosting the +// @jsii/kernel process. It only exposes a very straight-forward +// request/response interface. +type Process struct { + compatibleVersions *semver.Constraints + + cmd *exec.Cmd + tmpdir string + + stdin io.WriteCloser + stdout io.ReadCloser + stderr io.ReadCloser + + requests *json.Encoder + responses *json.Decoder + stderrDone chan bool + + started bool + closed bool + + mutex sync.Mutex +} + +// NewProcess prepares a new child process, but does not start it yet. It will +// be automatically started whenever the client attempts to send a request +// to it. +// +// If the JSII_RUNTIME environment variable is set, this command will be used +// to start the child process, in a sub-shell (using %COMSPEC% or cmd.exe on +// Windows; $SHELL or /bin/sh on other OS'es). Otherwise, the embedded runtime +// application will be extracted into a temporary directory, and used. +// +// The current process' environment is inherited by the child process. Additional +// environment may be injected into the child process' environment - all of which +// with lower precedence than the launching process' environment, with the notable +// exception of JSII_AGENT, which is reserved. +func NewProcess(compatibleVersions string) (*Process, error) { + p := Process{} + + if constraints, err := semver.NewConstraint(compatibleVersions); err != nil { + return nil, err + } else { + p.compatibleVersions = constraints + } + + if custom := os.Getenv(JSII_RUNTIME); custom != "" { + var ( + command string + args []string + ) + // Sub-shelling in order to avoid having to parse arguments + if runtime.GOOS == "windows" { + // On windows, we use %ComSpec% if set, or cmd.exe + if cmd := os.Getenv("ComSpec"); cmd != "" { + command = cmd + } else { + command = "cmd.exe" + } + // The /d option disables Registry-defined AutoRun, it's safer to enable + // The /s option tells cmd.exe the command is quoted as if it were typed into a prompt + // The /c option tells cmd.exe to run the specified command and exit immediately + args = []string{"/d", "/s", "/c", custom} + } else { + // On other OS'es, we use $SHELL and fall back to "/bin/sh" + if shell := os.Getenv("SHELL"); shell != "" { + command = shell + } else { + command = "/bin/sh" + } + args = []string{"-c", custom} + } + p.cmd = exec.Command(command, args...) + } else if tmpdir, err := ioutil.TempDir("", "jsii-runtime.*"); err != nil { + return nil, err + } else { + p.tmpdir = tmpdir + if entrypoint, err := embedded.ExtractRuntime(tmpdir); err != nil { + p.Close() + return nil, err + } else { + p.cmd = exec.Command("node", entrypoint) + } + } + + // Setting up environment - if duplicate keys are found, the last value is used, so we are careful with ordering. In + // particular, we are setting NODE_OPTIONS only if `os.Environ()` does not have another value... So the user can + // control the environment... However, JSII_AGENT must always be controlled by this process. + p.cmd.Env = append([]string{"NODE_OPTIONS=--max-old-space-size=4069"}, os.Environ()...) + p.cmd.Env = append(p.cmd.Env, fmt.Sprintf("JSII_AGENT=%s/%s/%s", runtime.Version(), runtime.GOOS, runtime.GOARCH)) + + if stdin, err := p.cmd.StdinPipe(); err != nil { + p.Close() + return nil, err + } else { + p.stdin = stdin + p.requests = json.NewEncoder(stdin) + } + if stdout, err := p.cmd.StdoutPipe(); err != nil { + p.Close() + return nil, err + } else { + p.stdout = stdout + p.responses = json.NewDecoder(stdout) + } + if stderr, err := p.cmd.StderrPipe(); err != nil { + p.Close() + return nil, err + } else { + p.stderr = stderr + } + + return &p, nil +} + +func (p *Process) ensureStarted() error { + if p.closed { + return fmt.Errorf("this process has been closed") + } + if p.started { + return nil + } + if err := p.cmd.Start(); err != nil { + p.Close() + return err + } + p.started = true + + done := make(chan bool, 1) + go p.consumeStderr(done) + p.stderrDone = done + + var handshake handshakeResponse + if err := p.readResponse(&handshake); err != nil { + p.Close() + return err + } + + if runtimeVersion, err := handshake.runtimeVersion(); err != nil { + p.Close() + return err + } else if ok, errs := p.compatibleVersions.Validate(runtimeVersion); !ok { + causes := make([]string, len(errs)) + for i, err := range errs { + causes[i] = fmt.Sprintf("- %v", err) + } + p.Close() + return fmt.Errorf("incompatible runtime version:\n%s", strings.Join(causes, "\n")) + } + + go func() { + err := p.cmd.Wait() + if err != nil { + fmt.Fprintf(os.Stderr, "Runtime process exited abnormally: %s", err.Error()) + } + p.Close() + }() + + return nil +} + +// Request starts the child process if that has not happened yet, then +// encodes the supplied request and sends it to the child process +// via the requests channel, then decodes the response into the provided +// response pointer. If the process is not in a usable state, or if the +// encoding fails, an error is returned. +func (p *Process) Request(request interface{}, response interface{}) error { + if err := p.ensureStarted(); err != nil { + return err + } + if err := p.requests.Encode(request); err != nil { + p.Close() + return err + } + return p.readResponse(response) +} + +func (p *Process) readResponse(into interface{}) error { + if !p.responses.More() { + return fmt.Errorf("no response received from child process") + } + return p.responses.Decode(into) +} + +func (p *Process) Close() { + if p.closed { + return + } + + // Acquire the lock, so we don't try to concurrently close multiple times + p.mutex.Lock() + defer p.mutex.Unlock() + + // Check again now that we own the lock, it may be a fast exit! + if p.closed { + return + } + + if p.stdin != nil { + // Try to send the exit message, this might fail, but we can ignore that. + p.stdin.Write([]byte("{\"exit\":0}\n")) + + // Close STDIN for the child process now. Ignoring errors, as it may + // have been closed already (e.g: if the process exited). + p.stdin.Close() + p.stdin = nil + } + + if p.stdout != nil { + // Close STDOUT for the child process now, as we don't expect to receive + // responses anymore. Ignoring errors, as it may have been closed + // already (e.g: if the process exited). + p.stdout.Close() + p.stdout = nil + } + + if p.stderrDone != nil { + // Wait for the stderr sink goroutine to have finished + <-p.stderrDone + p.stderrDone = nil + } + + if p.stderr != nil { + // Close STDERR for the child process now, as we're no longer consuming + // it anyway. Ignoring errors, as it may havebeen closed already (e.g: + // if the process exited). + p.stderr.Close() + p.stderr = nil + } + + if p.cmd != nil { + // Wait for the child process to be dead and gone (should already be) + p.cmd.Wait() + p.cmd = nil + } + + if p.tmpdir != "" { + // Clean up any temporary directory we provisioned. + if err := os.RemoveAll(p.tmpdir); err != nil { + fmt.Fprintf(os.Stderr, "could not clean up temporary directory: %v\n", err) + } + p.tmpdir = "" + } + + p.closed = true +} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/process_test.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/process_test.go new file mode 100644 index 0000000000..b3a91c08b7 --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/process_test.go @@ -0,0 +1,126 @@ +package process + +import ( + _ "embed" + "fmt" + "io/ioutil" + "os" + "os/exec" + "runtime" + "strings" + "testing" +) + +//go:embed jsii-mock-runtime.js +var mockRuntimeSource []byte +var mockRuntime string + +func TestMain(m *testing.M) { + file, _ := ioutil.TempFile("", "jsii-mock-runtime.*.js") + if _, err := file.Write(mockRuntimeSource); err != nil { + panic(err) + } + file.Close() + mockRuntime = file.Name() + + status := m.Run() + + // Clean up temporary file + os.Remove(mockRuntime) + + os.Exit(status) +} + +// TestVersionCheck ensures the version check logic works correctly. As a side +// benefit, it validates we are correctly launching custom JSII_RUNTIME processes +// as this relies on a mock implementation. +func TestVersionCheck(t *testing.T) { + acceptedVersions := []string{"4.3.2", "4.3.1337", "4.1337.42"} + + for _, mockVersion := range acceptedVersions { + t.Run(fmt.Sprintf("accepts version %s", mockVersion), func(t *testing.T) { + oldJsiiRuntime := os.Getenv(JSII_RUNTIME) + if runtime, err := makeCustomRuntime(mockVersion); err != nil { + t.Fatal(err) + } else { + os.Setenv(JSII_RUNTIME, runtime) + } + defer os.Setenv(JSII_RUNTIME, oldJsiiRuntime) + + process, err := NewProcess(fmt.Sprintf("^4.3.2")) + if err != nil { + t.Fatal(err) + return + } + defer process.Close() + t.Logf("Subprocess command: %s", strings.Join(process.cmd.Args, " ")) + + var ( + request = EchoRequest{Message: "Oh, hi!"} + response EchoResponse + ) + if err := process.Request(request, &response); err != nil { + t.Fatal(err) + } + if response.Message != request.Message { + t.Errorf("Expected %s, received %s", request.Message, response.Message) + } + }) + } + + rejectedVersions := []string{"3.1337.42", "5.0.0-0", "4.3.2-pre.0", "4.3.3-pre.0"} + + for _, mockVersion := range rejectedVersions { + t.Run(fmt.Sprintf("rejects version %s", mockVersion), func(t *testing.T) { + oldJsiiRuntime := os.Getenv(JSII_RUNTIME) + if runtime, err := makeCustomRuntime(mockVersion); err != nil { + t.Fatal(err) + } else { + os.Setenv(JSII_RUNTIME, runtime) + } + defer os.Setenv(JSII_RUNTIME, oldJsiiRuntime) + + process, err := NewProcess(fmt.Sprintf("^4.3.2")) + if err != nil { + t.Fatal(err) + return + } + defer process.Close() + t.Logf("Subprocess command: %s", strings.Join(process.cmd.Args, " ")) + + var ( + request = EchoRequest{Message: "Oh, hi!"} + response EchoResponse + ) + if err := process.Request(request, &response); err == nil { + t.Errorf("expected an error, but no error received") + } else if !strings.Contains(err.Error(), "incompatible runtime version") { + t.Errorf("expected incompatible runtime version error, got %s", err.Error()) + } + }) + } +} + +type EchoRequest struct { + Message string `json:"message"` +} + +type EchoResponse struct { + Message string `json:"message"` +} + +func makeCustomRuntime(mockVersion string) (string, error) { + var ( + node string + err error + ) + if runtime.GOOS == "windows" { + node, err = exec.LookPath("node.exe") + } else { + node, err = exec.LookPath("node") + } + if err != nil { + return "", err + } + return fmt.Sprintf("%s %s %s", node, mockRuntime, mockVersion), nil +} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/request-response-markers.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/request-response-markers.go similarity index 50% rename from packages/@jsii/go-runtime/jsii-runtime-go/kernel/request-response-markers.go rename to packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/request-response-markers.go index aac029efc1..ca319e1f90 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/request-response-markers.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/request-response-markers.go @@ -1,39 +1,40 @@ package kernel -// kernelRequest allows creating a union of kernelRequest and kernelResponse +// kernelRequester allows creating a union of kernelRequester and kernelResponder // types by defining private method implemented by a private custom type, which // is embedded in all relevant types. -type kernelRequest interface { +type kernelRequester interface { // isRequest is a marker method that is intended to ensure no external type // can implement this interface. isRequest() kernelBrand } -// kernelRequester is a 0-width marker struct embedded to make another type be -// usable as a kernelRequest. -type kernelRequester struct{} +// kernelRequest is the standard implementation for kernelRequester. +type kernelRequest struct { + API string `json:"api"` +} -func (r kernelRequester) isRequest() kernelBrand { +func (r kernelRequest) isRequest() kernelBrand { return kernelBrand{} } -// kenrelResponse allows creating a union of kernelResponse and kernelRequest +// kernelResponder allows creating a union of kernelResponder and kernelRequester // types by defining private method implemented by a private custom type, which // is embedded in all relevant types. -type kernelResponse interface { +type kernelResponder interface { // isResponse is a marker method that is intended to ensure no external type // can implement this interface. isResponse() kernelBrand } -// kernelResponder is a 0-width marker struc tembedded to make another type be -// usable as a kernelResponse. -type kernelResponder struct{} +// kernelResponse is a 0-width marker struc tembedded to make another type be +// usable as a kernelResponder. +type kernelResponse struct{} -func (r kernelResponder) isResponse() kernelBrand { +func (r kernelResponse) isResponse() kernelBrand { return kernelBrand{} } -// kernelBrand is a private type used to ensure the kernelRequest and -// kernelResponse cannot be implemented outside of this package. +// kernelBrand is a private type used to ensure the kernelRequester and +// kernelResponder cannot be implemented outside of this package. type kernelBrand struct{} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/set.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/set.go new file mode 100644 index 0000000000..485cb1fe35 --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/set.go @@ -0,0 +1,44 @@ +package kernel + +import "github.com/aws/jsii-runtime-go/internal/api" + +type SetProps struct { + Property string `json:"property"` + Value interface{} `json:"value"` + ObjRef api.ObjectRef `json:"objref"` +} + +type StaticSetProps struct { + FQN api.FQN `json:"fqn"` + Property string `json:"property"` + Value interface{} `json:"value"` +} + +type SetResponse struct { + kernelResponse +} + +func (c *Client) Set(props SetProps) (response SetResponse, err error) { + type request struct { + kernelRequest + SetProps + } + err = c.request(request{kernelRequest{"set"}, props}, &response) + return +} + +func (c *Client) SSet(props StaticSetProps) (response SetResponse, err error) { + type request struct { + kernelRequest + StaticSetProps + } + err = c.request(request{kernelRequest{"sset"}, props}, &response) + return +} + +// UnmarshalJSON provides custom unmarshalling implementation for response +// structs. Creating new types is required in order to avoid infinite recursion. +func (r *SetResponse) UnmarshalJSON(data []byte) error { + type response SetResponse + return unmarshalKernelResponse(data, (*response)(r), r) +} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/stats.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/stats.go new file mode 100644 index 0000000000..a24f0c257e --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/stats.go @@ -0,0 +1,11 @@ +package kernel + +type StatsResponse struct { + kernelResponse + ObjectCount float64 `json:"object_count"` +} + +func (c *Client) Stats() (response StatsResponse, err error) { + err = c.request(kernelRequest{"stats"}, &response) + return +} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/objectstore/doc.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/objectstore/doc.go new file mode 100644 index 0000000000..b0094d71ec --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/objectstore/doc.go @@ -0,0 +1,7 @@ +// Package objectstore implements support for tracking a mapping of object +// references to and from their instance ID. It tracks objects by proxy of their +// memory address (i.e: pointer value), in order to avoid the pitfalls of go's +// standard object equality mechanism (which is also reflect.Value's equality +// mechanism) causing distinct instances appearing to be equal (including when +// used as keys to a map). +package objectstore diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/objectstore/objectstore.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/objectstore/objectstore.go new file mode 100644 index 0000000000..492ce5c1da --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/objectstore/objectstore.go @@ -0,0 +1,165 @@ +package objectstore + +import ( + "fmt" + "reflect" +) + +// ObjectStore tracks object instances for which an identifier has been +// associated. Object to instanceID association is tracked using the object +// memory address (aka pointer value) in order to not have issues with go's +// standard object equality rules (we need distinct - but possibly equal) object +// instances to be considered as separate entities for our purposes. +type ObjectStore struct { + // objectToID associates an object's memory address (pointer value) with an + // instanceID. This includes aliases (anonymous embedded values) of objects + // passed to the Register method. + objectToID map[uintptr]string + + // idToObject associates an instanceID with the reflect.Value that + // represents the top-level object that was registered with the instanceID + // via the Register method. + idToObject map[string]reflect.Value +} + +// New initializes a new ObjectStore. +func New() *ObjectStore { + return &ObjectStore{ + objectToID: make(map[uintptr]string), + idToObject: make(map[string]reflect.Value), + } +} + +// Register associates the provided value with the given instanceID. It also +// registers any anonymously embedded value (transitively) against the same +// instanceID, so that methods promoted from those resolve the correct +// instanceID, too. +// +// Returns an error if the provided value is not a pointer value; if the value +// or any of it's (transitively) anonymous embeds have already been registered +// against a different instanceID; of if the provided instanceID was already +// associated to a different value. +// +// The call is idempotent: calling Register again with the same value and +// instanceID does not result in an error. +func (o *ObjectStore) Register(value reflect.Value, instanceID string) error { + var err error + if value, err = canonicalValue(value); err != nil { + return err + } + ptr := value.Pointer() + + if existing, found := o.objectToID[ptr]; found { + if existing == instanceID { + return nil + } + return fmt.Errorf("attempting to register %v as %s, but it was already registered as %s", value, instanceID, existing) + } + if existing, found := o.idToObject[instanceID]; found { + if existing == value { + return nil + } + return fmt.Errorf("attempted to register %v as %s, but %v has this ID", value, instanceID, existing) + } + + aliases := findAliases(value) + for _, alias := range aliases { + ptr := alias.Pointer() + if existing, found := o.objectToID[ptr]; found && existing != instanceID { + return fmt.Errorf("value %s is embedded in %s which has ID %s, but was already assigned %s", alias, value, instanceID, existing) + } + } + + o.objectToID[ptr] = instanceID + o.idToObject[instanceID] = value + for _, alias := range aliases { + o.objectToID[alias.Pointer()] = instanceID + } + + return nil +} + +// InstanceID attempts to determine the instanceID associated with the provided +// value, if any. Returns the existing instanceID and a boolean informing +// whether an instanceID was already found or not. +// +// The InstanceID method is safe to call with values that are not track-able in +// an ObjectStore (i.e: non-pointer values, primitive values, etc...). +func (o *ObjectStore) InstanceID(value reflect.Value) (instanceID string, found bool) { + var err error + if value, err = canonicalValue(value); err == nil { + ptr := value.Pointer() + instanceID, found = o.objectToID[ptr] + } + return +} + +// GetObject attempts to retrieve the object value associated with the given +// instanceID. Returns the existing value and a boolean informing whether a +// value was associated with this instanceID or not. +// +// The GetObject method is safe to call with an instanceID that was never +// registered with the ObjectStore. +func (o *ObjectStore) GetObject(instanceID string) (value reflect.Value, found bool) { + value, found = o.idToObject[instanceID] + return +} + +// canonicalValue ensures the same reference is always considered for object +// identity (especially in maps), so that we don't get surprised by pointer to +// struct versus struct value versus opaque interface value, etc... +func canonicalValue(value reflect.Value) (reflect.Value, error) { + if value.Kind() == reflect.Ptr && value.Elem().Kind() == reflect.Struct { + return value, nil + } + // If this is a pointer to something, de-references it. + result := reflect.ValueOf(reflect.Indirect(value).Interface()) + + if result.Kind() != reflect.Ptr { + return reflect.Value{}, fmt.Errorf("illegal argument: %s is not a pointer", result.String()) + } + + return result, nil +} + +// findAliases traverses the provided object value to recursively identify all +// anonymous embedded values, which will then be registered against the same +// instanceID as the embedding value. +// +// This function assumes the provided value is either a reflect.Struct or a +// pointer to a reflect.Struct (possibly as a reflect.Interface). Calling with +// a nil value, or a value that is not ultimately a reflect.Struct may result +// in panic. +func findAliases(value reflect.Value) []reflect.Value { + result := []reflect.Value{} + + // Indirect so we always work on the pointer referree + value = reflect.Indirect(value) + + t := value.Type() + numField := t.NumField() + for i := 0; i < numField; i++ { + f := t.Field(i) + + // Ignore non-anonymous fields (including padding) + if !f.Anonymous { + continue + } + + fv := value.FieldByIndex(f.Index) + if fv.Kind() == reflect.Interface { + // If an interface, de-reference to get to the struct type. + fv = reflect.ValueOf(fv.Interface()) + } + if fv.Kind() == reflect.Struct { + // If a struct, get the address of the member. + fv = fv.Addr() + } + + result = append(result, fv) + // Recurse down to collect nested aliases + result = append(result, findAliases(fv)...) + } + + return result +} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/discover-implemented.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/discover-implemented.go new file mode 100644 index 0000000000..8ff78583cd --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/discover-implemented.go @@ -0,0 +1,39 @@ +package typeregistry + +import ( + "reflect" + + "github.com/aws/jsii-runtime-go/internal/api" +) + +// DiscoverImplementation determines the list of registered interfaces that are +// implemented by the provided type, and returns the list of their FQNs and +// overrides for all their combined methods and properties. +func (t *TypeRegistry) DiscoverImplementation(vt reflect.Type) (interfaces []api.FQN, overrides []api.Override) { + registeredOverrides := make(map[string]bool) + + for fqn, members := range t.typeMembers { + iface := t.fqnToType[fqn] + if iface.Kind == classType || !vt.AssignableTo(iface.Type) { + continue + } + // Found a hit, registering it's FQN in the list! + interfaces = append(interfaces, fqn) + + // Now, collecting all members thereof + for _, override := range members { + var identifier string + if api.IsMethodOverride(override) { + identifier = override.(api.MethodOverride).GoMethod + } else { + identifier = override.(api.PropertyOverride).GoGetter + } + if !registeredOverrides[identifier] { + registeredOverrides[identifier] = true + overrides = append(overrides, override) + } + } + } + + return +} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/typeregistry/doc.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/doc.go similarity index 100% rename from packages/@jsii/go-runtime/jsii-runtime-go/typeregistry/doc.go rename to packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/doc.go diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/typeregistry/registration.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/registration.go similarity index 56% rename from packages/@jsii/go-runtime/jsii-runtime-go/typeregistry/registration.go rename to packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/registration.go index ed8392437d..ceb9083882 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/typeregistry/registration.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/registration.go @@ -4,46 +4,44 @@ import ( "fmt" "reflect" - "github.com/aws/jsii-runtime-go/api" + "github.com/aws/jsii-runtime-go/internal/api" ) -// TypeRegisterer exposes the methods to register types with the jsii runtime -// for go. -type TypeRegisterer interface { - // RegisterClass maps the given FQN to the provided class interface, and proxy - // maker function. This returns an error if the class type is not a go interface. - RegisterClass(fqn api.FQN, class reflect.Type, maker func() interface{}) error - - // RegisterEnum maps the given FQN to the provided enum type, and records the - // provided members map (jsii member name => go value). This returns an error - // if the provided enum is not a string derivative, or of any of the provided - // member values has a type other than enm. - RegisterEnum(fqn api.FQN, enm reflect.Type, members map[string]interface{}) error - - // RegisterInterface maps the given FQN to the provided interface type, and - // proxy maker function. Returns an error if the provided interface is not a go - // interface. - RegisterInterface(fqn api.FQN, iface reflect.Type, maker func() interface{}) error - - // RegisterStruct maps the given FQN to the provided struct type, and struct - // interface. Returns an error if the provided struct type is not a go struct. - RegisterStruct(fqn api.FQN, strct reflect.Type) error +type typeKind uint8 + +const ( + _ = iota + classType typeKind = iota + enumType typeKind = iota + interfaceType typeKind = iota + structType typeKind = iota +) + +type registeredType struct { + Type reflect.Type + Kind typeKind } -// RegisterClass maps the given FQN to the provided class interface, and proxy -// maker function. This returns an error if the class type is not a go interface. -func (t *typeRegistry) RegisterClass(fqn api.FQN, class reflect.Type, maker func() interface{}) error { +// RegisterClass maps the given FQN to the provided class interface, list of +// overrides, and proxy maker function. This returns an error if the class +// type is not a go interface. +func (t *TypeRegistry) RegisterClass(fqn api.FQN, class reflect.Type, overrides []api.Override, maker func() interface{}) error { if class.Kind() != reflect.Interface { return fmt.Errorf("the provided class is not an interface: %v", class) } - if existing, exists := t.fqnToType[fqn]; exists && existing != class { + if existing, exists := t.fqnToType[fqn]; exists && existing.Type != class { return fmt.Errorf("another type was already registered with %s: %v", fqn, existing) } - t.fqnToType[fqn] = class + t.fqnToType[fqn] = registeredType{class, classType} t.proxyMakers[class] = maker + // Skipping registration if there are no members, as this would have no use. + if len(overrides) > 0 { + t.typeMembers[fqn] = append([]api.Override{}, overrides...) + } + return nil } @@ -51,11 +49,11 @@ func (t *typeRegistry) RegisterClass(fqn api.FQN, class reflect.Type, maker func // provided members map (jsii member name => go value). This returns an error // if the provided enum is not a string derivative, or of any of the provided // member values has a type other than enm. -func (t *typeRegistry) RegisterEnum(fqn api.FQN, enm reflect.Type, members map[string]interface{}) error { +func (t *TypeRegistry) RegisterEnum(fqn api.FQN, enm reflect.Type, members map[string]interface{}) error { if enm.Kind() != reflect.String { return fmt.Errorf("the provided enum is not a string derivative: %v", enm) } - if existing, exists := t.fqnToType[fqn]; exists && existing != enm { + if existing, exists := t.fqnToType[fqn]; exists && existing.Type != enm { return fmt.Errorf("another type was already registered with %s: %v", fqn, existing) } for memberName, memberVal := range members { @@ -67,6 +65,7 @@ func (t *typeRegistry) RegisterEnum(fqn api.FQN, enm reflect.Type, members map[s // if the pre-condition fails at any point. This is done in a second loop. } + t.fqnToType[fqn] = registeredType{enm, enumType} t.typeToEnumFQN[enm] = fqn for memberName, memberVal := range members { memberFQN := fmt.Sprintf("%s/%s", fqn, memberName) @@ -76,36 +75,45 @@ func (t *typeRegistry) RegisterEnum(fqn api.FQN, enm reflect.Type, members map[s return nil } -// RegisterInterface maps the given FQN to the provided interface type, and -// proxy maker function. Returns an error if the provided interface is not a go -// interface. -func (t *typeRegistry) RegisterInterface(fqn api.FQN, iface reflect.Type, maker func() interface{}) error { +// RegisterInterface maps the given FQN to the provided interface type, list of +// overrides, and proxy maker function. Returns an error if the provided interface +// is not a go interface. +func (t *TypeRegistry) RegisterInterface(fqn api.FQN, iface reflect.Type, overrides []api.Override, maker func() interface{}) error { if iface.Kind() != reflect.Interface { return fmt.Errorf("the provided interface is not an interface: %v", iface) } - if existing, exists := t.fqnToType[fqn]; exists && existing != iface { + if existing, exists := t.fqnToType[fqn]; exists && existing.Type != iface { return fmt.Errorf("another type was already registered with %s: %v", fqn, existing) } - t.fqnToType[fqn] = iface + t.fqnToType[fqn] = registeredType{iface, interfaceType} t.proxyMakers[iface] = maker + // Skipping registration if there are no members, as this would have no use. + if len(overrides) > 0 { + t.typeMembers[fqn] = append([]api.Override{}, overrides...) + } + return nil } // RegisterStruct maps the given FQN to the provided struct type, and struct // interface. Returns an error if the provided struct type is not a go struct, // or the provided iface not a go interface. -func (t *typeRegistry) RegisterStruct(fqn api.FQN, strct reflect.Type) error { +func (t *TypeRegistry) RegisterStruct(fqn api.FQN, strct reflect.Type) error { if strct.Kind() != reflect.Struct { return fmt.Errorf("the provided struct is not a struct: %v", strct) } - if existing, exists := t.fqnToType[fqn]; exists && existing != strct { + if existing, exists := t.fqnToType[fqn]; exists && existing.Type != strct { return fmt.Errorf("another type was already registered with %s: %v", fqn, existing) } + if existing, exists := t.typeToFQN[strct]; exists && existing != fqn { + return fmt.Errorf("attempting to register type %s as %s, but it was already registered as: %s", strct.String(), fqn, existing) + } + fields := []reflect.StructField{} numField := strct.NumField() for i := 0; i < numField; i++ { @@ -122,7 +130,8 @@ func (t *typeRegistry) RegisterStruct(fqn api.FQN, strct reflect.Type) error { fields = append(fields, field) } - t.fqnToType[fqn] = strct + t.fqnToType[fqn] = registeredType{strct, structType} + t.typeToFQN[strct] = fqn t.structFields[strct] = fields return nil diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/typeregistry/type-registry.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/type-registry.go similarity index 64% rename from packages/@jsii/go-runtime/jsii-runtime-go/typeregistry/type-registry.go rename to packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/type-registry.go index a62fca9396..e560d89b90 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/typeregistry/type-registry.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/type-registry.go @@ -4,44 +4,23 @@ import ( "fmt" "reflect" - "github.com/aws/jsii-runtime-go/api" + "github.com/aws/jsii-runtime-go/internal/api" ) -// TypeRegistry exposes the methods to register types with the jsii runtime for -// go as well as methods to work with registered types. -type TypeRegistry interface { - TypeRegisterer - - // StructFields returns the list of fields that make a registered jsii struct. - StructFields(typ reflect.Type) (fields []reflect.StructField, found bool) - - // InitJsiiProxy initializes a jsii proxy value at the provided pointer. It - // returns an error if the pointer does not have a value of a registered - // proxyable type (that is, a class or interface type). - InitJsiiProxy(val reflect.Value) error - - // EnumMemberForEnumRef returns the go enum member corresponding to a jsii fully - // qualified enum member name (e.g: "jsii-calc.StringEnum/A"). If no enum member - // was registered (via registerEnum) for the provided enumref, an error is - // returned. - EnumMemberForEnumRef(ref api.EnumRef) (interface{}, error) - - // TryRenderEnumRef returns an enumref if the provided value corresponds to a - // registered enum type. The returned enumref is nil if the provided enum value - // is a zero-value (i.e: ""). - TryRenderEnumRef(value reflect.Value) (ref *api.EnumRef, isEnumRef bool) -} - -// typeRegistry is used to record runtime type information about the loaded +// TypeRegistry is used to record runtime type information about the loaded // modules, which is later used to correctly convert objects received from the // JavaScript process into native go values. -type typeRegistry struct { +type TypeRegistry struct { // fqnToType is used to obtain the native go type for a given jsii fully // qualified type name. The kind of type being returned depends on what the // FQN represents... This will be the second argument of provided to a // register* function. // enums are not included - fqnToType map[api.FQN]reflect.Type + fqnToType map[api.FQN]registeredType + + // typeToFQN is sued to obtain the jsii fully qualified type name for a + // given native go type. Currently only tracks jsii struct types. + typeToFQN map[reflect.Type]api.FQN // map enum member FQNs (e.g. "jsii-calc.StringEnum/A") to the corresponding // go const for this member. @@ -56,24 +35,35 @@ type typeRegistry struct { // map registered interface types to a proxy maker function proxyMakers map[reflect.Type]func() interface{} + + // typeMembers maps each class or interface FQN to the set of members it implements + // in the form of api.Override values. + typeMembers map[api.FQN][]api.Override } -// NewTypeRegistry creates a new type registry. -func NewTypeRegistry() TypeRegistry { - return &typeRegistry{ - fqnToType: make(map[api.FQN]reflect.Type), +// New creates a new type registry. +func New() *TypeRegistry { + return &TypeRegistry{ + fqnToType: make(map[api.FQN]registeredType), + typeToFQN: make(map[reflect.Type]api.FQN), fqnToEnumMember: make(map[string]interface{}), typeToEnumFQN: make(map[reflect.Type]api.FQN), structFields: make(map[reflect.Type][]reflect.StructField), proxyMakers: make(map[reflect.Type]func() interface{}), + typeMembers: make(map[api.FQN][]api.Override), } } -// IsStruct returns true if the provided type is a registered jsii struct. -func (t *typeRegistry) StructFields(typ reflect.Type) (fields []reflect.StructField, ok bool) { +// StructFields returns the list of fields associated with a jsii struct type, +// the jsii fully qualified type name, and a boolean telling whether the +// provided type was a registered jsii struct type. +func (t *TypeRegistry) StructFields(typ reflect.Type) (fields []reflect.StructField, fqn api.FQN, ok bool) { + if fqn, ok = t.typeToFQN[typ]; !ok { + return + } + var found []reflect.StructField - found, ok = t.structFields[typ] - if ok { + if found, ok = t.structFields[typ]; ok { // Returning a copy, to ensure our storage does not get mutated. fields = append(fields, found...) } @@ -83,7 +73,7 @@ func (t *typeRegistry) StructFields(typ reflect.Type) (fields []reflect.StructFi // InitJsiiProxy initializes a jsii proxy value at the provided pointer. It // returns an error if the pointer does not have a value of a registered // proxyable type (that is, a class or interface type). -func (t *typeRegistry) InitJsiiProxy(val reflect.Value) error { +func (t *TypeRegistry) InitJsiiProxy(val reflect.Value) error { valType := val.Type() switch valType.Kind() { @@ -124,7 +114,7 @@ func (t *typeRegistry) InitJsiiProxy(val reflect.Value) error { // qualified enum member name (e.g: "jsii-calc.StringEnum/A"). If no enum member // was registered (via registerEnum) for the provided enumref, an error is // returned. -func (t *typeRegistry) EnumMemberForEnumRef(ref api.EnumRef) (interface{}, error) { +func (t *TypeRegistry) EnumMemberForEnumRef(ref api.EnumRef) (interface{}, error) { if member, ok := t.fqnToEnumMember[ref.MemberFQN]; ok { return member, nil } @@ -134,7 +124,7 @@ func (t *typeRegistry) EnumMemberForEnumRef(ref api.EnumRef) (interface{}, error // TryRenderEnumRef returns an enumref if the provided value corresponds to a // registered enum type. The returned enumref is nil if the provided enum value // is a zero-value (i.e: ""). -func (t *typeRegistry) TryRenderEnumRef(value reflect.Value) (ref *api.EnumRef, isEnumRef bool) { +func (t *TypeRegistry) TryRenderEnumRef(value reflect.Value) (ref *api.EnumRef, isEnumRef bool) { if value.Kind() != reflect.String { isEnumRef = false return diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/begin.go b/packages/@jsii/go-runtime/jsii-runtime-go/kernel/begin.go deleted file mode 100644 index dbe53c2bad..0000000000 --- a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/begin.go +++ /dev/null @@ -1,23 +0,0 @@ -package kernel - -import "github.com/aws/jsii-runtime-go/api" - -type BeginRequest struct { - kernelRequester - - API string `json:"api"` - Method *string `json:"method"` - Arguments []interface{} `json:"args"` - ObjRef api.ObjectRef `json:"objref"` -} - -type BeginResponse struct { - kernelResponder - - PromiseID *string `json:"promise_id"` -} - -func (c *client) Begin(request BeginRequest) (response BeginResponse, err error) { - err = c.request(request, &response) - return -} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/callbacks.go b/packages/@jsii/go-runtime/jsii-runtime-go/kernel/callbacks.go deleted file mode 100644 index 0719f8a6ea..0000000000 --- a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/callbacks.go +++ /dev/null @@ -1,20 +0,0 @@ -package kernel - -import "github.com/aws/jsii-runtime-go/api" - -type callbacksRequest struct { - kernelRequester - - API string `json:"api"` -} - -type CallbacksResponse struct { - kernelResponder - - Callbacks []api.Callback `json:"callbacks"` -} - -func (c *client) Callbacks() (response CallbacksResponse, err error) { - err = c.request(callbacksRequest{API: "callbacks"}, &response) - return -} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/client.go b/packages/@jsii/go-runtime/jsii-runtime-go/kernel/client.go deleted file mode 100644 index ba30c07567..0000000000 --- a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/client.go +++ /dev/null @@ -1,290 +0,0 @@ -package kernel - -import ( - "bufio" - "encoding/json" - "errors" - "fmt" - "io" - "io/ioutil" - "os" - "os/exec" - "reflect" - "runtime" - "sync" - - "github.com/aws/jsii-runtime-go/embedded" - "github.com/aws/jsii-runtime-go/typeregistry" -) - -var ( - clientInstance *client - clientInstanceMutex sync.Mutex - clientOnce sync.Once -) - -// The client struct owns the jsii child process and its io interfaces. It also -// owns a map (objects) that tracks all object references by ID. This is used -// to call methods and access properties on objects passed by the runtime -// process by reference. -type client struct { - process *exec.Cmd - RuntimeVersion string - writer *json.Encoder - reader *json.Decoder - - // Keeping track of state that'll need cleaning up in close() - stdin io.WriteCloser - tmpdir string - - types typeregistry.TypeRegistry - objects map[reflect.Value]string -} - -// GetClient returns a singleton client instance, initializing one the first -// time it is called. -func GetClient() *client { - clientOnce.Do(func() { - // Locking early to be safe with a concurrent Close execution - clientInstanceMutex.Lock() - defer clientInstanceMutex.Unlock() - - client, err := newClient() - if err != nil { - panic(err) - } - - clientInstance = client - }) - - return clientInstance -} - -// CloseClient finalizes the runtime process, signalling the end of the -// execution to the jsii kernel process, and waiting for graceful termination. -// -// If a jsii client is used *after* CloseClient was called, a new jsii kernel -// process will be initialized, and CloseClient should be called again to -// correctly finalize that, too. -func CloseClient() { - // Locking early to be safe with a concurrent getClient execution - clientInstanceMutex.Lock() - defer clientInstanceMutex.Unlock() - - // Reset the "once" so a new client would get initialized next time around - clientOnce = sync.Once{} - - if clientInstance != nil { - // Close the client & reset it - clientInstance.close() - clientInstance = nil - } -} - -// newClient starts the kernel child process and verifies the "hello" message -// was correct. -func newClient() (*client, error) { - clientinstance := &client{ - objects: make(map[reflect.Value]string), - types: typeregistry.NewTypeRegistry(), - } - - // Register a finalizer to call Close() - runtime.SetFinalizer(clientinstance, func(c *client) { - c.close() - }) - - customruntime := os.Getenv("JSII_RUNTIME") - if customruntime != "" { - // The user has provided a custom JSII_RUNTIME, so we'll just honor that. This feature can - // greatly help during development iterations or when trying to diagnose a user-discovered bug - // that resists reproduction. The "built-in" runtime is webpack'd, and this can degrade the - // debugger experience with certain debuggers (so far, only Chrome's was found to give the right - // experience) - clientinstance.process = exec.Command(customruntime) - } else { - // The user hasn't provided a custom JSII_RUNTIME, so we'll unpack the built-in one - tmpdir, err := ioutil.TempDir("", "jsii-runtime.*") - if err != nil { - return nil, err - } - clientinstance.tmpdir = tmpdir - - entrypoint, err := embedded.ExtractRuntime(tmpdir) - if err != nil { - panic(err) - } - - // --max-old-space-size is recommended to be set because `jsii` currently does not quite do - // garbage collection (the kernel API only allows the host library to report object deleting, - // but in order to be effective, the jsii kernel needs to also have a way to signal objects it - // no longer has a reference to). - clientinstance.process = exec.Command("node", "--max-old-space-size=4069", entrypoint) - } - - clientinstance.process.Env = append( - os.Environ(), - fmt.Sprintf("JSII_AGENT=%s/%s/%s", runtime.Version(), runtime.GOOS, runtime.GOARCH), - ) - - // Pipe child process STDIN from a JSON encoder - in, err := clientinstance.process.StdinPipe() - if err != nil { - return nil, err - } - clientinstance.stdin = in - clientinstance.writer = json.NewEncoder(in) - - // Pipe child process STDOUT to a JSON decoder - out, err := clientinstance.process.StdoutPipe() - if err != nil { - return nil, err - } - clientinstance.reader = json.NewDecoder(out) - - stderr, err := clientinstance.process.StderrPipe() - if err != nil { - return nil, err - } - - // Start a goroutine to process what comes in on that StderrPipe - go func() { - reader := bufio.NewReader(stderr) - - type consoleMessage struct { - Stderr []byte `json:"stderr"` - Stdout []byte `json:"stdout"` - } - - eof := false - for !eof { - line, err := reader.ReadBytes('\n') - if len(line) == 0 || err == io.EOF { - eof = true - } - if len(line) > 0 { - result := consoleMessage{} - err := json.Unmarshal(line, &result) - if err != nil { - fmt.Fprintf(os.Stderr, "%s\n", line) - } else { - if result.Stderr != nil { - os.Stderr.Write(result.Stderr) - } - if result.Stdout != nil { - os.Stdout.Write(result.Stdout) - } - } - } - } - }() - - // Start process - if err := clientinstance.process.Start(); err != nil { - return nil, err - } - - // Check for "hello" message and parse runtime version - rtversion, err := clientinstance.processHello() - if err != nil { - return nil, err - } - clientinstance.RuntimeVersion = rtversion - - return clientinstance, nil -} - -func (c *client) Types() typeregistry.TypeRegistry { - return c.types -} - -func (c *client) RegisterInstance(instance reflect.Value, instanceID string) error { - instance = reflect.Indirect(instance) - if instance.Kind() == reflect.Interface { - instance = reflect.ValueOf(instance.Interface()).Elem() - } - - if existing, found := c.objects[instance]; found && existing != instanceID { - return fmt.Errorf("attempted to register %v as %s, but it was already registered as %s", instance, instanceID, existing) - } - - var findAliases func(v reflect.Value) []reflect.Value - findAliases = func(v reflect.Value) (res []reflect.Value) { - v = reflect.Indirect(v) - t := v.Type() - numField := t.NumField() - for i := 0; i < numField; i++ { - f := t.Field(i) - if f.Name == "_" { - // Ignore any padding - continue - } - if !f.Anonymous { - // Ignore any non-anonymous field - continue - } - fv := reflect.Indirect(v.Field(i)) - if fv.Kind() == reflect.Interface { - fv = reflect.ValueOf(fv.Interface()).Elem() - } - - res = append(res, fv) - res = append(res, findAliases(fv)...) - } - return - } - - aliases := findAliases(instance) - for _, alias := range aliases { - if existing, found := c.objects[alias]; found && existing != instanceID { - return fmt.Errorf("value %v is embedded in %s, but was already assigned %s", alias, instanceID, existing) - } - } - - c.objects[instance] = instanceID - for _, alias := range aliases { - c.objects[alias] = instanceID - } - return nil -} - -func (c *client) request(req kernelRequest, res kernelResponse) error { - err := c.writer.Encode(req) - if err != nil { - return err - } - - return c.response(res) -} - -func (c *client) response(res kernelResponse) error { - if c.reader.More() { - return c.reader.Decode(res) - } - - return errors.New("No Response from runtime") - -} - -func (c *client) FindObjectRef(obj reflect.Value) (refid string, ok bool) { - obj = reflect.Indirect(obj) - if obj.Kind() == reflect.Interface { - obj = reflect.ValueOf(obj.Interface()).Elem() - } - refid, ok = c.objects[obj] - return -} - -func (c *client) close() { - if c.process != nil { - c.stdin.Write([]byte("{\"exit\":0}\n")) - c.stdin.Close() - c.process.Wait() - } - if c.tmpdir != "" { - os.RemoveAll(c.tmpdir) - } - - // We no longer need a finalizer to run - runtime.SetFinalizer(c, nil) -} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/complete.go b/packages/@jsii/go-runtime/jsii-runtime-go/kernel/complete.go deleted file mode 100644 index cee353f6ed..0000000000 --- a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/complete.go +++ /dev/null @@ -1,21 +0,0 @@ -package kernel - -type CompleteRequest struct { - kernelRequester - - API string `json:"api"` - CallbackID *string `json:"cbid"` - Error *string `json:"err"` - Result interface{} `json:"result"` -} - -type CompleteResponse struct { - kernelResponder - - CallbackID *string `json:"cbid"` -} - -func (c *client) Complete(request CompleteRequest) (response CompleteResponse, err error) { - err = c.request(request, &response) - return -} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/conversions.go b/packages/@jsii/go-runtime/jsii-runtime-go/kernel/conversions.go deleted file mode 100644 index e26dea6c07..0000000000 --- a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/conversions.go +++ /dev/null @@ -1,175 +0,0 @@ -package kernel - -import ( - "reflect" - - "github.com/aws/jsii-runtime-go/api" -) - -// CastAndSetToPtr accepts a pointer to any type and attempts to cast the value -// argument to be the same type. Then it sets the value of the pointer element -// to be the newly cast data. This is used to cast payloads from JSII to -// expected return types for Get and Invoke functions. -func (c *client) CastAndSetToPtr(ptr interface{}, data interface{}) { - ptrVal := reflect.ValueOf(ptr).Elem() - dataVal := reflect.ValueOf(data) - - if ref, isRef := castValToRef(data); isRef { - // If return data is a jsii struct passed by reference, de-reference it all. - if fields, isStruct := c.Types().StructFields(ptrVal.Type()); isStruct { - for _, field := range fields { - got, err := c.Get(GetRequest{ - API: "get", - Property: field.Tag.Get("json"), - ObjRef: ref, - }) - if err != nil { - panic(err) - } - fieldVal := ptrVal.FieldByIndex(field.Index) - c.CastAndSetToPtr(fieldVal.Addr().Interface(), got.Value) - } - return - } - - // If return data is jsii object references, add to objects table. - if err := c.Types().InitJsiiProxy(ptrVal); err == nil { - if err = c.RegisterInstance(ptrVal, ref.InstanceID); err != nil { - panic(err) - } - } else { - panic(err) - } - return - } - - if enumref, isEnum := castValToEnumRef(data); isEnum { - member, err := c.Types().EnumMemberForEnumRef(enumref) - if err != nil { - panic(err) - } - - ptrVal.Set(reflect.ValueOf(member)) - return - } - - // maps - if m, isMap := c.castValToMap(dataVal, ptrVal.Type()); isMap { - ptrVal.Set(m) - return - } - - // arrays - if ptrVal.Kind() == reflect.Slice && dataVal.Kind() == reflect.Slice { - // If return type is a slice, recursively cast elements - for i := 0; i < dataVal.Len(); i++ { - innerType := ptrVal.Type().Elem() - inner := reflect.New(innerType) - - c.CastAndSetToPtr(inner.Interface(), dataVal.Index(i).Interface()) - ptrVal.Set(reflect.Append(ptrVal, inner.Elem())) - } - - return - } - - // TODO: maps - - if data != nil { - val := reflect.ValueOf(data) - ptrVal.Set(val) - } -} - -func castValToRef(data interface{}) (api.ObjectRef, bool) { - ref := api.ObjectRef{} - ok := false - dataVal := reflect.ValueOf(data) - - if dataVal.Kind() == reflect.Map { - for _, k := range dataVal.MapKeys() { - // Finding values type requires extracting from reflect.Value - // otherwise .Kind() returns `interface{}` - v := reflect.ValueOf(dataVal.MapIndex(k).Interface()) - - if k.Kind() == reflect.String && k.String() == "$jsii.byref" && v.Kind() == reflect.String { - ref.InstanceID = v.String() - ok = true - } - - } - } - - return ref, ok -} - -func castValToEnumRef(data interface{}) (enum api.EnumRef, ok bool) { - dataVal := reflect.ValueOf(data) - ok = false - - if dataVal.Kind() == reflect.Map { - for _, k := range dataVal.MapKeys() { - // Finding values type requires extracting from reflect.Value - // otherwise .Kind() returns `interface{}` - v := reflect.ValueOf(dataVal.MapIndex(k).Interface()) - - if k.Kind() == reflect.String && k.String() == "$jsii.enum" && v.Kind() == reflect.String { - enum.MemberFQN = v.String() - ok = true - return - } - } - } - - return -} - -// castValToMap attempts converting the provided jsii wire value to a -// go map. This recognizes the "$jsii.map" object and does the necessary -// recursive value conversion. -func (c *client) castValToMap(data reflect.Value, mapType reflect.Type) (m reflect.Value, ok bool) { - ok = false - - if data.Kind() != reflect.Map || data.Type().Key().Kind() != reflect.String { - return - } - - if mapType.Kind() == reflect.Map && mapType.Key().Kind() != reflect.String { - return - } - anyType := reflect.TypeOf((*interface{})(nil)).Elem() - if mapType == anyType { - mapType = reflect.TypeOf((map[string]interface{})(nil)) - } - - dataIter := data.MapRange() - for dataIter.Next() { - key := dataIter.Key().String() - if key != "$jsii.map" { - continue - } - - // Finding value type requries extracting from reflect.Value - // otherwise .Kind() returns `interface{}` - val := reflect.ValueOf(dataIter.Value().Interface()) - if val.Kind() != reflect.Map { - return - } - - ok = true - - m = reflect.MakeMap(mapType) - - iter := val.MapRange() - for iter.Next() { - val := iter.Value().Interface() - // Note: reflect.New(t) returns a pointer to a newly allocated t - convertedVal := reflect.New(mapType.Elem()) - c.CastAndSetToPtr(convertedVal.Interface(), val) - - m.SetMapIndex(iter.Key(), convertedVal.Elem()) - } - return - } - return -} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/del.go b/packages/@jsii/go-runtime/jsii-runtime-go/kernel/del.go deleted file mode 100644 index b9d5dee8d0..0000000000 --- a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/del.go +++ /dev/null @@ -1,19 +0,0 @@ -package kernel - -import "github.com/aws/jsii-runtime-go/api" - -type DelRequest struct { - kernelRequester - - API string `json:"api"` - ObjRef api.ObjectRef `json:"objref"` -} - -type DelResponse struct { - kernelResponder -} - -func (c *client) Del(request DelRequest) (response DelResponse, err error) { - err = c.request(request, &response) - return -} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/end.go b/packages/@jsii/go-runtime/jsii-runtime-go/kernel/end.go deleted file mode 100644 index cab26dafbe..0000000000 --- a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/end.go +++ /dev/null @@ -1,19 +0,0 @@ -package kernel - -type EndRequest struct { - kernelRequester - - API string `json:"api"` - PromiseID *string `json:"promise_id"` -} - -type EndResponse struct { - kernelResponder - - Result interface{} `json:"result"` -} - -func (c *client) End(request EndRequest) (response EndResponse, err error) { - err = c.request(request, &response) - return -} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/get.go b/packages/@jsii/go-runtime/jsii-runtime-go/kernel/get.go deleted file mode 100644 index f08ded0f68..0000000000 --- a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/get.go +++ /dev/null @@ -1,42 +0,0 @@ -package kernel - -import "github.com/aws/jsii-runtime-go/api" - -type GetRequest struct { - kernelRequester - - API string `json:"api"` - Property string `json:"property"` - ObjRef api.ObjectRef `json:"objref"` -} - -type StaticGetRequest struct { - kernelRequester - - API string `json:"api"` - FQN api.FQN `json:"fqn"` - Property string `json:"property"` -} - -type GetResponse struct { - kernelResponder - - Value interface{} `json:"value"` -} - -func (c *client) Get(request GetRequest) (response GetResponse, err error) { - err = c.request(request, &response) - return -} - -func (c *client) SGet(request StaticGetRequest) (response GetResponse, err error) { - err = c.request(request, &response) - return -} - -// UnmarshalJSON provides custom unmarshalling implementation for response -// structs. Creating new types is required in order to avoid infinite recursion. -func (r *GetResponse) UnmarshalJSON(data []byte) error { - type response GetResponse - return unmarshalKernelResponse(data, (*response)(r)) -} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/hello.go b/packages/@jsii/go-runtime/jsii-runtime-go/kernel/hello.go deleted file mode 100644 index ef4753b047..0000000000 --- a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/hello.go +++ /dev/null @@ -1,21 +0,0 @@ -package kernel - -import "regexp" - -type HelloMessage struct { - kernelResponder - - Hello string `json:"hello"` -} - -func (c *client) processHello() (version string, err error) { - response := HelloMessage{} - - if err = c.response(&response); err != nil { - return - } - - parts := regexp.MustCompile("@").Split(response.Hello, 3) - version = parts[len(parts)-1] - return -} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/invoke.go b/packages/@jsii/go-runtime/jsii-runtime-go/kernel/invoke.go deleted file mode 100644 index 10f5c617ed..0000000000 --- a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/invoke.go +++ /dev/null @@ -1,44 +0,0 @@ -package kernel - -import "github.com/aws/jsii-runtime-go/api" - -type InvokeRequest struct { - kernelRequester - - API string `json:"api"` - Method string `json:"method"` - Arguments []interface{} `json:"args"` - ObjRef api.ObjectRef `json:"objref"` -} - -type StaticInvokeRequest struct { - kernelRequester - - API string `json:"api"` - FQN api.FQN `json:"fqn"` - Method string `json:"method"` - Arguments []interface{} `json:"args"` -} - -type InvokeResponse struct { - kernelResponder - - Result interface{} `json:"result"` -} - -func (c *client) Invoke(request InvokeRequest) (response InvokeResponse, err error) { - err = c.request(request, &response) - return -} - -func (c *client) SInvoke(request StaticInvokeRequest) (response InvokeResponse, err error) { - err = c.request(request, &response) - return -} - -// UnmarshalJSON provides custom unmarshalling implementation for response -// structs. Creating new types is required in order to avoid infinite recursion. -func (r *InvokeResponse) UnmarshalJSON(data []byte) error { - type response InvokeResponse - return unmarshalKernelResponse(data, (*response)(r)) -} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/json.go b/packages/@jsii/go-runtime/jsii-runtime-go/kernel/json.go deleted file mode 100644 index fc05f83899..0000000000 --- a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/json.go +++ /dev/null @@ -1,23 +0,0 @@ -package kernel - -import ( - "encoding/json" - "errors" -) - -// Custom unmarshaling for kernel responses, checks for presence of `error` key on json and returns if present -func unmarshalKernelResponse(data []byte, result interface{}) error { - datacopy := make([]byte, len(data)) - copy(datacopy, data) - - var response map[string]json.RawMessage - if err := json.Unmarshal(datacopy, &response); err != nil { - return err - } - - if err, ok := response["error"]; ok { - return errors.New(string(err)) - } - - return json.Unmarshal(response["ok"], result) -} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/naming.go b/packages/@jsii/go-runtime/jsii-runtime-go/kernel/naming.go deleted file mode 100644 index 8f78f31735..0000000000 --- a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/naming.go +++ /dev/null @@ -1,20 +0,0 @@ -package kernel - -type NamingRequest struct { - kernelRequester - - API string `json:"api"` - Assembly string `json:"assembly"` -} - -type NamingResponse struct { - kernelResponder - // readonly naming: { - // readonly [language: string]: { readonly [key: string]: any } | undefined; - // }; -} - -func (c *client) Naming(request NamingRequest) (response NamingResponse, err error) { - err = c.request(request, &response) - return -} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/set.go b/packages/@jsii/go-runtime/jsii-runtime-go/kernel/set.go deleted file mode 100644 index 9732c6c02e..0000000000 --- a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/set.go +++ /dev/null @@ -1,42 +0,0 @@ -package kernel - -import "github.com/aws/jsii-runtime-go/api" - -type SetRequest struct { - kernelRequester - - API string `json:"api"` - Property string `json:"property"` - Value interface{} `json:"value"` - ObjRef api.ObjectRef `json:"objref"` -} - -type StaticSetRequest struct { - kernelRequester - - API string `json:"api"` - FQN api.FQN `json:"fqn"` - Property string `json:"property"` - Value interface{} `json:"value"` -} - -type SetResponse struct { - kernelResponder -} - -func (c *client) Set(request SetRequest) (response SetResponse, err error) { - err = c.request(request, &response) - return -} - -func (c *client) SSet(request StaticSetRequest) (response SetResponse, err error) { - err = c.request(request, &response) - return -} - -// UnmarshalJSON provides custom unmarshalling implementation for response -// structs. Creating new types is required in order to avoid infinite recursion. -func (r *SetResponse) UnmarshalJSON(data []byte) error { - type response SetResponse - return unmarshalKernelResponse(data, (*response)(r)) -} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/stats.go b/packages/@jsii/go-runtime/jsii-runtime-go/kernel/stats.go deleted file mode 100644 index dd406af6f7..0000000000 --- a/packages/@jsii/go-runtime/jsii-runtime-go/kernel/stats.go +++ /dev/null @@ -1,18 +0,0 @@ -package kernel - -type statsRequest struct { - kernelRequester - - API string `json:"api"` -} - -type StatsResponse struct { - kernelResponder - - ObjectCount float64 `json:"object_count"` -} - -func (c *client) Stats() (response StatsResponse, err error) { - err = c.request(statsRequest{API: "stats"}, &response) - return -} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/runtime.go b/packages/@jsii/go-runtime/jsii-runtime-go/runtime.go index 14d8307106..076b9056a6 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/runtime.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/runtime.go @@ -7,16 +7,31 @@ import ( "reflect" "regexp" - "github.com/aws/jsii-runtime-go/api" - "github.com/aws/jsii-runtime-go/kernel" + "github.com/aws/jsii-runtime-go/internal/api" + "github.com/aws/jsii-runtime-go/internal/kernel" ) // FQN represents a fully-qualified type name in the jsii type system. type FQN api.FQN -type Override api.Override -type MethodOverride api.MethodOverride -type PropertyOverride api.PropertyOverride +// Member is a runtime descriptor for a class or interface member +type Member interface { + toOverride() api.Override +} + +// MemberMethod is a runtime descriptor for a class method (implementation of Member) +type MemberMethod api.MethodOverride + +func (m MemberMethod) toOverride() api.Override { + return api.MethodOverride(m) +} + +// MemberProperty is a runtime descriptor for a class or interface property (implementation of Member) +type MemberProperty api.PropertyOverride + +func (m MemberProperty) toOverride() api.Override { + return api.PropertyOverride(m) +} // Load ensures a npm package is loaded in the jsii kernel. func Load(name string, version string, tarball []byte) { @@ -36,8 +51,7 @@ func Load(name string, version string, tarball []byte) { } tmpfile.Close() - _, err = c.Load(kernel.LoadRequest{ - API: "load", + _, err = c.Load(kernel.LoadProps{ Name: name, Version: version, Tarball: tmpfile.Name(), @@ -48,12 +62,17 @@ func Load(name string, version string, tarball []byte) { } // RegisterClass associates a class fully qualified name to the specified class -// interface, and proxy struct. Panics if class is not an go interface, proxy is -// not a go struct, or if the provided fqn was already used to register a different -// type. -func RegisterClass(fqn FQN, class reflect.Type, maker func() interface{}) { +// interface, member list, and proxy maker function. Panics if class is not a go +// interface, or if the provided fqn was already used to register a different type. +func RegisterClass(fqn FQN, class reflect.Type, members []Member, maker func() interface{}) { client := kernel.GetClient() - if err := client.Types().RegisterClass(api.FQN(fqn), class, maker); err != nil { + + overrides := make([]api.Override, len(members)) + for i, m := range members { + overrides[i] = m.toOverride() + } + + if err := client.Types().RegisterClass(api.FQN(fqn), class, overrides, maker); err != nil { panic(err) } } @@ -70,11 +89,17 @@ func RegisterEnum(fqn FQN, enum reflect.Type, members map[string]interface{}) { } // RegisterInterface associates an interface's fully qualified name to the -// specified interface type, and proxy maker function. Panics if iface is not an -// interface, or if the provided fqn was already used to register a different type. -func RegisterInterface(fqn FQN, iface reflect.Type, maker func() interface{}) { +// specified interface type, member list, and proxy maker function. Panics if iface is not +// an interface, or if the provided fqn was already used to register a different type. +func RegisterInterface(fqn FQN, iface reflect.Type, members []Member, maker func() interface{}) { client := kernel.GetClient() - if err := client.Types().RegisterInterface(api.FQN(fqn), iface, maker); err != nil { + + overrides := make([]api.Override, len(members)) + for i, m := range members { + overrides[i] = m.toOverride() + } + + if err := client.Types().RegisterInterface(api.FQN(fqn), iface, overrides, maker); err != nil { panic(err) } } @@ -101,11 +126,12 @@ func InitJsiiProxy(ptr interface{}) { // Create will construct a new JSII object within the kernel runtime. This is // called by jsii object constructors. -func Create(fqn FQN, args []interface{}, interfaces []FQN, overrides []Override, inst interface{}) { +func Create(fqn FQN, args []interface{}, interfaces []FQN, overriddenMembers []Member, inst interface{}) { client := kernel.GetClient() - instVal := reflect.ValueOf(inst).Elem() - instType := instVal.Type() + instVal := reflect.ValueOf(inst) + structVal := instVal.Elem() + instType := structVal.Type() numField := instType.NumField() for i := 0; i < numField; i++ { field := instType.Field(i) @@ -114,7 +140,7 @@ func Create(fqn FQN, args []interface{}, interfaces []FQN, overrides []Override, } switch field.Type.Kind() { case reflect.Interface: - fieldVal := instVal.Field(i) + fieldVal := structVal.Field(i) if !fieldVal.IsNil() { continue } @@ -123,7 +149,7 @@ func Create(fqn FQN, args []interface{}, interfaces []FQN, overrides []Override, } case reflect.Struct: - fieldVal := instVal.Field(i) + fieldVal := structVal.Field(i) if !fieldVal.IsZero() { continue } @@ -137,17 +163,16 @@ func Create(fqn FQN, args []interface{}, interfaces []FQN, overrides []Override, for _, iface := range interfaces { interfaceFQNs = append(interfaceFQNs, api.FQN(iface)) } - var apiOverrides []api.Override - for _, override := range overrides { - apiOverrides = append(apiOverrides, override) + overrides := make([]api.Override, len(overriddenMembers)) + for i, member := range overriddenMembers { + overrides[i] = member.toOverride() } - res, err := client.Create(kernel.CreateRequest{ - API: "create", + res, err := client.Create(kernel.CreateProps{ FQN: api.FQN(fqn), - Arguments: castPtrsToRef(args), + Arguments: convertArguments(args), Interfaces: interfaceFQNs, - Overrides: apiOverrides, + Overrides: overrides, }) if err != nil { @@ -159,9 +184,9 @@ func Create(fqn FQN, args []interface{}, interfaces []FQN, overrides []Override, } } -// Invoke will call a method on a jsii class instance. The response should be +// Invoke will call a method on a jsii class instance. The response will be // decoded into the expected return type for the method being called. -func Invoke(obj interface{}, method string, args []interface{}, hasReturn bool, ret interface{}) { +func Invoke(obj interface{}, method string, args []interface{}, ret interface{}) { client := kernel.GetClient() // Find reference to class instance in client @@ -171,10 +196,9 @@ func Invoke(obj interface{}, method string, args []interface{}, hasReturn bool, panic("No Object Found") } - res, err := client.Invoke(kernel.InvokeRequest{ - API: "invoke", + res, err := client.Invoke(kernel.InvokeProps{ Method: method, - Arguments: castPtrsToRef(args), + Arguments: convertArguments(args), ObjRef: api.ObjectRef{ InstanceID: refid, }, @@ -184,29 +208,61 @@ func Invoke(obj interface{}, method string, args []interface{}, hasReturn bool, panic(err) } - if hasReturn { - client.CastAndSetToPtr(ret, res.Result) + client.CastAndSetToPtr(ret, res.Result) +} + +// InvokeVoid will call a void method on a jsii class instance. +func InvokeVoid(obj interface{}, method string, args []interface{}) { + client := kernel.GetClient() + + // Find reference to class instance in client + refid, found := client.FindObjectRef(reflect.ValueOf(obj)) + + if !found { + panic("No Object Found") + } + + _, err := client.Invoke(kernel.InvokeProps{ + Method: method, + Arguments: convertArguments(args), + ObjRef: api.ObjectRef{InstanceID: refid}, + }) + + if err != nil { + panic(err) } } // StaticInvoke will call a static method on a given jsii class. The response -// should be decoded into the expected return type for the method being called. -func StaticInvoke(fqn FQN, method string, args []interface{}, hasReturn bool, ret interface{}) { +// will be decoded into the expected return type for the method being called. +func StaticInvoke(fqn FQN, method string, args []interface{}, ret interface{}) { client := kernel.GetClient() - res, err := client.SInvoke(kernel.StaticInvokeRequest{ - API: "sinvoke", + res, err := client.SInvoke(kernel.StaticInvokeProps{ FQN: api.FQN(fqn), Method: method, - Arguments: castPtrsToRef(args), + Arguments: convertArguments(args), }) if err != nil { panic(err) } - if hasReturn { - client.CastAndSetToPtr(ret, res.Result) + client.CastAndSetToPtr(ret, res.Result) +} + +// StaticInvokeVoid will call a static void method on a given jsii class. +func StaticInvokeVoid(fqn FQN, method string, args []interface{}) { + client := kernel.GetClient() + + _, err := client.SInvoke(kernel.StaticInvokeProps{ + FQN: api.FQN(fqn), + Method: method, + Arguments: convertArguments(args), + }) + + if err != nil { + panic(err) } } @@ -222,8 +278,7 @@ func Get(obj interface{}, property string, ret interface{}) { panic(fmt.Errorf("no object reference found for %v", obj)) } - res, err := client.Get(kernel.GetRequest{ - API: "get", + res, err := client.Get(kernel.GetProps{ Property: property, ObjRef: api.ObjectRef{ InstanceID: refid, @@ -242,8 +297,7 @@ func Get(obj interface{}, property string, ret interface{}) { func StaticGet(fqn FQN, property string, ret interface{}) { client := kernel.GetClient() - res, err := client.SGet(kernel.StaticGetRequest{ - API: "sget", + res, err := client.SGet(kernel.StaticGetProps{ FQN: api.FQN(fqn), Property: property, }) @@ -267,10 +321,9 @@ func Set(obj interface{}, property string, value interface{}) { panic("No Object Found") } - _, err := client.Set(kernel.SetRequest{ - API: "set", + _, err := client.Set(kernel.SetProps{ Property: property, - Value: castPtrToRef(value), + Value: client.CastPtrToRef(reflect.ValueOf(value)), ObjRef: api.ObjectRef{ InstanceID: refid, }, @@ -286,11 +339,10 @@ func Set(obj interface{}, property string, value interface{}) { func StaticSet(fqn FQN, property string, value interface{}) { client := kernel.GetClient() - _, err := client.SSet(kernel.StaticSetRequest{ - API: "sset", + _, err := client.SSet(kernel.StaticSetProps{ FQN: api.FQN(fqn), Property: property, - Value: value, + Value: client.CastPtrToRef(reflect.ValueOf(value)), }) if err != nil { @@ -298,63 +350,21 @@ func StaticSet(fqn FQN, property string, value interface{}) { } } -// Accepts pointers to structs that implement interfaces and searches for an -// existing object reference in the kernel. If it exists, it casts it to an -// objref for the runtime. Recursively casts types that may contain nested -// object references. -func castPtrToRef(data interface{}) interface{} { - if data == nil { - return data +// convertArguments turns an argument struct and produces a list of values +// ready for inclusion in an invoke or create request. +func convertArguments(args []interface{}) []interface{} { + if len(args) == 0 { + return make([]interface{}, 0, 0) } + result := make([]interface{}, len(args), len(args)) client := kernel.GetClient() - dataVal := reflect.ValueOf(data) - - switch dataVal.Kind() { - case reflect.Map: - result := api.WireMap{MapData: make(map[string]interface{})} - - iter := dataVal.MapRange() - for iter.Next() { - key := iter.Key().String() - val := iter.Value().Interface() - result.MapData[key] = castPtrToRef(val) - } - - return result - - case reflect.Ptr: - valref, valHasRef := client.FindObjectRef(reflect.ValueOf(data)) - if valHasRef { - return api.ObjectRef{InstanceID: valref} - } - - case reflect.Slice: - refs := make([]interface{}, dataVal.Len()) - for i := 0; i < dataVal.Len(); i++ { - refs[i] = dataVal.Index(i).Interface() - } - return refs - - case reflect.String: - if enumRef, isEnumRef := client.Types().TryRenderEnumRef(dataVal); isEnumRef { - return enumRef - } - } - return data -} - -// Casts slice of data into new slice of data with pointers to interfaces -// converted to objrefs. This is useful for casting arguments to methods and -// constructors to data that can be serialized before being passed over the -// wire. -func castPtrsToRef(args []interface{}) []interface{} { - argRefs := make([]interface{}, len(args)) for i, arg := range args { - argRefs[i] = castPtrToRef(arg) + val := reflect.ValueOf(arg) + result[i] = client.CastPtrToRef(val) } - return argRefs + return result } // Close finalizes the runtime process, signalling the end of the execution to diff --git a/packages/@jsii/go-runtime/package.json b/packages/@jsii/go-runtime/package.json index 98de163dd6..ae2e8a55a2 100644 --- a/packages/@jsii/go-runtime/package.json +++ b/packages/@jsii/go-runtime/package.json @@ -6,13 +6,16 @@ "main": "lib/index.js", "scripts": { "build": "tsc --build && npm run gen:rt", - "fmt": "node build-tools/all-go.js fmt ./...", + "doc": "yarn --silent go:run godoc", + "fmt": "yarn --silent go:all yarn --silent go:run goimports .", "gen:calc": "node build-tools/gen-calc.js", "gen:rt": "node build-tools/gen.js", "generate": "npm run gen:rt && npm run gen:calc", + "go:all": "node build-tools/all-go.js", + "go:run": "go mod download && node build-tools/go-run.js", "package": "build-tools/package.sh", - "lint": "node build-tools/all-go.js vet ./...", - "test": "npm run gen:calc && node build-tools/all-go.js test ./..." + "lint": "yarn --silent go:all go vet ./... && yarn --silent go:all yarn --silent go:run golint ./...", + "test": "npm run gen:calc && yarn --silent go:all go test ./..." }, "keywords": [], "author": "", diff --git a/packages/@jsii/go-runtime/tools.go b/packages/@jsii/go-runtime/tools.go new file mode 100644 index 0000000000..81c01faf65 --- /dev/null +++ b/packages/@jsii/go-runtime/tools.go @@ -0,0 +1,14 @@ +// +build tools + +// Package tools contains the necessary statements to ensure tool dependencies +// are not "cleaned up" by "go mod tidy" despite being used... The "// +" +// comment above makes sure the file is never included in an actual compiled +// unit (unless someone manually specifies the "build tools" tag at compile +// time). +package tools + +import ( + _ "golang.org/x/lint/golint" + _ "golang.org/x/tools/cmd/godoc" + _ "golang.org/x/tools/cmd/goimports" +) diff --git a/packages/@jsii/python-runtime/requirements.txt b/packages/@jsii/python-runtime/requirements.txt index 627cf5dc29..25bfd61a45 100644 --- a/packages/@jsii/python-runtime/requirements.txt +++ b/packages/@jsii/python-runtime/requirements.txt @@ -3,7 +3,7 @@ mypy==0.812 pip~=21.0 pytest~=6.2 pytest-mypy~=0.8 -setuptools~=53.0 +setuptools~=54.0 wheel~=0.36 -e . diff --git a/packages/@jsii/python-runtime/setup.py b/packages/@jsii/python-runtime/setup.py index bb858f883d..44bd4f2090 100644 --- a/packages/@jsii/python-runtime/setup.py +++ b/packages/@jsii/python-runtime/setup.py @@ -32,7 +32,7 @@ install_requires=[ "attrs~=20.1", "cattrs~=1.0.0 ; python_version < '3.7'", - "cattrs~=1.1.0 ; python_version >= '3.7'", + "cattrs~=1.3.0 ; python_version >= '3.7'", "importlib_resources ; python_version < '3.7'", "python-dateutil", "typing_extensions~=3.7", diff --git a/packages/@jsii/python-runtime/src/jsii/_kernel/__init__.py b/packages/@jsii/python-runtime/src/jsii/_kernel/__init__.py index ebf137cf48..69c00ac1d7 100644 --- a/packages/@jsii/python-runtime/src/jsii/_kernel/__init__.py +++ b/packages/@jsii/python-runtime/src/jsii/_kernel/__init__.py @@ -8,6 +8,7 @@ import functools import attr +import enum from ..errors import JSIIError from .. import _reference_map @@ -137,15 +138,20 @@ def _make_reference_for_native(kernel, d): k: _make_reference_for_native(kernel, v) for k, v in d.items() } } + elif isinstance(d, list): return [_make_reference_for_native(kernel, i) for i in d] if getattr(d, "__jsii_type__", None) is not None: + typeFqn = getattr(d, "__jsii_type__") + + if isinstance(d, enum.Enum): + return {"$jsii.enum": f"{typeFqn}/{d.value}"} + # Ugly delayed import here because I can't solve the cyclic # package dependency right now :(. from .._runtime import python_jsii_mapping - typeFqn = getattr(d, "__jsii_type__") mapping = python_jsii_mapping(d) if mapping: # This means we are handling a data_type (aka Struct) return { @@ -160,8 +166,10 @@ def _make_reference_for_native(kernel, d): } } return d + elif isinstance(d, (int, type(None), str, float, bool, datetime.datetime)): return d + elif isinstance(d, (FunctionType, MethodType, BuiltinFunctionType, LambdaType)): # Whether a given object is a function-like object. # We won't use iscallable() since objects may implement __call__() @@ -170,6 +178,7 @@ def _make_reference_for_native(kernel, d): "Cannot pass function as argument here (did you mean to call this function?): %r" % d ) + else: kernel.create(d.__class__, d) _reference_map.register_reference(d) diff --git a/packages/@jsii/python-runtime/src/jsii/_kernel/providers/process.py b/packages/@jsii/python-runtime/src/jsii/_kernel/providers/process.py index ef960c90a4..37cde885b5 100644 --- a/packages/@jsii/python-runtime/src/jsii/_kernel/providers/process.py +++ b/packages/@jsii/python-runtime/src/jsii/_kernel/providers/process.py @@ -102,10 +102,6 @@ class _CompleteRequest: _ProcessResponse = Union[_OkayResponse, _ErrorRespose, _CallbackResponse] -# Workaround for mypy#5354 -_ProcessResponse_R: Type[Any] -if not TYPE_CHECKING: - _ProcessResponse_R = _ProcessResponse def _with_api_key(api_name, asdict): @@ -319,7 +315,7 @@ def send( self._process.stdin.flush() resp: _ProcessResponse = self._serializer.structure( - self._next_message(), _ProcessResponse_R + self._next_message(), _ProcessResponse ) if isinstance(resp, _OkayResponse): diff --git a/packages/@jsii/python-runtime/src/jsii/_kernel/types.py b/packages/@jsii/python-runtime/src/jsii/_kernel/types.py index cc0f73c022..cdafb396a7 100644 --- a/packages/@jsii/python-runtime/src/jsii/_kernel/types.py +++ b/packages/@jsii/python-runtime/src/jsii/_kernel/types.py @@ -1,15 +1,9 @@ -from typing import Union, List, Any, Optional, Mapping +from typing import Any, Generic, List, Optional, Mapping, TypeVar, Union from typing_extensions import Protocol import attr -# TODO: -# - HelloResponse -# - OkayResponse -# - ErrorResponse - - @attr.s(auto_attribs=True, frozen=True, slots=True) class ObjRef: @@ -241,6 +235,7 @@ class StatsResponse: CreateRequest, DeleteRequest, GetRequest, + SetRequest, StaticGetRequest, InvokeRequest, InvokeScriptRequest, diff --git a/packages/jsii-calc/lib/compliance.ts b/packages/jsii-calc/lib/compliance.ts index 94c433094c..add3569240 100644 --- a/packages/jsii-calc/lib/compliance.ts +++ b/packages/jsii-calc/lib/compliance.ts @@ -2872,3 +2872,86 @@ export class StaticHelloChild extends StaticHelloParent { super(); } } + +// -------------------------------------------------- +// enums within structs + +export interface StructWithEnum { + /** + * An enum value + */ + readonly foo: StringEnum; + + /** + * Optional enum value (of type integer) + * @default AllTypesEnum.YOUR_ENUM_VALUE + */ + readonly bar?: AllTypesEnum; +} + +export class TestStructWithEnum { + /** + * Returns true if `foo` is `StringEnum.A`. + */ + public isStringEnumA(input: StructWithEnum) { + return input.foo === StringEnum.A && !input.bar; + } + + /** + * Returns true if `foo` is `StringEnum.B` and `bar` is `AllTypesEnum.THIS_IS_GREAT`. + */ + public isStringEnumB(input: StructWithEnum) { + return ( + input.foo === StringEnum.B && input.bar === AllTypesEnum.THIS_IS_GREAT + ); + } + + /** + * Returns `foo: StringEnum.C` and `bar: AllTypesEnum.MY_ENUM_VALUE`. + */ + public get structWithFooBar(): StructWithEnum { + return { + foo: StringEnum.C, + bar: AllTypesEnum.MY_ENUM_VALUE, + }; + } + + /** + * Returns `foo: StringEnum.A`. + */ + public get structWithFoo(): StructWithEnum { + return { + foo: StringEnum.A, + }; + } +} + +/** + * Docstrings with period + * @see https://github.com/aws/jsii/issues/2638 + */ +export class Issue2638 { + /** + * First sentence. Second sentence. Third sentence. + */ + public constructor() { + return; + } +} + +export class Issue2638B { + public constructor() { + return; // no docs + } +} + +/** + * A class named "Default" + * + * @see https://github.com/aws/jsii/issues/2637 + */ +export class Default { + public pleaseCompile() { + return; + } +} diff --git a/packages/jsii-calc/lib/submodule/index.ts b/packages/jsii-calc/lib/submodule/index.ts index 3bba85f95e..09938c1642 100644 --- a/packages/jsii-calc/lib/submodule/index.ts +++ b/packages/jsii-calc/lib/submodule/index.ts @@ -5,3 +5,4 @@ export * as returnsparam from './returns-param'; export * from './my-class'; export * from './nested_submodule'; export * as back_references from './refers-to-parent'; +export * from './issue2637'; diff --git a/packages/jsii-calc/lib/submodule/issue2637.ts b/packages/jsii-calc/lib/submodule/issue2637.ts new file mode 100644 index 0000000000..40bf19fd3c --- /dev/null +++ b/packages/jsii-calc/lib/submodule/issue2637.ts @@ -0,0 +1,8 @@ +/** + * A struct named "Default" + * + * @see https://github.com/aws/jsii/issues/2637 + */ +export interface Default { + readonly foo: number; +} diff --git a/packages/jsii-calc/test/assembly.jsii b/packages/jsii-calc/test/assembly.jsii index d62d14f275..6a03cc06a9 100644 --- a/packages/jsii-calc/test/assembly.jsii +++ b/packages/jsii-calc/test/assembly.jsii @@ -3373,6 +3373,38 @@ ], "name": "DataRenderer" }, + "jsii-calc.Default": { + "assembly": "jsii-calc", + "docs": { + "see": "https://github.com/aws/jsii/issues/2637", + "stability": "stable", + "summary": "A class named \"Default\"." + }, + "fqn": "jsii-calc.Default", + "initializer": { + "docs": { + "stability": "stable" + } + }, + "kind": "class", + "locationInModule": { + "filename": "lib/compliance.ts", + "line": 2953 + }, + "methods": [ + { + "docs": { + "stability": "stable" + }, + "locationInModule": { + "filename": "lib/compliance.ts", + "line": 2954 + }, + "name": "pleaseCompile" + } + ], + "name": "Default" + }, "jsii-calc.DefaultedConstructorArgument": { "assembly": "jsii-calc", "docs": { @@ -7219,6 +7251,54 @@ ], "name": "Isomorphism" }, + "jsii-calc.Issue2638": { + "assembly": "jsii-calc", + "docs": { + "see": "https://github.com/aws/jsii/issues/2638", + "stability": "stable", + "summary": "Docstrings with period." + }, + "fqn": "jsii-calc.Issue2638", + "initializer": { + "docs": { + "remarks": "Second sentence. Third sentence.", + "stability": "stable", + "summary": "First sentence." + }, + "locationInModule": { + "filename": "lib/compliance.ts", + "line": 2937 + } + }, + "kind": "class", + "locationInModule": { + "filename": "lib/compliance.ts", + "line": 2933 + }, + "name": "Issue2638" + }, + "jsii-calc.Issue2638B": { + "assembly": "jsii-calc", + "docs": { + "stability": "stable" + }, + "fqn": "jsii-calc.Issue2638B", + "initializer": { + "docs": { + "stability": "stable" + }, + "locationInModule": { + "filename": "lib/compliance.ts", + "line": 2943 + } + }, + "kind": "class", + "locationInModule": { + "filename": "lib/compliance.ts", + "line": 2942 + }, + "name": "Issue2638B" + }, "jsii-calc.JSII417Derived": { "assembly": "jsii-calc", "base": "jsii-calc.JSII417PublicBaseOfBase", @@ -12178,6 +12258,56 @@ ], "name": "StructUnionConsumer" }, + "jsii-calc.StructWithEnum": { + "assembly": "jsii-calc", + "datatype": true, + "docs": { + "stability": "stable" + }, + "fqn": "jsii-calc.StructWithEnum", + "kind": "interface", + "locationInModule": { + "filename": "lib/compliance.ts", + "line": 2879 + }, + "name": "StructWithEnum", + "properties": [ + { + "abstract": true, + "docs": { + "stability": "stable", + "summary": "An enum value." + }, + "immutable": true, + "locationInModule": { + "filename": "lib/compliance.ts", + "line": 2883 + }, + "name": "foo", + "type": { + "fqn": "jsii-calc.StringEnum" + } + }, + { + "abstract": true, + "docs": { + "default": "AllTypesEnum.YOUR_ENUM_VALUE", + "stability": "stable", + "summary": "Optional enum value (of type integer)." + }, + "immutable": true, + "locationInModule": { + "filename": "lib/compliance.ts", + "line": 2889 + }, + "name": "bar", + "optional": true, + "type": { + "fqn": "jsii-calc.AllTypesEnum" + } + } + ] + }, "jsii-calc.StructWithJavaReservedWords": { "assembly": "jsii-calc", "datatype": true, @@ -12829,6 +12959,106 @@ } ] }, + "jsii-calc.TestStructWithEnum": { + "assembly": "jsii-calc", + "docs": { + "stability": "stable" + }, + "fqn": "jsii-calc.TestStructWithEnum", + "initializer": { + "docs": { + "stability": "stable" + } + }, + "kind": "class", + "locationInModule": { + "filename": "lib/compliance.ts", + "line": 2892 + }, + "methods": [ + { + "docs": { + "stability": "stable", + "summary": "Returns true if `foo` is `StringEnum.A`." + }, + "locationInModule": { + "filename": "lib/compliance.ts", + "line": 2896 + }, + "name": "isStringEnumA", + "parameters": [ + { + "name": "input", + "type": { + "fqn": "jsii-calc.StructWithEnum" + } + } + ], + "returns": { + "type": { + "primitive": "boolean" + } + } + }, + { + "docs": { + "stability": "stable", + "summary": "Returns true if `foo` is `StringEnum.B` and `bar` is `AllTypesEnum.THIS_IS_GREAT`." + }, + "locationInModule": { + "filename": "lib/compliance.ts", + "line": 2903 + }, + "name": "isStringEnumB", + "parameters": [ + { + "name": "input", + "type": { + "fqn": "jsii-calc.StructWithEnum" + } + } + ], + "returns": { + "type": { + "primitive": "boolean" + } + } + } + ], + "name": "TestStructWithEnum", + "properties": [ + { + "docs": { + "stability": "stable", + "summary": "Returns `foo: StringEnum.A`." + }, + "immutable": true, + "locationInModule": { + "filename": "lib/compliance.ts", + "line": 2922 + }, + "name": "structWithFoo", + "type": { + "fqn": "jsii-calc.StructWithEnum" + } + }, + { + "docs": { + "stability": "stable", + "summary": "Returns `foo: StringEnum.C` and `bar: AllTypesEnum.MY_ENUM_VALUE`." + }, + "immutable": true, + "locationInModule": { + "filename": "lib/compliance.ts", + "line": 2912 + }, + "name": "structWithFooBar", + "type": { + "fqn": "jsii-calc.StructWithEnum" + } + } + ] + }, "jsii-calc.Thrower": { "assembly": "jsii-calc", "docs": { @@ -13989,6 +14219,40 @@ "name": "OnlyStaticMethods", "namespace": "onlystatic" }, + "jsii-calc.submodule.Default": { + "assembly": "jsii-calc", + "datatype": true, + "docs": { + "see": "https://github.com/aws/jsii/issues/2637", + "stability": "stable", + "summary": "A struct named \"Default\"." + }, + "fqn": "jsii-calc.submodule.Default", + "kind": "interface", + "locationInModule": { + "filename": "lib/submodule/issue2637.ts", + "line": 6 + }, + "name": "Default", + "namespace": "submodule", + "properties": [ + { + "abstract": true, + "docs": { + "stability": "stable" + }, + "immutable": true, + "locationInModule": { + "filename": "lib/submodule/issue2637.ts", + "line": 7 + }, + "name": "foo", + "type": { + "primitive": "number" + } + } + ] + }, "jsii-calc.submodule.MyClass": { "assembly": "jsii-calc", "docs": { @@ -14606,5 +14870,5 @@ } }, "version": "3.20.120", - "fingerprint": "JMTvoEnsqFjh72kI95PtIx01MmNxAbZV41K/nIgoZ4Q=" + "fingerprint": "rH6rK3iHNatb4ojll7sd8rvJ4k/89Kybg89FRd96Hno=" } diff --git a/packages/jsii-pacmak/lib/targets/go/runtime/class-constructor.ts b/packages/jsii-pacmak/lib/targets/go/runtime/class-constructor.ts index 16e4d9fa65..de5029670d 100644 --- a/packages/jsii-pacmak/lib/targets/go/runtime/class-constructor.ts +++ b/packages/jsii-pacmak/lib/targets/go/runtime/class-constructor.ts @@ -1,7 +1,7 @@ import { CodeMaker } from 'codemaker'; import { GoClassConstructor } from '../types'; -import { JSII_CREATE_FUNC, JSII_OVERRIDE, JSII_FQN } from './constants'; +import { JSII_CREATE_FUNC, JSII_FQN } from './constants'; import { slugify, emitInitialization } from './util'; export class ClassConstructor { @@ -9,6 +9,7 @@ export class ClassConstructor { public emit(code: CodeMaker) { emitInitialization(code); + code.line(); const resultVar = slugify( this.parent.parent.proxyName[0], @@ -23,11 +24,12 @@ export class ClassConstructor { code.line(`"${this.parent.parent.fqn}",`); code.line(`${this.argsString},`); code.line(`${this.interfacesString},`); - code.line(`[]${JSII_OVERRIDE}{},`); + code.line('nil, // no overrides'); code.line(`&${resultVar},`); code.close(`)`); + code.line(); code.line(`return &${resultVar}`); } @@ -38,10 +40,11 @@ export class ClassConstructor { return `[]${JSII_FQN}{${iFaceList}}`; } - public get argsString(): string { - const argsList = this.parent.parameters - .map((param) => param.name) - .join(', '); - return `[]interface{}{${argsList}}`; + private get argsString(): string { + const argsList = this.parent.parameters.map((param) => param.name); + if (argsList.length === 0) { + return 'nil /* no parameters */'; + } + return `[]interface{}{${argsList.join(', ')}}`; } } diff --git a/packages/jsii-pacmak/lib/targets/go/runtime/constants.ts b/packages/jsii-pacmak/lib/targets/go/runtime/constants.ts index dfedb9145d..1d9b4275c6 100644 --- a/packages/jsii-pacmak/lib/targets/go/runtime/constants.ts +++ b/packages/jsii-pacmak/lib/targets/go/runtime/constants.ts @@ -13,8 +13,10 @@ export const JSII_INIT_ALIAS = '_init_'; export const JSII_CREATE_FUNC = `${JSII_RT_ALIAS}.Create`; // JSII invoke request export const JSII_INVOKE_FUNC = `${JSII_RT_ALIAS}.Invoke`; +export const JSII_INVOKE_VOID_FUNC = `${JSII_RT_ALIAS}.InvokeVoid`; // JSII static invoke export const JSII_SINVOKE_FUNC = `${JSII_RT_ALIAS}.StaticInvoke`; +export const JSII_SINVOKE_VOID_FUNC = `${JSII_RT_ALIAS}.StaticInvokeVoid`; // JSII get request export const JSII_GET_FUNC = `${JSII_RT_ALIAS}.Get`; diff --git a/packages/jsii-pacmak/lib/targets/go/runtime/function-call.ts b/packages/jsii-pacmak/lib/targets/go/runtime/function-call.ts index b5a8c6178b..739f7ce816 100644 --- a/packages/jsii-pacmak/lib/targets/go/runtime/function-call.ts +++ b/packages/jsii-pacmak/lib/targets/go/runtime/function-call.ts @@ -4,7 +4,7 @@ export abstract class FunctionCall { public constructor(public readonly parent: GoTypeMember) {} protected get returnsVal(): boolean { - return Boolean(this.parent.reference && !this.parent.reference.void); + return !this.parent.reference?.void; } protected get returnType(): string { diff --git a/packages/jsii-pacmak/lib/targets/go/runtime/method-call.ts b/packages/jsii-pacmak/lib/targets/go/runtime/method-call.ts index 3eaf264f4f..01b617e2ca 100644 --- a/packages/jsii-pacmak/lib/targets/go/runtime/method-call.ts +++ b/packages/jsii-pacmak/lib/targets/go/runtime/method-call.ts @@ -1,7 +1,12 @@ import { CodeMaker } from 'codemaker'; import { GoMethod } from '../types'; -import { JSII_INVOKE_FUNC, JSII_SINVOKE_FUNC } from './constants'; +import { + JSII_INVOKE_FUNC, + JSII_INVOKE_VOID_FUNC, + JSII_SINVOKE_FUNC, + JSII_SINVOKE_VOID_FUNC, +} from './constants'; import { FunctionCall } from './function-call'; import { slugify, emitInitialization } from './util'; @@ -20,37 +25,52 @@ export class MethodCall extends FunctionCall { } private emitDynamic(code: CodeMaker) { - code.line(`var ${this.returnVarName} ${this.returnType}`); - code.open(`${JSII_INVOKE_FUNC}(`); + if (this.returnsVal) { + code.line(`var ${this.returnVarName} ${this.returnType}`); + code.line(); + code.open(`${JSII_INVOKE_FUNC}(`); + } else { + code.open(`${JSII_INVOKE_VOID_FUNC}(`); + } code.line(`${this.parent.instanceArg},`); code.line(`"${this.parent.method.name}",`); code.line(`${this.argsString},`); - code.line(`${this.returnsVal ? 'true' : 'false'},`); - code.line(`&${this.returnVarName},`); + if (this.returnsVal) { + code.line(`&${this.returnVarName},`); + } code.close(`)`); if (this.returnsVal) { + code.line(); code.line(`return ${this.returnVarName}`); } } private emitStatic(code: CodeMaker) { emitInitialization(code); - code.line(`var ${this.returnVarName} ${this.returnType}`); + code.line(); - code.open(`${JSII_SINVOKE_FUNC}(`); + if (this.returnsVal) { + code.line(`var ${this.returnVarName} ${this.returnType}`); + code.line(); + code.open(`${JSII_SINVOKE_FUNC}(`); + } else { + code.open(`${JSII_SINVOKE_VOID_FUNC}(`); + } code.line(`"${this.parent.parent.fqn}",`); code.line(`"${this.parent.method.name}",`); code.line(`${this.argsString},`); - code.line(`${this.returnsVal ? 'true' : 'false'},`); - code.line(`&${this.returnVarName},`); + if (this.returnsVal) { + code.line(`&${this.returnVarName},`); + } code.close(`)`); if (this.returnsVal) { + code.line(); code.line(`return ${this.returnVarName}`); } } @@ -70,9 +90,10 @@ export class MethodCall extends FunctionCall { } private get argsString(): string { - const argsList = this.parent.parameters - .map((param) => param.name) - .join(', '); - return `[]interface{}{${argsList}}`; + const argsList = this.parent.parameters.map((param) => param.name); + if (argsList.length === 0) { + return 'nil /* no parameters */'; + } + return `[]interface{}{${argsList.join(', ')}}`; } } diff --git a/packages/jsii-pacmak/lib/targets/go/types/class.ts b/packages/jsii-pacmak/lib/targets/go/types/class.ts index 515f22ff35..9dff125484 100644 --- a/packages/jsii-pacmak/lib/targets/go/types/class.ts +++ b/packages/jsii-pacmak/lib/targets/go/types/class.ts @@ -152,6 +152,25 @@ export class GoClass extends GoType { code.open(`${JSII_RT_ALIAS}.RegisterClass(`); code.line(`"${this.fqn}",`); code.line(`reflect.TypeOf((*${this.name})(nil)).Elem(),`); + + const allMembers = [ + ...this.type.allMethods + .filter((method) => !method.static) + .map((method) => new ClassMethod(this, method)), + ...this.type.allProperties + .filter((property) => !property.static) + .map((property) => new GoProperty(this, property)), + ].sort(comparators.byName); + if (allMembers.length === 0) { + code.line('nil, // no members'); + } else { + code.open(`[]${JSII_RT_ALIAS}.Member{`); + for (const member of allMembers) { + code.line(`${member.override},`); + } + code.close('},'); + } + this.emitProxyMakerFunction(code, this.baseTypes); code.close(')'); } @@ -327,12 +346,7 @@ export class GoClassConstructor { ? '' : this.parameters.map((p) => p.toString()).join(', '); - let docstring = ''; - if (this.type.docs.summary) { - docstring = this.type.docs.toString(); - code.line(`// ${docstring}`); - } - + context.documenter.emit(this.type.docs); code.openBlock(`func ${constr}(${paramString}) ${this.parent.name}`); this.constructorRuntimeCall.emit(code); diff --git a/packages/jsii-pacmak/lib/targets/go/types/go-type.ts b/packages/jsii-pacmak/lib/targets/go/types/go-type.ts index ceadf081bc..c90df336f0 100644 --- a/packages/jsii-pacmak/lib/targets/go/types/go-type.ts +++ b/packages/jsii-pacmak/lib/targets/go/types/go-type.ts @@ -14,7 +14,9 @@ export abstract class GoType { public constructor(public pkg: Package, public type: Type) { this.name = toPascalCase(type.name); - this.proxyName = toCamelCase(type.name); + // add "_jsiiProxy" postfix to private struct name to avoid keyword + // conflicts such as "default". see https://github.com/aws/jsii/issues/2637 + this.proxyName = `${toCamelCase(type.name)}_jsiiProxy`; this.fqn = type.fqn; } diff --git a/packages/jsii-pacmak/lib/targets/go/types/interface.ts b/packages/jsii-pacmak/lib/targets/go/types/interface.ts index 65114468f2..8d3509b232 100644 --- a/packages/jsii-pacmak/lib/targets/go/types/interface.ts +++ b/packages/jsii-pacmak/lib/targets/go/types/interface.ts @@ -127,6 +127,25 @@ export class GoInterface extends GoType { code.open(`${JSII_RT_ALIAS}.RegisterInterface(`); code.line(`"${this.fqn}",`); code.line(`reflect.TypeOf((*${this.name})(nil)).Elem(),`); + + const allMembers = [ + ...this.type.allMethods + .filter((method) => !method.static) + .map((method) => new InterfaceMethod(this, method)), + ...this.type.allProperties + .filter((property) => !property.static) + .map((property) => new GoProperty(this, property)), + ].sort(comparators.byName); + if (allMembers.length === 0) { + code.line('nil, // no members'); + } else { + code.open(`[]${JSII_RT_ALIAS}.Member{`); + for (const member of allMembers) { + code.line(`${member.override},`); + } + code.close('},'); + } + this.emitProxyMakerFunction(code, this.extends); code.close(')'); } diff --git a/packages/jsii-pacmak/lib/targets/go/types/type-member.ts b/packages/jsii-pacmak/lib/targets/go/types/type-member.ts index 7021e2c805..5dc3f235b1 100644 --- a/packages/jsii-pacmak/lib/targets/go/types/type-member.ts +++ b/packages/jsii-pacmak/lib/targets/go/types/type-member.ts @@ -2,7 +2,7 @@ import { toPascalCase } from 'codemaker'; import { Method, Parameter, Property } from 'jsii-reflect'; import { EmitContext } from '../emit-context'; -import { GetProperty, SetProperty } from '../runtime'; +import { GetProperty, JSII_RT_ALIAS, SetProperty } from '../runtime'; import { substituteReservedWords } from '../util'; import { GoClass, GoType, GoInterface, GoTypeRef } from './index'; @@ -64,6 +64,10 @@ export class GoProperty implements GoTypeMember { return this.parent.proxyName.substring(0, 1).toLowerCase(); } + public get override(): string { + return `${JSII_RT_ALIAS}.MemberProperty{JsiiProperty: "${this.property.name}", GoGetter: "${this.name}"}`; + } + public emitStructMember({ code, documenter }: EmitContext) { documenter.emit(this.property.docs); const memberType = @@ -193,6 +197,10 @@ export abstract class GoMethod implements GoTypeMember { return this.parent.name.substring(0, 1).toLowerCase(); } + public get override(): string { + return `${JSII_RT_ALIAS}.MemberMethod{JsiiMethod: "${this.method.name}", GoMethod: "${this.name}"}`; + } + public paramString(): string { return this.parameters.length === 0 ? '' diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-dotnet.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-dotnet.test.ts.snap index 07d3ed7867..57e34d287b 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-dotnet.test.ts.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-dotnet.test.ts.snap @@ -2688,6 +2688,7 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 ConsumerCanRingBell.cs ┃ ┣━ 📄 ConsumersOfThisCrazyTypeSystem.cs ┃ ┣━ 📄 DataRenderer.cs + ┃ ┣━ 📄 Default.cs ┃ ┣━ 📄 DefaultedConstructorArgument.cs ┃ ┣━ 📄 Demonstrate982.cs ┃ ┣━ 📄 DeprecatedClass.cs @@ -2804,12 +2805,15 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 ISecondLevelStruct.cs ┃ ┣━ 📄 ISmellyStruct.cs ┃ ┣━ 📄 Isomorphism.cs + ┃ ┣━ 📄 Issue2638.cs + ┃ ┣━ 📄 Issue2638B.cs ┃ ┣━ 📄 IStableInterface.cs ┃ ┣━ 📄 IStableStruct.cs ┃ ┣━ 📄 IStructA.cs ┃ ┣━ 📄 IStructB.cs ┃ ┣━ 📄 IStructParameterType.cs ┃ ┣━ 📄 IStructReturningDelegate.cs + ┃ ┣━ 📄 IStructWithEnum.cs ┃ ┣━ 📄 IStructWithJavaReservedWords.cs ┃ ┣━ 📄 ISupportsNiceJavaBuilderProps.cs ┃ ┣━ 📄 ITopLevelStruct.cs @@ -2894,6 +2898,7 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 StructParameterType.cs ┃ ┣━ 📄 StructPassing.cs ┃ ┣━ 📄 StructUnionConsumer.cs + ┃ ┣━ 📄 StructWithEnum.cs ┃ ┣━ 📄 StructWithJavaReservedWords.cs ┃ ┣━ 📁 Submodule ┃ ┃ ┣━ 📁 BackReferences @@ -2911,6 +2916,8 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┃ ┃ ┣━ 📄 SomeEnum.cs ┃ ┃ ┃ ┣━ 📄 SomeStruct.cs ┃ ┃ ┃ ┗━ 📄 Structure.cs + ┃ ┃ ┣━ 📄 Default.cs + ┃ ┃ ┣━ 📄 IDefault.cs ┃ ┃ ┣━ 📁 Isolated ┃ ┃ ┃ ┗━ 📄 Kwargs.cs ┃ ┃ ┣━ 📄 MyClass.cs @@ -2928,6 +2935,7 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 SupportsNiceJavaBuilderProps.cs ┃ ┣━ 📄 SupportsNiceJavaBuilderWithRequiredProps.cs ┃ ┣━ 📄 SyncVirtualMethods.cs + ┃ ┣━ 📄 TestStructWithEnum.cs ┃ ┣━ 📄 Thrower.cs ┃ ┣━ 📄 TopLevelStruct.cs ┃ ┣━ 📄 UmaskCheck.cs @@ -5111,6 +5119,48 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Default.cs 1`] = ` +using Amazon.JSII.Runtime.Deputy; + +#pragma warning disable CS0672,CS0809,CS1591 + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// A class named "Default". + /// + /// See: https://github.com/aws/jsii/issues/2637 + /// + [JsiiClass(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.Default), fullyQualifiedName: "jsii-calc.Default")] + public class Default : DeputyBase + { + public Default(): base(new DeputyProps(System.Array.Empty())) + { + } + + /// Used by jsii to construct an instance of this class from a Javascript-owned object reference + /// The Javascript-owned object reference + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + protected Default(ByRefValue reference): base(reference) + { + } + + /// Used by jsii to construct an instance of this class from DeputyProps + /// The deputy props + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + protected Default(DeputyProps props): base(props) + { + } + + [JsiiMethod(name: "pleaseCompile")] + public virtual void PleaseCompile() + { + InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + } + } +} + +`; + exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DefaultedConstructorArgument.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -9919,6 +9969,67 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IStructWithEnum.cs 1`] = ` +using Amazon.JSII.Runtime.Deputy; + +#pragma warning disable CS0672,CS0809,CS1591 + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiInterface(nativeType: typeof(IStructWithEnum), fullyQualifiedName: "jsii-calc.StructWithEnum")] + public interface IStructWithEnum + { + /// An enum value. + [JsiiProperty(name: "foo", typeJson: "{\\"fqn\\":\\"jsii-calc.StringEnum\\"}")] + Amazon.JSII.Tests.CalculatorNamespace.StringEnum Foo + { + get; + } + + /// Optional enum value (of type integer). + /// + /// Default: AllTypesEnum.YOUR_ENUM_VALUE + /// + [JsiiProperty(name: "bar", typeJson: "{\\"fqn\\":\\"jsii-calc.AllTypesEnum\\"}", isOptional: true)] + [Amazon.JSII.Runtime.Deputy.JsiiOptional] + Amazon.JSII.Tests.CalculatorNamespace.AllTypesEnum? Bar + { + get + { + return null; + } + } + + [JsiiTypeProxy(nativeType: typeof(IStructWithEnum), fullyQualifiedName: "jsii-calc.StructWithEnum")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IStructWithEnum + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + /// An enum value. + [JsiiProperty(name: "foo", typeJson: "{\\"fqn\\":\\"jsii-calc.StringEnum\\"}")] + public Amazon.JSII.Tests.CalculatorNamespace.StringEnum Foo + { + get => GetInstanceProperty()!; + } + + /// Optional enum value (of type integer). + /// + /// Default: AllTypesEnum.YOUR_ENUM_VALUE + /// + [JsiiOptional] + [JsiiProperty(name: "bar", typeJson: "{\\"fqn\\":\\"jsii-calc.AllTypesEnum\\"}", isOptional: true)] + public Amazon.JSII.Tests.CalculatorNamespace.AllTypesEnum? Bar + { + get => GetInstanceProperty(); + } + } + } +} + +`; + exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IStructWithJavaReservedWords.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -10799,6 +10910,78 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Issue2638.cs 1`] = ` +using Amazon.JSII.Runtime.Deputy; + +#pragma warning disable CS0672,CS0809,CS1591 + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// Docstrings with period. + /// + /// See: https://github.com/aws/jsii/issues/2638 + /// + [JsiiClass(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.Issue2638), fullyQualifiedName: "jsii-calc.Issue2638")] + public class Issue2638 : DeputyBase + { + /// First sentence. + /// + /// Second sentence. Third sentence. + /// + public Issue2638(): base(new DeputyProps(System.Array.Empty())) + { + } + + /// Used by jsii to construct an instance of this class from a Javascript-owned object reference + /// The Javascript-owned object reference + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + protected Issue2638(ByRefValue reference): base(reference) + { + } + + /// Used by jsii to construct an instance of this class from DeputyProps + /// The deputy props + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + protected Issue2638(DeputyProps props): base(props) + { + } + } +} + +`; + +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Issue2638B.cs 1`] = ` +using Amazon.JSII.Runtime.Deputy; + +#pragma warning disable CS0672,CS0809,CS1591 + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiClass(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.Issue2638B), fullyQualifiedName: "jsii-calc.Issue2638B")] + public class Issue2638B : DeputyBase + { + public Issue2638B(): base(new DeputyProps(System.Array.Empty())) + { + } + + /// Used by jsii to construct an instance of this class from a Javascript-owned object reference + /// The Javascript-owned object reference + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + protected Issue2638B(ByRefValue reference): base(reference) + { + } + + /// Used by jsii to construct an instance of this class from DeputyProps + /// The deputy props + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + protected Issue2638B(DeputyProps props): base(props) + { + } + } +} + +`; + exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSII417Derived.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -14559,6 +14742,42 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructWithEnum.cs 1`] = ` +using Amazon.JSII.Runtime.Deputy; + +#pragma warning disable CS0672,CS0809,CS1591 + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + #pragma warning disable CS8618 + + [JsiiByValue(fqn: "jsii-calc.StructWithEnum")] + public class StructWithEnum : Amazon.JSII.Tests.CalculatorNamespace.IStructWithEnum + { + /// An enum value. + [JsiiProperty(name: "foo", typeJson: "{\\"fqn\\":\\"jsii-calc.StringEnum\\"}", isOverride: true)] + public Amazon.JSII.Tests.CalculatorNamespace.StringEnum Foo + { + get; + set; + } + + /// Optional enum value (of type integer). + /// + /// Default: AllTypesEnum.YOUR_ENUM_VALUE + /// + [JsiiOptional] + [JsiiProperty(name: "bar", typeJson: "{\\"fqn\\":\\"jsii-calc.AllTypesEnum\\"}", isOptional: true, isOverride: true)] + public Amazon.JSII.Tests.CalculatorNamespace.AllTypesEnum? Bar + { + get; + set; + } + } +} + +`; + exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructWithJavaReservedWords.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -14994,6 +15213,75 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child `; +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Submodule/Default.cs 1`] = ` +using Amazon.JSII.Runtime.Deputy; + +#pragma warning disable CS0672,CS0809,CS1591 + +namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule +{ + #pragma warning disable CS8618 + + /// A struct named "Default". + /// + /// See: https://github.com/aws/jsii/issues/2637 + /// + [JsiiByValue(fqn: "jsii-calc.submodule.Default")] + public class Default : Amazon.JSII.Tests.CalculatorNamespace.Submodule.IDefault + { + [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"number\\"}", isOverride: true)] + public double Foo + { + get; + set; + } + } +} + +`; + +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Submodule/IDefault.cs 1`] = ` +using Amazon.JSII.Runtime.Deputy; + +#pragma warning disable CS0672,CS0809,CS1591 + +namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule +{ + /// A struct named "Default". + /// + /// See: https://github.com/aws/jsii/issues/2637 + /// + [JsiiInterface(nativeType: typeof(IDefault), fullyQualifiedName: "jsii-calc.submodule.Default")] + public interface IDefault + { + [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"number\\"}")] + double Foo + { + get; + } + + /// A struct named "Default". + /// + /// See: https://github.com/aws/jsii/issues/2637 + /// + [JsiiTypeProxy(nativeType: typeof(IDefault), fullyQualifiedName: "jsii-calc.submodule.Default")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.Submodule.IDefault + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"number\\"}")] + public double Foo + { + get => GetInstanceProperty()!; + } + } + } +} + +`; + exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Submodule/Isolated/Kwargs.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -15606,6 +15894,66 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/TestStructWithEnum.cs 1`] = ` +using Amazon.JSII.Runtime.Deputy; + +#pragma warning disable CS0672,CS0809,CS1591 + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiClass(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.TestStructWithEnum), fullyQualifiedName: "jsii-calc.TestStructWithEnum")] + public class TestStructWithEnum : DeputyBase + { + public TestStructWithEnum(): base(new DeputyProps(System.Array.Empty())) + { + } + + /// Used by jsii to construct an instance of this class from a Javascript-owned object reference + /// The Javascript-owned object reference + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + protected TestStructWithEnum(ByRefValue reference): base(reference) + { + } + + /// Used by jsii to construct an instance of this class from DeputyProps + /// The deputy props + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + protected TestStructWithEnum(DeputyProps props): base(props) + { + } + + /// Returns true if \`foo\` is \`StringEnum.A\`. + [JsiiMethod(name: "isStringEnumA", returnsJson: "{\\"type\\":{\\"primitive\\":\\"boolean\\"}}", parametersJson: "[{\\"name\\":\\"input\\",\\"type\\":{\\"fqn\\":\\"jsii-calc.StructWithEnum\\"}}]")] + public virtual bool IsStringEnumA(Amazon.JSII.Tests.CalculatorNamespace.IStructWithEnum input) + { + return InvokeInstanceMethod(new System.Type[]{typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructWithEnum)}, new object[]{input})!; + } + + /// Returns true if \`foo\` is \`StringEnum.B\` and \`bar\` is \`AllTypesEnum.THIS_IS_GREAT\`. + [JsiiMethod(name: "isStringEnumB", returnsJson: "{\\"type\\":{\\"primitive\\":\\"boolean\\"}}", parametersJson: "[{\\"name\\":\\"input\\",\\"type\\":{\\"fqn\\":\\"jsii-calc.StructWithEnum\\"}}]")] + public virtual bool IsStringEnumB(Amazon.JSII.Tests.CalculatorNamespace.IStructWithEnum input) + { + return InvokeInstanceMethod(new System.Type[]{typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructWithEnum)}, new object[]{input})!; + } + + /// Returns \`foo: StringEnum.A\`. + [JsiiProperty(name: "structWithFoo", typeJson: "{\\"fqn\\":\\"jsii-calc.StructWithEnum\\"}")] + public virtual Amazon.JSII.Tests.CalculatorNamespace.IStructWithEnum StructWithFoo + { + get => GetInstanceProperty()!; + } + + /// Returns \`foo: StringEnum.C\` and \`bar: AllTypesEnum.MY_ENUM_VALUE\`. + [JsiiProperty(name: "structWithFooBar", typeJson: "{\\"fqn\\":\\"jsii-calc.StructWithEnum\\"}")] + public virtual Amazon.JSII.Tests.CalculatorNamespace.IStructWithEnum StructWithFooBar + { + get => GetInstanceProperty()!; + } + } +} + +`; + exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Thrower.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.ts.snap index 0fa6db0132..302fc2d842 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.ts.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.ts.snap @@ -287,34 +287,37 @@ type Base interface { } // The jsii proxy struct for Base -type base struct { +type base_jsiiProxy struct { _ byte // padding } func NewBase() Base { _init_.Initialize() - b := base{} + + b := base_jsiiProxy{} _jsii_.Create( "@scope/jsii-calc-base.Base", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &b, ) + return &b } // Returns: the name of the class (to verify native type names are created for derived classes). -func (b *base) TypeName() interface{} { +func (b *base_jsiiProxy) TypeName() interface{} { var returns interface{} + _jsii_.Invoke( b, "typeName", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -336,18 +339,15 @@ type IBaseInterface interface { } // The jsii proxy for IBaseInterface -type iBaseInterface struct { +type iBaseInterface_jsiiProxy struct { scopejsiicalcbaseofbase.IVeryBaseInterface // extends @scope/jsii-calc-base-of-base.IVeryBaseInterface } -func (i *iBaseInterface) Bar() { - var returns interface{} - _jsii_.Invoke( +func (i *iBaseInterface_jsiiProxy) Bar() { + _jsii_.InvokeVoid( i, "bar", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } @@ -356,33 +356,33 @@ type StaticConsumer interface { } // The jsii proxy struct for StaticConsumer -type staticConsumer struct { +type staticConsumer_jsiiProxy struct { _ byte // padding } func NewStaticConsumer() StaticConsumer { _init_.Initialize() - s := staticConsumer{} + + s := staticConsumer_jsiiProxy{} _jsii_.Create( "@scope/jsii-calc-base.StaticConsumer", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &s, ) + return &s } func StaticConsumer_Consume(args interface{}) { _init_.Initialize() - var returns interface{} - _jsii_.StaticInvoke( + + _jsii_.StaticInvokeVoid( "@scope/jsii-calc-base.StaticConsumer", "consume", []interface{}{args}, - false, - &returns, ) } @@ -402,8 +402,11 @@ 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 &base{} + return &base_jsiiProxy{} }, ) _jsii_.RegisterStruct( @@ -413,8 +416,12 @@ func init() { _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{} { - i := iBaseInterface{} + i := iBaseInterface_jsiiProxy{} _jsii_.InitJsiiProxy(&i.IVeryBaseInterface) return &i }, @@ -422,8 +429,9 @@ func init() { _jsii_.RegisterClass( "@scope/jsii-calc-base.StaticConsumer", reflect.TypeOf((*StaticConsumer)(nil)).Elem(), + nil, // no members func() interface{} { - return &staticConsumer{} + return &staticConsumer_jsiiProxy{} }, ) } @@ -713,18 +721,15 @@ type IVeryBaseInterface interface { } // The jsii proxy for IVeryBaseInterface -type iVeryBaseInterface struct { +type iVeryBaseInterface_jsiiProxy struct { _ byte // padding } -func (i *iVeryBaseInterface) Foo() { - var returns interface{} - _jsii_.Invoke( +func (i *iVeryBaseInterface_jsiiProxy) Foo() { + _jsii_.InvokeVoid( i, "foo", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } @@ -732,19 +737,17 @@ type StaticConsumer interface { } // The jsii proxy struct for StaticConsumer -type staticConsumer struct { +type staticConsumer_jsiiProxy struct { _ byte // padding } func StaticConsumer_Consume(_args interface{}) { _init_.Initialize() - var returns interface{} - _jsii_.StaticInvoke( + + _jsii_.StaticInvokeVoid( "@scope/jsii-calc-base-of-base.StaticConsumer", "consume", []interface{}{_args}, - false, - &returns, ) } @@ -755,34 +758,38 @@ type Very interface { } // The jsii proxy struct for Very -type very struct { +type very_jsiiProxy struct { _ byte // padding } +// Experimental. func NewVery() Very { _init_.Initialize() - v := very{} + + v := very_jsiiProxy{} _jsii_.Create( "@scope/jsii-calc-base-of-base.Very", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &v, ) + return &v } // Experimental. -func (v *very) Hey() float64 { +func (v *very_jsiiProxy) Hey() float64 { var returns float64 + _jsii_.Invoke( v, "hey", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -806,22 +813,29 @@ 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 &iVeryBaseInterface{} + return &iVeryBaseInterface_jsiiProxy{} }, ) _jsii_.RegisterClass( "@scope/jsii-calc-base-of-base.StaticConsumer", reflect.TypeOf((*StaticConsumer)(nil)).Elem(), + nil, // no members func() interface{} { - return &staticConsumer{} + return &staticConsumer_jsiiProxy{} }, ) _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 &very{} + return &very_jsiiProxy{} }, ) _jsii_.RegisterStruct( @@ -1159,11 +1173,11 @@ type IDoublable interface { } // The jsii proxy for IDoublable -type iDoublable struct { +type iDoublable_jsiiProxy struct { _ byte // padding } -func (i *iDoublable) DoubleValue() float64 { +func (i *iDoublable_jsiiProxy) DoubleValue() float64 { var returns float64 _jsii_.Get( i, @@ -1185,19 +1199,20 @@ type IFriendly interface { } // The jsii proxy for IFriendly -type iFriendly struct { +type iFriendly_jsiiProxy struct { _ byte // padding } -func (i *iFriendly) Hello() string { +func (i *iFriendly_jsiiProxy) Hello() string { var returns string + _jsii_.Invoke( i, "hello", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -1213,18 +1228,15 @@ type IThreeLevelsInterface interface { } // The jsii proxy for IThreeLevelsInterface -type iThreeLevelsInterface struct { +type iThreeLevelsInterface_jsiiProxy struct { scopejsiicalcbase.IBaseInterface // extends @scope/jsii-calc-base.IBaseInterface } -func (i *iThreeLevelsInterface) Baz() { - var returns interface{} - _jsii_.Invoke( +func (i *iThreeLevelsInterface_jsiiProxy) Baz() { + _jsii_.InvokeVoid( i, "baz", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } @@ -1251,12 +1263,12 @@ type Number interface { } // The jsii proxy struct for Number -type number struct { - numericValue // extends @scope/jsii-calc-lib.NumericValue - iDoublable // implements @scope/jsii-calc-lib.IDoublable +type number_jsiiProxy struct { + numericValue_jsiiProxy // extends @scope/jsii-calc-lib.NumericValue + iDoublable_jsiiProxy // implements @scope/jsii-calc-lib.IDoublable } -func (n *number) DoubleValue() float64 { +func (n *number_jsiiProxy) DoubleValue() float64 { var returns float64 _jsii_.Get( n, @@ -1266,7 +1278,7 @@ func (n *number) DoubleValue() float64 { return returns } -func (n *number) Value() float64 { +func (n *number_jsiiProxy) Value() float64 { var returns float64 _jsii_.Get( n, @@ -1278,45 +1290,50 @@ func (n *number) Value() float64 { // Creates a Number object. +// Deprecated. func NewNumber(value float64) Number { _init_.Initialize() - n := number{} + + n := number_jsiiProxy{} _jsii_.Create( "@scope/jsii-calc-lib.Number", []interface{}{value}, []_jsii_.FQN{"@scope/jsii-calc-lib.IDoublable"}, - []_jsii_.Override{}, + nil, // no overrides &n, ) + return &n } // String representation of the value. // Deprecated. -func (n *number) ToString() string { +func (n *number_jsiiProxy) ToString() string { var returns string + _jsii_.Invoke( n, "toString", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } // Returns: the name of the class (to verify native type names are created for derived classes). // Deprecated. -func (n *number) TypeName() interface{} { +func (n *number_jsiiProxy) TypeName() interface{} { var returns interface{} + _jsii_.Invoke( n, "typeName", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -1329,11 +1346,11 @@ type NumericValue interface { } // The jsii proxy struct for NumericValue -type numericValue struct { +type numericValue_jsiiProxy struct { scopejsiicalcbase.Base // extends @scope/jsii-calc-base.Base } -func (n *numericValue) Value() float64 { +func (n *numericValue_jsiiProxy) Value() float64 { var returns float64 _jsii_.Get( n, @@ -1344,31 +1361,35 @@ func (n *numericValue) Value() float64 { } +// Deprecated. func NewNumericValue() NumericValue { _init_.Initialize() - n := numericValue{} + + n := numericValue_jsiiProxy{} _jsii_.Create( "@scope/jsii-calc-lib.NumericValue", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &n, ) + return &n } // String representation of the value. // Deprecated. -func (n *numericValue) ToString() string { +func (n *numericValue_jsiiProxy) ToString() string { var returns string + _jsii_.Invoke( n, "toString", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -1380,35 +1401,39 @@ type Operation interface { } // The jsii proxy struct for Operation -type operation struct { - numericValue // extends @scope/jsii-calc-lib.NumericValue +type operation_jsiiProxy struct { + numericValue_jsiiProxy // extends @scope/jsii-calc-lib.NumericValue } +// Deprecated. func NewOperation() Operation { _init_.Initialize() - o := operation{} + + o := operation_jsiiProxy{} _jsii_.Create( "@scope/jsii-calc-lib.Operation", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &o, ) + return &o } // String representation of the value. // Deprecated. -func (o *operation) ToString() string { +func (o *operation_jsiiProxy) ToString() string { var returns string + _jsii_.Invoke( o, "toString", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -1456,22 +1481,33 @@ func init() { _jsii_.RegisterInterface( "@scope/jsii-calc-lib.IDoublable", reflect.TypeOf((*IDoublable)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "doubleValue", GoGetter: "DoubleValue"}, + }, func() interface{} { - return &iDoublable{} + return &iDoublable_jsiiProxy{} }, ) _jsii_.RegisterInterface( "@scope/jsii-calc-lib.IFriendly", reflect.TypeOf((*IFriendly)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, + }, func() interface{} { - return &iFriendly{} + return &iFriendly_jsiiProxy{} }, ) _jsii_.RegisterInterface( "@scope/jsii-calc-lib.IThreeLevelsInterface", reflect.TypeOf((*IThreeLevelsInterface)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "bar", GoMethod: "Bar"}, + _jsii_.MemberMethod{JsiiMethod: "baz", GoMethod: "Baz"}, + _jsii_.MemberMethod{JsiiMethod: "foo", GoMethod: "Foo"}, + }, func() interface{} { - i := iThreeLevelsInterface{} + i := iThreeLevelsInterface_jsiiProxy{} _jsii_.InitJsiiProxy(&i.IBaseInterface) return &i }, @@ -1483,18 +1519,29 @@ func init() { _jsii_.RegisterClass( "@scope/jsii-calc-lib.Number", reflect.TypeOf((*Number)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "doubleValue", GoGetter: "DoubleValue"}, + _jsii_.MemberMethod{JsiiMethod: "toString", GoMethod: "ToString"}, + _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, + _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, + }, func() interface{} { - n := number{} - _jsii_.InitJsiiProxy(&n.numericValue) - _jsii_.InitJsiiProxy(&n.iDoublable) + n := number_jsiiProxy{} + _jsii_.InitJsiiProxy(&n.numericValue_jsiiProxy) + _jsii_.InitJsiiProxy(&n.iDoublable_jsiiProxy) return &n }, ) _jsii_.RegisterClass( "@scope/jsii-calc-lib.NumericValue", reflect.TypeOf((*NumericValue)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "toString", GoMethod: "ToString"}, + _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, + _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, + }, func() interface{} { - n := numericValue{} + n := numericValue_jsiiProxy{} _jsii_.InitJsiiProxy(&n.Base) return &n }, @@ -1502,9 +1549,14 @@ func init() { _jsii_.RegisterClass( "@scope/jsii-calc-lib.Operation", reflect.TypeOf((*Operation)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "toString", GoMethod: "ToString"}, + _jsii_.MemberMethod{JsiiMethod: "typeName", GoMethod: "TypeName"}, + _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, + }, func() interface{} { - o := operation{} - _jsii_.InitJsiiProxy(&o.numericValue) + o := operation_jsiiProxy{} + _jsii_.InitJsiiProxy(&o.numericValue_jsiiProxy) return &o }, ) @@ -1531,11 +1583,11 @@ type IReflectable interface { } // The jsii proxy for IReflectable -type iReflectable struct { +type iReflectable_jsiiProxy struct { _ byte // padding } -func (i *iReflectable) Entries() []ReflectableEntry { +func (i *iReflectable_jsiiProxy) Entries() []ReflectableEntry { var returns []ReflectableEntry _jsii_.Get( i, @@ -1551,7 +1603,7 @@ type NestingClass interface { } // The jsii proxy struct for NestingClass -type nestingClass struct { +type nestingClass_jsiiProxy struct { _ byte // padding } @@ -1562,11 +1614,11 @@ type NestedClass interface { } // The jsii proxy struct for NestedClass -type nestedClass struct { +type nestedClass_jsiiProxy struct { _ byte // padding } -func (n *nestedClass) Property() string { +func (n *nestedClass_jsiiProxy) Property() string { var returns string _jsii_.Get( n, @@ -1577,17 +1629,20 @@ func (n *nestedClass) Property() string { } +// Deprecated. func NewNestedClass() NestedClass { _init_.Initialize() - n := nestedClass{} + + n := nestedClass_jsiiProxy{} _jsii_.Create( "@scope/jsii-calc-lib.submodule.NestingClass.NestedClass", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &n, ) + return &n } @@ -1614,34 +1669,38 @@ type Reflector interface { } // The jsii proxy struct for Reflector -type reflector struct { +type reflector_jsiiProxy struct { _ byte // padding } +// Deprecated. func NewReflector() Reflector { _init_.Initialize() - r := reflector{} + + r := reflector_jsiiProxy{} _jsii_.Create( "@scope/jsii-calc-lib.submodule.Reflector", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &r, ) + return &r } // Deprecated. -func (r *reflector) AsMap(reflectable IReflectable) map[string]interface{} { +func (r *reflector_jsiiProxy) AsMap(reflectable IReflectable) map[string]interface{} { var returns map[string]interface{} + _jsii_.Invoke( r, "asMap", []interface{}{reflectable}, - true, &returns, ) + return returns } @@ -1661,22 +1720,29 @@ 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 &iReflectable{} + return &iReflectable_jsiiProxy{} }, ) _jsii_.RegisterClass( "@scope/jsii-calc-lib.submodule.NestingClass", reflect.TypeOf((*NestingClass)(nil)).Elem(), + nil, // no members func() interface{} { - return &nestingClass{} + return &nestingClass_jsiiProxy{} }, ) _jsii_.RegisterClass( "@scope/jsii-calc-lib.submodule.NestingClass.NestedClass", reflect.TypeOf((*NestedClass)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "property", GoGetter: "Property"}, + }, func() interface{} { - return &nestedClass{} + return &nestedClass_jsiiProxy{} }, ) _jsii_.RegisterStruct( @@ -1690,8 +1756,11 @@ func init() { _jsii_.RegisterClass( "@scope/jsii-calc-lib.submodule.Reflector", reflect.TypeOf((*Reflector)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "asMap", GoMethod: "AsMap"}, + }, func() interface{} { - return &reflector{} + return &reflector_jsiiProxy{} }, ) } @@ -2035,11 +2104,11 @@ type CompositeOperation interface { } // The jsii proxy struct for CompositeOperation -type compositeOperation struct { +type compositeOperation_jsiiProxy struct { scopejsiicalclib.Operation // extends @scope/jsii-calc-lib.Operation } -func (c *compositeOperation) DecorationPostfixes() []string { +func (c *compositeOperation_jsiiProxy) DecorationPostfixes() []string { var returns []string _jsii_.Get( c, @@ -2049,7 +2118,7 @@ func (c *compositeOperation) DecorationPostfixes() []string { return returns } -func (c *compositeOperation) DecorationPrefixes() []string { +func (c *compositeOperation_jsiiProxy) DecorationPrefixes() []string { var returns []string _jsii_.Get( c, @@ -2059,7 +2128,7 @@ func (c *compositeOperation) DecorationPrefixes() []string { return returns } -func (c *compositeOperation) Expression() scopejsiicalclib.NumericValue { +func (c *compositeOperation_jsiiProxy) Expression() scopejsiicalclib.NumericValue { var returns scopejsiicalclib.NumericValue _jsii_.Get( c, @@ -2069,7 +2138,7 @@ func (c *compositeOperation) Expression() scopejsiicalclib.NumericValue { return returns } -func (c *compositeOperation) StringStyle() CompositionStringStyle { +func (c *compositeOperation_jsiiProxy) StringStyle() CompositionStringStyle { var returns CompositionStringStyle _jsii_.Get( c, @@ -2079,7 +2148,7 @@ func (c *compositeOperation) StringStyle() CompositionStringStyle { return returns } -func (c *compositeOperation) Value() float64 { +func (c *compositeOperation_jsiiProxy) Value() float64 { var returns float64 _jsii_.Get( c, @@ -2092,19 +2161,21 @@ func (c *compositeOperation) Value() float64 { func NewCompositeOperation() CompositeOperation { _init_.Initialize() - c := compositeOperation{} + + c := compositeOperation_jsiiProxy{} _jsii_.Create( "jsii-calc.composition.CompositeOperation", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &c, ) + return &c } -func (c *compositeOperation) SetDecorationPostfixes(val []string) { +func (c *compositeOperation_jsiiProxy) SetDecorationPostfixes(val []string) { _jsii_.Set( c, "decorationPostfixes", @@ -2112,7 +2183,7 @@ func (c *compositeOperation) SetDecorationPostfixes(val []string) { ) } -func (c *compositeOperation) SetDecorationPrefixes(val []string) { +func (c *compositeOperation_jsiiProxy) SetDecorationPrefixes(val []string) { _jsii_.Set( c, "decorationPrefixes", @@ -2120,7 +2191,7 @@ func (c *compositeOperation) SetDecorationPrefixes(val []string) { ) } -func (c *compositeOperation) SetStringStyle(val CompositionStringStyle) { +func (c *compositeOperation_jsiiProxy) SetStringStyle(val CompositionStringStyle) { _jsii_.Set( c, "stringStyle", @@ -2129,15 +2200,16 @@ func (c *compositeOperation) SetStringStyle(val CompositionStringStyle) { } // (deprecated) String representation of the value. -func (c *compositeOperation) ToString() string { +func (c *compositeOperation_jsiiProxy) ToString() string { var returns string + _jsii_.Invoke( c, "toString", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -2165,8 +2237,17 @@ 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{} { - c := compositeOperation{} + c := compositeOperation_jsiiProxy{} _jsii_.InitJsiiProxy(&c.Operation) return &c }, @@ -2197,11 +2278,11 @@ type Base interface { } // The jsii proxy struct for Base -type base struct { +type base_jsiiProxy struct { _ byte // padding } -func (b *base) Prop() string { +func (b *base_jsiiProxy) Prop() string { var returns string _jsii_.Get( b, @@ -2214,19 +2295,21 @@ func (b *base) Prop() string { func NewBase() Base { _init_.Initialize() - b := base{} + + b := base_jsiiProxy{} _jsii_.Create( "jsii-calc.DerivedClassHasNoProperties.Base", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &b, ) + return &b } -func (b *base) SetProp(val string) { +func (b *base_jsiiProxy) SetProp(val string) { _jsii_.Set( b, "prop", @@ -2239,21 +2322,23 @@ type Derived interface { } // The jsii proxy struct for Derived -type derived struct { - base // extends jsii-calc.DerivedClassHasNoProperties.Base +type derived_jsiiProxy struct { + base_jsiiProxy // extends jsii-calc.DerivedClassHasNoProperties.Base } func NewDerived() Derived { _init_.Initialize() - d := derived{} + + d := derived_jsiiProxy{} _jsii_.Create( "jsii-calc.DerivedClassHasNoProperties.Derived", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &d, ) + return &d } @@ -2273,16 +2358,22 @@ func init() { _jsii_.RegisterClass( "jsii-calc.DerivedClassHasNoProperties.Base", reflect.TypeOf((*Base)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "prop", GoGetter: "Prop"}, + }, func() interface{} { - return &base{} + return &base_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.DerivedClassHasNoProperties.Derived", reflect.TypeOf((*Derived)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "prop", GoGetter: "Prop"}, + }, func() interface{} { - d := derived{} - _jsii_.InitJsiiProxy(&d.base) + d := derived_jsiiProxy{} + _jsii_.InitJsiiProxy(&d.base_jsiiProxy) return &d }, ) @@ -2318,11 +2409,11 @@ type Foo interface { } // The jsii proxy struct for Foo -type foo struct { +type foo_jsiiProxy struct { _ byte // padding } -func (f *foo) Bar() string { +func (f *foo_jsiiProxy) Bar() string { var returns string _jsii_.Get( f, @@ -2335,19 +2426,21 @@ func (f *foo) Bar() string { func NewFoo() Foo { _init_.Initialize() - f := foo{} + + f := foo_jsiiProxy{} _jsii_.Create( "jsii-calc.InterfaceInNamespaceIncludesClasses.Foo", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &f, ) + return &f } -func (f *foo) SetBar(val string) { +func (f *foo_jsiiProxy) SetBar(val string) { _jsii_.Set( f, "bar", @@ -2375,8 +2468,11 @@ func init() { _jsii_.RegisterClass( "jsii-calc.InterfaceInNamespaceIncludesClasses.Foo", reflect.TypeOf((*Foo)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "bar", GoGetter: "Bar"}, + }, func() interface{} { - return &foo{} + return &foo_jsiiProxy{} }, ) _jsii_.RegisterStruct( @@ -2474,12 +2570,12 @@ type AbstractClass interface { } // The jsii proxy struct for AbstractClass -type abstractClass struct { - abstractClassBase // extends jsii-calc.AbstractClassBase - iInterfaceImplementedByAbstractClass // implements jsii-calc.IInterfaceImplementedByAbstractClass +type abstractClass_jsiiProxy struct { + abstractClassBase_jsiiProxy // extends jsii-calc.AbstractClassBase + iInterfaceImplementedByAbstractClass_jsiiProxy // implements jsii-calc.IInterfaceImplementedByAbstractClass } -func (a *abstractClass) PropFromInterface() string { +func (a *abstractClass_jsiiProxy) PropFromInterface() string { var returns string _jsii_.Get( a, @@ -2492,39 +2588,43 @@ func (a *abstractClass) PropFromInterface() string { func NewAbstractClass() AbstractClass { _init_.Initialize() - a := abstractClass{} + + a := abstractClass_jsiiProxy{} _jsii_.Create( "jsii-calc.AbstractClass", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{"jsii-calc.IInterfaceImplementedByAbstractClass"}, - []_jsii_.Override{}, + nil, // no overrides &a, ) + return &a } -func (a *abstractClass) AbstractMethod(name string) string { +func (a *abstractClass_jsiiProxy) AbstractMethod(name string) string { var returns string + _jsii_.Invoke( a, "abstractMethod", []interface{}{name}, - true, &returns, ) + return returns } -func (a *abstractClass) NonAbstractMethod() float64 { +func (a *abstractClass_jsiiProxy) NonAbstractMethod() float64 { var returns float64 + _jsii_.Invoke( a, "nonAbstractMethod", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -2533,11 +2633,11 @@ type AbstractClassBase interface { } // The jsii proxy struct for AbstractClassBase -type abstractClassBase struct { +type abstractClassBase_jsiiProxy struct { _ byte // padding } -func (a *abstractClassBase) AbstractProperty() string { +func (a *abstractClassBase_jsiiProxy) AbstractProperty() string { var returns string _jsii_.Get( a, @@ -2550,15 +2650,17 @@ func (a *abstractClassBase) AbstractProperty() string { func NewAbstractClassBase() AbstractClassBase { _init_.Initialize() - a := abstractClassBase{} + + a := abstractClassBase_jsiiProxy{} _jsii_.Create( "jsii-calc.AbstractClassBase", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &a, ) + return &a } @@ -2569,11 +2671,11 @@ type AbstractClassReturner interface { } // The jsii proxy struct for AbstractClassReturner -type abstractClassReturner struct { +type abstractClassReturner_jsiiProxy struct { _ byte // padding } -func (a *abstractClassReturner) ReturnAbstractFromProperty() AbstractClassBase { +func (a *abstractClassReturner_jsiiProxy) ReturnAbstractFromProperty() AbstractClassBase { var returns AbstractClassBase _jsii_.Get( a, @@ -2586,39 +2688,43 @@ func (a *abstractClassReturner) ReturnAbstractFromProperty() AbstractClassBase { func NewAbstractClassReturner() AbstractClassReturner { _init_.Initialize() - a := abstractClassReturner{} + + a := abstractClassReturner_jsiiProxy{} _jsii_.Create( "jsii-calc.AbstractClassReturner", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &a, ) + return &a } -func (a *abstractClassReturner) GiveMeAbstract() AbstractClass { +func (a *abstractClassReturner_jsiiProxy) GiveMeAbstract() AbstractClass { var returns AbstractClass + _jsii_.Invoke( a, "giveMeAbstract", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } -func (a *abstractClassReturner) GiveMeInterface() IInterfaceImplementedByAbstractClass { +func (a *abstractClassReturner_jsiiProxy) GiveMeInterface() IInterfaceImplementedByAbstractClass { var returns IInterfaceImplementedByAbstractClass + _jsii_.Invoke( a, "giveMeInterface", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -2630,11 +2736,11 @@ type AbstractSuite interface { } // The jsii proxy struct for AbstractSuite -type abstractSuite struct { +type abstractSuite_jsiiProxy struct { _ byte // padding } -func (a *abstractSuite) Property() string { +func (a *abstractSuite_jsiiProxy) Property() string { var returns string _jsii_.Get( a, @@ -2647,19 +2753,21 @@ func (a *abstractSuite) Property() string { func NewAbstractSuite() AbstractSuite { _init_.Initialize() - a := abstractSuite{} + + a := abstractSuite_jsiiProxy{} _jsii_.Create( "jsii-calc.AbstractSuite", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &a, ) + return &a } -func (a *abstractSuite) SetProperty(val string) { +func (a *abstractSuite_jsiiProxy) SetProperty(val string) { _jsii_.Set( a, "property", @@ -2667,28 +2775,30 @@ func (a *abstractSuite) SetProperty(val string) { ) } -func (a *abstractSuite) SomeMethod(str string) string { +func (a *abstractSuite_jsiiProxy) SomeMethod(str string) string { var returns string + _jsii_.Invoke( a, "someMethod", []interface{}{str}, - true, &returns, ) + return returns } // Sets \`seed\` to \`this.property\`, then calls \`someMethod\` with \`this.property\` and returns the result. -func (a *abstractSuite) WorkItAll(seed string) string { +func (a *abstractSuite_jsiiProxy) WorkItAll(seed string) string { var returns string + _jsii_.Invoke( a, "workItAll", []interface{}{seed}, - true, &returns, ) + return returns } @@ -2700,11 +2810,11 @@ type Add interface { } // The jsii proxy struct for Add -type add struct { - binaryOperation // extends jsii-calc.BinaryOperation +type add_jsiiProxy struct { + binaryOperation_jsiiProxy // extends jsii-calc.BinaryOperation } -func (a *add) Value() float64 { +func (a *add_jsiiProxy) Value() float64 { var returns float64 _jsii_.Get( a, @@ -2718,28 +2828,31 @@ func (a *add) Value() float64 { // Creates a BinaryOperation. func NewAdd(lhs scopejsiicalclib.NumericValue, rhs scopejsiicalclib.NumericValue) Add { _init_.Initialize() - a := add{} + + a := add_jsiiProxy{} _jsii_.Create( "jsii-calc.Add", []interface{}{lhs, rhs}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &a, ) + return &a } // (deprecated) String representation of the value. -func (a *add) ToString() string { +func (a *add_jsiiProxy) ToString() string { var returns string + _jsii_.Invoke( a, "toString", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -2791,11 +2904,11 @@ type AllTypes interface { } // The jsii proxy struct for AllTypes -type allTypes struct { +type allTypes_jsiiProxy struct { _ byte // padding } -func (a *allTypes) AnyArrayProperty() []interface{} { +func (a *allTypes_jsiiProxy) AnyArrayProperty() []interface{} { var returns []interface{} _jsii_.Get( a, @@ -2805,7 +2918,7 @@ func (a *allTypes) AnyArrayProperty() []interface{} { return returns } -func (a *allTypes) AnyMapProperty() map[string]interface{} { +func (a *allTypes_jsiiProxy) AnyMapProperty() map[string]interface{} { var returns map[string]interface{} _jsii_.Get( a, @@ -2815,7 +2928,7 @@ func (a *allTypes) AnyMapProperty() map[string]interface{} { return returns } -func (a *allTypes) AnyProperty() interface{} { +func (a *allTypes_jsiiProxy) AnyProperty() interface{} { var returns interface{} _jsii_.Get( a, @@ -2825,7 +2938,7 @@ func (a *allTypes) AnyProperty() interface{} { return returns } -func (a *allTypes) ArrayProperty() []string { +func (a *allTypes_jsiiProxy) ArrayProperty() []string { var returns []string _jsii_.Get( a, @@ -2835,7 +2948,7 @@ func (a *allTypes) ArrayProperty() []string { return returns } -func (a *allTypes) BooleanProperty() bool { +func (a *allTypes_jsiiProxy) BooleanProperty() bool { var returns bool _jsii_.Get( a, @@ -2845,7 +2958,7 @@ func (a *allTypes) BooleanProperty() bool { return returns } -func (a *allTypes) DateProperty() string { +func (a *allTypes_jsiiProxy) DateProperty() string { var returns string _jsii_.Get( a, @@ -2855,7 +2968,7 @@ func (a *allTypes) DateProperty() string { return returns } -func (a *allTypes) EnumProperty() AllTypesEnum { +func (a *allTypes_jsiiProxy) EnumProperty() AllTypesEnum { var returns AllTypesEnum _jsii_.Get( a, @@ -2865,7 +2978,7 @@ func (a *allTypes) EnumProperty() AllTypesEnum { return returns } -func (a *allTypes) EnumPropertyValue() float64 { +func (a *allTypes_jsiiProxy) EnumPropertyValue() float64 { var returns float64 _jsii_.Get( a, @@ -2875,7 +2988,7 @@ func (a *allTypes) EnumPropertyValue() float64 { return returns } -func (a *allTypes) JsonProperty() map[string]interface{} { +func (a *allTypes_jsiiProxy) JsonProperty() map[string]interface{} { var returns map[string]interface{} _jsii_.Get( a, @@ -2885,7 +2998,7 @@ func (a *allTypes) JsonProperty() map[string]interface{} { return returns } -func (a *allTypes) MapProperty() map[string]scopejsiicalclib.Number { +func (a *allTypes_jsiiProxy) MapProperty() map[string]scopejsiicalclib.Number { var returns map[string]scopejsiicalclib.Number _jsii_.Get( a, @@ -2895,7 +3008,7 @@ func (a *allTypes) MapProperty() map[string]scopejsiicalclib.Number { return returns } -func (a *allTypes) NumberProperty() float64 { +func (a *allTypes_jsiiProxy) NumberProperty() float64 { var returns float64 _jsii_.Get( a, @@ -2905,7 +3018,7 @@ func (a *allTypes) NumberProperty() float64 { return returns } -func (a *allTypes) OptionalEnumValue() StringEnum { +func (a *allTypes_jsiiProxy) OptionalEnumValue() StringEnum { var returns StringEnum _jsii_.Get( a, @@ -2915,7 +3028,7 @@ func (a *allTypes) OptionalEnumValue() StringEnum { return returns } -func (a *allTypes) StringProperty() string { +func (a *allTypes_jsiiProxy) StringProperty() string { var returns string _jsii_.Get( a, @@ -2925,7 +3038,7 @@ func (a *allTypes) StringProperty() string { return returns } -func (a *allTypes) UnionArrayProperty() []interface{} { +func (a *allTypes_jsiiProxy) UnionArrayProperty() []interface{} { var returns []interface{} _jsii_.Get( a, @@ -2935,7 +3048,7 @@ func (a *allTypes) UnionArrayProperty() []interface{} { return returns } -func (a *allTypes) UnionMapProperty() map[string]interface{} { +func (a *allTypes_jsiiProxy) UnionMapProperty() map[string]interface{} { var returns map[string]interface{} _jsii_.Get( a, @@ -2945,7 +3058,7 @@ func (a *allTypes) UnionMapProperty() map[string]interface{} { return returns } -func (a *allTypes) UnionProperty() interface{} { +func (a *allTypes_jsiiProxy) UnionProperty() interface{} { var returns interface{} _jsii_.Get( a, @@ -2955,7 +3068,7 @@ func (a *allTypes) UnionProperty() interface{} { return returns } -func (a *allTypes) UnknownArrayProperty() []interface{} { +func (a *allTypes_jsiiProxy) UnknownArrayProperty() []interface{} { var returns []interface{} _jsii_.Get( a, @@ -2965,7 +3078,7 @@ func (a *allTypes) UnknownArrayProperty() []interface{} { return returns } -func (a *allTypes) UnknownMapProperty() map[string]interface{} { +func (a *allTypes_jsiiProxy) UnknownMapProperty() map[string]interface{} { var returns map[string]interface{} _jsii_.Get( a, @@ -2975,7 +3088,7 @@ func (a *allTypes) UnknownMapProperty() map[string]interface{} { return returns } -func (a *allTypes) UnknownProperty() interface{} { +func (a *allTypes_jsiiProxy) UnknownProperty() interface{} { var returns interface{} _jsii_.Get( a, @@ -2988,19 +3101,21 @@ func (a *allTypes) UnknownProperty() interface{} { func NewAllTypes() AllTypes { _init_.Initialize() - a := allTypes{} + + a := allTypes_jsiiProxy{} _jsii_.Create( "jsii-calc.AllTypes", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &a, ) + return &a } -func (a *allTypes) SetAnyArrayProperty(val []interface{}) { +func (a *allTypes_jsiiProxy) SetAnyArrayProperty(val []interface{}) { _jsii_.Set( a, "anyArrayProperty", @@ -3008,7 +3123,7 @@ func (a *allTypes) SetAnyArrayProperty(val []interface{}) { ) } -func (a *allTypes) SetAnyMapProperty(val map[string]interface{}) { +func (a *allTypes_jsiiProxy) SetAnyMapProperty(val map[string]interface{}) { _jsii_.Set( a, "anyMapProperty", @@ -3016,7 +3131,7 @@ func (a *allTypes) SetAnyMapProperty(val map[string]interface{}) { ) } -func (a *allTypes) SetAnyProperty(val interface{}) { +func (a *allTypes_jsiiProxy) SetAnyProperty(val interface{}) { _jsii_.Set( a, "anyProperty", @@ -3024,7 +3139,7 @@ func (a *allTypes) SetAnyProperty(val interface{}) { ) } -func (a *allTypes) SetArrayProperty(val []string) { +func (a *allTypes_jsiiProxy) SetArrayProperty(val []string) { _jsii_.Set( a, "arrayProperty", @@ -3032,7 +3147,7 @@ func (a *allTypes) SetArrayProperty(val []string) { ) } -func (a *allTypes) SetBooleanProperty(val bool) { +func (a *allTypes_jsiiProxy) SetBooleanProperty(val bool) { _jsii_.Set( a, "booleanProperty", @@ -3040,7 +3155,7 @@ func (a *allTypes) SetBooleanProperty(val bool) { ) } -func (a *allTypes) SetDateProperty(val string) { +func (a *allTypes_jsiiProxy) SetDateProperty(val string) { _jsii_.Set( a, "dateProperty", @@ -3048,7 +3163,7 @@ func (a *allTypes) SetDateProperty(val string) { ) } -func (a *allTypes) SetEnumProperty(val AllTypesEnum) { +func (a *allTypes_jsiiProxy) SetEnumProperty(val AllTypesEnum) { _jsii_.Set( a, "enumProperty", @@ -3056,7 +3171,7 @@ func (a *allTypes) SetEnumProperty(val AllTypesEnum) { ) } -func (a *allTypes) SetJsonProperty(val map[string]interface{}) { +func (a *allTypes_jsiiProxy) SetJsonProperty(val map[string]interface{}) { _jsii_.Set( a, "jsonProperty", @@ -3064,7 +3179,7 @@ func (a *allTypes) SetJsonProperty(val map[string]interface{}) { ) } -func (a *allTypes) SetMapProperty(val map[string]scopejsiicalclib.Number) { +func (a *allTypes_jsiiProxy) SetMapProperty(val map[string]scopejsiicalclib.Number) { _jsii_.Set( a, "mapProperty", @@ -3072,7 +3187,7 @@ func (a *allTypes) SetMapProperty(val map[string]scopejsiicalclib.Number) { ) } -func (a *allTypes) SetNumberProperty(val float64) { +func (a *allTypes_jsiiProxy) SetNumberProperty(val float64) { _jsii_.Set( a, "numberProperty", @@ -3080,7 +3195,7 @@ func (a *allTypes) SetNumberProperty(val float64) { ) } -func (a *allTypes) SetOptionalEnumValue(val StringEnum) { +func (a *allTypes_jsiiProxy) SetOptionalEnumValue(val StringEnum) { _jsii_.Set( a, "optionalEnumValue", @@ -3088,7 +3203,7 @@ func (a *allTypes) SetOptionalEnumValue(val StringEnum) { ) } -func (a *allTypes) SetStringProperty(val string) { +func (a *allTypes_jsiiProxy) SetStringProperty(val string) { _jsii_.Set( a, "stringProperty", @@ -3096,7 +3211,7 @@ func (a *allTypes) SetStringProperty(val string) { ) } -func (a *allTypes) SetUnionArrayProperty(val []interface{}) { +func (a *allTypes_jsiiProxy) SetUnionArrayProperty(val []interface{}) { _jsii_.Set( a, "unionArrayProperty", @@ -3104,7 +3219,7 @@ func (a *allTypes) SetUnionArrayProperty(val []interface{}) { ) } -func (a *allTypes) SetUnionMapProperty(val map[string]interface{}) { +func (a *allTypes_jsiiProxy) SetUnionMapProperty(val map[string]interface{}) { _jsii_.Set( a, "unionMapProperty", @@ -3112,7 +3227,7 @@ func (a *allTypes) SetUnionMapProperty(val map[string]interface{}) { ) } -func (a *allTypes) SetUnionProperty(val interface{}) { +func (a *allTypes_jsiiProxy) SetUnionProperty(val interface{}) { _jsii_.Set( a, "unionProperty", @@ -3120,7 +3235,7 @@ func (a *allTypes) SetUnionProperty(val interface{}) { ) } -func (a *allTypes) SetUnknownArrayProperty(val []interface{}) { +func (a *allTypes_jsiiProxy) SetUnknownArrayProperty(val []interface{}) { _jsii_.Set( a, "unknownArrayProperty", @@ -3128,7 +3243,7 @@ func (a *allTypes) SetUnknownArrayProperty(val []interface{}) { ) } -func (a *allTypes) SetUnknownMapProperty(val map[string]interface{}) { +func (a *allTypes_jsiiProxy) SetUnknownMapProperty(val map[string]interface{}) { _jsii_.Set( a, "unknownMapProperty", @@ -3136,7 +3251,7 @@ func (a *allTypes) SetUnknownMapProperty(val map[string]interface{}) { ) } -func (a *allTypes) SetUnknownProperty(val interface{}) { +func (a *allTypes_jsiiProxy) SetUnknownProperty(val interface{}) { _jsii_.Set( a, "unknownProperty", @@ -3144,38 +3259,37 @@ func (a *allTypes) SetUnknownProperty(val interface{}) { ) } -func (a *allTypes) AnyIn(inp interface{}) { - var returns interface{} - _jsii_.Invoke( +func (a *allTypes_jsiiProxy) AnyIn(inp interface{}) { + _jsii_.InvokeVoid( a, "anyIn", []interface{}{inp}, - false, - &returns, ) } -func (a *allTypes) AnyOut() interface{} { +func (a *allTypes_jsiiProxy) AnyOut() interface{} { var returns interface{} + _jsii_.Invoke( a, "anyOut", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } -func (a *allTypes) EnumMethod(value StringEnum) StringEnum { +func (a *allTypes_jsiiProxy) EnumMethod(value StringEnum) StringEnum { var returns StringEnum + _jsii_.Invoke( a, "enumMethod", []interface{}{value}, - true, &returns, ) + return returns } @@ -3195,68 +3309,62 @@ type AllowedMethodNames interface { } // The jsii proxy struct for AllowedMethodNames -type allowedMethodNames struct { +type allowedMethodNames_jsiiProxy struct { _ byte // padding } func NewAllowedMethodNames() AllowedMethodNames { _init_.Initialize() - a := allowedMethodNames{} + + a := allowedMethodNames_jsiiProxy{} _jsii_.Create( "jsii-calc.AllowedMethodNames", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &a, ) + return &a } -func (a *allowedMethodNames) GetBar(_p1 string, _p2 float64) { - var returns interface{} - _jsii_.Invoke( +func (a *allowedMethodNames_jsiiProxy) GetBar(_p1 string, _p2 float64) { + _jsii_.InvokeVoid( a, "getBar", []interface{}{_p1, _p2}, - false, - &returns, ) } // getXxx() is not allowed (see negatives), but getXxx(a, ...) is okay. -func (a *allowedMethodNames) GetFoo(withParam string) string { +func (a *allowedMethodNames_jsiiProxy) GetFoo(withParam string) string { var returns string + _jsii_.Invoke( a, "getFoo", []interface{}{withParam}, - true, &returns, ) + return returns } -func (a *allowedMethodNames) SetBar(_x string, _y float64, _z bool) { - var returns interface{} - _jsii_.Invoke( +func (a *allowedMethodNames_jsiiProxy) SetBar(_x string, _y float64, _z bool) { + _jsii_.InvokeVoid( a, "setBar", []interface{}{_x, _y, _z}, - false, - &returns, ) } // setFoo(x) is not allowed (see negatives), but setXxx(a, b, ...) is okay. -func (a *allowedMethodNames) SetFoo(_x string, _y float64) { - var returns interface{} - _jsii_.Invoke( +func (a *allowedMethodNames_jsiiProxy) SetFoo(_x string, _y float64) { + _jsii_.InvokeVoid( a, "setFoo", []interface{}{_x, _y}, - false, - &returns, ) } @@ -3266,11 +3374,11 @@ type AmbiguousParameters interface { } // The jsii proxy struct for AmbiguousParameters -type ambiguousParameters struct { +type ambiguousParameters_jsiiProxy struct { _ byte // padding } -func (a *ambiguousParameters) Props() StructParameterType { +func (a *ambiguousParameters_jsiiProxy) Props() StructParameterType { var returns StructParameterType _jsii_.Get( a, @@ -3280,7 +3388,7 @@ func (a *ambiguousParameters) Props() StructParameterType { return returns } -func (a *ambiguousParameters) Scope() Bell { +func (a *ambiguousParameters_jsiiProxy) Scope() Bell { var returns Bell _jsii_.Get( a, @@ -3293,15 +3401,17 @@ func (a *ambiguousParameters) Scope() Bell { func NewAmbiguousParameters(scope Bell, props StructParameterType) AmbiguousParameters { _init_.Initialize() - a := ambiguousParameters{} + + a := ambiguousParameters_jsiiProxy{} _jsii_.Create( "jsii-calc.AmbiguousParameters", []interface{}{scope, props}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &a, ) + return &a } @@ -3312,45 +3422,49 @@ type AnonymousImplementationProvider interface { } // The jsii proxy struct for AnonymousImplementationProvider -type anonymousImplementationProvider struct { - iAnonymousImplementationProvider // implements jsii-calc.IAnonymousImplementationProvider +type anonymousImplementationProvider_jsiiProxy struct { + iAnonymousImplementationProvider_jsiiProxy // implements jsii-calc.IAnonymousImplementationProvider } func NewAnonymousImplementationProvider() AnonymousImplementationProvider { _init_.Initialize() - a := anonymousImplementationProvider{} + + a := anonymousImplementationProvider_jsiiProxy{} _jsii_.Create( "jsii-calc.AnonymousImplementationProvider", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{"jsii-calc.IAnonymousImplementationProvider"}, - []_jsii_.Override{}, + nil, // no overrides &a, ) + return &a } -func (a *anonymousImplementationProvider) ProvideAsClass() Implementation { +func (a *anonymousImplementationProvider_jsiiProxy) ProvideAsClass() Implementation { var returns Implementation + _jsii_.Invoke( a, "provideAsClass", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } -func (a *anonymousImplementationProvider) ProvideAsInterface() IAnonymouslyImplementMe { +func (a *anonymousImplementationProvider_jsiiProxy) ProvideAsInterface() IAnonymouslyImplementMe { var returns IAnonymouslyImplementMe + _jsii_.Invoke( a, "provideAsInterface", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -3364,46 +3478,50 @@ type AsyncVirtualMethods interface { } // The jsii proxy struct for AsyncVirtualMethods -type asyncVirtualMethods struct { +type asyncVirtualMethods_jsiiProxy struct { _ byte // padding } func NewAsyncVirtualMethods() AsyncVirtualMethods { _init_.Initialize() - a := asyncVirtualMethods{} + + a := asyncVirtualMethods_jsiiProxy{} _jsii_.Create( "jsii-calc.AsyncVirtualMethods", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &a, ) + return &a } -func (a *asyncVirtualMethods) CallMe() float64 { +func (a *asyncVirtualMethods_jsiiProxy) CallMe() float64 { var returns float64 + _jsii_.Invoke( a, "callMe", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } // Just calls "overrideMeToo". -func (a *asyncVirtualMethods) CallMe2() float64 { +func (a *asyncVirtualMethods_jsiiProxy) CallMe2() float64 { var returns float64 + _jsii_.Invoke( a, "callMe2", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -3412,51 +3530,55 @@ func (a *asyncVirtualMethods) CallMe2() float64 { // This is a "double promise" situation, which // means that callbacks are not going to be available immediate, but only // after an "immediates" cycle. -func (a *asyncVirtualMethods) CallMeDoublePromise() float64 { +func (a *asyncVirtualMethods_jsiiProxy) CallMeDoublePromise() float64 { var returns float64 + _jsii_.Invoke( a, "callMeDoublePromise", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } -func (a *asyncVirtualMethods) DontOverrideMe() float64 { +func (a *asyncVirtualMethods_jsiiProxy) DontOverrideMe() float64 { var returns float64 + _jsii_.Invoke( a, "dontOverrideMe", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } -func (a *asyncVirtualMethods) OverrideMe(mult float64) float64 { +func (a *asyncVirtualMethods_jsiiProxy) OverrideMe(mult float64) float64 { var returns float64 + _jsii_.Invoke( a, "overrideMe", []interface{}{mult}, - true, &returns, ) + return returns } -func (a *asyncVirtualMethods) OverrideMeToo() float64 { +func (a *asyncVirtualMethods_jsiiProxy) OverrideMeToo() float64 { var returns float64 + _jsii_.Invoke( a, "overrideMeToo", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -3466,43 +3588,39 @@ type AugmentableClass interface { } // The jsii proxy struct for AugmentableClass -type augmentableClass struct { +type augmentableClass_jsiiProxy struct { _ byte // padding } func NewAugmentableClass() AugmentableClass { _init_.Initialize() - a := augmentableClass{} + + a := augmentableClass_jsiiProxy{} _jsii_.Create( "jsii-calc.AugmentableClass", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &a, ) + return &a } -func (a *augmentableClass) MethodOne() { - var returns interface{} - _jsii_.Invoke( +func (a *augmentableClass_jsiiProxy) MethodOne() { + _jsii_.InvokeVoid( a, "methodOne", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (a *augmentableClass) MethodTwo() { - var returns interface{} - _jsii_.Invoke( +func (a *augmentableClass_jsiiProxy) MethodTwo() { + _jsii_.InvokeVoid( a, "methodTwo", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } @@ -3510,21 +3628,23 @@ type BaseJsii976 interface { } // The jsii proxy struct for BaseJsii976 -type baseJsii976 struct { +type baseJsii976_jsiiProxy struct { _ byte // padding } func NewBaseJsii976() BaseJsii976 { _init_.Initialize() - b := baseJsii976{} + + b := baseJsii976_jsiiProxy{} _jsii_.Create( "jsii-calc.BaseJsii976", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &b, ) + return &b } @@ -3536,11 +3656,11 @@ type Bell interface { } // The jsii proxy struct for Bell -type bell struct { - iBell // implements jsii-calc.IBell +type bell_jsiiProxy struct { + iBell_jsiiProxy // implements jsii-calc.IBell } -func (b *bell) Rung() bool { +func (b *bell_jsiiProxy) Rung() bool { var returns bool _jsii_.Get( b, @@ -3553,19 +3673,21 @@ func (b *bell) Rung() bool { func NewBell() Bell { _init_.Initialize() - b := bell{} + + b := bell_jsiiProxy{} _jsii_.Create( "jsii-calc.Bell", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{"jsii-calc.IBell"}, - []_jsii_.Override{}, + nil, // no overrides &b, ) + return &b } -func (b *bell) SetRung(val bool) { +func (b *bell_jsiiProxy) SetRung(val bool) { _jsii_.Set( b, "rung", @@ -3573,14 +3695,11 @@ func (b *bell) SetRung(val bool) { ) } -func (b *bell) Ring() { - var returns interface{} - _jsii_.Invoke( +func (b *bell_jsiiProxy) Ring() { + _jsii_.InvokeVoid( b, "ring", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } @@ -3594,12 +3713,12 @@ type BinaryOperation interface { } // The jsii proxy struct for BinaryOperation -type binaryOperation struct { +type binaryOperation_jsiiProxy struct { scopejsiicalclib.Operation // extends @scope/jsii-calc-lib.Operation scopejsiicalclib.IFriendly // implements @scope/jsii-calc-lib.IFriendly } -func (b *binaryOperation) Lhs() scopejsiicalclib.NumericValue { +func (b *binaryOperation_jsiiProxy) Lhs() scopejsiicalclib.NumericValue { var returns scopejsiicalclib.NumericValue _jsii_.Get( b, @@ -3609,7 +3728,7 @@ func (b *binaryOperation) Lhs() scopejsiicalclib.NumericValue { return returns } -func (b *binaryOperation) Rhs() scopejsiicalclib.NumericValue { +func (b *binaryOperation_jsiiProxy) Rhs() scopejsiicalclib.NumericValue { var returns scopejsiicalclib.NumericValue _jsii_.Get( b, @@ -3619,7 +3738,7 @@ func (b *binaryOperation) Rhs() scopejsiicalclib.NumericValue { return returns } -func (b *binaryOperation) Value() float64 { +func (b *binaryOperation_jsiiProxy) Value() float64 { var returns float64 _jsii_.Get( b, @@ -3633,55 +3752,60 @@ func (b *binaryOperation) Value() float64 { // Creates a BinaryOperation. func NewBinaryOperation(lhs scopejsiicalclib.NumericValue, rhs scopejsiicalclib.NumericValue) BinaryOperation { _init_.Initialize() - b := binaryOperation{} + + b := binaryOperation_jsiiProxy{} _jsii_.Create( "jsii-calc.BinaryOperation", []interface{}{lhs, rhs}, []_jsii_.FQN{"@scope/jsii-calc-lib.IFriendly"}, - []_jsii_.Override{}, + nil, // no overrides &b, ) + return &b } // (deprecated) Say hello! -func (b *binaryOperation) Hello() string { +func (b *binaryOperation_jsiiProxy) Hello() string { var returns string + _jsii_.Invoke( b, "hello", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } // String representation of the value. // Deprecated. -func (b *binaryOperation) ToString() string { +func (b *binaryOperation_jsiiProxy) ToString() string { var returns string + _jsii_.Invoke( b, "toString", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } // Returns: the name of the class (to verify native type names are created for derived classes). -func (b *binaryOperation) TypeName() interface{} { +func (b *binaryOperation_jsiiProxy) TypeName() interface{} { var returns interface{} + _jsii_.Invoke( b, "typeName", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -3692,48 +3816,52 @@ type BurriedAnonymousObject interface { } // The jsii proxy struct for BurriedAnonymousObject -type burriedAnonymousObject struct { +type burriedAnonymousObject_jsiiProxy struct { _ byte // padding } func NewBurriedAnonymousObject() BurriedAnonymousObject { _init_.Initialize() - b := burriedAnonymousObject{} + + b := burriedAnonymousObject_jsiiProxy{} _jsii_.Create( "jsii-calc.BurriedAnonymousObject", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &b, ) + return &b } -func (b *burriedAnonymousObject) Check() bool { +func (b *burriedAnonymousObject_jsiiProxy) Check() bool { var returns bool + _jsii_.Invoke( b, "check", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } // Implement this method and have it return it's parameter. // // Returns: \`value\` -func (b *burriedAnonymousObject) GiveItBack(value interface{}) interface{} { +func (b *burriedAnonymousObject_jsiiProxy) GiveItBack(value interface{}) interface{} { var returns interface{} + _jsii_.Invoke( b, "giveItBack", []interface{}{value}, - true, &returns, ) + return returns } @@ -3771,11 +3899,11 @@ type Calculator interface { } // The jsii proxy struct for Calculator -type calculator struct { +type calculator_jsiiProxy struct { composition.CompositeOperation // extends jsii-calc.composition.CompositeOperation } -func (c *calculator) Curr() scopejsiicalclib.NumericValue { +func (c *calculator_jsiiProxy) Curr() scopejsiicalclib.NumericValue { var returns scopejsiicalclib.NumericValue _jsii_.Get( c, @@ -3785,7 +3913,7 @@ func (c *calculator) Curr() scopejsiicalclib.NumericValue { return returns } -func (c *calculator) Expression() scopejsiicalclib.NumericValue { +func (c *calculator_jsiiProxy) Expression() scopejsiicalclib.NumericValue { var returns scopejsiicalclib.NumericValue _jsii_.Get( c, @@ -3795,7 +3923,7 @@ func (c *calculator) Expression() scopejsiicalclib.NumericValue { return returns } -func (c *calculator) MaxValue() float64 { +func (c *calculator_jsiiProxy) MaxValue() float64 { var returns float64 _jsii_.Get( c, @@ -3805,7 +3933,7 @@ func (c *calculator) MaxValue() float64 { return returns } -func (c *calculator) OperationsLog() []scopejsiicalclib.NumericValue { +func (c *calculator_jsiiProxy) OperationsLog() []scopejsiicalclib.NumericValue { var returns []scopejsiicalclib.NumericValue _jsii_.Get( c, @@ -3815,7 +3943,7 @@ func (c *calculator) OperationsLog() []scopejsiicalclib.NumericValue { return returns } -func (c *calculator) OperationsMap() map[string][]scopejsiicalclib.NumericValue { +func (c *calculator_jsiiProxy) OperationsMap() map[string][]scopejsiicalclib.NumericValue { var returns map[string][]scopejsiicalclib.NumericValue _jsii_.Get( c, @@ -3825,7 +3953,7 @@ func (c *calculator) OperationsMap() map[string][]scopejsiicalclib.NumericValue return returns } -func (c *calculator) UnionProperty() interface{} { +func (c *calculator_jsiiProxy) UnionProperty() interface{} { var returns interface{} _jsii_.Get( c, @@ -3839,19 +3967,21 @@ func (c *calculator) UnionProperty() interface{} { // Creates a Calculator object. func NewCalculator(props CalculatorProps) Calculator { _init_.Initialize() - c := calculator{} + + c := calculator_jsiiProxy{} _jsii_.Create( "jsii-calc.Calculator", []interface{}{props}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &c, ) + return &c } -func (c *calculator) SetCurr(val scopejsiicalclib.NumericValue) { +func (c *calculator_jsiiProxy) SetCurr(val scopejsiicalclib.NumericValue) { _jsii_.Set( c, "curr", @@ -3859,7 +3989,7 @@ func (c *calculator) SetCurr(val scopejsiicalclib.NumericValue) { ) } -func (c *calculator) SetMaxValue(val float64) { +func (c *calculator_jsiiProxy) SetMaxValue(val float64) { _jsii_.Set( c, "maxValue", @@ -3867,7 +3997,7 @@ func (c *calculator) SetMaxValue(val float64) { ) } -func (c *calculator) SetUnionProperty(val interface{}) { +func (c *calculator_jsiiProxy) SetUnionProperty(val interface{}) { _jsii_.Set( c, "unionProperty", @@ -3876,63 +4006,52 @@ func (c *calculator) SetUnionProperty(val interface{}) { } // Adds a number to the current value. -func (c *calculator) Add(value float64) { - var returns interface{} - _jsii_.Invoke( +func (c *calculator_jsiiProxy) Add(value float64) { + _jsii_.InvokeVoid( c, "add", []interface{}{value}, - false, - &returns, ) } // Multiplies the current value by a number. -func (c *calculator) Mul(value float64) { - var returns interface{} - _jsii_.Invoke( +func (c *calculator_jsiiProxy) Mul(value float64) { + _jsii_.InvokeVoid( c, "mul", []interface{}{value}, - false, - &returns, ) } // Negates the current value. -func (c *calculator) Neg() { - var returns interface{} - _jsii_.Invoke( +func (c *calculator_jsiiProxy) Neg() { + _jsii_.InvokeVoid( c, "neg", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } // Raises the current value by a power. -func (c *calculator) Pow(value float64) { - var returns interface{} - _jsii_.Invoke( +func (c *calculator_jsiiProxy) Pow(value float64) { + _jsii_.InvokeVoid( c, "pow", []interface{}{value}, - false, - &returns, ) } // Returns teh value of the union property (if defined). -func (c *calculator) ReadUnionValue() float64 { +func (c *calculator_jsiiProxy) ReadUnionValue() float64 { var returns float64 + _jsii_.Invoke( c, "readUnionValue", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -3971,11 +4090,11 @@ type ClassThatImplementsTheInternalInterface interface { } // The jsii proxy struct for ClassThatImplementsTheInternalInterface -type classThatImplementsTheInternalInterface struct { - iNonInternalInterface // implements jsii-calc.INonInternalInterface +type classThatImplementsTheInternalInterface_jsiiProxy struct { + iNonInternalInterface_jsiiProxy // implements jsii-calc.INonInternalInterface } -func (c *classThatImplementsTheInternalInterface) A() string { +func (c *classThatImplementsTheInternalInterface_jsiiProxy) A() string { var returns string _jsii_.Get( c, @@ -3985,7 +4104,7 @@ func (c *classThatImplementsTheInternalInterface) A() string { return returns } -func (c *classThatImplementsTheInternalInterface) B() string { +func (c *classThatImplementsTheInternalInterface_jsiiProxy) B() string { var returns string _jsii_.Get( c, @@ -3995,7 +4114,7 @@ func (c *classThatImplementsTheInternalInterface) B() string { return returns } -func (c *classThatImplementsTheInternalInterface) C() string { +func (c *classThatImplementsTheInternalInterface_jsiiProxy) C() string { var returns string _jsii_.Get( c, @@ -4005,7 +4124,7 @@ func (c *classThatImplementsTheInternalInterface) C() string { return returns } -func (c *classThatImplementsTheInternalInterface) D() string { +func (c *classThatImplementsTheInternalInterface_jsiiProxy) D() string { var returns string _jsii_.Get( c, @@ -4018,19 +4137,21 @@ func (c *classThatImplementsTheInternalInterface) D() string { func NewClassThatImplementsTheInternalInterface() ClassThatImplementsTheInternalInterface { _init_.Initialize() - c := classThatImplementsTheInternalInterface{} + + c := classThatImplementsTheInternalInterface_jsiiProxy{} _jsii_.Create( "jsii-calc.ClassThatImplementsTheInternalInterface", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{"jsii-calc.INonInternalInterface"}, - []_jsii_.Override{}, + nil, // no overrides &c, ) + return &c } -func (c *classThatImplementsTheInternalInterface) SetA(val string) { +func (c *classThatImplementsTheInternalInterface_jsiiProxy) SetA(val string) { _jsii_.Set( c, "a", @@ -4038,7 +4159,7 @@ func (c *classThatImplementsTheInternalInterface) SetA(val string) { ) } -func (c *classThatImplementsTheInternalInterface) SetB(val string) { +func (c *classThatImplementsTheInternalInterface_jsiiProxy) SetB(val string) { _jsii_.Set( c, "b", @@ -4046,7 +4167,7 @@ func (c *classThatImplementsTheInternalInterface) SetB(val string) { ) } -func (c *classThatImplementsTheInternalInterface) SetC(val string) { +func (c *classThatImplementsTheInternalInterface_jsiiProxy) SetC(val string) { _jsii_.Set( c, "c", @@ -4054,7 +4175,7 @@ func (c *classThatImplementsTheInternalInterface) SetC(val string) { ) } -func (c *classThatImplementsTheInternalInterface) SetD(val string) { +func (c *classThatImplementsTheInternalInterface_jsiiProxy) SetD(val string) { _jsii_.Set( c, "d", @@ -4075,11 +4196,11 @@ type ClassThatImplementsThePrivateInterface interface { } // The jsii proxy struct for ClassThatImplementsThePrivateInterface -type classThatImplementsThePrivateInterface struct { - iNonInternalInterface // implements jsii-calc.INonInternalInterface +type classThatImplementsThePrivateInterface_jsiiProxy struct { + iNonInternalInterface_jsiiProxy // implements jsii-calc.INonInternalInterface } -func (c *classThatImplementsThePrivateInterface) A() string { +func (c *classThatImplementsThePrivateInterface_jsiiProxy) A() string { var returns string _jsii_.Get( c, @@ -4089,7 +4210,7 @@ func (c *classThatImplementsThePrivateInterface) A() string { return returns } -func (c *classThatImplementsThePrivateInterface) B() string { +func (c *classThatImplementsThePrivateInterface_jsiiProxy) B() string { var returns string _jsii_.Get( c, @@ -4099,7 +4220,7 @@ func (c *classThatImplementsThePrivateInterface) B() string { return returns } -func (c *classThatImplementsThePrivateInterface) C() string { +func (c *classThatImplementsThePrivateInterface_jsiiProxy) C() string { var returns string _jsii_.Get( c, @@ -4109,7 +4230,7 @@ func (c *classThatImplementsThePrivateInterface) C() string { return returns } -func (c *classThatImplementsThePrivateInterface) E() string { +func (c *classThatImplementsThePrivateInterface_jsiiProxy) E() string { var returns string _jsii_.Get( c, @@ -4122,19 +4243,21 @@ func (c *classThatImplementsThePrivateInterface) E() string { func NewClassThatImplementsThePrivateInterface() ClassThatImplementsThePrivateInterface { _init_.Initialize() - c := classThatImplementsThePrivateInterface{} + + c := classThatImplementsThePrivateInterface_jsiiProxy{} _jsii_.Create( "jsii-calc.ClassThatImplementsThePrivateInterface", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{"jsii-calc.INonInternalInterface"}, - []_jsii_.Override{}, + nil, // no overrides &c, ) + return &c } -func (c *classThatImplementsThePrivateInterface) SetA(val string) { +func (c *classThatImplementsThePrivateInterface_jsiiProxy) SetA(val string) { _jsii_.Set( c, "a", @@ -4142,7 +4265,7 @@ func (c *classThatImplementsThePrivateInterface) SetA(val string) { ) } -func (c *classThatImplementsThePrivateInterface) SetB(val string) { +func (c *classThatImplementsThePrivateInterface_jsiiProxy) SetB(val string) { _jsii_.Set( c, "b", @@ -4150,7 +4273,7 @@ func (c *classThatImplementsThePrivateInterface) SetB(val string) { ) } -func (c *classThatImplementsThePrivateInterface) SetC(val string) { +func (c *classThatImplementsThePrivateInterface_jsiiProxy) SetC(val string) { _jsii_.Set( c, "c", @@ -4158,7 +4281,7 @@ func (c *classThatImplementsThePrivateInterface) SetC(val string) { ) } -func (c *classThatImplementsThePrivateInterface) SetE(val string) { +func (c *classThatImplementsThePrivateInterface_jsiiProxy) SetE(val string) { _jsii_.Set( c, "e", @@ -4174,11 +4297,11 @@ type ClassWithCollections interface { } // The jsii proxy struct for ClassWithCollections -type classWithCollections struct { +type classWithCollections_jsiiProxy struct { _ byte // padding } -func (c *classWithCollections) Array() []string { +func (c *classWithCollections_jsiiProxy) Array() []string { var returns []string _jsii_.Get( c, @@ -4188,7 +4311,7 @@ func (c *classWithCollections) Array() []string { return returns } -func (c *classWithCollections) Map() map[string]string { +func (c *classWithCollections_jsiiProxy) Map() map[string]string { var returns map[string]string _jsii_.Get( c, @@ -4201,19 +4324,21 @@ func (c *classWithCollections) Map() map[string]string { func NewClassWithCollections(map_ map[string]string, array []string) ClassWithCollections { _init_.Initialize() - c := classWithCollections{} + + c := classWithCollections_jsiiProxy{} _jsii_.Create( "jsii-calc.ClassWithCollections", []interface{}{map_, array}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &c, ) + return &c } -func (c *classWithCollections) SetArray(val []string) { +func (c *classWithCollections_jsiiProxy) SetArray(val []string) { _jsii_.Set( c, "array", @@ -4221,7 +4346,7 @@ func (c *classWithCollections) SetArray(val []string) { ) } -func (c *classWithCollections) SetMap(val map[string]string) { +func (c *classWithCollections_jsiiProxy) SetMap(val map[string]string) { _jsii_.Set( c, "map", @@ -4231,27 +4356,31 @@ func (c *classWithCollections) SetMap(val map[string]string) { func ClassWithCollections_CreateAList() []string { _init_.Initialize() + var returns []string + _jsii_.StaticInvoke( "jsii-calc.ClassWithCollections", "createAList", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } func ClassWithCollections_CreateAMap() map[string]string { _init_.Initialize() + var returns map[string]string + _jsii_.StaticInvoke( "jsii-calc.ClassWithCollections", "createAMap", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -4307,21 +4436,23 @@ type ClassWithDocs interface { } // The jsii proxy struct for ClassWithDocs -type classWithDocs struct { +type classWithDocs_jsiiProxy struct { _ byte // padding } func NewClassWithDocs() ClassWithDocs { _init_.Initialize() - c := classWithDocs{} + + c := classWithDocs_jsiiProxy{} _jsii_.Create( "jsii-calc.ClassWithDocs", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &c, ) + return &c } @@ -4331,11 +4462,11 @@ type ClassWithJavaReservedWords interface { } // The jsii proxy struct for ClassWithJavaReservedWords -type classWithJavaReservedWords struct { +type classWithJavaReservedWords_jsiiProxy struct { _ byte // padding } -func (c *classWithJavaReservedWords) Int() string { +func (c *classWithJavaReservedWords_jsiiProxy) Int() string { var returns string _jsii_.Get( c, @@ -4348,27 +4479,30 @@ func (c *classWithJavaReservedWords) Int() string { func NewClassWithJavaReservedWords(int string) ClassWithJavaReservedWords { _init_.Initialize() - c := classWithJavaReservedWords{} + + c := classWithJavaReservedWords_jsiiProxy{} _jsii_.Create( "jsii-calc.ClassWithJavaReservedWords", []interface{}{int}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &c, ) + return &c } -func (c *classWithJavaReservedWords) Import(assert string) string { +func (c *classWithJavaReservedWords_jsiiProxy) Import(assert string) string { var returns string + _jsii_.Invoke( c, "import", []interface{}{assert}, - true, &returns, ) + return returns } @@ -4378,11 +4512,11 @@ type ClassWithMutableObjectLiteralProperty interface { } // The jsii proxy struct for ClassWithMutableObjectLiteralProperty -type classWithMutableObjectLiteralProperty struct { +type classWithMutableObjectLiteralProperty_jsiiProxy struct { _ byte // padding } -func (c *classWithMutableObjectLiteralProperty) MutableObject() IMutableObjectLiteral { +func (c *classWithMutableObjectLiteralProperty_jsiiProxy) MutableObject() IMutableObjectLiteral { var returns IMutableObjectLiteral _jsii_.Get( c, @@ -4395,19 +4529,21 @@ func (c *classWithMutableObjectLiteralProperty) MutableObject() IMutableObjectLi func NewClassWithMutableObjectLiteralProperty() ClassWithMutableObjectLiteralProperty { _init_.Initialize() - c := classWithMutableObjectLiteralProperty{} + + c := classWithMutableObjectLiteralProperty_jsiiProxy{} _jsii_.Create( "jsii-calc.ClassWithMutableObjectLiteralProperty", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &c, ) + return &c } -func (c *classWithMutableObjectLiteralProperty) SetMutableObject(val IMutableObjectLiteral) { +func (c *classWithMutableObjectLiteralProperty_jsiiProxy) SetMutableObject(val IMutableObjectLiteral) { _jsii_.Set( c, "mutableObject", @@ -4424,11 +4560,11 @@ type ClassWithPrivateConstructorAndAutomaticProperties interface { } // The jsii proxy struct for ClassWithPrivateConstructorAndAutomaticProperties -type classWithPrivateConstructorAndAutomaticProperties struct { - iInterfaceWithProperties // implements jsii-calc.IInterfaceWithProperties +type classWithPrivateConstructorAndAutomaticProperties_jsiiProxy struct { + iInterfaceWithProperties_jsiiProxy // implements jsii-calc.IInterfaceWithProperties } -func (c *classWithPrivateConstructorAndAutomaticProperties) ReadOnlyString() string { +func (c *classWithPrivateConstructorAndAutomaticProperties_jsiiProxy) ReadOnlyString() string { var returns string _jsii_.Get( c, @@ -4438,7 +4574,7 @@ func (c *classWithPrivateConstructorAndAutomaticProperties) ReadOnlyString() str return returns } -func (c *classWithPrivateConstructorAndAutomaticProperties) ReadWriteString() string { +func (c *classWithPrivateConstructorAndAutomaticProperties_jsiiProxy) ReadWriteString() string { var returns string _jsii_.Get( c, @@ -4449,7 +4585,7 @@ func (c *classWithPrivateConstructorAndAutomaticProperties) ReadWriteString() st } -func (c *classWithPrivateConstructorAndAutomaticProperties) SetReadWriteString(val string) { +func (c *classWithPrivateConstructorAndAutomaticProperties_jsiiProxy) SetReadWriteString(val string) { _jsii_.Set( c, "readWriteString", @@ -4459,14 +4595,16 @@ func (c *classWithPrivateConstructorAndAutomaticProperties) SetReadWriteString(v func ClassWithPrivateConstructorAndAutomaticProperties_Create(readOnlyString string, readWriteString string) ClassWithPrivateConstructorAndAutomaticProperties { _init_.Initialize() + var returns ClassWithPrivateConstructorAndAutomaticProperties + _jsii_.StaticInvoke( "jsii-calc.ClassWithPrivateConstructorAndAutomaticProperties", "create", []interface{}{readOnlyString, readWriteString}, - true, &returns, ) + return returns } @@ -4479,11 +4617,11 @@ type ConfusingToJackson interface { } // The jsii proxy struct for ConfusingToJackson -type confusingToJackson struct { +type confusingToJackson_jsiiProxy struct { _ byte // padding } -func (c *confusingToJackson) UnionProperty() interface{} { +func (c *confusingToJackson_jsiiProxy) UnionProperty() interface{} { var returns interface{} _jsii_.Get( c, @@ -4494,7 +4632,7 @@ func (c *confusingToJackson) UnionProperty() interface{} { } -func (c *confusingToJackson) SetUnionProperty(val interface{}) { +func (c *confusingToJackson_jsiiProxy) SetUnionProperty(val interface{}) { _jsii_.Set( c, "unionProperty", @@ -4504,27 +4642,31 @@ func (c *confusingToJackson) SetUnionProperty(val interface{}) { func ConfusingToJackson_MakeInstance() ConfusingToJackson { _init_.Initialize() + var returns ConfusingToJackson + _jsii_.StaticInvoke( "jsii-calc.ConfusingToJackson", "makeInstance", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } func ConfusingToJackson_MakeStructInstance() ConfusingToJacksonStruct { _init_.Initialize() + var returns ConfusingToJacksonStruct + _jsii_.StaticInvoke( "jsii-calc.ConfusingToJackson", "makeStructInstance", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -4536,21 +4678,23 @@ type ConstructorPassesThisOut interface { } // The jsii proxy struct for ConstructorPassesThisOut -type constructorPassesThisOut struct { +type constructorPassesThisOut_jsiiProxy struct { _ byte // padding } func NewConstructorPassesThisOut(consumer PartiallyInitializedThisConsumer) ConstructorPassesThisOut { _init_.Initialize() - c := constructorPassesThisOut{} + + c := constructorPassesThisOut_jsiiProxy{} _jsii_.Create( "jsii-calc.ConstructorPassesThisOut", []interface{}{consumer}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &c, ) + return &c } @@ -4558,112 +4702,128 @@ type Constructors interface { } // The jsii proxy struct for Constructors -type constructors struct { +type constructors_jsiiProxy struct { _ byte // padding } func NewConstructors() Constructors { _init_.Initialize() - c := constructors{} + + c := constructors_jsiiProxy{} _jsii_.Create( "jsii-calc.Constructors", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &c, ) + return &c } func Constructors_HiddenInterface() IPublicInterface { _init_.Initialize() + var returns IPublicInterface + _jsii_.StaticInvoke( "jsii-calc.Constructors", "hiddenInterface", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } func Constructors_HiddenInterfaces() []IPublicInterface { _init_.Initialize() + var returns []IPublicInterface + _jsii_.StaticInvoke( "jsii-calc.Constructors", "hiddenInterfaces", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } func Constructors_HiddenSubInterfaces() []IPublicInterface { _init_.Initialize() + var returns []IPublicInterface + _jsii_.StaticInvoke( "jsii-calc.Constructors", "hiddenSubInterfaces", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } func Constructors_MakeClass() PublicClass { _init_.Initialize() + var returns PublicClass + _jsii_.StaticInvoke( "jsii-calc.Constructors", "makeClass", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } func Constructors_MakeInterface() IPublicInterface { _init_.Initialize() + var returns IPublicInterface + _jsii_.StaticInvoke( "jsii-calc.Constructors", "makeInterface", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } func Constructors_MakeInterface2() IPublicInterface2 { _init_.Initialize() + var returns IPublicInterface2 + _jsii_.StaticInvoke( "jsii-calc.Constructors", "makeInterface2", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } func Constructors_MakeInterfaces() []IPublicInterface { _init_.Initialize() + var returns []IPublicInterface + _jsii_.StaticInvoke( "jsii-calc.Constructors", "makeInterfaces", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -4672,33 +4832,36 @@ type ConsumePureInterface interface { } // The jsii proxy struct for ConsumePureInterface -type consumePureInterface struct { +type consumePureInterface_jsiiProxy struct { _ byte // padding } func NewConsumePureInterface(delegate IStructReturningDelegate) ConsumePureInterface { _init_.Initialize() - c := consumePureInterface{} + + c := consumePureInterface_jsiiProxy{} _jsii_.Create( "jsii-calc.ConsumePureInterface", []interface{}{delegate}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &c, ) + return &c } -func (c *consumePureInterface) WorkItBaby() StructB { +func (c *consumePureInterface_jsiiProxy) WorkItBaby() StructB { var returns StructB + _jsii_.Invoke( c, "workItBaby", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -4714,21 +4877,23 @@ type ConsumerCanRingBell interface { } // The jsii proxy struct for ConsumerCanRingBell -type consumerCanRingBell struct { +type consumerCanRingBell_jsiiProxy struct { _ byte // padding } func NewConsumerCanRingBell() ConsumerCanRingBell { _init_.Initialize() - c := consumerCanRingBell{} + + c := consumerCanRingBell_jsiiProxy{} _jsii_.Create( "jsii-calc.ConsumerCanRingBell", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &c, ) + return &c } @@ -4737,14 +4902,16 @@ func NewConsumerCanRingBell() ConsumerCanRingBell { // 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}, - true, &returns, ) + return returns } @@ -4753,14 +4920,16 @@ func ConsumerCanRingBell_StaticImplementedByObjectLiteral(ringer IBellRinger) bo // 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}, - true, &returns, ) + return returns } @@ -4769,14 +4938,16 @@ func ConsumerCanRingBell_StaticImplementedByPrivateClass(ringer IBellRinger) boo // 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}, - true, &returns, ) + return returns } @@ -4785,74 +4956,80 @@ func ConsumerCanRingBell_StaticImplementedByPublicClass(ringer IBellRinger) bool // 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}, - true, &returns, ) + return returns } // ...if the interface is implemented using an object literal. // // Returns whether the bell was rung. -func (c *consumerCanRingBell) ImplementedByObjectLiteral(ringer IBellRinger) bool { +func (c *consumerCanRingBell_jsiiProxy) ImplementedByObjectLiteral(ringer IBellRinger) bool { var returns bool + _jsii_.Invoke( c, "implementedByObjectLiteral", []interface{}{ringer}, - true, &returns, ) + return returns } // ...if the interface is implemented using a private class. // // Return whether the bell was rung. -func (c *consumerCanRingBell) ImplementedByPrivateClass(ringer IBellRinger) bool { +func (c *consumerCanRingBell_jsiiProxy) ImplementedByPrivateClass(ringer IBellRinger) bool { var returns bool + _jsii_.Invoke( c, "implementedByPrivateClass", []interface{}{ringer}, - true, &returns, ) + return returns } // ...if the interface is implemented using a public class. // // Return whether the bell was rung. -func (c *consumerCanRingBell) ImplementedByPublicClass(ringer IBellRinger) bool { +func (c *consumerCanRingBell_jsiiProxy) ImplementedByPublicClass(ringer IBellRinger) bool { var returns bool + _jsii_.Invoke( c, "implementedByPublicClass", []interface{}{ringer}, - true, &returns, ) + return returns } // If the parameter is a concrete class instead of an interface. // // Return whether the bell was rung. -func (c *consumerCanRingBell) WhenTypedAsClass(ringer IConcreteBellRinger) bool { +func (c *consumerCanRingBell_jsiiProxy) WhenTypedAsClass(ringer IConcreteBellRinger) bool { var returns bool + _jsii_.Invoke( c, "whenTypedAsClass", []interface{}{ringer}, - true, &returns, ) + return returns } @@ -4862,45 +5039,49 @@ type ConsumersOfThisCrazyTypeSystem interface { } // The jsii proxy struct for ConsumersOfThisCrazyTypeSystem -type consumersOfThisCrazyTypeSystem struct { +type consumersOfThisCrazyTypeSystem_jsiiProxy struct { _ byte // padding } func NewConsumersOfThisCrazyTypeSystem() ConsumersOfThisCrazyTypeSystem { _init_.Initialize() - c := consumersOfThisCrazyTypeSystem{} + + c := consumersOfThisCrazyTypeSystem_jsiiProxy{} _jsii_.Create( "jsii-calc.ConsumersOfThisCrazyTypeSystem", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &c, ) + return &c } -func (c *consumersOfThisCrazyTypeSystem) ConsumeAnotherPublicInterface(obj IAnotherPublicInterface) string { +func (c *consumersOfThisCrazyTypeSystem_jsiiProxy) ConsumeAnotherPublicInterface(obj IAnotherPublicInterface) string { var returns string + _jsii_.Invoke( c, "consumeAnotherPublicInterface", []interface{}{obj}, - true, &returns, ) + return returns } -func (c *consumersOfThisCrazyTypeSystem) ConsumeNonInternalInterface(obj INonInternalInterface) interface{} { +func (c *consumersOfThisCrazyTypeSystem_jsiiProxy) ConsumeNonInternalInterface(obj INonInternalInterface) interface{} { var returns interface{} + _jsii_.Invoke( c, "consumeNonInternalInterface", []interface{}{obj}, - true, &returns, ) + return returns } @@ -4912,60 +5093,101 @@ type DataRenderer interface { } // The jsii proxy struct for DataRenderer -type dataRenderer struct { +type dataRenderer_jsiiProxy struct { _ byte // padding } func NewDataRenderer() DataRenderer { _init_.Initialize() - d := dataRenderer{} + + d := dataRenderer_jsiiProxy{} _jsii_.Create( "jsii-calc.DataRenderer", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &d, ) + return &d } -func (d *dataRenderer) Render(data scopejsiicalclib.MyFirstStruct) string { +func (d *dataRenderer_jsiiProxy) Render(data scopejsiicalclib.MyFirstStruct) string { var returns string + _jsii_.Invoke( d, "render", []interface{}{data}, - true, &returns, ) + return returns } -func (d *dataRenderer) RenderArbitrary(data map[string]interface{}) string { +func (d *dataRenderer_jsiiProxy) RenderArbitrary(data map[string]interface{}) string { var returns string + _jsii_.Invoke( d, "renderArbitrary", []interface{}{data}, - true, &returns, ) + return returns } -func (d *dataRenderer) RenderMap(map_ map[string]interface{}) string { +func (d *dataRenderer_jsiiProxy) RenderMap(map_ map[string]interface{}) string { var returns string + _jsii_.Invoke( d, "renderMap", []interface{}{map_}, - true, &returns, ) + return returns } +// A class named "Default". +// See: https://github.com/aws/jsii/issues/2637 +// +type Default interface { + PleaseCompile() +} + +// The jsii proxy struct for Default +type default_jsiiProxy struct { + _ byte // padding +} + +func NewDefault() Default { + _init_.Initialize() + + d := default_jsiiProxy{} + + _jsii_.Create( + "jsii-calc.Default", + nil /* no parameters */, + []_jsii_.FQN{}, + nil, // no overrides + &d, + ) + + return &d +} + +func (d *default_jsiiProxy) PleaseCompile() { + _jsii_.InvokeVoid( + d, + "pleaseCompile", + nil /* no parameters */, + ) +} + type DefaultedConstructorArgument interface { Arg1() float64 Arg2() string @@ -4973,11 +5195,11 @@ type DefaultedConstructorArgument interface { } // The jsii proxy struct for DefaultedConstructorArgument -type defaultedConstructorArgument struct { +type defaultedConstructorArgument_jsiiProxy struct { _ byte // padding } -func (d *defaultedConstructorArgument) Arg1() float64 { +func (d *defaultedConstructorArgument_jsiiProxy) Arg1() float64 { var returns float64 _jsii_.Get( d, @@ -4987,7 +5209,7 @@ func (d *defaultedConstructorArgument) Arg1() float64 { return returns } -func (d *defaultedConstructorArgument) Arg2() string { +func (d *defaultedConstructorArgument_jsiiProxy) Arg2() string { var returns string _jsii_.Get( d, @@ -4997,7 +5219,7 @@ func (d *defaultedConstructorArgument) Arg2() string { return returns } -func (d *defaultedConstructorArgument) Arg3() string { +func (d *defaultedConstructorArgument_jsiiProxy) Arg3() string { var returns string _jsii_.Get( d, @@ -5010,15 +5232,17 @@ func (d *defaultedConstructorArgument) Arg3() string { func NewDefaultedConstructorArgument(arg1 float64, arg2 string, arg3 string) DefaultedConstructorArgument { _init_.Initialize() - d := defaultedConstructorArgument{} + + d := defaultedConstructorArgument_jsiiProxy{} _jsii_.Create( "jsii-calc.DefaultedConstructorArgument", []interface{}{arg1, arg2, arg3}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &d, ) + return &d } @@ -5030,49 +5254,55 @@ type Demonstrate982 interface { } // The jsii proxy struct for Demonstrate982 -type demonstrate982 struct { +type demonstrate982_jsiiProxy struct { _ byte // padding } func NewDemonstrate982() Demonstrate982 { _init_.Initialize() - d := demonstrate982{} + + d := demonstrate982_jsiiProxy{} _jsii_.Create( "jsii-calc.Demonstrate982", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &d, ) + return &d } // It's dangerous to go alone! func Demonstrate982_TakeThis() ChildStruct982 { _init_.Initialize() + var returns ChildStruct982 + _jsii_.StaticInvoke( "jsii-calc.Demonstrate982", "takeThis", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } // It's dangerous to go alone! func Demonstrate982_TakeThisToo() ParentStruct982 { _init_.Initialize() + var returns ParentStruct982 + _jsii_.StaticInvoke( "jsii-calc.Demonstrate982", "takeThisToo", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -5085,11 +5315,11 @@ type DeprecatedClass interface { } // The jsii proxy struct for DeprecatedClass -type deprecatedClass struct { +type deprecatedClass_jsiiProxy struct { _ byte // padding } -func (d *deprecatedClass) MutableProperty() float64 { +func (d *deprecatedClass_jsiiProxy) MutableProperty() float64 { var returns float64 _jsii_.Get( d, @@ -5099,7 +5329,7 @@ func (d *deprecatedClass) MutableProperty() float64 { return returns } -func (d *deprecatedClass) ReadonlyProperty() string { +func (d *deprecatedClass_jsiiProxy) ReadonlyProperty() string { var returns string _jsii_.Get( d, @@ -5110,21 +5340,24 @@ func (d *deprecatedClass) ReadonlyProperty() string { } +// Deprecated: this constructor is "just" okay func NewDeprecatedClass(readonlyString string, mutableNumber float64) DeprecatedClass { _init_.Initialize() - d := deprecatedClass{} + + d := deprecatedClass_jsiiProxy{} _jsii_.Create( "jsii-calc.DeprecatedClass", []interface{}{readonlyString, mutableNumber}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &d, ) + return &d } -func (d *deprecatedClass) SetMutableProperty(val float64) { +func (d *deprecatedClass_jsiiProxy) SetMutableProperty(val float64) { _jsii_.Set( d, "mutableProperty", @@ -5133,14 +5366,11 @@ func (d *deprecatedClass) SetMutableProperty(val float64) { } // Deprecated: it was a bad idea -func (d *deprecatedClass) Method() { - var returns interface{} - _jsii_.Invoke( +func (d *deprecatedClass_jsiiProxy) Method() { + _jsii_.InvokeVoid( d, "method", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } @@ -5278,7 +5508,7 @@ type DisappointingCollectionSource interface { } // The jsii proxy struct for DisappointingCollectionSource -type disappointingCollectionSource struct { +type disappointingCollectionSource_jsiiProxy struct { _ byte // padding } @@ -5311,56 +5541,57 @@ type DoNotOverridePrivates interface { } // The jsii proxy struct for DoNotOverridePrivates -type doNotOverridePrivates struct { +type doNotOverridePrivates_jsiiProxy struct { _ byte // padding } func NewDoNotOverridePrivates() DoNotOverridePrivates { _init_.Initialize() - d := doNotOverridePrivates{} + + d := doNotOverridePrivates_jsiiProxy{} _jsii_.Create( "jsii-calc.DoNotOverridePrivates", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &d, ) + return &d } -func (d *doNotOverridePrivates) ChangePrivatePropertyValue(newValue string) { - var returns interface{} - _jsii_.Invoke( +func (d *doNotOverridePrivates_jsiiProxy) ChangePrivatePropertyValue(newValue string) { + _jsii_.InvokeVoid( d, "changePrivatePropertyValue", []interface{}{newValue}, - false, - &returns, ) } -func (d *doNotOverridePrivates) PrivateMethodValue() string { +func (d *doNotOverridePrivates_jsiiProxy) PrivateMethodValue() string { var returns string + _jsii_.Invoke( d, "privateMethodValue", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } -func (d *doNotOverridePrivates) PrivatePropertyValue() string { +func (d *doNotOverridePrivates_jsiiProxy) PrivatePropertyValue() string { var returns string + _jsii_.Invoke( d, "privatePropertyValue", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -5370,32 +5601,31 @@ type DoNotRecognizeAnyAsOptional interface { } // The jsii proxy struct for DoNotRecognizeAnyAsOptional -type doNotRecognizeAnyAsOptional struct { +type doNotRecognizeAnyAsOptional_jsiiProxy struct { _ byte // padding } func NewDoNotRecognizeAnyAsOptional() DoNotRecognizeAnyAsOptional { _init_.Initialize() - d := doNotRecognizeAnyAsOptional{} + + d := doNotRecognizeAnyAsOptional_jsiiProxy{} _jsii_.Create( "jsii-calc.DoNotRecognizeAnyAsOptional", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &d, ) + return &d } -func (d *doNotRecognizeAnyAsOptional) Method(_requiredAny interface{}, _optionalAny interface{}, _optionalString string) { - var returns interface{} - _jsii_.Invoke( +func (d *doNotRecognizeAnyAsOptional_jsiiProxy) Method(_requiredAny interface{}, _optionalAny interface{}, _optionalString string) { + _jsii_.InvokeVoid( d, "method", []interface{}{_requiredAny, _optionalAny, _optionalString}, - false, - &returns, ) } @@ -5414,21 +5644,23 @@ type DocumentedClass interface { } // The jsii proxy struct for DocumentedClass -type documentedClass struct { +type documentedClass_jsiiProxy struct { _ byte // padding } func NewDocumentedClass() DocumentedClass { _init_.Initialize() - d := documentedClass{} + + d := documentedClass_jsiiProxy{} _jsii_.Create( "jsii-calc.DocumentedClass", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &d, ) + return &d } @@ -5438,28 +5670,26 @@ func NewDocumentedClass() DocumentedClass { // // Returns: A number that everyone knows very well and represents the answer // to the ultimate question -func (d *documentedClass) Greet(greetee Greetee) float64 { +func (d *documentedClass_jsiiProxy) Greet(greetee Greetee) float64 { var returns float64 + _jsii_.Invoke( d, "greet", []interface{}{greetee}, - true, &returns, ) + return returns } // Say ¡Hola! // Experimental. -func (d *documentedClass) Hola() { - var returns interface{} - _jsii_.Invoke( +func (d *documentedClass_jsiiProxy) Hola() { + _jsii_.InvokeVoid( d, "hola", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } @@ -5468,33 +5698,36 @@ type DontComplainAboutVariadicAfterOptional interface { } // The jsii proxy struct for DontComplainAboutVariadicAfterOptional -type dontComplainAboutVariadicAfterOptional struct { +type dontComplainAboutVariadicAfterOptional_jsiiProxy struct { _ byte // padding } func NewDontComplainAboutVariadicAfterOptional() DontComplainAboutVariadicAfterOptional { _init_.Initialize() - d := dontComplainAboutVariadicAfterOptional{} + + d := dontComplainAboutVariadicAfterOptional_jsiiProxy{} _jsii_.Create( "jsii-calc.DontComplainAboutVariadicAfterOptional", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &d, ) + return &d } -func (d *dontComplainAboutVariadicAfterOptional) OptionalAndVariadic(optional string, things string) string { +func (d *dontComplainAboutVariadicAfterOptional_jsiiProxy) OptionalAndVariadic(optional string, things string) string { var returns string + _jsii_.Invoke( d, "optionalAndVariadic", []interface{}{optional, things}, - true, &returns, ) + return returns } @@ -5505,47 +5738,51 @@ type DoubleTrouble interface { } // The jsii proxy struct for DoubleTrouble -type doubleTrouble struct { - iFriendlyRandomGenerator // implements jsii-calc.IFriendlyRandomGenerator +type doubleTrouble_jsiiProxy struct { + iFriendlyRandomGenerator_jsiiProxy // implements jsii-calc.IFriendlyRandomGenerator } func NewDoubleTrouble() DoubleTrouble { _init_.Initialize() - d := doubleTrouble{} + + d := doubleTrouble_jsiiProxy{} _jsii_.Create( "jsii-calc.DoubleTrouble", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{"jsii-calc.IFriendlyRandomGenerator"}, - []_jsii_.Override{}, + nil, // no overrides &d, ) + return &d } // (deprecated) Say hello! -func (d *doubleTrouble) Hello() string { +func (d *doubleTrouble_jsiiProxy) Hello() string { var returns string + _jsii_.Invoke( d, "hello", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } // Returns another random number. -func (d *doubleTrouble) Next() float64 { +func (d *doubleTrouble_jsiiProxy) Next() float64 { var returns float64 + _jsii_.Invoke( d, "next", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -5558,11 +5795,11 @@ type DynamicPropertyBearer interface { } // The jsii proxy struct for DynamicPropertyBearer -type dynamicPropertyBearer struct { +type dynamicPropertyBearer_jsiiProxy struct { _ byte // padding } -func (d *dynamicPropertyBearer) DynamicProperty() string { +func (d *dynamicPropertyBearer_jsiiProxy) DynamicProperty() string { var returns string _jsii_.Get( d, @@ -5572,7 +5809,7 @@ func (d *dynamicPropertyBearer) DynamicProperty() string { return returns } -func (d *dynamicPropertyBearer) ValueStore() string { +func (d *dynamicPropertyBearer_jsiiProxy) ValueStore() string { var returns string _jsii_.Get( d, @@ -5585,19 +5822,21 @@ func (d *dynamicPropertyBearer) ValueStore() string { func NewDynamicPropertyBearer(valueStore string) DynamicPropertyBearer { _init_.Initialize() - d := dynamicPropertyBearer{} + + d := dynamicPropertyBearer_jsiiProxy{} _jsii_.Create( "jsii-calc.DynamicPropertyBearer", []interface{}{valueStore}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &d, ) + return &d } -func (d *dynamicPropertyBearer) SetDynamicProperty(val string) { +func (d *dynamicPropertyBearer_jsiiProxy) SetDynamicProperty(val string) { _jsii_.Set( d, "dynamicProperty", @@ -5605,7 +5844,7 @@ func (d *dynamicPropertyBearer) SetDynamicProperty(val string) { ) } -func (d *dynamicPropertyBearer) SetValueStore(val string) { +func (d *dynamicPropertyBearer_jsiiProxy) SetValueStore(val string) { _jsii_.Set( d, "valueStore", @@ -5620,11 +5859,11 @@ type DynamicPropertyBearerChild interface { } // The jsii proxy struct for DynamicPropertyBearerChild -type dynamicPropertyBearerChild struct { - dynamicPropertyBearer // extends jsii-calc.DynamicPropertyBearer +type dynamicPropertyBearerChild_jsiiProxy struct { + dynamicPropertyBearer_jsiiProxy // extends jsii-calc.DynamicPropertyBearer } -func (d *dynamicPropertyBearerChild) OriginalValue() string { +func (d *dynamicPropertyBearerChild_jsiiProxy) OriginalValue() string { var returns string _jsii_.Get( d, @@ -5637,30 +5876,33 @@ func (d *dynamicPropertyBearerChild) OriginalValue() string { func NewDynamicPropertyBearerChild(originalValue string) DynamicPropertyBearerChild { _init_.Initialize() - d := dynamicPropertyBearerChild{} + + d := dynamicPropertyBearerChild_jsiiProxy{} _jsii_.Create( "jsii-calc.DynamicPropertyBearerChild", []interface{}{originalValue}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &d, ) + return &d } // Sets \`this.dynamicProperty\` to the new value, and returns the old value. // // Returns: the old value that was set. -func (d *dynamicPropertyBearerChild) OverrideValue(newValue string) string { +func (d *dynamicPropertyBearerChild_jsiiProxy) OverrideValue(newValue string) string { var returns string + _jsii_.Invoke( d, "overrideValue", []interface{}{newValue}, - true, &returns, ) + return returns } @@ -5671,52 +5913,56 @@ type Entropy interface { } // The jsii proxy struct for Entropy -type entropy struct { +type entropy_jsiiProxy struct { _ byte // padding } // Creates a new instance of Entropy. func NewEntropy(clock IWallClock) Entropy { _init_.Initialize() - e := entropy{} + + e := entropy_jsiiProxy{} _jsii_.Create( "jsii-calc.Entropy", []interface{}{clock}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &e, ) + return &e } // Increases entropy by consuming time from the clock (yes, this is a long shot, please don't judge). // // Returns: the time from the \`WallClock\`. -func (e *entropy) Increase() string { +func (e *entropy_jsiiProxy) Increase() string { var returns string + _jsii_.Invoke( e, "increase", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } // Implement this method such that it returns \`word\`. // // Returns: \`word\`. -func (e *entropy) Repeat(word string) string { +func (e *entropy_jsiiProxy) Repeat(word string) string { var returns string + _jsii_.Invoke( e, "repeat", []interface{}{word}, - true, &returns, ) + return returns } @@ -5724,33 +5970,37 @@ type EnumDispenser interface { } // The jsii proxy struct for EnumDispenser -type enumDispenser struct { +type enumDispenser_jsiiProxy struct { _ byte // padding } func EnumDispenser_RandomIntegerLikeEnum() AllTypesEnum { _init_.Initialize() + var returns AllTypesEnum + _jsii_.StaticInvoke( "jsii-calc.EnumDispenser", "randomIntegerLikeEnum", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } func EnumDispenser_RandomStringLikeEnum() StringEnum { _init_.Initialize() + var returns StringEnum + _jsii_.StaticInvoke( "jsii-calc.EnumDispenser", "randomStringLikeEnum", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -5758,21 +6008,23 @@ type EraseUndefinedHashValues interface { } // The jsii proxy struct for EraseUndefinedHashValues -type eraseUndefinedHashValues struct { +type eraseUndefinedHashValues_jsiiProxy struct { _ byte // padding } func NewEraseUndefinedHashValues() EraseUndefinedHashValues { _init_.Initialize() - e := eraseUndefinedHashValues{} + + e := eraseUndefinedHashValues_jsiiProxy{} _jsii_.Create( "jsii-calc.EraseUndefinedHashValues", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &e, ) + return &e } @@ -5782,42 +6034,48 @@ func NewEraseUndefinedHashValues() EraseUndefinedHashValues { // are being erased when sending values from native code to JS. func EraseUndefinedHashValues_DoesKeyExist(opts EraseUndefinedHashValuesOptions, key string) bool { _init_.Initialize() + var returns bool + _jsii_.StaticInvoke( "jsii-calc.EraseUndefinedHashValues", "doesKeyExist", []interface{}{opts, key}, - true, &returns, ) + return returns } // We expect "prop1" to be erased. func EraseUndefinedHashValues_Prop1IsNull() map[string]interface{} { _init_.Initialize() + var returns map[string]interface{} + _jsii_.StaticInvoke( "jsii-calc.EraseUndefinedHashValues", "prop1IsNull", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } // We expect "prop2" to be erased. func EraseUndefinedHashValues_Prop2IsUndefined() map[string]interface{} { _init_.Initialize() + var returns map[string]interface{} + _jsii_.StaticInvoke( "jsii-calc.EraseUndefinedHashValues", "prop2IsUndefined", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -5835,11 +6093,11 @@ type ExperimentalClass interface { } // The jsii proxy struct for ExperimentalClass -type experimentalClass struct { +type experimentalClass_jsiiProxy struct { _ byte // padding } -func (e *experimentalClass) MutableProperty() float64 { +func (e *experimentalClass_jsiiProxy) MutableProperty() float64 { var returns float64 _jsii_.Get( e, @@ -5849,7 +6107,7 @@ func (e *experimentalClass) MutableProperty() float64 { return returns } -func (e *experimentalClass) ReadonlyProperty() string { +func (e *experimentalClass_jsiiProxy) ReadonlyProperty() string { var returns string _jsii_.Get( e, @@ -5860,21 +6118,24 @@ func (e *experimentalClass) ReadonlyProperty() string { } +// Experimental. func NewExperimentalClass(readonlyString string, mutableNumber float64) ExperimentalClass { _init_.Initialize() - e := experimentalClass{} + + e := experimentalClass_jsiiProxy{} _jsii_.Create( "jsii-calc.ExperimentalClass", []interface{}{readonlyString, mutableNumber}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &e, ) + return &e } -func (e *experimentalClass) SetMutableProperty(val float64) { +func (e *experimentalClass_jsiiProxy) SetMutableProperty(val float64) { _jsii_.Set( e, "mutableProperty", @@ -5883,14 +6144,11 @@ func (e *experimentalClass) SetMutableProperty(val float64) { } // Experimental. -func (e *experimentalClass) Method() { - var returns interface{} - _jsii_.Invoke( +func (e *experimentalClass_jsiiProxy) Method() { + _jsii_.InvokeVoid( e, "method", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } @@ -5913,11 +6171,11 @@ type ExportedBaseClass interface { } // The jsii proxy struct for ExportedBaseClass -type exportedBaseClass struct { +type exportedBaseClass_jsiiProxy struct { _ byte // padding } -func (e *exportedBaseClass) Success() bool { +func (e *exportedBaseClass_jsiiProxy) Success() bool { var returns bool _jsii_.Get( e, @@ -5930,15 +6188,17 @@ func (e *exportedBaseClass) Success() bool { func NewExportedBaseClass(success bool) ExportedBaseClass { _init_.Initialize() - e := exportedBaseClass{} + + e := exportedBaseClass_jsiiProxy{} _jsii_.Create( "jsii-calc.ExportedBaseClass", []interface{}{success}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &e, ) + return &e } @@ -5955,11 +6215,11 @@ type ExternalClass interface { } // The jsii proxy struct for ExternalClass -type externalClass struct { +type externalClass_jsiiProxy struct { _ byte // padding } -func (e *externalClass) MutableProperty() float64 { +func (e *externalClass_jsiiProxy) MutableProperty() float64 { var returns float64 _jsii_.Get( e, @@ -5969,7 +6229,7 @@ func (e *externalClass) MutableProperty() float64 { return returns } -func (e *externalClass) ReadonlyProperty() string { +func (e *externalClass_jsiiProxy) ReadonlyProperty() string { var returns string _jsii_.Get( e, @@ -5982,19 +6242,21 @@ func (e *externalClass) ReadonlyProperty() string { func NewExternalClass(readonlyString string, mutableNumber float64) ExternalClass { _init_.Initialize() - e := externalClass{} + + e := externalClass_jsiiProxy{} _jsii_.Create( "jsii-calc.ExternalClass", []interface{}{readonlyString, mutableNumber}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &e, ) + return &e } -func (e *externalClass) SetMutableProperty(val float64) { +func (e *externalClass_jsiiProxy) SetMutableProperty(val float64) { _jsii_.Set( e, "mutableProperty", @@ -6002,14 +6264,11 @@ func (e *externalClass) SetMutableProperty(val float64) { ) } -func (e *externalClass) Method() { - var returns interface{} - _jsii_.Invoke( +func (e *externalClass_jsiiProxy) Method() { + _jsii_.InvokeVoid( e, "method", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } @@ -6032,11 +6291,11 @@ type GiveMeStructs interface { } // The jsii proxy struct for GiveMeStructs -type giveMeStructs struct { +type giveMeStructs_jsiiProxy struct { _ byte // padding } -func (g *giveMeStructs) StructLiteral() scopejsiicalclib.StructWithOnlyOptionals { +func (g *giveMeStructs_jsiiProxy) StructLiteral() scopejsiicalclib.StructWithOnlyOptionals { var returns scopejsiicalclib.StructWithOnlyOptionals _jsii_.Get( g, @@ -6049,54 +6308,59 @@ func (g *giveMeStructs) StructLiteral() scopejsiicalclib.StructWithOnlyOptionals func NewGiveMeStructs() GiveMeStructs { _init_.Initialize() - g := giveMeStructs{} + + g := giveMeStructs_jsiiProxy{} _jsii_.Create( "jsii-calc.GiveMeStructs", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &g, ) + return &g } // Accepts a struct of type DerivedStruct and returns a struct of type FirstStruct. -func (g *giveMeStructs) DerivedToFirst(derived DerivedStruct) scopejsiicalclib.MyFirstStruct { +func (g *giveMeStructs_jsiiProxy) DerivedToFirst(derived DerivedStruct) scopejsiicalclib.MyFirstStruct { var returns scopejsiicalclib.MyFirstStruct + _jsii_.Invoke( g, "derivedToFirst", []interface{}{derived}, - true, &returns, ) + return returns } // Returns the boolean from a DerivedStruct struct. -func (g *giveMeStructs) ReadDerivedNonPrimitive(derived DerivedStruct) DoubleTrouble { +func (g *giveMeStructs_jsiiProxy) ReadDerivedNonPrimitive(derived DerivedStruct) DoubleTrouble { var returns DoubleTrouble + _jsii_.Invoke( g, "readDerivedNonPrimitive", []interface{}{derived}, - true, &returns, ) + return returns } // Returns the "anumber" from a MyFirstStruct struct; -func (g *giveMeStructs) ReadFirstNumber(first scopejsiicalclib.MyFirstStruct) float64 { +func (g *giveMeStructs_jsiiProxy) ReadFirstNumber(first scopejsiicalclib.MyFirstStruct) float64 { var returns float64 + _jsii_.Invoke( g, "readFirstNumber", []interface{}{first}, - true, &returns, ) + return returns } @@ -6111,33 +6375,36 @@ type GreetingAugmenter interface { } // The jsii proxy struct for GreetingAugmenter -type greetingAugmenter struct { +type greetingAugmenter_jsiiProxy struct { _ byte // padding } func NewGreetingAugmenter() GreetingAugmenter { _init_.Initialize() - g := greetingAugmenter{} + + g := greetingAugmenter_jsiiProxy{} _jsii_.Create( "jsii-calc.GreetingAugmenter", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &g, ) + return &g } -func (g *greetingAugmenter) BetterGreeting(friendly scopejsiicalclib.IFriendly) string { +func (g *greetingAugmenter_jsiiProxy) BetterGreeting(friendly scopejsiicalclib.IFriendly) string { var returns string + _jsii_.Invoke( g, "betterGreeting", []interface{}{friendly}, - true, &returns, ) + return returns } @@ -6148,31 +6415,33 @@ type IAnonymousImplementationProvider interface { } // The jsii proxy for IAnonymousImplementationProvider -type iAnonymousImplementationProvider struct { +type iAnonymousImplementationProvider_jsiiProxy struct { _ byte // padding } -func (i *iAnonymousImplementationProvider) ProvideAsClass() Implementation { +func (i *iAnonymousImplementationProvider_jsiiProxy) ProvideAsClass() Implementation { var returns Implementation + _jsii_.Invoke( i, "provideAsClass", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } -func (i *iAnonymousImplementationProvider) ProvideAsInterface() IAnonymouslyImplementMe { +func (i *iAnonymousImplementationProvider_jsiiProxy) ProvideAsInterface() IAnonymouslyImplementMe { var returns IAnonymouslyImplementMe + _jsii_.Invoke( i, "provideAsInterface", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -6182,23 +6451,24 @@ type IAnonymouslyImplementMe interface { } // The jsii proxy for IAnonymouslyImplementMe -type iAnonymouslyImplementMe struct { +type iAnonymouslyImplementMe_jsiiProxy struct { _ byte // padding } -func (i *iAnonymouslyImplementMe) Verb() string { +func (i *iAnonymouslyImplementMe_jsiiProxy) Verb() string { var returns string + _jsii_.Invoke( i, "verb", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } -func (i *iAnonymouslyImplementMe) Value() float64 { +func (i *iAnonymouslyImplementMe_jsiiProxy) Value() float64 { var returns float64 _jsii_.Get( i, @@ -6213,11 +6483,11 @@ type IAnotherPublicInterface interface { } // The jsii proxy for IAnotherPublicInterface -type iAnotherPublicInterface struct { +type iAnotherPublicInterface_jsiiProxy struct { _ byte // padding } -func (i *iAnotherPublicInterface) A() string { +func (i *iAnotherPublicInterface_jsiiProxy) A() string { var returns string _jsii_.Get( i, @@ -6227,7 +6497,7 @@ func (i *iAnotherPublicInterface) A() string { return returns } -func (i *iAnotherPublicInterface) SetA(val string) { +func (i *iAnotherPublicInterface_jsiiProxy) SetA(val string) { _jsii_.Set( i, "a", @@ -6240,18 +6510,15 @@ type IBell interface { } // The jsii proxy for IBell -type iBell struct { +type iBell_jsiiProxy struct { _ byte // padding } -func (i *iBell) Ring() { - var returns interface{} - _jsii_.Invoke( +func (i *iBell_jsiiProxy) Ring() { + _jsii_.InvokeVoid( i, "ring", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } @@ -6261,18 +6528,15 @@ type IBellRinger interface { } // The jsii proxy for IBellRinger -type iBellRinger struct { +type iBellRinger_jsiiProxy struct { _ byte // padding } -func (i *iBellRinger) YourTurn(bell IBell) { - var returns interface{} - _jsii_.Invoke( +func (i *iBellRinger_jsiiProxy) YourTurn(bell IBell) { + _jsii_.InvokeVoid( i, "yourTurn", []interface{}{bell}, - false, - &returns, ) } @@ -6282,18 +6546,15 @@ type IConcreteBellRinger interface { } // The jsii proxy for IConcreteBellRinger -type iConcreteBellRinger struct { +type iConcreteBellRinger_jsiiProxy struct { _ byte // padding } -func (i *iConcreteBellRinger) YourTurn(bell Bell) { - var returns interface{} - _jsii_.Invoke( +func (i *iConcreteBellRinger_jsiiProxy) YourTurn(bell Bell) { + _jsii_.InvokeVoid( i, "yourTurn", []interface{}{bell}, - false, - &returns, ) } @@ -6306,22 +6567,19 @@ type IDeprecatedInterface interface { } // The jsii proxy for IDeprecatedInterface -type iDeprecatedInterface struct { +type iDeprecatedInterface_jsiiProxy struct { _ byte // padding } -func (i *iDeprecatedInterface) Method() { - var returns interface{} - _jsii_.Invoke( +func (i *iDeprecatedInterface_jsiiProxy) Method() { + _jsii_.InvokeVoid( i, "method", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (i *iDeprecatedInterface) MutableProperty() float64 { +func (i *iDeprecatedInterface_jsiiProxy) MutableProperty() float64 { var returns float64 _jsii_.Get( i, @@ -6331,7 +6589,7 @@ func (i *iDeprecatedInterface) MutableProperty() float64 { return returns } -func (i *iDeprecatedInterface) SetMutableProperty(val float64) { +func (i *iDeprecatedInterface_jsiiProxy) SetMutableProperty(val float64) { _jsii_.Set( i, "mutableProperty", @@ -6348,22 +6606,19 @@ type IExperimentalInterface interface { } // The jsii proxy for IExperimentalInterface -type iExperimentalInterface struct { +type iExperimentalInterface_jsiiProxy struct { _ byte // padding } -func (i *iExperimentalInterface) Method() { - var returns interface{} - _jsii_.Invoke( +func (i *iExperimentalInterface_jsiiProxy) Method() { + _jsii_.InvokeVoid( i, "method", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (i *iExperimentalInterface) MutableProperty() float64 { +func (i *iExperimentalInterface_jsiiProxy) MutableProperty() float64 { var returns float64 _jsii_.Get( i, @@ -6373,7 +6628,7 @@ func (i *iExperimentalInterface) MutableProperty() float64 { return returns } -func (i *iExperimentalInterface) SetMutableProperty(val float64) { +func (i *iExperimentalInterface_jsiiProxy) SetMutableProperty(val float64) { _jsii_.Set( i, "mutableProperty", @@ -6387,11 +6642,11 @@ type IExtendsPrivateInterface interface { } // The jsii proxy for IExtendsPrivateInterface -type iExtendsPrivateInterface struct { +type iExtendsPrivateInterface_jsiiProxy struct { _ byte // padding } -func (i *iExtendsPrivateInterface) MoreThings() []string { +func (i *iExtendsPrivateInterface_jsiiProxy) MoreThings() []string { var returns []string _jsii_.Get( i, @@ -6401,7 +6656,7 @@ func (i *iExtendsPrivateInterface) MoreThings() []string { return returns } -func (i *iExtendsPrivateInterface) Private() string { +func (i *iExtendsPrivateInterface_jsiiProxy) Private() string { var returns string _jsii_.Get( i, @@ -6411,7 +6666,7 @@ func (i *iExtendsPrivateInterface) Private() string { return returns } -func (i *iExtendsPrivateInterface) SetPrivate(val string) { +func (i *iExtendsPrivateInterface_jsiiProxy) SetPrivate(val string) { _jsii_.Set( i, "private", @@ -6425,22 +6680,19 @@ type IExternalInterface interface { } // The jsii proxy for IExternalInterface -type iExternalInterface struct { +type iExternalInterface_jsiiProxy struct { _ byte // padding } -func (i *iExternalInterface) Method() { - var returns interface{} - _jsii_.Invoke( +func (i *iExternalInterface_jsiiProxy) Method() { + _jsii_.InvokeVoid( i, "method", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (i *iExternalInterface) MutableProperty() float64 { +func (i *iExternalInterface_jsiiProxy) MutableProperty() float64 { var returns float64 _jsii_.Get( i, @@ -6450,7 +6702,7 @@ func (i *iExternalInterface) MutableProperty() float64 { return returns } -func (i *iExternalInterface) SetMutableProperty(val float64) { +func (i *iExternalInterface_jsiiProxy) SetMutableProperty(val float64) { _jsii_.Set( i, "mutableProperty", @@ -6470,31 +6722,33 @@ type IFriendlier interface { } // The jsii proxy for IFriendlier -type iFriendlier struct { +type iFriendlier_jsiiProxy struct { scopejsiicalclib.IFriendly // extends @scope/jsii-calc-lib.IFriendly } -func (i *iFriendlier) Farewell() string { +func (i *iFriendlier_jsiiProxy) Farewell() string { var returns string + _jsii_.Invoke( i, "farewell", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } -func (i *iFriendlier) Goodbye() string { +func (i *iFriendlier_jsiiProxy) Goodbye() string { var returns string + _jsii_.Invoke( i, "goodbye", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -6504,32 +6758,34 @@ type IFriendlyRandomGenerator interface { } // The jsii proxy for IFriendlyRandomGenerator -type iFriendlyRandomGenerator struct { +type iFriendlyRandomGenerator_jsiiProxy struct { scopejsiicalclib.IFriendly // extends @scope/jsii-calc-lib.IFriendly - iRandomNumberGenerator // extends jsii-calc.IRandomNumberGenerator + iRandomNumberGenerator_jsiiProxy // extends jsii-calc.IRandomNumberGenerator } -func (i *iFriendlyRandomGenerator) Hello() string { +func (i *iFriendlyRandomGenerator_jsiiProxy) Hello() string { var returns string + _jsii_.Invoke( i, "hello", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } -func (i *iFriendlyRandomGenerator) Next() float64 { +func (i *iFriendlyRandomGenerator_jsiiProxy) Next() float64 { var returns float64 + _jsii_.Invoke( i, "next", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -6539,11 +6795,11 @@ type IInterfaceImplementedByAbstractClass interface { } // The jsii proxy for IInterfaceImplementedByAbstractClass -type iInterfaceImplementedByAbstractClass struct { +type iInterfaceImplementedByAbstractClass_jsiiProxy struct { _ byte // padding } -func (i *iInterfaceImplementedByAbstractClass) PropFromInterface() string { +func (i *iInterfaceImplementedByAbstractClass_jsiiProxy) PropFromInterface() string { var returns string _jsii_.Get( i, @@ -6560,11 +6816,11 @@ type IInterfaceThatShouldNotBeADataType interface { } // The jsii proxy for IInterfaceThatShouldNotBeADataType -type iInterfaceThatShouldNotBeADataType struct { - iInterfaceWithMethods // extends jsii-calc.IInterfaceWithMethods +type iInterfaceThatShouldNotBeADataType_jsiiProxy struct { + iInterfaceWithMethods_jsiiProxy // extends jsii-calc.IInterfaceWithMethods } -func (i *iInterfaceThatShouldNotBeADataType) OtherValue() string { +func (i *iInterfaceThatShouldNotBeADataType_jsiiProxy) OtherValue() string { var returns string _jsii_.Get( i, @@ -6579,18 +6835,15 @@ type IInterfaceWithInternal interface { } // The jsii proxy for IInterfaceWithInternal -type iInterfaceWithInternal struct { +type iInterfaceWithInternal_jsiiProxy struct { _ byte // padding } -func (i *iInterfaceWithInternal) Visible() { - var returns interface{} - _jsii_.Invoke( +func (i *iInterfaceWithInternal_jsiiProxy) Visible() { + _jsii_.InvokeVoid( i, "visible", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } @@ -6600,22 +6853,19 @@ type IInterfaceWithMethods interface { } // The jsii proxy for IInterfaceWithMethods -type iInterfaceWithMethods struct { +type iInterfaceWithMethods_jsiiProxy struct { _ byte // padding } -func (i *iInterfaceWithMethods) DoThings() { - var returns interface{} - _jsii_.Invoke( +func (i *iInterfaceWithMethods_jsiiProxy) DoThings() { + _jsii_.InvokeVoid( i, "doThings", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (i *iInterfaceWithMethods) Value() string { +func (i *iInterfaceWithMethods_jsiiProxy) Value() string { var returns string _jsii_.Get( i, @@ -6631,18 +6881,15 @@ type IInterfaceWithOptionalMethodArguments interface { } // The jsii proxy for IInterfaceWithOptionalMethodArguments -type iInterfaceWithOptionalMethodArguments struct { +type iInterfaceWithOptionalMethodArguments_jsiiProxy struct { _ byte // padding } -func (i *iInterfaceWithOptionalMethodArguments) Hello(arg1 string, arg2 float64) { - var returns interface{} - _jsii_.Invoke( +func (i *iInterfaceWithOptionalMethodArguments_jsiiProxy) Hello(arg1 string, arg2 float64) { + _jsii_.InvokeVoid( i, "hello", []interface{}{arg1, arg2}, - false, - &returns, ) } @@ -6652,11 +6899,11 @@ type IInterfaceWithProperties interface { } // The jsii proxy for IInterfaceWithProperties -type iInterfaceWithProperties struct { +type iInterfaceWithProperties_jsiiProxy struct { _ byte // padding } -func (i *iInterfaceWithProperties) ReadOnlyString() string { +func (i *iInterfaceWithProperties_jsiiProxy) ReadOnlyString() string { var returns string _jsii_.Get( i, @@ -6666,7 +6913,7 @@ func (i *iInterfaceWithProperties) ReadOnlyString() string { return returns } -func (i *iInterfaceWithProperties) ReadWriteString() string { +func (i *iInterfaceWithProperties_jsiiProxy) ReadWriteString() string { var returns string _jsii_.Get( i, @@ -6676,7 +6923,7 @@ func (i *iInterfaceWithProperties) ReadWriteString() string { return returns } -func (i *iInterfaceWithProperties) SetReadWriteString(val string) { +func (i *iInterfaceWithProperties_jsiiProxy) SetReadWriteString(val string) { _jsii_.Set( i, "readWriteString", @@ -6690,11 +6937,11 @@ type IInterfaceWithPropertiesExtension interface { } // The jsii proxy for IInterfaceWithPropertiesExtension -type iInterfaceWithPropertiesExtension struct { - iInterfaceWithProperties // extends jsii-calc.IInterfaceWithProperties +type iInterfaceWithPropertiesExtension_jsiiProxy struct { + iInterfaceWithProperties_jsiiProxy // extends jsii-calc.IInterfaceWithProperties } -func (i *iInterfaceWithPropertiesExtension) Foo() float64 { +func (i *iInterfaceWithPropertiesExtension_jsiiProxy) Foo() float64 { var returns float64 _jsii_.Get( i, @@ -6704,7 +6951,7 @@ func (i *iInterfaceWithPropertiesExtension) Foo() float64 { return returns } -func (i *iInterfaceWithPropertiesExtension) SetFoo(val float64) { +func (i *iInterfaceWithPropertiesExtension_jsiiProxy) SetFoo(val float64) { _jsii_.Set( i, "foo", @@ -6720,33 +6967,27 @@ type Ijsii417Derived interface { } // The jsii proxy for Ijsii417Derived -type ijsii417Derived struct { - ijsii417PublicBaseOfBase // extends jsii-calc.IJSII417PublicBaseOfBase +type ijsii417Derived_jsiiProxy struct { + ijsii417PublicBaseOfBase_jsiiProxy // extends jsii-calc.IJSII417PublicBaseOfBase } -func (i *ijsii417Derived) Bar() { - var returns interface{} - _jsii_.Invoke( +func (i *ijsii417Derived_jsiiProxy) Bar() { + _jsii_.InvokeVoid( i, "bar", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (i *ijsii417Derived) Baz() { - var returns interface{} - _jsii_.Invoke( +func (i *ijsii417Derived_jsiiProxy) Baz() { + _jsii_.InvokeVoid( i, "baz", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (i *ijsii417Derived) Property() string { +func (i *ijsii417Derived_jsiiProxy) Property() string { var returns string _jsii_.Get( i, @@ -6762,22 +7003,19 @@ type Ijsii417PublicBaseOfBase interface { } // The jsii proxy for Ijsii417PublicBaseOfBase -type ijsii417PublicBaseOfBase struct { +type ijsii417PublicBaseOfBase_jsiiProxy struct { _ byte // padding } -func (i *ijsii417PublicBaseOfBase) Foo() { - var returns interface{} - _jsii_.Invoke( +func (i *ijsii417PublicBaseOfBase_jsiiProxy) Foo() { + _jsii_.InvokeVoid( i, "foo", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (i *ijsii417PublicBaseOfBase) HasRoot() bool { +func (i *ijsii417PublicBaseOfBase_jsiiProxy) HasRoot() bool { var returns bool _jsii_.Get( i, @@ -6791,7 +7029,7 @@ type IJsii487External interface { } // The jsii proxy for IJsii487External -type iJsii487External struct { +type iJsii487External_jsiiProxy struct { _ byte // padding } @@ -6799,7 +7037,7 @@ type IJsii487External2 interface { } // The jsii proxy for IJsii487External2 -type iJsii487External2 struct { +type iJsii487External2_jsiiProxy struct { _ byte // padding } @@ -6807,7 +7045,7 @@ type IJsii496 interface { } // The jsii proxy for IJsii496 -type iJsii496 struct { +type iJsii496_jsiiProxy struct { _ byte // padding } @@ -6816,11 +7054,11 @@ type IMutableObjectLiteral interface { } // The jsii proxy for IMutableObjectLiteral -type iMutableObjectLiteral struct { +type iMutableObjectLiteral_jsiiProxy struct { _ byte // padding } -func (i *iMutableObjectLiteral) Value() string { +func (i *iMutableObjectLiteral_jsiiProxy) Value() string { var returns string _jsii_.Get( i, @@ -6830,7 +7068,7 @@ func (i *iMutableObjectLiteral) Value() string { return returns } -func (i *iMutableObjectLiteral) SetValue(val string) { +func (i *iMutableObjectLiteral_jsiiProxy) SetValue(val string) { _jsii_.Set( i, "value", @@ -6845,11 +7083,11 @@ type INonInternalInterface interface { } // The jsii proxy for INonInternalInterface -type iNonInternalInterface struct { - iAnotherPublicInterface // extends jsii-calc.IAnotherPublicInterface +type iNonInternalInterface_jsiiProxy struct { + iAnotherPublicInterface_jsiiProxy // extends jsii-calc.IAnotherPublicInterface } -func (i *iNonInternalInterface) B() string { +func (i *iNonInternalInterface_jsiiProxy) B() string { var returns string _jsii_.Get( i, @@ -6859,7 +7097,7 @@ func (i *iNonInternalInterface) B() string { return returns } -func (i *iNonInternalInterface) SetB(val string) { +func (i *iNonInternalInterface_jsiiProxy) SetB(val string) { _jsii_.Set( i, "b", @@ -6867,7 +7105,7 @@ func (i *iNonInternalInterface) SetB(val string) { ) } -func (i *iNonInternalInterface) C() string { +func (i *iNonInternalInterface_jsiiProxy) C() string { var returns string _jsii_.Get( i, @@ -6877,7 +7115,7 @@ func (i *iNonInternalInterface) C() string { return returns } -func (i *iNonInternalInterface) SetC(val string) { +func (i *iNonInternalInterface_jsiiProxy) SetC(val string) { _jsii_.Set( i, "c", @@ -6892,23 +7130,24 @@ type IObjectWithProperty interface { } // The jsii proxy for IObjectWithProperty -type iObjectWithProperty struct { +type iObjectWithProperty_jsiiProxy struct { _ byte // padding } -func (i *iObjectWithProperty) WasSet() bool { +func (i *iObjectWithProperty_jsiiProxy) WasSet() bool { var returns bool + _jsii_.Invoke( i, "wasSet", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } -func (i *iObjectWithProperty) Property() string { +func (i *iObjectWithProperty_jsiiProxy) Property() string { var returns string _jsii_.Get( i, @@ -6918,7 +7157,7 @@ func (i *iObjectWithProperty) Property() string { return returns } -func (i *iObjectWithProperty) SetProperty(val string) { +func (i *iObjectWithProperty_jsiiProxy) SetProperty(val string) { _jsii_.Set( i, "property", @@ -6932,19 +7171,20 @@ type IOptionalMethod interface { } // The jsii proxy for IOptionalMethod -type iOptionalMethod struct { +type iOptionalMethod_jsiiProxy struct { _ byte // padding } -func (i *iOptionalMethod) Optional() string { +func (i *iOptionalMethod_jsiiProxy) Optional() string { var returns string + _jsii_.Invoke( i, "optional", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -6953,11 +7193,11 @@ type IPrivatelyImplemented interface { } // The jsii proxy for IPrivatelyImplemented -type iPrivatelyImplemented struct { +type iPrivatelyImplemented_jsiiProxy struct { _ byte // padding } -func (i *iPrivatelyImplemented) Success() bool { +func (i *iPrivatelyImplemented_jsiiProxy) Success() bool { var returns bool _jsii_.Get( i, @@ -6972,19 +7212,20 @@ type IPublicInterface interface { } // The jsii proxy for IPublicInterface -type iPublicInterface struct { +type iPublicInterface_jsiiProxy struct { _ byte // padding } -func (i *iPublicInterface) Bye() string { +func (i *iPublicInterface_jsiiProxy) Bye() string { var returns string + _jsii_.Invoke( i, "bye", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -6993,19 +7234,20 @@ type IPublicInterface2 interface { } // The jsii proxy for IPublicInterface2 -type iPublicInterface2 struct { +type iPublicInterface2_jsiiProxy struct { _ byte // padding } -func (i *iPublicInterface2) Ciao() string { +func (i *iPublicInterface2_jsiiProxy) Ciao() string { var returns string + _jsii_.Invoke( i, "ciao", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -7018,19 +7260,20 @@ type IRandomNumberGenerator interface { } // The jsii proxy for IRandomNumberGenerator -type iRandomNumberGenerator struct { +type iRandomNumberGenerator_jsiiProxy struct { _ byte // padding } -func (i *iRandomNumberGenerator) Next() float64 { +func (i *iRandomNumberGenerator_jsiiProxy) Next() float64 { var returns float64 + _jsii_.Invoke( i, "next", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -7040,11 +7283,11 @@ type IReturnJsii976 interface { } // The jsii proxy for IReturnJsii976 -type iReturnJsii976 struct { +type iReturnJsii976_jsiiProxy struct { _ byte // padding } -func (i *iReturnJsii976) Foo() float64 { +func (i *iReturnJsii976_jsiiProxy) Foo() float64 { var returns float64 _jsii_.Get( i, @@ -7060,23 +7303,24 @@ type IReturnsNumber interface { } // The jsii proxy for IReturnsNumber -type iReturnsNumber struct { +type iReturnsNumber_jsiiProxy struct { _ byte // padding } -func (i *iReturnsNumber) ObtainNumber() scopejsiicalclib.IDoublable { +func (i *iReturnsNumber_jsiiProxy) ObtainNumber() scopejsiicalclib.IDoublable { var returns scopejsiicalclib.IDoublable + _jsii_.Invoke( i, "obtainNumber", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } -func (i *iReturnsNumber) NumberProp() scopejsiicalclib.Number { +func (i *iReturnsNumber_jsiiProxy) NumberProp() scopejsiicalclib.Number { var returns scopejsiicalclib.Number _jsii_.Get( i, @@ -7092,22 +7336,19 @@ type IStableInterface interface { } // The jsii proxy for IStableInterface -type iStableInterface struct { +type iStableInterface_jsiiProxy struct { _ byte // padding } -func (i *iStableInterface) Method() { - var returns interface{} - _jsii_.Invoke( +func (i *iStableInterface_jsiiProxy) Method() { + _jsii_.InvokeVoid( i, "method", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (i *iStableInterface) MutableProperty() float64 { +func (i *iStableInterface_jsiiProxy) MutableProperty() float64 { var returns float64 _jsii_.Get( i, @@ -7117,7 +7358,7 @@ func (i *iStableInterface) MutableProperty() float64 { return returns } -func (i *iStableInterface) SetMutableProperty(val float64) { +func (i *iStableInterface_jsiiProxy) SetMutableProperty(val float64) { _jsii_.Set( i, "mutableProperty", @@ -7131,19 +7372,20 @@ type IStructReturningDelegate interface { } // The jsii proxy for IStructReturningDelegate -type iStructReturningDelegate struct { +type iStructReturningDelegate_jsiiProxy struct { _ byte // padding } -func (i *iStructReturningDelegate) ReturnStruct() StructB { +func (i *iStructReturningDelegate_jsiiProxy) ReturnStruct() StructB { var returns StructB + _jsii_.Invoke( i, "returnStruct", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -7154,19 +7396,20 @@ type IWallClock interface { } // The jsii proxy for IWallClock -type iWallClock struct { +type iWallClock_jsiiProxy struct { _ byte // padding } -func (i *iWallClock) Iso8601Now() string { +func (i *iWallClock_jsiiProxy) Iso8601Now() string { var returns string + _jsii_.Invoke( i, "iso8601Now", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -7176,11 +7419,11 @@ type ImplementInternalInterface interface { } // The jsii proxy struct for ImplementInternalInterface -type implementInternalInterface struct { +type implementInternalInterface_jsiiProxy struct { _ byte // padding } -func (i *implementInternalInterface) Prop() string { +func (i *implementInternalInterface_jsiiProxy) Prop() string { var returns string _jsii_.Get( i, @@ -7193,19 +7436,21 @@ func (i *implementInternalInterface) Prop() string { func NewImplementInternalInterface() ImplementInternalInterface { _init_.Initialize() - i := implementInternalInterface{} + + i := implementInternalInterface_jsiiProxy{} _jsii_.Create( "jsii-calc.ImplementInternalInterface", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &i, ) + return &i } -func (i *implementInternalInterface) SetProp(val string) { +func (i *implementInternalInterface_jsiiProxy) SetProp(val string) { _jsii_.Set( i, "prop", @@ -7218,11 +7463,11 @@ type Implementation interface { } // The jsii proxy struct for Implementation -type implementation struct { +type implementation_jsiiProxy struct { _ byte // padding } -func (i *implementation) Value() float64 { +func (i *implementation_jsiiProxy) Value() float64 { var returns float64 _jsii_.Get( i, @@ -7235,15 +7480,17 @@ func (i *implementation) Value() float64 { func NewImplementation() Implementation { _init_.Initialize() - i := implementation{} + + i := implementation_jsiiProxy{} _jsii_.Create( "jsii-calc.Implementation", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &i, ) + return &i } @@ -7253,32 +7500,31 @@ type ImplementsInterfaceWithInternal interface { } // The jsii proxy struct for ImplementsInterfaceWithInternal -type implementsInterfaceWithInternal struct { - iInterfaceWithInternal // implements jsii-calc.IInterfaceWithInternal +type implementsInterfaceWithInternal_jsiiProxy struct { + iInterfaceWithInternal_jsiiProxy // implements jsii-calc.IInterfaceWithInternal } func NewImplementsInterfaceWithInternal() ImplementsInterfaceWithInternal { _init_.Initialize() - i := implementsInterfaceWithInternal{} + + i := implementsInterfaceWithInternal_jsiiProxy{} _jsii_.Create( "jsii-calc.ImplementsInterfaceWithInternal", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{"jsii-calc.IInterfaceWithInternal"}, - []_jsii_.Override{}, + nil, // no overrides &i, ) + return &i } -func (i *implementsInterfaceWithInternal) Visible() { - var returns interface{} - _jsii_.Invoke( +func (i *implementsInterfaceWithInternal_jsiiProxy) Visible() { + _jsii_.InvokeVoid( i, "visible", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } @@ -7287,21 +7533,23 @@ type ImplementsInterfaceWithInternalSubclass interface { } // The jsii proxy struct for ImplementsInterfaceWithInternalSubclass -type implementsInterfaceWithInternalSubclass struct { - implementsInterfaceWithInternal // extends jsii-calc.ImplementsInterfaceWithInternal +type implementsInterfaceWithInternalSubclass_jsiiProxy struct { + implementsInterfaceWithInternal_jsiiProxy // extends jsii-calc.ImplementsInterfaceWithInternal } func NewImplementsInterfaceWithInternalSubclass() ImplementsInterfaceWithInternalSubclass { _init_.Initialize() - i := implementsInterfaceWithInternalSubclass{} + + i := implementsInterfaceWithInternalSubclass_jsiiProxy{} _jsii_.Create( "jsii-calc.ImplementsInterfaceWithInternalSubclass", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &i, ) + return &i } @@ -7311,11 +7559,11 @@ type ImplementsPrivateInterface interface { } // The jsii proxy struct for ImplementsPrivateInterface -type implementsPrivateInterface struct { +type implementsPrivateInterface_jsiiProxy struct { _ byte // padding } -func (i *implementsPrivateInterface) Private() string { +func (i *implementsPrivateInterface_jsiiProxy) Private() string { var returns string _jsii_.Get( i, @@ -7328,19 +7576,21 @@ func (i *implementsPrivateInterface) Private() string { func NewImplementsPrivateInterface() ImplementsPrivateInterface { _init_.Initialize() - i := implementsPrivateInterface{} + + i := implementsPrivateInterface_jsiiProxy{} _jsii_.Create( "jsii-calc.ImplementsPrivateInterface", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &i, ) + return &i } -func (i *implementsPrivateInterface) SetPrivate(val string) { +func (i *implementsPrivateInterface_jsiiProxy) SetPrivate(val string) { _jsii_.Set( i, "private", @@ -7376,34 +7626,37 @@ type InbetweenClass interface { } // The jsii proxy struct for InbetweenClass -type inbetweenClass struct { - publicClass // extends jsii-calc.PublicClass - iPublicInterface2 // implements jsii-calc.IPublicInterface2 +type inbetweenClass_jsiiProxy struct { + publicClass_jsiiProxy // extends jsii-calc.PublicClass + iPublicInterface2_jsiiProxy // implements jsii-calc.IPublicInterface2 } func NewInbetweenClass() InbetweenClass { _init_.Initialize() - i := inbetweenClass{} + + i := inbetweenClass_jsiiProxy{} _jsii_.Create( "jsii-calc.InbetweenClass", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{"jsii-calc.IPublicInterface2"}, - []_jsii_.Override{}, + nil, // no overrides &i, ) + return &i } -func (i *inbetweenClass) Ciao() string { +func (i *inbetweenClass_jsiiProxy) Ciao() string { var returns string + _jsii_.Invoke( i, "ciao", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -7414,59 +7667,67 @@ type InterfaceCollections interface { } // The jsii proxy struct for InterfaceCollections -type interfaceCollections struct { +type interfaceCollections_jsiiProxy struct { _ byte // padding } func InterfaceCollections_ListOfInterfaces() []IBell { _init_.Initialize() + var returns []IBell + _jsii_.StaticInvoke( "jsii-calc.InterfaceCollections", "listOfInterfaces", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } func InterfaceCollections_ListOfStructs() []StructA { _init_.Initialize() + var returns []StructA + _jsii_.StaticInvoke( "jsii-calc.InterfaceCollections", "listOfStructs", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } func InterfaceCollections_MapOfInterfaces() map[string]IBell { _init_.Initialize() + var returns map[string]IBell + _jsii_.StaticInvoke( "jsii-calc.InterfaceCollections", "mapOfInterfaces", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } func InterfaceCollections_MapOfStructs() map[string]StructA { _init_.Initialize() + var returns map[string]StructA + _jsii_.StaticInvoke( "jsii-calc.InterfaceCollections", "mapOfStructs", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -7475,20 +7736,22 @@ type InterfacesMaker interface { } // The jsii proxy struct for InterfacesMaker -type interfacesMaker struct { +type interfacesMaker_jsiiProxy struct { _ byte // padding } func InterfacesMaker_MakeInterfaces(count float64) []scopejsiicalclib.IDoublable { _init_.Initialize() + var returns []scopejsiicalclib.IDoublable + _jsii_.StaticInvoke( "jsii-calc.InterfacesMaker", "makeInterfaces", []interface{}{count}, - true, &returns, ) + return returns } @@ -7501,36 +7764,93 @@ type Isomorphism interface { } // The jsii proxy struct for Isomorphism -type isomorphism struct { +type isomorphism_jsiiProxy struct { _ byte // padding } func NewIsomorphism() Isomorphism { _init_.Initialize() - i := isomorphism{} + + i := isomorphism_jsiiProxy{} _jsii_.Create( "jsii-calc.Isomorphism", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &i, ) + return &i } -func (i *isomorphism) Myself() Isomorphism { +func (i *isomorphism_jsiiProxy) Myself() Isomorphism { var returns Isomorphism + _jsii_.Invoke( i, "myself", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } +// Docstrings with period. +// See: https://github.com/aws/jsii/issues/2638 +// +type Issue2638 interface { +} + +// The jsii proxy struct for Issue2638 +type issue2638_jsiiProxy struct { + _ byte // padding +} + +// First sentence. +// +// Second sentence. Third sentence. +func NewIssue2638() Issue2638 { + _init_.Initialize() + + i := issue2638_jsiiProxy{} + + _jsii_.Create( + "jsii-calc.Issue2638", + nil /* no parameters */, + []_jsii_.FQN{}, + nil, // no overrides + &i, + ) + + return &i +} + +type Issue2638B interface { +} + +// The jsii proxy struct for Issue2638B +type issue2638B_jsiiProxy struct { + _ byte // padding +} + +func NewIssue2638B() Issue2638B { + _init_.Initialize() + + i := issue2638B_jsiiProxy{} + + _jsii_.Create( + "jsii-calc.Issue2638B", + nil /* no parameters */, + []_jsii_.FQN{}, + nil, // no overrides + &i, + ) + + return &i +} + type Jsii417Derived interface { Jsii417PublicBaseOfBase Property() string @@ -7539,11 +7859,11 @@ type Jsii417Derived interface { } // The jsii proxy struct for Jsii417Derived -type jsii417Derived struct { - jsii417PublicBaseOfBase // extends jsii-calc.JSII417PublicBaseOfBase +type jsii417Derived_jsiiProxy struct { + jsii417PublicBaseOfBase_jsiiProxy // extends jsii-calc.JSII417PublicBaseOfBase } -func (j *jsii417Derived) Property() string { +func (j *jsii417Derived_jsiiProxy) Property() string { var returns string _jsii_.Get( j, @@ -7556,37 +7876,33 @@ func (j *jsii417Derived) Property() string { func NewJsii417Derived(property string) Jsii417Derived { _init_.Initialize() - j := jsii417Derived{} + + j := jsii417Derived_jsiiProxy{} _jsii_.Create( "jsii-calc.JSII417Derived", []interface{}{property}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &j, ) + return &j } -func (j *jsii417Derived) Bar() { - var returns interface{} - _jsii_.Invoke( +func (j *jsii417Derived_jsiiProxy) Bar() { + _jsii_.InvokeVoid( j, "bar", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *jsii417Derived) Baz() { - var returns interface{} - _jsii_.Invoke( +func (j *jsii417Derived_jsiiProxy) Baz() { + _jsii_.InvokeVoid( j, "baz", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } @@ -7596,11 +7912,11 @@ type Jsii417PublicBaseOfBase interface { } // The jsii proxy struct for Jsii417PublicBaseOfBase -type jsii417PublicBaseOfBase struct { +type jsii417PublicBaseOfBase_jsiiProxy struct { _ byte // padding } -func (j *jsii417PublicBaseOfBase) HasRoot() bool { +func (j *jsii417PublicBaseOfBase_jsiiProxy) HasRoot() bool { var returns bool _jsii_.Get( j, @@ -7613,39 +7929,40 @@ func (j *jsii417PublicBaseOfBase) HasRoot() bool { func NewJsii417PublicBaseOfBase() Jsii417PublicBaseOfBase { _init_.Initialize() - j := jsii417PublicBaseOfBase{} + + j := jsii417PublicBaseOfBase_jsiiProxy{} _jsii_.Create( "jsii-calc.JSII417PublicBaseOfBase", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &j, ) + return &j } func Jsii417PublicBaseOfBase_MakeInstance() Jsii417PublicBaseOfBase { _init_.Initialize() + var returns Jsii417PublicBaseOfBase + _jsii_.StaticInvoke( "jsii-calc.JSII417PublicBaseOfBase", "makeInstance", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } -func (j *jsii417PublicBaseOfBase) Foo() { - var returns interface{} - _jsii_.Invoke( +func (j *jsii417PublicBaseOfBase_jsiiProxy) Foo() { + _jsii_.InvokeVoid( j, "foo", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } @@ -7655,45 +7972,49 @@ type JsObjectLiteralForInterface interface { } // The jsii proxy struct for JsObjectLiteralForInterface -type jsObjectLiteralForInterface struct { +type jsObjectLiteralForInterface_jsiiProxy struct { _ byte // padding } func NewJsObjectLiteralForInterface() JsObjectLiteralForInterface { _init_.Initialize() - j := jsObjectLiteralForInterface{} + + j := jsObjectLiteralForInterface_jsiiProxy{} _jsii_.Create( "jsii-calc.JSObjectLiteralForInterface", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &j, ) + return &j } -func (j *jsObjectLiteralForInterface) GiveMeFriendly() scopejsiicalclib.IFriendly { +func (j *jsObjectLiteralForInterface_jsiiProxy) GiveMeFriendly() scopejsiicalclib.IFriendly { var returns scopejsiicalclib.IFriendly + _jsii_.Invoke( j, "giveMeFriendly", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } -func (j *jsObjectLiteralForInterface) GiveMeFriendlyGenerator() IFriendlyRandomGenerator { +func (j *jsObjectLiteralForInterface_jsiiProxy) GiveMeFriendlyGenerator() IFriendlyRandomGenerator { var returns IFriendlyRandomGenerator + _jsii_.Invoke( j, "giveMeFriendlyGenerator", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -7702,33 +8023,36 @@ type JsObjectLiteralToNative interface { } // The jsii proxy struct for JsObjectLiteralToNative -type jsObjectLiteralToNative struct { +type jsObjectLiteralToNative_jsiiProxy struct { _ byte // padding } func NewJsObjectLiteralToNative() JsObjectLiteralToNative { _init_.Initialize() - j := jsObjectLiteralToNative{} + + j := jsObjectLiteralToNative_jsiiProxy{} _jsii_.Create( "jsii-calc.JSObjectLiteralToNative", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &j, ) + return &j } -func (j *jsObjectLiteralToNative) ReturnLiteral() JsObjectLiteralToNativeClass { +func (j *jsObjectLiteralToNative_jsiiProxy) ReturnLiteral() JsObjectLiteralToNativeClass { var returns JsObjectLiteralToNativeClass + _jsii_.Invoke( j, "returnLiteral", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -7740,11 +8064,11 @@ type JsObjectLiteralToNativeClass interface { } // The jsii proxy struct for JsObjectLiteralToNativeClass -type jsObjectLiteralToNativeClass struct { +type jsObjectLiteralToNativeClass_jsiiProxy struct { _ byte // padding } -func (j *jsObjectLiteralToNativeClass) PropA() string { +func (j *jsObjectLiteralToNativeClass_jsiiProxy) PropA() string { var returns string _jsii_.Get( j, @@ -7754,7 +8078,7 @@ func (j *jsObjectLiteralToNativeClass) PropA() string { return returns } -func (j *jsObjectLiteralToNativeClass) PropB() float64 { +func (j *jsObjectLiteralToNativeClass_jsiiProxy) PropB() float64 { var returns float64 _jsii_.Get( j, @@ -7767,19 +8091,21 @@ func (j *jsObjectLiteralToNativeClass) PropB() float64 { func NewJsObjectLiteralToNativeClass() JsObjectLiteralToNativeClass { _init_.Initialize() - j := jsObjectLiteralToNativeClass{} + + j := jsObjectLiteralToNativeClass_jsiiProxy{} _jsii_.Create( "jsii-calc.JSObjectLiteralToNativeClass", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &j, ) + return &j } -func (j *jsObjectLiteralToNativeClass) SetPropA(val string) { +func (j *jsObjectLiteralToNativeClass_jsiiProxy) SetPropA(val string) { _jsii_.Set( j, "propA", @@ -7787,7 +8113,7 @@ func (j *jsObjectLiteralToNativeClass) SetPropA(val string) { ) } -func (j *jsObjectLiteralToNativeClass) SetPropB(val float64) { +func (j *jsObjectLiteralToNativeClass_jsiiProxy) SetPropB(val float64) { _jsii_.Set( j, "propB", @@ -7853,11 +8179,11 @@ type JavaReservedWords interface { } // The jsii proxy struct for JavaReservedWords -type javaReservedWords struct { +type javaReservedWords_jsiiProxy struct { _ byte // padding } -func (j *javaReservedWords) While() string { +func (j *javaReservedWords_jsiiProxy) While() string { var returns string _jsii_.Get( j, @@ -7870,19 +8196,21 @@ func (j *javaReservedWords) While() string { func NewJavaReservedWords() JavaReservedWords { _init_.Initialize() - j := javaReservedWords{} + + j := javaReservedWords_jsiiProxy{} _jsii_.Create( "jsii-calc.JavaReservedWords", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &j, ) + return &j } -func (j *javaReservedWords) SetWhile(val string) { +func (j *javaReservedWords_jsiiProxy) SetWhile(val string) { _jsii_.Set( j, "while", @@ -7890,575 +8218,419 @@ func (j *javaReservedWords) SetWhile(val string) { ) } -func (j *javaReservedWords) Abstract() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Abstract() { + _jsii_.InvokeVoid( j, "abstract", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Assert() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Assert() { + _jsii_.InvokeVoid( j, "assert", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Boolean() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Boolean() { + _jsii_.InvokeVoid( j, "boolean", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Break() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Break() { + _jsii_.InvokeVoid( j, "break", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Byte() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Byte() { + _jsii_.InvokeVoid( j, "byte", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Case() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Case() { + _jsii_.InvokeVoid( j, "case", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Catch() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Catch() { + _jsii_.InvokeVoid( j, "catch", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Char() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Char() { + _jsii_.InvokeVoid( j, "char", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Class() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Class() { + _jsii_.InvokeVoid( j, "class", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Const() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Const() { + _jsii_.InvokeVoid( j, "const", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Continue() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Continue() { + _jsii_.InvokeVoid( j, "continue", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Default() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Default() { + _jsii_.InvokeVoid( j, "default", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Do() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Do() { + _jsii_.InvokeVoid( j, "do", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Double() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Double() { + _jsii_.InvokeVoid( j, "double", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Else() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Else() { + _jsii_.InvokeVoid( j, "else", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Enum() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Enum() { + _jsii_.InvokeVoid( j, "enum", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Extends() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Extends() { + _jsii_.InvokeVoid( j, "extends", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) False() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) False() { + _jsii_.InvokeVoid( j, "false", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Final() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Final() { + _jsii_.InvokeVoid( j, "final", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Finally() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Finally() { + _jsii_.InvokeVoid( j, "finally", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Float() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Float() { + _jsii_.InvokeVoid( j, "float", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) For() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) For() { + _jsii_.InvokeVoid( j, "for", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Goto() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Goto() { + _jsii_.InvokeVoid( j, "goto", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) If() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) If() { + _jsii_.InvokeVoid( j, "if", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Implements() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Implements() { + _jsii_.InvokeVoid( j, "implements", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Import() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Import() { + _jsii_.InvokeVoid( j, "import", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Instanceof() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Instanceof() { + _jsii_.InvokeVoid( j, "instanceof", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Int() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Int() { + _jsii_.InvokeVoid( j, "int", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Interface() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Interface() { + _jsii_.InvokeVoid( j, "interface", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Long() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Long() { + _jsii_.InvokeVoid( j, "long", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Native() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Native() { + _jsii_.InvokeVoid( j, "native", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) New() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) New() { + _jsii_.InvokeVoid( j, "new", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Null() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Null() { + _jsii_.InvokeVoid( j, "null", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Package() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Package() { + _jsii_.InvokeVoid( j, "package", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Private() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Private() { + _jsii_.InvokeVoid( j, "private", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Protected() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Protected() { + _jsii_.InvokeVoid( j, "protected", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Public() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Public() { + _jsii_.InvokeVoid( j, "public", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Return() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Return() { + _jsii_.InvokeVoid( j, "return", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Short() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Short() { + _jsii_.InvokeVoid( j, "short", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Static() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Static() { + _jsii_.InvokeVoid( j, "static", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Strictfp() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Strictfp() { + _jsii_.InvokeVoid( j, "strictfp", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Super() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Super() { + _jsii_.InvokeVoid( j, "super", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Switch() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Switch() { + _jsii_.InvokeVoid( j, "switch", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Synchronized() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Synchronized() { + _jsii_.InvokeVoid( j, "synchronized", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) This() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) This() { + _jsii_.InvokeVoid( j, "this", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Throw() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Throw() { + _jsii_.InvokeVoid( j, "throw", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Throws() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Throws() { + _jsii_.InvokeVoid( j, "throws", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Transient() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Transient() { + _jsii_.InvokeVoid( j, "transient", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) True() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) True() { + _jsii_.InvokeVoid( j, "true", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Try() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Try() { + _jsii_.InvokeVoid( j, "try", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Void() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Void() { + _jsii_.InvokeVoid( j, "void", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (j *javaReservedWords) Volatile() { - var returns interface{} - _jsii_.Invoke( +func (j *javaReservedWords_jsiiProxy) Volatile() { + _jsii_.InvokeVoid( j, "volatile", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } @@ -8468,22 +8640,24 @@ type Jsii487Derived interface { } // The jsii proxy struct for Jsii487Derived -type jsii487Derived struct { - iJsii487External // implements jsii-calc.IJsii487External - iJsii487External2 // implements jsii-calc.IJsii487External2 +type jsii487Derived_jsiiProxy struct { + iJsii487External_jsiiProxy // implements jsii-calc.IJsii487External + iJsii487External2_jsiiProxy // implements jsii-calc.IJsii487External2 } func NewJsii487Derived() Jsii487Derived { _init_.Initialize() - j := jsii487Derived{} + + j := jsii487Derived_jsiiProxy{} _jsii_.Create( "jsii-calc.Jsii487Derived", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{"jsii-calc.IJsii487External2", "jsii-calc.IJsii487External"}, - []_jsii_.Override{}, + nil, // no overrides &j, ) + return &j } @@ -8492,21 +8666,23 @@ type Jsii496Derived interface { } // The jsii proxy struct for Jsii496Derived -type jsii496Derived struct { - iJsii496 // implements jsii-calc.IJsii496 +type jsii496Derived_jsiiProxy struct { + iJsii496_jsiiProxy // implements jsii-calc.IJsii496 } func NewJsii496Derived() Jsii496Derived { _init_.Initialize() - j := jsii496Derived{} + + j := jsii496Derived_jsiiProxy{} _jsii_.Create( "jsii-calc.Jsii496Derived", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{"jsii-calc.IJsii496"}, - []_jsii_.Override{}, + nil, // no overrides &j, ) + return &j } @@ -8515,21 +8691,23 @@ type JsiiAgent interface { } // The jsii proxy struct for JsiiAgent -type jsiiAgent struct { +type jsiiAgent_jsiiProxy struct { _ byte // padding } func NewJsiiAgent() JsiiAgent { _init_.Initialize() - j := jsiiAgent{} + + j := jsiiAgent_jsiiProxy{} _jsii_.Create( "jsii-calc.JsiiAgent", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &j, ) + return &j } @@ -8551,189 +8729,217 @@ type JsonFormatter interface { } // The jsii proxy struct for JsonFormatter -type jsonFormatter struct { +type jsonFormatter_jsiiProxy struct { _ byte // padding } func JsonFormatter_AnyArray() interface{} { _init_.Initialize() + var returns interface{} + _jsii_.StaticInvoke( "jsii-calc.JsonFormatter", "anyArray", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } func JsonFormatter_AnyBooleanFalse() interface{} { _init_.Initialize() + var returns interface{} + _jsii_.StaticInvoke( "jsii-calc.JsonFormatter", "anyBooleanFalse", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } func JsonFormatter_AnyBooleanTrue() interface{} { _init_.Initialize() + var returns interface{} + _jsii_.StaticInvoke( "jsii-calc.JsonFormatter", "anyBooleanTrue", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } func JsonFormatter_AnyDate() interface{} { _init_.Initialize() + var returns interface{} + _jsii_.StaticInvoke( "jsii-calc.JsonFormatter", "anyDate", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } func JsonFormatter_AnyEmptyString() interface{} { _init_.Initialize() + var returns interface{} + _jsii_.StaticInvoke( "jsii-calc.JsonFormatter", "anyEmptyString", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } func JsonFormatter_AnyFunction() interface{} { _init_.Initialize() + var returns interface{} + _jsii_.StaticInvoke( "jsii-calc.JsonFormatter", "anyFunction", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } func JsonFormatter_AnyHash() interface{} { _init_.Initialize() + var returns interface{} + _jsii_.StaticInvoke( "jsii-calc.JsonFormatter", "anyHash", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } func JsonFormatter_AnyNull() interface{} { _init_.Initialize() + var returns interface{} + _jsii_.StaticInvoke( "jsii-calc.JsonFormatter", "anyNull", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } func JsonFormatter_AnyNumber() interface{} { _init_.Initialize() + var returns interface{} + _jsii_.StaticInvoke( "jsii-calc.JsonFormatter", "anyNumber", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } func JsonFormatter_AnyRef() interface{} { _init_.Initialize() + var returns interface{} + _jsii_.StaticInvoke( "jsii-calc.JsonFormatter", "anyRef", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } func JsonFormatter_AnyString() interface{} { _init_.Initialize() + var returns interface{} + _jsii_.StaticInvoke( "jsii-calc.JsonFormatter", "anyString", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } func JsonFormatter_AnyUndefined() interface{} { _init_.Initialize() + var returns interface{} + _jsii_.StaticInvoke( "jsii-calc.JsonFormatter", "anyUndefined", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } func JsonFormatter_AnyZero() interface{} { _init_.Initialize() + var returns interface{} + _jsii_.StaticInvoke( "jsii-calc.JsonFormatter", "anyZero", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } func JsonFormatter_Stringify(value interface{}) string { _init_.Initialize() + var returns string + _jsii_.StaticInvoke( "jsii-calc.JsonFormatter", "stringify", []interface{}{value}, - true, &returns, ) + return returns } @@ -8743,11 +8949,11 @@ type LevelOne interface { } // The jsii proxy struct for LevelOne -type levelOne struct { +type levelOne_jsiiProxy struct { _ byte // padding } -func (l *levelOne) Props() LevelOneProps { +func (l *levelOne_jsiiProxy) Props() LevelOneProps { var returns LevelOneProps _jsii_.Get( l, @@ -8760,15 +8966,17 @@ func (l *levelOne) Props() LevelOneProps { func NewLevelOne(props LevelOneProps) LevelOne { _init_.Initialize() - l := levelOne{} + + l := levelOne_jsiiProxy{} _jsii_.Create( "jsii-calc.LevelOne", []interface{}{props}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &l, ) + return &l } @@ -8830,11 +9038,11 @@ type MethodNamedProperty interface { } // The jsii proxy struct for MethodNamedProperty -type methodNamedProperty struct { +type methodNamedProperty_jsiiProxy struct { _ byte // padding } -func (m *methodNamedProperty) Elite() float64 { +func (m *methodNamedProperty_jsiiProxy) Elite() float64 { var returns float64 _jsii_.Get( m, @@ -8847,27 +9055,30 @@ func (m *methodNamedProperty) Elite() float64 { func NewMethodNamedProperty() MethodNamedProperty { _init_.Initialize() - m := methodNamedProperty{} + + m := methodNamedProperty_jsiiProxy{} _jsii_.Create( "jsii-calc.MethodNamedProperty", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &m, ) + return &m } -func (m *methodNamedProperty) Property() string { +func (m *methodNamedProperty_jsiiProxy) Property() string { var returns string + _jsii_.Invoke( m, "property", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -8884,13 +9095,13 @@ type Multiply interface { } // The jsii proxy struct for Multiply -type multiply struct { - binaryOperation // extends jsii-calc.BinaryOperation - iFriendlier // implements jsii-calc.IFriendlier - iRandomNumberGenerator // implements jsii-calc.IRandomNumberGenerator +type multiply_jsiiProxy struct { + binaryOperation_jsiiProxy // extends jsii-calc.BinaryOperation + iFriendlier_jsiiProxy // implements jsii-calc.IFriendlier + iRandomNumberGenerator_jsiiProxy // implements jsii-calc.IRandomNumberGenerator } -func (m *multiply) Value() float64 { +func (m *multiply_jsiiProxy) Value() float64 { var returns float64 _jsii_.Get( m, @@ -8900,7 +9111,7 @@ func (m *multiply) Value() float64 { return returns } -func (m *multiply) Lhs() scopejsiicalclib.NumericValue { +func (m *multiply_jsiiProxy) Lhs() scopejsiicalclib.NumericValue { var returns scopejsiicalclib.NumericValue _jsii_.Get( m, @@ -8910,7 +9121,7 @@ func (m *multiply) Lhs() scopejsiicalclib.NumericValue { return returns } -func (m *multiply) Rhs() scopejsiicalclib.NumericValue { +func (m *multiply_jsiiProxy) Rhs() scopejsiicalclib.NumericValue { var returns scopejsiicalclib.NumericValue _jsii_.Get( m, @@ -8924,93 +9135,101 @@ func (m *multiply) Rhs() scopejsiicalclib.NumericValue { // Creates a BinaryOperation. func NewMultiply(lhs scopejsiicalclib.NumericValue, rhs scopejsiicalclib.NumericValue) Multiply { _init_.Initialize() - m := multiply{} + + m := multiply_jsiiProxy{} _jsii_.Create( "jsii-calc.Multiply", []interface{}{lhs, rhs}, []_jsii_.FQN{"jsii-calc.IFriendlier", "jsii-calc.IRandomNumberGenerator"}, - []_jsii_.Override{}, + nil, // no overrides &m, ) + return &m } // Say farewell. -func (m *multiply) Farewell() string { +func (m *multiply_jsiiProxy) Farewell() string { var returns string + _jsii_.Invoke( m, "farewell", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } // Say goodbye. -func (m *multiply) Goodbye() string { +func (m *multiply_jsiiProxy) Goodbye() string { var returns string + _jsii_.Invoke( m, "goodbye", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } // Returns another random number. -func (m *multiply) Next() float64 { +func (m *multiply_jsiiProxy) Next() float64 { var returns float64 + _jsii_.Invoke( m, "next", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } // (deprecated) String representation of the value. -func (m *multiply) ToString() string { +func (m *multiply_jsiiProxy) ToString() string { var returns string + _jsii_.Invoke( m, "toString", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } // (deprecated) Say hello! -func (m *multiply) Hello() string { +func (m *multiply_jsiiProxy) Hello() string { var returns string + _jsii_.Invoke( m, "hello", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } // Returns: the name of the class (to verify native type names are created for derived classes). -func (m *multiply) TypeName() interface{} { +func (m *multiply_jsiiProxy) TypeName() interface{} { var returns interface{} + _jsii_.Invoke( m, "typeName", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -9026,12 +9245,12 @@ type Negate interface { } // The jsii proxy struct for Negate -type negate struct { - unaryOperation // extends jsii-calc.UnaryOperation - iFriendlier // implements jsii-calc.IFriendlier +type negate_jsiiProxy struct { + unaryOperation_jsiiProxy // extends jsii-calc.UnaryOperation + iFriendlier_jsiiProxy // implements jsii-calc.IFriendlier } -func (n *negate) Value() float64 { +func (n *negate_jsiiProxy) Value() float64 { var returns float64 _jsii_.Get( n, @@ -9041,7 +9260,7 @@ func (n *negate) Value() float64 { return returns } -func (n *negate) Operand() scopejsiicalclib.NumericValue { +func (n *negate_jsiiProxy) Operand() scopejsiicalclib.NumericValue { var returns scopejsiicalclib.NumericValue _jsii_.Get( n, @@ -9054,80 +9273,87 @@ func (n *negate) Operand() scopejsiicalclib.NumericValue { func NewNegate(operand scopejsiicalclib.NumericValue) Negate { _init_.Initialize() - n := negate{} + + n := negate_jsiiProxy{} _jsii_.Create( "jsii-calc.Negate", []interface{}{operand}, []_jsii_.FQN{"jsii-calc.IFriendlier"}, - []_jsii_.Override{}, + nil, // no overrides &n, ) + return &n } // Say farewell. -func (n *negate) Farewell() string { +func (n *negate_jsiiProxy) Farewell() string { var returns string + _jsii_.Invoke( n, "farewell", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } // Say goodbye. -func (n *negate) Goodbye() string { +func (n *negate_jsiiProxy) Goodbye() string { var returns string + _jsii_.Invoke( n, "goodbye", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } // (deprecated) Say hello! -func (n *negate) Hello() string { +func (n *negate_jsiiProxy) Hello() string { var returns string + _jsii_.Invoke( n, "hello", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } // (deprecated) String representation of the value. -func (n *negate) ToString() string { +func (n *negate_jsiiProxy) ToString() string { var returns string + _jsii_.Invoke( n, "toString", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } // Returns: the name of the class (to verify native type names are created for derived classes). -func (n *negate) TypeName() interface{} { +func (n *negate_jsiiProxy) TypeName() interface{} { var returns interface{} + _jsii_.Invoke( n, "typeName", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -9135,20 +9361,22 @@ type NestedClassInstance interface { } // The jsii proxy struct for NestedClassInstance -type nestedClassInstance struct { +type nestedClassInstance_jsiiProxy struct { _ byte // padding } func NestedClassInstance_MakeInstance() submodule.NestedClass { _init_.Initialize() + var returns submodule.NestedClass + _jsii_.StaticInvoke( "jsii-calc.NestedClassInstance", "makeInstance", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -9166,11 +9394,11 @@ type NodeStandardLibrary interface { } // The jsii proxy struct for NodeStandardLibrary -type nodeStandardLibrary struct { +type nodeStandardLibrary_jsiiProxy struct { _ byte // padding } -func (n *nodeStandardLibrary) OsPlatform() string { +func (n *nodeStandardLibrary_jsiiProxy) OsPlatform() string { var returns string _jsii_.Get( n, @@ -9183,60 +9411,65 @@ func (n *nodeStandardLibrary) OsPlatform() string { func NewNodeStandardLibrary() NodeStandardLibrary { _init_.Initialize() - n := nodeStandardLibrary{} + + n := nodeStandardLibrary_jsiiProxy{} _jsii_.Create( "jsii-calc.NodeStandardLibrary", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &n, ) + return &n } // Uses node.js "crypto" module to calculate sha256 of a string. // // Returns: "6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50" -func (n *nodeStandardLibrary) CryptoSha256() string { +func (n *nodeStandardLibrary_jsiiProxy) CryptoSha256() string { var returns string + _jsii_.Invoke( n, "cryptoSha256", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } // Reads a local resource file (resource.txt) asynchronously. // // Returns: "Hello, resource!" -func (n *nodeStandardLibrary) FsReadFile() string { +func (n *nodeStandardLibrary_jsiiProxy) FsReadFile() string { var returns string + _jsii_.Invoke( n, "fsReadFile", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } // Sync version of fsReadFile. // // Returns: "Hello, resource! SYNC!" -func (n *nodeStandardLibrary) FsReadFileSync() string { +func (n *nodeStandardLibrary_jsiiProxy) FsReadFileSync() string { var returns string + _jsii_.Invoke( n, "fsReadFileSync", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -9250,11 +9483,11 @@ type NullShouldBeTreatedAsUndefined interface { } // The jsii proxy struct for NullShouldBeTreatedAsUndefined -type nullShouldBeTreatedAsUndefined struct { +type nullShouldBeTreatedAsUndefined_jsiiProxy struct { _ byte // padding } -func (n *nullShouldBeTreatedAsUndefined) ChangeMeToUndefined() string { +func (n *nullShouldBeTreatedAsUndefined_jsiiProxy) ChangeMeToUndefined() string { var returns string _jsii_.Get( n, @@ -9267,19 +9500,21 @@ func (n *nullShouldBeTreatedAsUndefined) ChangeMeToUndefined() string { func NewNullShouldBeTreatedAsUndefined(_param1 string, optional interface{}) NullShouldBeTreatedAsUndefined { _init_.Initialize() - n := nullShouldBeTreatedAsUndefined{} + + n := nullShouldBeTreatedAsUndefined_jsiiProxy{} _jsii_.Create( "jsii-calc.NullShouldBeTreatedAsUndefined", []interface{}{_param1, optional}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &n, ) + return &n } -func (n *nullShouldBeTreatedAsUndefined) SetChangeMeToUndefined(val string) { +func (n *nullShouldBeTreatedAsUndefined_jsiiProxy) SetChangeMeToUndefined(val string) { _jsii_.Set( n, "changeMeToUndefined", @@ -9287,36 +9522,27 @@ func (n *nullShouldBeTreatedAsUndefined) SetChangeMeToUndefined(val string) { ) } -func (n *nullShouldBeTreatedAsUndefined) GiveMeUndefined(value interface{}) { - var returns interface{} - _jsii_.Invoke( +func (n *nullShouldBeTreatedAsUndefined_jsiiProxy) GiveMeUndefined(value interface{}) { + _jsii_.InvokeVoid( n, "giveMeUndefined", []interface{}{value}, - false, - &returns, ) } -func (n *nullShouldBeTreatedAsUndefined) GiveMeUndefinedInsideAnObject(input NullShouldBeTreatedAsUndefinedData) { - var returns interface{} - _jsii_.Invoke( +func (n *nullShouldBeTreatedAsUndefined_jsiiProxy) GiveMeUndefinedInsideAnObject(input NullShouldBeTreatedAsUndefinedData) { + _jsii_.InvokeVoid( n, "giveMeUndefinedInsideAnObject", []interface{}{input}, - false, - &returns, ) } -func (n *nullShouldBeTreatedAsUndefined) VerifyPropertyIsUndefined() { - var returns interface{} - _jsii_.Invoke( +func (n *nullShouldBeTreatedAsUndefined_jsiiProxy) VerifyPropertyIsUndefined() { + _jsii_.InvokeVoid( n, "verifyPropertyIsUndefined", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } @@ -9334,11 +9560,11 @@ type NumberGenerator interface { } // The jsii proxy struct for NumberGenerator -type numberGenerator struct { +type numberGenerator_jsiiProxy struct { _ byte // padding } -func (n *numberGenerator) Generator() IRandomNumberGenerator { +func (n *numberGenerator_jsiiProxy) Generator() IRandomNumberGenerator { var returns IRandomNumberGenerator _jsii_.Get( n, @@ -9351,19 +9577,21 @@ func (n *numberGenerator) Generator() IRandomNumberGenerator { func NewNumberGenerator(generator IRandomNumberGenerator) NumberGenerator { _init_.Initialize() - n := numberGenerator{} + + n := numberGenerator_jsiiProxy{} _jsii_.Create( "jsii-calc.NumberGenerator", []interface{}{generator}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &n, ) + return &n } -func (n *numberGenerator) SetGenerator(val IRandomNumberGenerator) { +func (n *numberGenerator_jsiiProxy) SetGenerator(val IRandomNumberGenerator) { _jsii_.Set( n, "generator", @@ -9371,27 +9599,29 @@ func (n *numberGenerator) SetGenerator(val IRandomNumberGenerator) { ) } -func (n *numberGenerator) IsSameGenerator(gen IRandomNumberGenerator) bool { +func (n *numberGenerator_jsiiProxy) IsSameGenerator(gen IRandomNumberGenerator) bool { var returns bool + _jsii_.Invoke( n, "isSameGenerator", []interface{}{gen}, - true, &returns, ) + return returns } -func (n *numberGenerator) NextTimes100() float64 { +func (n *numberGenerator_jsiiProxy) NextTimes100() float64 { var returns float64 + _jsii_.Invoke( n, "nextTimes100", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -9402,47 +9632,51 @@ type ObjectRefsInCollections interface { } // The jsii proxy struct for ObjectRefsInCollections -type objectRefsInCollections struct { +type objectRefsInCollections_jsiiProxy struct { _ byte // padding } func NewObjectRefsInCollections() ObjectRefsInCollections { _init_.Initialize() - o := objectRefsInCollections{} + + o := objectRefsInCollections_jsiiProxy{} _jsii_.Create( "jsii-calc.ObjectRefsInCollections", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &o, ) + return &o } // Returns the sum of all values. -func (o *objectRefsInCollections) SumFromArray(values []scopejsiicalclib.NumericValue) float64 { +func (o *objectRefsInCollections_jsiiProxy) SumFromArray(values []scopejsiicalclib.NumericValue) float64 { var returns float64 + _jsii_.Invoke( o, "sumFromArray", []interface{}{values}, - true, &returns, ) + return returns } // Returns the sum of all values in a map. -func (o *objectRefsInCollections) SumFromMap(values map[string]scopejsiicalclib.NumericValue) float64 { +func (o *objectRefsInCollections_jsiiProxy) SumFromMap(values map[string]scopejsiicalclib.NumericValue) float64 { var returns float64 + _jsii_.Invoke( o, "sumFromMap", []interface{}{values}, - true, &returns, ) + return returns } @@ -9450,20 +9684,22 @@ type ObjectWithPropertyProvider interface { } // The jsii proxy struct for ObjectWithPropertyProvider -type objectWithPropertyProvider struct { +type objectWithPropertyProvider_jsiiProxy struct { _ byte // padding } func ObjectWithPropertyProvider_Provide() IObjectWithProperty { _init_.Initialize() + var returns IObjectWithProperty + _jsii_.StaticInvoke( "jsii-calc.ObjectWithPropertyProvider", "provide", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -9475,35 +9711,36 @@ type Old interface { } // The jsii proxy struct for Old -type old struct { +type old_jsiiProxy 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 { _init_.Initialize() - o := old{} + + o := old_jsiiProxy{} _jsii_.Create( "jsii-calc.Old", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &o, ) + return &o } // Doo wop that thing. // Deprecated: Use the new class or the old class whatever you want because // whatever you like is always the best -func (o *old) DoAThing() { - var returns interface{} - _jsii_.Invoke( +func (o *old_jsiiProxy) DoAThing() { + _jsii_.InvokeVoid( o, "doAThing", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } @@ -9513,43 +9750,39 @@ type OptionalArgumentInvoker interface { } // The jsii proxy struct for OptionalArgumentInvoker -type optionalArgumentInvoker struct { +type optionalArgumentInvoker_jsiiProxy struct { _ byte // padding } func NewOptionalArgumentInvoker(delegate IInterfaceWithOptionalMethodArguments) OptionalArgumentInvoker { _init_.Initialize() - o := optionalArgumentInvoker{} + + o := optionalArgumentInvoker_jsiiProxy{} _jsii_.Create( "jsii-calc.OptionalArgumentInvoker", []interface{}{delegate}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &o, ) + return &o } -func (o *optionalArgumentInvoker) InvokeWithOptional() { - var returns interface{} - _jsii_.Invoke( +func (o *optionalArgumentInvoker_jsiiProxy) InvokeWithOptional() { + _jsii_.InvokeVoid( o, "invokeWithOptional", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (o *optionalArgumentInvoker) InvokeWithoutOptional() { - var returns interface{} - _jsii_.Invoke( +func (o *optionalArgumentInvoker_jsiiProxy) InvokeWithoutOptional() { + _jsii_.InvokeVoid( o, "invokeWithoutOptional", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } @@ -9560,11 +9793,11 @@ type OptionalConstructorArgument interface { } // The jsii proxy struct for OptionalConstructorArgument -type optionalConstructorArgument struct { +type optionalConstructorArgument_jsiiProxy struct { _ byte // padding } -func (o *optionalConstructorArgument) Arg1() float64 { +func (o *optionalConstructorArgument_jsiiProxy) Arg1() float64 { var returns float64 _jsii_.Get( o, @@ -9574,7 +9807,7 @@ func (o *optionalConstructorArgument) Arg1() float64 { return returns } -func (o *optionalConstructorArgument) Arg2() string { +func (o *optionalConstructorArgument_jsiiProxy) Arg2() string { var returns string _jsii_.Get( o, @@ -9584,7 +9817,7 @@ func (o *optionalConstructorArgument) Arg2() string { return returns } -func (o *optionalConstructorArgument) Arg3() string { +func (o *optionalConstructorArgument_jsiiProxy) Arg3() string { var returns string _jsii_.Get( o, @@ -9597,15 +9830,17 @@ func (o *optionalConstructorArgument) Arg3() string { func NewOptionalConstructorArgument(arg1 float64, arg2 string, arg3 string) OptionalConstructorArgument { _init_.Initialize() - o := optionalConstructorArgument{} + + o := optionalConstructorArgument_jsiiProxy{} _jsii_.Create( "jsii-calc.OptionalConstructorArgument", []interface{}{arg1, arg2, arg3}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &o, ) + return &o } @@ -9619,11 +9854,11 @@ type OptionalStructConsumer interface { } // The jsii proxy struct for OptionalStructConsumer -type optionalStructConsumer struct { +type optionalStructConsumer_jsiiProxy struct { _ byte // padding } -func (o *optionalStructConsumer) FieldValue() string { +func (o *optionalStructConsumer_jsiiProxy) FieldValue() string { var returns string _jsii_.Get( o, @@ -9633,7 +9868,7 @@ func (o *optionalStructConsumer) FieldValue() string { return returns } -func (o *optionalStructConsumer) ParameterWasUndefined() bool { +func (o *optionalStructConsumer_jsiiProxy) ParameterWasUndefined() bool { var returns bool _jsii_.Get( o, @@ -9646,15 +9881,17 @@ func (o *optionalStructConsumer) ParameterWasUndefined() bool { func NewOptionalStructConsumer(optionalStruct OptionalStruct) OptionalStructConsumer { _init_.Initialize() - o := optionalStructConsumer{} + + o := optionalStructConsumer_jsiiProxy{} _jsii_.Create( "jsii-calc.OptionalStructConsumer", []interface{}{optionalStruct}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &o, ) + return &o } @@ -9669,11 +9906,11 @@ type OverridableProtectedMember interface { } // The jsii proxy struct for OverridableProtectedMember -type overridableProtectedMember struct { +type overridableProtectedMember_jsiiProxy struct { _ byte // padding } -func (o *overridableProtectedMember) OverrideReadOnly() string { +func (o *overridableProtectedMember_jsiiProxy) OverrideReadOnly() string { var returns string _jsii_.Get( o, @@ -9683,7 +9920,7 @@ func (o *overridableProtectedMember) OverrideReadOnly() string { return returns } -func (o *overridableProtectedMember) OverrideReadWrite() string { +func (o *overridableProtectedMember_jsiiProxy) OverrideReadWrite() string { var returns string _jsii_.Get( o, @@ -9696,19 +9933,21 @@ func (o *overridableProtectedMember) OverrideReadWrite() string { func NewOverridableProtectedMember() OverridableProtectedMember { _init_.Initialize() - o := overridableProtectedMember{} + + o := overridableProtectedMember_jsiiProxy{} _jsii_.Create( "jsii-calc.OverridableProtectedMember", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &o, ) + return &o } -func (o *overridableProtectedMember) SetOverrideReadWrite(val string) { +func (o *overridableProtectedMember_jsiiProxy) SetOverrideReadWrite(val string) { _jsii_.Set( o, "overrideReadWrite", @@ -9716,38 +9955,37 @@ func (o *overridableProtectedMember) SetOverrideReadWrite(val string) { ) } -func (o *overridableProtectedMember) OverrideMe() string { +func (o *overridableProtectedMember_jsiiProxy) OverrideMe() string { var returns string + _jsii_.Invoke( o, "overrideMe", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } -func (o *overridableProtectedMember) SwitchModes() { - var returns interface{} - _jsii_.Invoke( +func (o *overridableProtectedMember_jsiiProxy) SwitchModes() { + _jsii_.InvokeVoid( o, "switchModes", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (o *overridableProtectedMember) ValueFromProtected() string { +func (o *overridableProtectedMember_jsiiProxy) ValueFromProtected() string { var returns string + _jsii_.Invoke( o, "valueFromProtected", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -9756,33 +9994,36 @@ type OverrideReturnsObject interface { } // The jsii proxy struct for OverrideReturnsObject -type overrideReturnsObject struct { +type overrideReturnsObject_jsiiProxy struct { _ byte // padding } func NewOverrideReturnsObject() OverrideReturnsObject { _init_.Initialize() - o := overrideReturnsObject{} + + o := overrideReturnsObject_jsiiProxy{} _jsii_.Create( "jsii-calc.OverrideReturnsObject", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &o, ) + return &o } -func (o *overrideReturnsObject) Test(obj IReturnsNumber) float64 { +func (o *overrideReturnsObject_jsiiProxy) Test(obj IReturnsNumber) float64 { var returns float64 + _jsii_.Invoke( o, "test", []interface{}{obj}, - true, &returns, ) + return returns } @@ -9796,33 +10037,36 @@ type PartiallyInitializedThisConsumer interface { } // The jsii proxy struct for PartiallyInitializedThisConsumer -type partiallyInitializedThisConsumer struct { +type partiallyInitializedThisConsumer_jsiiProxy struct { _ byte // padding } func NewPartiallyInitializedThisConsumer() PartiallyInitializedThisConsumer { _init_.Initialize() - p := partiallyInitializedThisConsumer{} + + p := partiallyInitializedThisConsumer_jsiiProxy{} _jsii_.Create( "jsii-calc.PartiallyInitializedThisConsumer", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &p, ) + return &p } -func (p *partiallyInitializedThisConsumer) ConsumePartiallyInitializedThis(obj ConstructorPassesThisOut, dt string, ev AllTypesEnum) string { +func (p *partiallyInitializedThisConsumer_jsiiProxy) ConsumePartiallyInitializedThis(obj ConstructorPassesThisOut, dt string, ev AllTypesEnum) string { var returns string + _jsii_.Invoke( p, "consumePartiallyInitializedThis", []interface{}{obj, dt, ev}, - true, &returns, ) + return returns } @@ -9831,33 +10075,36 @@ type Polymorphism interface { } // The jsii proxy struct for Polymorphism -type polymorphism struct { +type polymorphism_jsiiProxy struct { _ byte // padding } func NewPolymorphism() Polymorphism { _init_.Initialize() - p := polymorphism{} + + p := polymorphism_jsiiProxy{} _jsii_.Create( "jsii-calc.Polymorphism", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &p, ) + return &p } -func (p *polymorphism) SayHello(friendly scopejsiicalclib.IFriendly) string { +func (p *polymorphism_jsiiProxy) SayHello(friendly scopejsiicalclib.IFriendly) string { var returns string + _jsii_.Invoke( p, "sayHello", []interface{}{friendly}, - true, &returns, ) + return returns } @@ -9870,11 +10117,11 @@ type Power interface { } // The jsii proxy struct for Power -type power struct { +type power_jsiiProxy struct { composition.CompositeOperation // extends jsii-calc.composition.CompositeOperation } -func (p *power) Base() scopejsiicalclib.NumericValue { +func (p *power_jsiiProxy) Base() scopejsiicalclib.NumericValue { var returns scopejsiicalclib.NumericValue _jsii_.Get( p, @@ -9884,7 +10131,7 @@ func (p *power) Base() scopejsiicalclib.NumericValue { return returns } -func (p *power) Expression() scopejsiicalclib.NumericValue { +func (p *power_jsiiProxy) Expression() scopejsiicalclib.NumericValue { var returns scopejsiicalclib.NumericValue _jsii_.Get( p, @@ -9894,7 +10141,7 @@ func (p *power) Expression() scopejsiicalclib.NumericValue { return returns } -func (p *power) Pow() scopejsiicalclib.NumericValue { +func (p *power_jsiiProxy) Pow() scopejsiicalclib.NumericValue { var returns scopejsiicalclib.NumericValue _jsii_.Get( p, @@ -9908,15 +10155,17 @@ func (p *power) Pow() scopejsiicalclib.NumericValue { // Creates a Power operation. func NewPower(base scopejsiicalclib.NumericValue, pow scopejsiicalclib.NumericValue) Power { _init_.Initialize() - p := power{} + + p := power_jsiiProxy{} _jsii_.Create( "jsii-calc.Power", []interface{}{base, pow}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &p, ) + return &p } @@ -9927,11 +10176,11 @@ type PropertyNamedProperty interface { } // The jsii proxy struct for PropertyNamedProperty -type propertyNamedProperty struct { +type propertyNamedProperty_jsiiProxy struct { _ byte // padding } -func (p *propertyNamedProperty) Property() string { +func (p *propertyNamedProperty_jsiiProxy) Property() string { var returns string _jsii_.Get( p, @@ -9941,7 +10190,7 @@ func (p *propertyNamedProperty) Property() string { return returns } -func (p *propertyNamedProperty) YetAnoterOne() bool { +func (p *propertyNamedProperty_jsiiProxy) YetAnoterOne() bool { var returns bool _jsii_.Get( p, @@ -9954,15 +10203,17 @@ func (p *propertyNamedProperty) YetAnoterOne() bool { func NewPropertyNamedProperty() PropertyNamedProperty { _init_.Initialize() - p := propertyNamedProperty{} + + p := propertyNamedProperty_jsiiProxy{} _jsii_.Create( "jsii-calc.PropertyNamedProperty", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &p, ) + return &p } @@ -9971,32 +10222,31 @@ type PublicClass interface { } // The jsii proxy struct for PublicClass -type publicClass struct { +type publicClass_jsiiProxy struct { _ byte // padding } func NewPublicClass() PublicClass { _init_.Initialize() - p := publicClass{} + + p := publicClass_jsiiProxy{} _jsii_.Create( "jsii-calc.PublicClass", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &p, ) + return &p } -func (p *publicClass) Hello() { - var returns interface{} - _jsii_.Invoke( +func (p *publicClass_jsiiProxy) Hello() { + _jsii_.InvokeVoid( p, "hello", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } @@ -10036,373 +10286,279 @@ type PythonReservedWords interface { } // The jsii proxy struct for PythonReservedWords -type pythonReservedWords struct { +type pythonReservedWords_jsiiProxy struct { _ byte // padding } func NewPythonReservedWords() PythonReservedWords { _init_.Initialize() - p := pythonReservedWords{} + + p := pythonReservedWords_jsiiProxy{} _jsii_.Create( "jsii-calc.PythonReservedWords", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &p, ) + return &p } -func (p *pythonReservedWords) And() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) And() { + _jsii_.InvokeVoid( p, "and", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) As() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) As() { + _jsii_.InvokeVoid( p, "as", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) Assert() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) Assert() { + _jsii_.InvokeVoid( p, "assert", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) Async() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) Async() { + _jsii_.InvokeVoid( p, "async", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) Await() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) Await() { + _jsii_.InvokeVoid( p, "await", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) Break() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) Break() { + _jsii_.InvokeVoid( p, "break", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) Class() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) Class() { + _jsii_.InvokeVoid( p, "class", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) Continue() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) Continue() { + _jsii_.InvokeVoid( p, "continue", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) Def() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) Def() { + _jsii_.InvokeVoid( p, "def", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) Del() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) Del() { + _jsii_.InvokeVoid( p, "del", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) Elif() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) Elif() { + _jsii_.InvokeVoid( p, "elif", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) Else() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) Else() { + _jsii_.InvokeVoid( p, "else", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) Except() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) Except() { + _jsii_.InvokeVoid( p, "except", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) Finally() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) Finally() { + _jsii_.InvokeVoid( p, "finally", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) For() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) For() { + _jsii_.InvokeVoid( p, "for", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) From() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) From() { + _jsii_.InvokeVoid( p, "from", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) Global() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) Global() { + _jsii_.InvokeVoid( p, "global", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) If() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) If() { + _jsii_.InvokeVoid( p, "if", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) Import() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) Import() { + _jsii_.InvokeVoid( p, "import", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) In() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) In() { + _jsii_.InvokeVoid( p, "in", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) Is() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) Is() { + _jsii_.InvokeVoid( p, "is", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) Lambda() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) Lambda() { + _jsii_.InvokeVoid( p, "lambda", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) Nonlocal() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) Nonlocal() { + _jsii_.InvokeVoid( p, "nonlocal", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) Not() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) Not() { + _jsii_.InvokeVoid( p, "not", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) Or() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) Or() { + _jsii_.InvokeVoid( p, "or", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) Pass() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) Pass() { + _jsii_.InvokeVoid( p, "pass", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) Raise() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) Raise() { + _jsii_.InvokeVoid( p, "raise", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) Return() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) Return() { + _jsii_.InvokeVoid( p, "return", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) Try() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) Try() { + _jsii_.InvokeVoid( p, "try", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) While() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) While() { + _jsii_.InvokeVoid( p, "while", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) With() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) With() { + _jsii_.InvokeVoid( p, "with", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (p *pythonReservedWords) Yield() { - var returns interface{} - _jsii_.Invoke( +func (p *pythonReservedWords_jsiiProxy) Yield() { + _jsii_.InvokeVoid( p, "yield", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } @@ -10415,11 +10571,11 @@ type ReferenceEnumFromScopedPackage interface { } // The jsii proxy struct for ReferenceEnumFromScopedPackage -type referenceEnumFromScopedPackage struct { +type referenceEnumFromScopedPackage_jsiiProxy struct { _ byte // padding } -func (r *referenceEnumFromScopedPackage) Foo() scopejsiicalclib.EnumFromScopedModule { +func (r *referenceEnumFromScopedPackage_jsiiProxy) Foo() scopejsiicalclib.EnumFromScopedModule { var returns scopejsiicalclib.EnumFromScopedModule _jsii_.Get( r, @@ -10432,19 +10588,21 @@ func (r *referenceEnumFromScopedPackage) Foo() scopejsiicalclib.EnumFromScopedMo func NewReferenceEnumFromScopedPackage() ReferenceEnumFromScopedPackage { _init_.Initialize() - r := referenceEnumFromScopedPackage{} + + r := referenceEnumFromScopedPackage_jsiiProxy{} _jsii_.Create( "jsii-calc.ReferenceEnumFromScopedPackage", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &r, ) + return &r } -func (r *referenceEnumFromScopedPackage) SetFoo(val scopejsiicalclib.EnumFromScopedModule) { +func (r *referenceEnumFromScopedPackage_jsiiProxy) SetFoo(val scopejsiicalclib.EnumFromScopedModule) { _jsii_.Set( r, "foo", @@ -10452,26 +10610,24 @@ func (r *referenceEnumFromScopedPackage) SetFoo(val scopejsiicalclib.EnumFromSco ) } -func (r *referenceEnumFromScopedPackage) LoadFoo() scopejsiicalclib.EnumFromScopedModule { +func (r *referenceEnumFromScopedPackage_jsiiProxy) LoadFoo() scopejsiicalclib.EnumFromScopedModule { var returns scopejsiicalclib.EnumFromScopedModule + _jsii_.Invoke( r, "loadFoo", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } -func (r *referenceEnumFromScopedPackage) SaveFoo(value scopejsiicalclib.EnumFromScopedModule) { - var returns interface{} - _jsii_.Invoke( +func (r *referenceEnumFromScopedPackage_jsiiProxy) SaveFoo(value scopejsiicalclib.EnumFromScopedModule) { + _jsii_.InvokeVoid( r, "saveFoo", []interface{}{value}, - false, - &returns, ) } @@ -10485,11 +10641,11 @@ type ReturnsPrivateImplementationOfInterface interface { } // The jsii proxy struct for ReturnsPrivateImplementationOfInterface -type returnsPrivateImplementationOfInterface struct { +type returnsPrivateImplementationOfInterface_jsiiProxy struct { _ byte // padding } -func (r *returnsPrivateImplementationOfInterface) PrivateImplementation() IPrivatelyImplemented { +func (r *returnsPrivateImplementationOfInterface_jsiiProxy) PrivateImplementation() IPrivatelyImplemented { var returns IPrivatelyImplemented _jsii_.Get( r, @@ -10502,15 +10658,17 @@ func (r *returnsPrivateImplementationOfInterface) PrivateImplementation() IPriva func NewReturnsPrivateImplementationOfInterface() ReturnsPrivateImplementationOfInterface { _init_.Initialize() - r := returnsPrivateImplementationOfInterface{} + + r := returnsPrivateImplementationOfInterface_jsiiProxy{} _jsii_.Create( "jsii-calc.ReturnsPrivateImplementationOfInterface", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &r, ) + return &r } @@ -10528,19 +10686,17 @@ type RootStructValidator interface { } // The jsii proxy struct for RootStructValidator -type rootStructValidator struct { +type rootStructValidator_jsiiProxy struct { _ byte // padding } func RootStructValidator_Validate(struct_ RootStruct) { _init_.Initialize() - var returns interface{} - _jsii_.StaticInvoke( + + _jsii_.StaticInvokeVoid( "jsii-calc.RootStructValidator", "validate", []interface{}{struct_}, - false, - &returns, ) } @@ -10551,55 +10707,48 @@ type RuntimeTypeChecking interface { } // The jsii proxy struct for RuntimeTypeChecking -type runtimeTypeChecking struct { +type runtimeTypeChecking_jsiiProxy struct { _ byte // padding } func NewRuntimeTypeChecking() RuntimeTypeChecking { _init_.Initialize() - r := runtimeTypeChecking{} + + r := runtimeTypeChecking_jsiiProxy{} _jsii_.Create( "jsii-calc.RuntimeTypeChecking", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &r, ) + return &r } -func (r *runtimeTypeChecking) MethodWithDefaultedArguments(arg1 float64, arg2 string, arg3 string) { - var returns interface{} - _jsii_.Invoke( +func (r *runtimeTypeChecking_jsiiProxy) MethodWithDefaultedArguments(arg1 float64, arg2 string, arg3 string) { + _jsii_.InvokeVoid( r, "methodWithDefaultedArguments", []interface{}{arg1, arg2, arg3}, - false, - &returns, ) } -func (r *runtimeTypeChecking) MethodWithOptionalAnyArgument(arg interface{}) { - var returns interface{} - _jsii_.Invoke( +func (r *runtimeTypeChecking_jsiiProxy) MethodWithOptionalAnyArgument(arg interface{}) { + _jsii_.InvokeVoid( r, "methodWithOptionalAnyArgument", []interface{}{arg}, - false, - &returns, ) } // Used to verify verification of number of method arguments. -func (r *runtimeTypeChecking) MethodWithOptionalArguments(arg1 float64, arg2 string, arg3 string) { - var returns interface{} - _jsii_.Invoke( +func (r *runtimeTypeChecking_jsiiProxy) MethodWithOptionalArguments(arg1 float64, arg2 string, arg3 string) { + _jsii_.InvokeVoid( r, "methodWithOptionalArguments", []interface{}{arg1, arg2, arg3}, - false, - &returns, ) } @@ -10621,45 +10770,49 @@ type SingleInstanceTwoTypes interface { } // The jsii proxy struct for SingleInstanceTwoTypes -type singleInstanceTwoTypes struct { +type singleInstanceTwoTypes_jsiiProxy struct { _ byte // padding } func NewSingleInstanceTwoTypes() SingleInstanceTwoTypes { _init_.Initialize() - s := singleInstanceTwoTypes{} + + s := singleInstanceTwoTypes_jsiiProxy{} _jsii_.Create( "jsii-calc.SingleInstanceTwoTypes", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &s, ) + return &s } -func (s *singleInstanceTwoTypes) Interface1() InbetweenClass { +func (s *singleInstanceTwoTypes_jsiiProxy) Interface1() InbetweenClass { var returns InbetweenClass + _jsii_.Invoke( s, "interface1", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } -func (s *singleInstanceTwoTypes) Interface2() IPublicInterface { +func (s *singleInstanceTwoTypes_jsiiProxy) Interface2() IPublicInterface { var returns IPublicInterface + _jsii_.Invoke( s, "interface2", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -10671,19 +10824,20 @@ type SingletonInt interface { } // The jsii proxy struct for SingletonInt -type singletonInt struct { +type singletonInt_jsiiProxy struct { _ byte // padding } -func (s *singletonInt) IsSingletonInt(value float64) bool { +func (s *singletonInt_jsiiProxy) IsSingletonInt(value float64) bool { var returns bool + _jsii_.Invoke( s, "isSingletonInt", []interface{}{value}, - true, &returns, ) + return returns } @@ -10702,19 +10856,20 @@ type SingletonString interface { } // The jsii proxy struct for SingletonString -type singletonString struct { +type singletonString_jsiiProxy struct { _ byte // padding } -func (s *singletonString) IsSingletonString(value string) bool { +func (s *singletonString_jsiiProxy) IsSingletonString(value string) bool { var returns bool + _jsii_.Invoke( s, "isSingletonString", []interface{}{value}, - true, &returns, ) + return returns } @@ -10734,47 +10889,53 @@ type SomeTypeJsii976 interface { } // The jsii proxy struct for SomeTypeJsii976 -type someTypeJsii976 struct { +type someTypeJsii976_jsiiProxy struct { _ byte // padding } func NewSomeTypeJsii976() SomeTypeJsii976 { _init_.Initialize() - s := someTypeJsii976{} + + s := someTypeJsii976_jsiiProxy{} _jsii_.Create( "jsii-calc.SomeTypeJsii976", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &s, ) + return &s } func SomeTypeJsii976_ReturnAnonymous() interface{} { _init_.Initialize() + var returns interface{} + _jsii_.StaticInvoke( "jsii-calc.SomeTypeJsii976", "returnAnonymous", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } func SomeTypeJsii976_ReturnReturn() IReturnJsii976 { _init_.Initialize() + var returns IReturnJsii976 + _jsii_.StaticInvoke( "jsii-calc.SomeTypeJsii976", "returnReturn", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -10786,11 +10947,11 @@ type StableClass interface { } // The jsii proxy struct for StableClass -type stableClass struct { +type stableClass_jsiiProxy struct { _ byte // padding } -func (s *stableClass) MutableProperty() float64 { +func (s *stableClass_jsiiProxy) MutableProperty() float64 { var returns float64 _jsii_.Get( s, @@ -10800,7 +10961,7 @@ func (s *stableClass) MutableProperty() float64 { return returns } -func (s *stableClass) ReadonlyProperty() string { +func (s *stableClass_jsiiProxy) ReadonlyProperty() string { var returns string _jsii_.Get( s, @@ -10813,19 +10974,21 @@ func (s *stableClass) ReadonlyProperty() string { func NewStableClass(readonlyString string, mutableNumber float64) StableClass { _init_.Initialize() - s := stableClass{} + + s := stableClass_jsiiProxy{} _jsii_.Create( "jsii-calc.StableClass", []interface{}{readonlyString, mutableNumber}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &s, ) + return &s } -func (s *stableClass) SetMutableProperty(val float64) { +func (s *stableClass_jsiiProxy) SetMutableProperty(val float64) { _jsii_.Set( s, "mutableProperty", @@ -10833,14 +10996,11 @@ func (s *stableClass) SetMutableProperty(val float64) { ) } -func (s *stableClass) Method() { - var returns interface{} - _jsii_.Invoke( +func (s *stableClass_jsiiProxy) Method() { + _jsii_.InvokeVoid( s, "method", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } @@ -10862,20 +11022,22 @@ type StaticContext interface { } // The jsii proxy struct for StaticContext -type staticContext struct { +type staticContext_jsiiProxy struct { _ byte // padding } func StaticContext_CanAccessStaticContext() bool { _init_.Initialize() + var returns bool + _jsii_.StaticInvoke( "jsii-calc.StaticContext", "canAccessStaticContext", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -10904,19 +11066,17 @@ type StaticHelloChild interface { } // The jsii proxy struct for StaticHelloChild -type staticHelloChild struct { - staticHelloParent // extends jsii-calc.StaticHelloParent +type staticHelloChild_jsiiProxy struct { + staticHelloParent_jsiiProxy // extends jsii-calc.StaticHelloParent } func StaticHelloChild_Method() { _init_.Initialize() - var returns interface{} - _jsii_.StaticInvoke( + + _jsii_.StaticInvokeVoid( "jsii-calc.StaticHelloChild", "method", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } @@ -10940,33 +11100,33 @@ type StaticHelloParent interface { } // The jsii proxy struct for StaticHelloParent -type staticHelloParent struct { +type staticHelloParent_jsiiProxy struct { _ byte // padding } func NewStaticHelloParent() StaticHelloParent { _init_.Initialize() - s := staticHelloParent{} + + s := staticHelloParent_jsiiProxy{} _jsii_.Create( "jsii-calc.StaticHelloParent", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &s, ) + return &s } func StaticHelloParent_Method() { _init_.Initialize() - var returns interface{} - _jsii_.StaticInvoke( + + _jsii_.StaticInvokeVoid( "jsii-calc.StaticHelloParent", "method", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } @@ -10987,11 +11147,11 @@ type Statics interface { } // The jsii proxy struct for Statics -type statics struct { +type statics_jsiiProxy struct { _ byte // padding } -func (s *statics) Value() string { +func (s *statics_jsiiProxy) Value() string { var returns string _jsii_.Get( s, @@ -11004,29 +11164,33 @@ func (s *statics) Value() string { func NewStatics(value string) Statics { _init_.Initialize() - s := statics{} + + s := statics_jsiiProxy{} _jsii_.Create( "jsii-calc.Statics", []interface{}{value}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &s, ) + return &s } // Jsdocs for static method. func Statics_StaticMethod(name string) string { _init_.Initialize() + var returns string + _jsii_.StaticInvoke( "jsii-calc.Statics", "staticMethod", []interface{}{name}, - true, &returns, ) + return returns } @@ -11114,15 +11278,16 @@ func Statics_ZooBar() map[string]string { return returns } -func (s *statics) JustMethod() string { +func (s *statics_jsiiProxy) JustMethod() string { var returns string + _jsii_.Invoke( s, "justMethod", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -11140,11 +11305,11 @@ type StripInternal interface { } // The jsii proxy struct for StripInternal -type stripInternal struct { +type stripInternal_jsiiProxy struct { _ byte // padding } -func (s *stripInternal) YouSeeMe() string { +func (s *stripInternal_jsiiProxy) YouSeeMe() string { var returns string _jsii_.Get( s, @@ -11157,19 +11322,21 @@ func (s *stripInternal) YouSeeMe() string { func NewStripInternal() StripInternal { _init_.Initialize() - s := stripInternal{} + + s := stripInternal_jsiiProxy{} _jsii_.Create( "jsii-calc.StripInternal", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &s, ) + return &s } -func (s *stripInternal) SetYouSeeMe(val string) { +func (s *stripInternal_jsiiProxy) SetYouSeeMe(val string) { _jsii_.Set( s, "youSeeMe", @@ -11204,47 +11371,53 @@ type StructPassing interface { } // The jsii proxy struct for StructPassing -type structPassing struct { +type structPassing_jsiiProxy struct { _ byte // padding } func NewStructPassing() StructPassing { _init_.Initialize() - s := structPassing{} + + s := structPassing_jsiiProxy{} _jsii_.Create( "jsii-calc.StructPassing", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &s, ) + return &s } func StructPassing_HowManyVarArgsDidIPass(_positional float64, inputs TopLevelStruct) float64 { _init_.Initialize() + var returns float64 + _jsii_.StaticInvoke( "jsii-calc.StructPassing", "howManyVarArgsDidIPass", []interface{}{_positional, inputs}, - true, &returns, ) + return returns } func StructPassing_RoundTrip(_positional float64, input TopLevelStruct) TopLevelStruct { _init_.Initialize() + var returns TopLevelStruct + _jsii_.StaticInvoke( "jsii-calc.StructPassing", "roundTrip", []interface{}{_positional, input}, - true, &returns, ) + return returns } @@ -11252,36 +11425,47 @@ type StructUnionConsumer interface { } // The jsii proxy struct for StructUnionConsumer -type structUnionConsumer struct { +type structUnionConsumer_jsiiProxy struct { _ byte // padding } func StructUnionConsumer_IsStructA(struct_ interface{}) bool { _init_.Initialize() + var returns bool + _jsii_.StaticInvoke( "jsii-calc.StructUnionConsumer", "isStructA", []interface{}{struct_}, - true, &returns, ) + return returns } func StructUnionConsumer_IsStructB(struct_ interface{}) bool { _init_.Initialize() + var returns bool + _jsii_.StaticInvoke( "jsii-calc.StructUnionConsumer", "isStructB", []interface{}{struct_}, - true, &returns, ) + return returns } +type StructWithEnum struct { + // An enum value. + Foo StringEnum \`json:"foo"\` + // Optional enum value (of type integer). + Bar AllTypesEnum \`json:"bar"\` +} + type StructWithJavaReservedWords struct { Default string \`json:"default"\` Assert string \`json:"assert"\` @@ -11298,11 +11482,11 @@ type Sum interface { } // The jsii proxy struct for Sum -type sum struct { +type sum_jsiiProxy struct { composition.CompositeOperation // extends jsii-calc.composition.CompositeOperation } -func (s *sum) Expression() scopejsiicalclib.NumericValue { +func (s *sum_jsiiProxy) Expression() scopejsiicalclib.NumericValue { var returns scopejsiicalclib.NumericValue _jsii_.Get( s, @@ -11312,7 +11496,7 @@ func (s *sum) Expression() scopejsiicalclib.NumericValue { return returns } -func (s *sum) Parts() []scopejsiicalclib.NumericValue { +func (s *sum_jsiiProxy) Parts() []scopejsiicalclib.NumericValue { var returns []scopejsiicalclib.NumericValue _jsii_.Get( s, @@ -11325,19 +11509,21 @@ func (s *sum) Parts() []scopejsiicalclib.NumericValue { func NewSum() Sum { _init_.Initialize() - s := sum{} + + s := sum_jsiiProxy{} _jsii_.Create( "jsii-calc.Sum", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &s, ) + return &s } -func (s *sum) SetParts(val []scopejsiicalclib.NumericValue) { +func (s *sum_jsiiProxy) SetParts(val []scopejsiicalclib.NumericValue) { _jsii_.Set( s, "parts", @@ -11352,11 +11538,11 @@ type SupportsNiceJavaBuilder interface { } // The jsii proxy struct for SupportsNiceJavaBuilder -type supportsNiceJavaBuilder struct { - supportsNiceJavaBuilderWithRequiredProps // extends jsii-calc.SupportsNiceJavaBuilderWithRequiredProps +type supportsNiceJavaBuilder_jsiiProxy struct { + supportsNiceJavaBuilderWithRequiredProps_jsiiProxy // extends jsii-calc.SupportsNiceJavaBuilderWithRequiredProps } -func (s *supportsNiceJavaBuilder) Id() float64 { +func (s *supportsNiceJavaBuilder_jsiiProxy) Id() float64 { var returns float64 _jsii_.Get( s, @@ -11366,7 +11552,7 @@ func (s *supportsNiceJavaBuilder) Id() float64 { return returns } -func (s *supportsNiceJavaBuilder) Rest() []string { +func (s *supportsNiceJavaBuilder_jsiiProxy) Rest() []string { var returns []string _jsii_.Get( s, @@ -11379,15 +11565,17 @@ func (s *supportsNiceJavaBuilder) Rest() []string { func NewSupportsNiceJavaBuilder(id float64, defaultBar float64, props SupportsNiceJavaBuilderProps, rest string) SupportsNiceJavaBuilder { _init_.Initialize() - s := supportsNiceJavaBuilder{} + + s := supportsNiceJavaBuilder_jsiiProxy{} _jsii_.Create( "jsii-calc.SupportsNiceJavaBuilder", []interface{}{id, defaultBar, props, rest}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &s, ) + return &s } @@ -11408,11 +11596,11 @@ type SupportsNiceJavaBuilderWithRequiredProps interface { } // The jsii proxy struct for SupportsNiceJavaBuilderWithRequiredProps -type supportsNiceJavaBuilderWithRequiredProps struct { +type supportsNiceJavaBuilderWithRequiredProps_jsiiProxy struct { _ byte // padding } -func (s *supportsNiceJavaBuilderWithRequiredProps) Bar() float64 { +func (s *supportsNiceJavaBuilderWithRequiredProps_jsiiProxy) Bar() float64 { var returns float64 _jsii_.Get( s, @@ -11422,7 +11610,7 @@ func (s *supportsNiceJavaBuilderWithRequiredProps) Bar() float64 { return returns } -func (s *supportsNiceJavaBuilderWithRequiredProps) Id() float64 { +func (s *supportsNiceJavaBuilderWithRequiredProps_jsiiProxy) Id() float64 { var returns float64 _jsii_.Get( s, @@ -11432,7 +11620,7 @@ func (s *supportsNiceJavaBuilderWithRequiredProps) Id() float64 { return returns } -func (s *supportsNiceJavaBuilderWithRequiredProps) PropId() string { +func (s *supportsNiceJavaBuilderWithRequiredProps_jsiiProxy) PropId() string { var returns string _jsii_.Get( s, @@ -11445,15 +11633,17 @@ func (s *supportsNiceJavaBuilderWithRequiredProps) PropId() string { func NewSupportsNiceJavaBuilderWithRequiredProps(id float64, props SupportsNiceJavaBuilderProps) SupportsNiceJavaBuilderWithRequiredProps { _init_.Initialize() - s := supportsNiceJavaBuilderWithRequiredProps{} + + s := supportsNiceJavaBuilderWithRequiredProps_jsiiProxy{} _jsii_.Create( "jsii-calc.SupportsNiceJavaBuilderWithRequiredProps", []interface{}{id, props}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &s, ) + return &s } @@ -11482,11 +11672,11 @@ type SyncVirtualMethods interface { } // The jsii proxy struct for SyncVirtualMethods -type syncVirtualMethods struct { +type syncVirtualMethods_jsiiProxy struct { _ byte // padding } -func (s *syncVirtualMethods) A() float64 { +func (s *syncVirtualMethods_jsiiProxy) A() float64 { var returns float64 _jsii_.Get( s, @@ -11496,7 +11686,7 @@ func (s *syncVirtualMethods) A() float64 { return returns } -func (s *syncVirtualMethods) CallerIsProperty() float64 { +func (s *syncVirtualMethods_jsiiProxy) CallerIsProperty() float64 { var returns float64 _jsii_.Get( s, @@ -11506,7 +11696,7 @@ func (s *syncVirtualMethods) CallerIsProperty() float64 { return returns } -func (s *syncVirtualMethods) OtherProperty() string { +func (s *syncVirtualMethods_jsiiProxy) OtherProperty() string { var returns string _jsii_.Get( s, @@ -11516,7 +11706,7 @@ func (s *syncVirtualMethods) OtherProperty() string { return returns } -func (s *syncVirtualMethods) ReadonlyProperty() string { +func (s *syncVirtualMethods_jsiiProxy) ReadonlyProperty() string { var returns string _jsii_.Get( s, @@ -11526,7 +11716,7 @@ func (s *syncVirtualMethods) ReadonlyProperty() string { return returns } -func (s *syncVirtualMethods) TheProperty() string { +func (s *syncVirtualMethods_jsiiProxy) TheProperty() string { var returns string _jsii_.Get( s, @@ -11536,7 +11726,7 @@ func (s *syncVirtualMethods) TheProperty() string { return returns } -func (s *syncVirtualMethods) ValueOfOtherProperty() string { +func (s *syncVirtualMethods_jsiiProxy) ValueOfOtherProperty() string { var returns string _jsii_.Get( s, @@ -11549,19 +11739,21 @@ func (s *syncVirtualMethods) ValueOfOtherProperty() string { func NewSyncVirtualMethods() SyncVirtualMethods { _init_.Initialize() - s := syncVirtualMethods{} + + s := syncVirtualMethods_jsiiProxy{} _jsii_.Create( "jsii-calc.SyncVirtualMethods", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &s, ) + return &s } -func (s *syncVirtualMethods) SetA(val float64) { +func (s *syncVirtualMethods_jsiiProxy) SetA(val float64) { _jsii_.Set( s, "a", @@ -11569,7 +11761,7 @@ func (s *syncVirtualMethods) SetA(val float64) { ) } -func (s *syncVirtualMethods) SetCallerIsProperty(val float64) { +func (s *syncVirtualMethods_jsiiProxy) SetCallerIsProperty(val float64) { _jsii_.Set( s, "callerIsProperty", @@ -11577,7 +11769,7 @@ func (s *syncVirtualMethods) SetCallerIsProperty(val float64) { ) } -func (s *syncVirtualMethods) SetOtherProperty(val string) { +func (s *syncVirtualMethods_jsiiProxy) SetOtherProperty(val string) { _jsii_.Set( s, "otherProperty", @@ -11585,7 +11777,7 @@ func (s *syncVirtualMethods) SetOtherProperty(val string) { ) } -func (s *syncVirtualMethods) SetTheProperty(val string) { +func (s *syncVirtualMethods_jsiiProxy) SetTheProperty(val string) { _jsii_.Set( s, "theProperty", @@ -11593,7 +11785,7 @@ func (s *syncVirtualMethods) SetTheProperty(val string) { ) } -func (s *syncVirtualMethods) SetValueOfOtherProperty(val string) { +func (s *syncVirtualMethods_jsiiProxy) SetValueOfOtherProperty(val string) { _jsii_.Set( s, "valueOfOtherProperty", @@ -11601,121 +11793,196 @@ func (s *syncVirtualMethods) SetValueOfOtherProperty(val string) { ) } -func (s *syncVirtualMethods) CallerIsAsync() float64 { +func (s *syncVirtualMethods_jsiiProxy) CallerIsAsync() float64 { var returns float64 + _jsii_.Invoke( s, "callerIsAsync", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } -func (s *syncVirtualMethods) CallerIsMethod() float64 { +func (s *syncVirtualMethods_jsiiProxy) CallerIsMethod() float64 { var returns float64 + _jsii_.Invoke( s, "callerIsMethod", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } -func (s *syncVirtualMethods) ModifyOtherProperty(value string) { - var returns interface{} - _jsii_.Invoke( +func (s *syncVirtualMethods_jsiiProxy) ModifyOtherProperty(value string) { + _jsii_.InvokeVoid( s, "modifyOtherProperty", []interface{}{value}, - false, - &returns, ) } -func (s *syncVirtualMethods) ModifyValueOfTheProperty(value string) { - var returns interface{} - _jsii_.Invoke( +func (s *syncVirtualMethods_jsiiProxy) ModifyValueOfTheProperty(value string) { + _jsii_.InvokeVoid( s, "modifyValueOfTheProperty", []interface{}{value}, - false, - &returns, ) } -func (s *syncVirtualMethods) ReadA() float64 { +func (s *syncVirtualMethods_jsiiProxy) ReadA() float64 { var returns float64 + _jsii_.Invoke( s, "readA", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } -func (s *syncVirtualMethods) RetrieveOtherProperty() string { +func (s *syncVirtualMethods_jsiiProxy) RetrieveOtherProperty() string { var returns string + _jsii_.Invoke( s, "retrieveOtherProperty", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } -func (s *syncVirtualMethods) RetrieveReadOnlyProperty() string { +func (s *syncVirtualMethods_jsiiProxy) RetrieveReadOnlyProperty() string { var returns string + _jsii_.Invoke( s, "retrieveReadOnlyProperty", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } -func (s *syncVirtualMethods) RetrieveValueOfTheProperty() string { +func (s *syncVirtualMethods_jsiiProxy) RetrieveValueOfTheProperty() string { var returns string + _jsii_.Invoke( s, "retrieveValueOfTheProperty", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } -func (s *syncVirtualMethods) VirtualMethod(n float64) float64 { +func (s *syncVirtualMethods_jsiiProxy) VirtualMethod(n float64) float64 { var returns float64 + _jsii_.Invoke( s, "virtualMethod", []interface{}{n}, - true, &returns, ) + return returns } -func (s *syncVirtualMethods) WriteA(value float64) { - var returns interface{} - _jsii_.Invoke( +func (s *syncVirtualMethods_jsiiProxy) WriteA(value float64) { + _jsii_.InvokeVoid( s, "writeA", []interface{}{value}, - false, + ) +} + +type TestStructWithEnum interface { + StructWithFoo() StructWithEnum + StructWithFooBar() StructWithEnum + IsStringEnumA(input StructWithEnum) bool + IsStringEnumB(input StructWithEnum) bool +} + +// The jsii proxy struct for TestStructWithEnum +type testStructWithEnum_jsiiProxy struct { + _ byte // padding +} + +func (t *testStructWithEnum_jsiiProxy) StructWithFoo() StructWithEnum { + var returns StructWithEnum + _jsii_.Get( + t, + "structWithFoo", + &returns, + ) + return returns +} + +func (t *testStructWithEnum_jsiiProxy) StructWithFooBar() StructWithEnum { + var returns StructWithEnum + _jsii_.Get( + t, + "structWithFooBar", + &returns, + ) + return returns +} + + +func NewTestStructWithEnum() TestStructWithEnum { + _init_.Initialize() + + t := testStructWithEnum_jsiiProxy{} + + _jsii_.Create( + "jsii-calc.TestStructWithEnum", + nil /* no parameters */, + []_jsii_.FQN{}, + nil, // no overrides + &t, + ) + + return &t +} + +// Returns true if \`foo\` is \`StringEnum.A\`. +func (t *testStructWithEnum_jsiiProxy) IsStringEnumA(input StructWithEnum) bool { + var returns bool + + _jsii_.Invoke( + t, + "isStringEnumA", + []interface{}{input}, + &returns, + ) + + return returns +} + +// Returns true if \`foo\` is \`StringEnum.B\` and \`bar\` is \`AllTypesEnum.THIS_IS_GREAT\`. +func (t *testStructWithEnum_jsiiProxy) IsStringEnumB(input StructWithEnum) bool { + var returns bool + + _jsii_.Invoke( + t, + "isStringEnumB", + []interface{}{input}, &returns, ) + + return returns } type Thrower interface { @@ -11723,32 +11990,31 @@ type Thrower interface { } // The jsii proxy struct for Thrower -type thrower struct { +type thrower_jsiiProxy struct { _ byte // padding } func NewThrower() Thrower { _init_.Initialize() - t := thrower{} + + t := thrower_jsiiProxy{} _jsii_.Create( "jsii-calc.Thrower", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &t, ) + return &t } -func (t *thrower) ThrowError() { - var returns interface{} - _jsii_.Invoke( +func (t *thrower_jsiiProxy) ThrowError() { + _jsii_.InvokeVoid( t, "throwError", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } @@ -11768,21 +12034,23 @@ type UmaskCheck interface { } // The jsii proxy struct for UmaskCheck -type umaskCheck struct { +type umaskCheck_jsiiProxy 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", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -11793,11 +12061,11 @@ type UnaryOperation interface { } // The jsii proxy struct for UnaryOperation -type unaryOperation struct { +type unaryOperation_jsiiProxy struct { scopejsiicalclib.Operation // extends @scope/jsii-calc-lib.Operation } -func (u *unaryOperation) Operand() scopejsiicalclib.NumericValue { +func (u *unaryOperation_jsiiProxy) Operand() scopejsiicalclib.NumericValue { var returns scopejsiicalclib.NumericValue _jsii_.Get( u, @@ -11810,15 +12078,17 @@ func (u *unaryOperation) Operand() scopejsiicalclib.NumericValue { func NewUnaryOperation(operand scopejsiicalclib.NumericValue) UnaryOperation { _init_.Initialize() - u := unaryOperation{} + + u := unaryOperation_jsiiProxy{} _jsii_.Create( "jsii-calc.UnaryOperation", []interface{}{operand}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &u, ) + return &u } @@ -11834,11 +12104,11 @@ type UpcasingReflectable interface { } // The jsii proxy struct for UpcasingReflectable -type upcasingReflectable struct { +type upcasingReflectable_jsiiProxy struct { submodule.IReflectable // implements @scope/jsii-calc-lib.submodule.IReflectable } -func (u *upcasingReflectable) Entries() []submodule.ReflectableEntry { +func (u *upcasingReflectable_jsiiProxy) Entries() []submodule.ReflectableEntry { var returns []submodule.ReflectableEntry _jsii_.Get( u, @@ -11851,15 +12121,17 @@ func (u *upcasingReflectable) Entries() []submodule.ReflectableEntry { func NewUpcasingReflectable(delegate map[string]interface{}) UpcasingReflectable { _init_.Initialize() - u := upcasingReflectable{} + + u := upcasingReflectable_jsiiProxy{} _jsii_.Create( "jsii-calc.UpcasingReflectable", []interface{}{delegate}, []_jsii_.FQN{"@scope/jsii-calc-lib.submodule.IReflectable"}, - []_jsii_.Override{}, + nil, // no overrides &u, ) + return &u } @@ -11879,33 +12151,36 @@ type UseBundledDependency interface { } // The jsii proxy struct for UseBundledDependency -type useBundledDependency struct { +type useBundledDependency_jsiiProxy struct { _ byte // padding } func NewUseBundledDependency() UseBundledDependency { _init_.Initialize() - u := useBundledDependency{} + + u := useBundledDependency_jsiiProxy{} _jsii_.Create( "jsii-calc.UseBundledDependency", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &u, ) + return &u } -func (u *useBundledDependency) Value() interface{} { +func (u *useBundledDependency_jsiiProxy) Value() interface{} { var returns interface{} + _jsii_.Invoke( u, "value", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -11915,33 +12190,36 @@ type UseCalcBase interface { } // The jsii proxy struct for UseCalcBase -type useCalcBase struct { +type useCalcBase_jsiiProxy struct { _ byte // padding } func NewUseCalcBase() UseCalcBase { _init_.Initialize() - u := useCalcBase{} + + u := useCalcBase_jsiiProxy{} _jsii_.Create( "jsii-calc.UseCalcBase", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &u, ) + return &u } -func (u *useCalcBase) Hello() scopejsiicalcbase.Base { +func (u *useCalcBase_jsiiProxy) Hello() scopejsiicalcbase.Base { var returns scopejsiicalcbase.Base + _jsii_.Invoke( u, "hello", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -11953,11 +12231,11 @@ type UsesInterfaceWithProperties interface { } // The jsii proxy struct for UsesInterfaceWithProperties -type usesInterfaceWithProperties struct { +type usesInterfaceWithProperties_jsiiProxy struct { _ byte // padding } -func (u *usesInterfaceWithProperties) Obj() IInterfaceWithProperties { +func (u *usesInterfaceWithProperties_jsiiProxy) Obj() IInterfaceWithProperties { var returns IInterfaceWithProperties _jsii_.Get( u, @@ -11970,51 +12248,56 @@ func (u *usesInterfaceWithProperties) Obj() IInterfaceWithProperties { func NewUsesInterfaceWithProperties(obj IInterfaceWithProperties) UsesInterfaceWithProperties { _init_.Initialize() - u := usesInterfaceWithProperties{} + + u := usesInterfaceWithProperties_jsiiProxy{} _jsii_.Create( "jsii-calc.UsesInterfaceWithProperties", []interface{}{obj}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &u, ) + return &u } -func (u *usesInterfaceWithProperties) JustRead() string { +func (u *usesInterfaceWithProperties_jsiiProxy) JustRead() string { var returns string + _jsii_.Invoke( u, "justRead", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } -func (u *usesInterfaceWithProperties) ReadStringAndNumber(ext IInterfaceWithPropertiesExtension) string { +func (u *usesInterfaceWithProperties_jsiiProxy) ReadStringAndNumber(ext IInterfaceWithPropertiesExtension) string { var returns string + _jsii_.Invoke( u, "readStringAndNumber", []interface{}{ext}, - true, &returns, ) + return returns } -func (u *usesInterfaceWithProperties) WriteAndRead(value string) string { +func (u *usesInterfaceWithProperties_jsiiProxy) WriteAndRead(value string) string { var returns string + _jsii_.Invoke( u, "writeAndRead", []interface{}{value}, - true, &returns, ) + return returns } @@ -12023,33 +12306,36 @@ type VariadicInvoker interface { } // The jsii proxy struct for VariadicInvoker -type variadicInvoker struct { +type variadicInvoker_jsiiProxy struct { _ byte // padding } func NewVariadicInvoker(method VariadicMethod) VariadicInvoker { _init_.Initialize() - v := variadicInvoker{} + + v := variadicInvoker_jsiiProxy{} _jsii_.Create( "jsii-calc.VariadicInvoker", []interface{}{method}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &v, ) + return &v } -func (v *variadicInvoker) AsArray(values float64) []float64 { +func (v *variadicInvoker_jsiiProxy) AsArray(values float64) []float64 { var returns []float64 + _jsii_.Invoke( v, "asArray", []interface{}{values}, - true, &returns, ) + return returns } @@ -12058,33 +12344,36 @@ type VariadicMethod interface { } // The jsii proxy struct for VariadicMethod -type variadicMethod struct { +type variadicMethod_jsiiProxy struct { _ byte // padding } func NewVariadicMethod(prefix float64) VariadicMethod { _init_.Initialize() - v := variadicMethod{} + + v := variadicMethod_jsiiProxy{} _jsii_.Create( "jsii-calc.VariadicMethod", []interface{}{prefix}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &v, ) + return &v } -func (v *variadicMethod) AsArray(first float64, others float64) []float64 { +func (v *variadicMethod_jsiiProxy) AsArray(first float64, others float64) []float64 { var returns []float64 + _jsii_.Invoke( v, "asArray", []interface{}{first, others}, - true, &returns, ) + return returns } @@ -12097,81 +12386,88 @@ type VirtualMethodPlayground interface { } // The jsii proxy struct for VirtualMethodPlayground -type virtualMethodPlayground struct { +type virtualMethodPlayground_jsiiProxy struct { _ byte // padding } func NewVirtualMethodPlayground() VirtualMethodPlayground { _init_.Initialize() - v := virtualMethodPlayground{} + + v := virtualMethodPlayground_jsiiProxy{} _jsii_.Create( "jsii-calc.VirtualMethodPlayground", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &v, ) + return &v } -func (v *virtualMethodPlayground) OverrideMeAsync(index float64) float64 { +func (v *virtualMethodPlayground_jsiiProxy) OverrideMeAsync(index float64) float64 { var returns float64 + _jsii_.Invoke( v, "overrideMeAsync", []interface{}{index}, - true, &returns, ) + return returns } -func (v *virtualMethodPlayground) OverrideMeSync(index float64) float64 { +func (v *virtualMethodPlayground_jsiiProxy) OverrideMeSync(index float64) float64 { var returns float64 + _jsii_.Invoke( v, "overrideMeSync", []interface{}{index}, - true, &returns, ) + return returns } -func (v *virtualMethodPlayground) ParallelSumAsync(count float64) float64 { +func (v *virtualMethodPlayground_jsiiProxy) ParallelSumAsync(count float64) float64 { var returns float64 + _jsii_.Invoke( v, "parallelSumAsync", []interface{}{count}, - true, &returns, ) + return returns } -func (v *virtualMethodPlayground) SerialSumAsync(count float64) float64 { +func (v *virtualMethodPlayground_jsiiProxy) SerialSumAsync(count float64) float64 { var returns float64 + _jsii_.Invoke( v, "serialSumAsync", []interface{}{count}, - true, &returns, ) + return returns } -func (v *virtualMethodPlayground) SumSync(count float64) float64 { +func (v *virtualMethodPlayground_jsiiProxy) SumSync(count float64) float64 { var returns float64 + _jsii_.Invoke( v, "sumSync", []interface{}{count}, - true, &returns, ) + return returns } @@ -12187,11 +12483,11 @@ type VoidCallback interface { } // The jsii proxy struct for VoidCallback -type voidCallback struct { +type voidCallback_jsiiProxy struct { _ byte // padding } -func (v *voidCallback) MethodWasCalled() bool { +func (v *voidCallback_jsiiProxy) MethodWasCalled() bool { var returns bool _jsii_.Get( v, @@ -12204,37 +12500,33 @@ func (v *voidCallback) MethodWasCalled() bool { func NewVoidCallback() VoidCallback { _init_.Initialize() - v := voidCallback{} + + v := voidCallback_jsiiProxy{} _jsii_.Create( "jsii-calc.VoidCallback", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &v, ) + return &v } -func (v *voidCallback) CallMe() { - var returns interface{} - _jsii_.Invoke( +func (v *voidCallback_jsiiProxy) CallMe() { + _jsii_.InvokeVoid( v, "callMe", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } -func (v *voidCallback) OverrideMe() { - var returns interface{} - _jsii_.Invoke( +func (v *voidCallback_jsiiProxy) OverrideMe() { + _jsii_.InvokeVoid( v, "overrideMe", - []interface{}{}, - false, - &returns, + nil /* no parameters */, ) } @@ -12244,11 +12536,11 @@ type WithPrivatePropertyInConstructor interface { } // The jsii proxy struct for WithPrivatePropertyInConstructor -type withPrivatePropertyInConstructor struct { +type withPrivatePropertyInConstructor_jsiiProxy struct { _ byte // padding } -func (w *withPrivatePropertyInConstructor) Success() bool { +func (w *withPrivatePropertyInConstructor_jsiiProxy) Success() bool { var returns bool _jsii_.Get( w, @@ -12261,15 +12553,17 @@ func (w *withPrivatePropertyInConstructor) Success() bool { func NewWithPrivatePropertyInConstructor(privateField string) WithPrivatePropertyInConstructor { _init_.Initialize() - w := withPrivatePropertyInConstructor{} + + w := withPrivatePropertyInConstructor_jsiiProxy{} _jsii_.Create( "jsii-calc.WithPrivatePropertyInConstructor", []interface{}{privateField}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &w, ) + return &w } @@ -12289,48 +12583,99 @@ 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{} { - a := abstractClass{} - _jsii_.InitJsiiProxy(&a.abstractClassBase) - _jsii_.InitJsiiProxy(&a.iInterfaceImplementedByAbstractClass) + a := abstractClass_jsiiProxy{} + _jsii_.InitJsiiProxy(&a.abstractClassBase_jsiiProxy) + _jsii_.InitJsiiProxy(&a.iInterfaceImplementedByAbstractClass_jsiiProxy) return &a }, ) _jsii_.RegisterClass( "jsii-calc.AbstractClassBase", reflect.TypeOf((*AbstractClassBase)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "abstractProperty", GoGetter: "AbstractProperty"}, + }, func() interface{} { - return &abstractClassBase{} + return &abstractClassBase_jsiiProxy{} }, ) _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 &abstractClassReturner{} + return &abstractClassReturner_jsiiProxy{} }, ) _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 &abstractSuite{} + return &abstractSuite_jsiiProxy{} }, ) _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{} { - a := add{} - _jsii_.InitJsiiProxy(&a.binaryOperation) + a := add_jsiiProxy{} + _jsii_.InitJsiiProxy(&a.binaryOperation_jsiiProxy) return &a }, ) _jsii_.RegisterClass( "jsii-calc.AllTypes", reflect.TypeOf((*AllTypes)(nil)).Elem(), - func() interface{} { - return &allTypes{} + []_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 &allTypes_jsiiProxy{} }, ) _jsii_.RegisterEnum( @@ -12345,61 +12690,100 @@ func init() { _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 &allowedMethodNames{} + return &allowedMethodNames_jsiiProxy{} }, ) _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 &ambiguousParameters{} + return &ambiguousParameters_jsiiProxy{} }, ) _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{} { - a := anonymousImplementationProvider{} - _jsii_.InitJsiiProxy(&a.iAnonymousImplementationProvider) + a := anonymousImplementationProvider_jsiiProxy{} + _jsii_.InitJsiiProxy(&a.iAnonymousImplementationProvider_jsiiProxy) return &a }, ) _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 &asyncVirtualMethods{} + return &asyncVirtualMethods_jsiiProxy{} }, ) _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 &augmentableClass{} + return &augmentableClass_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.BaseJsii976", reflect.TypeOf((*BaseJsii976)(nil)).Elem(), + nil, // no members func() interface{} { - return &baseJsii976{} + return &baseJsii976_jsiiProxy{} }, ) _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{} { - b := bell{} - _jsii_.InitJsiiProxy(&b.iBell) + b := bell_jsiiProxy{} + _jsii_.InitJsiiProxy(&b.iBell_jsiiProxy) return &b }, ) _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{} { - b := binaryOperation{} + b := binaryOperation_jsiiProxy{} _jsii_.InitJsiiProxy(&b.Operation) _jsii_.InitJsiiProxy(&b.IFriendly) return &b @@ -12408,15 +12792,38 @@ func init() { _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 &burriedAnonymousObject{} + return &burriedAnonymousObject_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.Calculator", reflect.TypeOf((*Calculator)(nil)).Elem(), - func() interface{} { - c := calculator{} + []_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{} { + c := calculator_jsiiProxy{} _jsii_.InitJsiiProxy(&c.CompositeOperation) return &c }, @@ -12432,63 +12839,94 @@ func init() { _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{} { - c := classThatImplementsTheInternalInterface{} - _jsii_.InitJsiiProxy(&c.iNonInternalInterface) + c := classThatImplementsTheInternalInterface_jsiiProxy{} + _jsii_.InitJsiiProxy(&c.iNonInternalInterface_jsiiProxy) return &c }, ) _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{} { - c := classThatImplementsThePrivateInterface{} - _jsii_.InitJsiiProxy(&c.iNonInternalInterface) + c := classThatImplementsThePrivateInterface_jsiiProxy{} + _jsii_.InitJsiiProxy(&c.iNonInternalInterface_jsiiProxy) return &c }, ) _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 &classWithCollections{} + return &classWithCollections_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.ClassWithDocs", reflect.TypeOf((*ClassWithDocs)(nil)).Elem(), + nil, // no members func() interface{} { - return &classWithDocs{} + return &classWithDocs_jsiiProxy{} }, ) _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 &classWithJavaReservedWords{} + return &classWithJavaReservedWords_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.ClassWithMutableObjectLiteralProperty", reflect.TypeOf((*ClassWithMutableObjectLiteralProperty)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "mutableObject", GoGetter: "MutableObject"}, + }, func() interface{} { - return &classWithMutableObjectLiteralProperty{} + return &classWithMutableObjectLiteralProperty_jsiiProxy{} }, ) _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{} { - c := classWithPrivateConstructorAndAutomaticProperties{} - _jsii_.InitJsiiProxy(&c.iInterfaceWithProperties) + c := classWithPrivateConstructorAndAutomaticProperties_jsiiProxy{} + _jsii_.InitJsiiProxy(&c.iInterfaceWithProperties_jsiiProxy) return &c }, ) _jsii_.RegisterClass( "jsii-calc.ConfusingToJackson", reflect.TypeOf((*ConfusingToJackson)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "unionProperty", GoGetter: "UnionProperty"}, + }, func() interface{} { - return &confusingToJackson{} + return &confusingToJackson_jsiiProxy{} }, ) _jsii_.RegisterStruct( @@ -12498,64 +12936,105 @@ func init() { _jsii_.RegisterClass( "jsii-calc.ConstructorPassesThisOut", reflect.TypeOf((*ConstructorPassesThisOut)(nil)).Elem(), + nil, // no members func() interface{} { - return &constructorPassesThisOut{} + return &constructorPassesThisOut_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.Constructors", reflect.TypeOf((*Constructors)(nil)).Elem(), + nil, // no members func() interface{} { - return &constructors{} + return &constructors_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.ConsumePureInterface", reflect.TypeOf((*ConsumePureInterface)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "workItBaby", GoMethod: "WorkItBaby"}, + }, func() interface{} { - return &consumePureInterface{} + return &consumePureInterface_jsiiProxy{} }, ) _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 &consumerCanRingBell{} + return &consumerCanRingBell_jsiiProxy{} }, ) _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 &consumersOfThisCrazyTypeSystem{} + return &consumersOfThisCrazyTypeSystem_jsiiProxy{} }, ) _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 &dataRenderer{} + return &dataRenderer_jsiiProxy{} + }, + ) + _jsii_.RegisterClass( + "jsii-calc.Default", + reflect.TypeOf((*Default)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "pleaseCompile", GoMethod: "PleaseCompile"}, + }, + func() interface{} { + return &default_jsiiProxy{} }, ) _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 &defaultedConstructorArgument{} + return &defaultedConstructorArgument_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.Demonstrate982", reflect.TypeOf((*Demonstrate982)(nil)).Elem(), + nil, // no members func() interface{} { - return &demonstrate982{} + return &demonstrate982_jsiiProxy{} }, ) _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 &deprecatedClass{} + return &deprecatedClass_jsiiProxy{} }, ) _jsii_.RegisterEnum( @@ -12597,82 +13076,118 @@ func init() { _jsii_.RegisterClass( "jsii-calc.DisappointingCollectionSource", reflect.TypeOf((*DisappointingCollectionSource)(nil)).Elem(), + nil, // no members func() interface{} { - return &disappointingCollectionSource{} + return &disappointingCollectionSource_jsiiProxy{} }, ) _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 &doNotOverridePrivates{} + return &doNotOverridePrivates_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.DoNotRecognizeAnyAsOptional", reflect.TypeOf((*DoNotRecognizeAnyAsOptional)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, + }, func() interface{} { - return &doNotRecognizeAnyAsOptional{} + return &doNotRecognizeAnyAsOptional_jsiiProxy{} }, ) _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 &documentedClass{} + return &documentedClass_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.DontComplainAboutVariadicAfterOptional", reflect.TypeOf((*DontComplainAboutVariadicAfterOptional)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "optionalAndVariadic", GoMethod: "OptionalAndVariadic"}, + }, func() interface{} { - return &dontComplainAboutVariadicAfterOptional{} + return &dontComplainAboutVariadicAfterOptional_jsiiProxy{} }, ) _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{} { - d := doubleTrouble{} - _jsii_.InitJsiiProxy(&d.iFriendlyRandomGenerator) + d := doubleTrouble_jsiiProxy{} + _jsii_.InitJsiiProxy(&d.iFriendlyRandomGenerator_jsiiProxy) return &d }, ) _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 &dynamicPropertyBearer{} + return &dynamicPropertyBearer_jsiiProxy{} }, ) _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{} { - d := dynamicPropertyBearerChild{} - _jsii_.InitJsiiProxy(&d.dynamicPropertyBearer) + d := dynamicPropertyBearerChild_jsiiProxy{} + _jsii_.InitJsiiProxy(&d.dynamicPropertyBearer_jsiiProxy) return &d }, ) _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 &entropy{} + return &entropy_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.EnumDispenser", reflect.TypeOf((*EnumDispenser)(nil)).Elem(), + nil, // no members func() interface{} { - return &enumDispenser{} + return &enumDispenser_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.EraseUndefinedHashValues", reflect.TypeOf((*EraseUndefinedHashValues)(nil)).Elem(), + nil, // no members func() interface{} { - return &eraseUndefinedHashValues{} + return &eraseUndefinedHashValues_jsiiProxy{} }, ) _jsii_.RegisterStruct( @@ -12682,8 +13197,13 @@ func init() { _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 &experimentalClass{} + return &experimentalClass_jsiiProxy{} }, ) _jsii_.RegisterEnum( @@ -12701,8 +13221,11 @@ func init() { _jsii_.RegisterClass( "jsii-calc.ExportedBaseClass", reflect.TypeOf((*ExportedBaseClass)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "success", GoGetter: "Success"}, + }, func() interface{} { - return &exportedBaseClass{} + return &exportedBaseClass_jsiiProxy{} }, ) _jsii_.RegisterStruct( @@ -12712,8 +13235,13 @@ func init() { _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 &externalClass{} + return &externalClass_jsiiProxy{} }, ) _jsii_.RegisterEnum( @@ -12731,8 +13259,14 @@ func init() { _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 &giveMeStructs{} + return &giveMeStructs_jsiiProxy{} }, ) _jsii_.RegisterStruct( @@ -12742,85 +13276,129 @@ func init() { _jsii_.RegisterClass( "jsii-calc.GreetingAugmenter", reflect.TypeOf((*GreetingAugmenter)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "betterGreeting", GoMethod: "BetterGreeting"}, + }, func() interface{} { - return &greetingAugmenter{} + return &greetingAugmenter_jsiiProxy{} }, ) _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 &iAnonymousImplementationProvider{} + return &iAnonymousImplementationProvider_jsiiProxy{} }, ) _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 &iAnonymouslyImplementMe{} + return &iAnonymouslyImplementMe_jsiiProxy{} }, ) _jsii_.RegisterInterface( "jsii-calc.IAnotherPublicInterface", reflect.TypeOf((*IAnotherPublicInterface)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "a", GoGetter: "A"}, + }, func() interface{} { - return &iAnotherPublicInterface{} + return &iAnotherPublicInterface_jsiiProxy{} }, ) _jsii_.RegisterInterface( "jsii-calc.IBell", reflect.TypeOf((*IBell)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "ring", GoMethod: "Ring"}, + }, func() interface{} { - return &iBell{} + return &iBell_jsiiProxy{} }, ) _jsii_.RegisterInterface( "jsii-calc.IBellRinger", reflect.TypeOf((*IBellRinger)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "yourTurn", GoMethod: "YourTurn"}, + }, func() interface{} { - return &iBellRinger{} + return &iBellRinger_jsiiProxy{} }, ) _jsii_.RegisterInterface( "jsii-calc.IConcreteBellRinger", reflect.TypeOf((*IConcreteBellRinger)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "yourTurn", GoMethod: "YourTurn"}, + }, func() interface{} { - return &iConcreteBellRinger{} + return &iConcreteBellRinger_jsiiProxy{} }, ) _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 &iDeprecatedInterface{} + return &iDeprecatedInterface_jsiiProxy{} }, ) _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 &iExperimentalInterface{} + return &iExperimentalInterface_jsiiProxy{} }, ) _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 &iExtendsPrivateInterface{} + return &iExtendsPrivateInterface_jsiiProxy{} }, ) _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 &iExternalInterface{} + return &iExternalInterface_jsiiProxy{} }, ) _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{} { - i := iFriendlier{} + i := iFriendlier_jsiiProxy{} _jsii_.InitJsiiProxy(&i.IFriendly) return &i }, @@ -12828,233 +13406,337 @@ func init() { _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{} { - i := iFriendlyRandomGenerator{} + i := iFriendlyRandomGenerator_jsiiProxy{} _jsii_.InitJsiiProxy(&i.IFriendly) - _jsii_.InitJsiiProxy(&i.iRandomNumberGenerator) + _jsii_.InitJsiiProxy(&i.iRandomNumberGenerator_jsiiProxy) return &i }, ) _jsii_.RegisterInterface( "jsii-calc.IInterfaceImplementedByAbstractClass", reflect.TypeOf((*IInterfaceImplementedByAbstractClass)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "propFromInterface", GoGetter: "PropFromInterface"}, + }, func() interface{} { - return &iInterfaceImplementedByAbstractClass{} + return &iInterfaceImplementedByAbstractClass_jsiiProxy{} }, ) _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{} { - i := iInterfaceThatShouldNotBeADataType{} - _jsii_.InitJsiiProxy(&i.iInterfaceWithMethods) + i := iInterfaceThatShouldNotBeADataType_jsiiProxy{} + _jsii_.InitJsiiProxy(&i.iInterfaceWithMethods_jsiiProxy) return &i }, ) _jsii_.RegisterInterface( "jsii-calc.IInterfaceWithInternal", reflect.TypeOf((*IInterfaceWithInternal)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "visible", GoMethod: "Visible"}, + }, func() interface{} { - return &iInterfaceWithInternal{} + return &iInterfaceWithInternal_jsiiProxy{} }, ) _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 &iInterfaceWithMethods{} + return &iInterfaceWithMethods_jsiiProxy{} }, ) _jsii_.RegisterInterface( "jsii-calc.IInterfaceWithOptionalMethodArguments", reflect.TypeOf((*IInterfaceWithOptionalMethodArguments)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, + }, func() interface{} { - return &iInterfaceWithOptionalMethodArguments{} + return &iInterfaceWithOptionalMethodArguments_jsiiProxy{} }, ) _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 &iInterfaceWithProperties{} + return &iInterfaceWithProperties_jsiiProxy{} }, ) _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{} { - i := iInterfaceWithPropertiesExtension{} - _jsii_.InitJsiiProxy(&i.iInterfaceWithProperties) + i := iInterfaceWithPropertiesExtension_jsiiProxy{} + _jsii_.InitJsiiProxy(&i.iInterfaceWithProperties_jsiiProxy) return &i }, ) _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{} { - i := ijsii417Derived{} - _jsii_.InitJsiiProxy(&i.ijsii417PublicBaseOfBase) + i := ijsii417Derived_jsiiProxy{} + _jsii_.InitJsiiProxy(&i.ijsii417PublicBaseOfBase_jsiiProxy) return &i }, ) _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 &ijsii417PublicBaseOfBase{} + return &ijsii417PublicBaseOfBase_jsiiProxy{} }, ) _jsii_.RegisterInterface( "jsii-calc.IJsii487External", reflect.TypeOf((*IJsii487External)(nil)).Elem(), + nil, // no members func() interface{} { - return &iJsii487External{} + return &iJsii487External_jsiiProxy{} }, ) _jsii_.RegisterInterface( "jsii-calc.IJsii487External2", reflect.TypeOf((*IJsii487External2)(nil)).Elem(), + nil, // no members func() interface{} { - return &iJsii487External2{} + return &iJsii487External2_jsiiProxy{} }, ) _jsii_.RegisterInterface( "jsii-calc.IJsii496", reflect.TypeOf((*IJsii496)(nil)).Elem(), + nil, // no members func() interface{} { - return &iJsii496{} + return &iJsii496_jsiiProxy{} }, ) _jsii_.RegisterInterface( "jsii-calc.IMutableObjectLiteral", reflect.TypeOf((*IMutableObjectLiteral)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, + }, func() interface{} { - return &iMutableObjectLiteral{} + return &iMutableObjectLiteral_jsiiProxy{} }, ) _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{} { - i := iNonInternalInterface{} - _jsii_.InitJsiiProxy(&i.iAnotherPublicInterface) + i := iNonInternalInterface_jsiiProxy{} + _jsii_.InitJsiiProxy(&i.iAnotherPublicInterface_jsiiProxy) return &i }, ) _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 &iObjectWithProperty{} + return &iObjectWithProperty_jsiiProxy{} }, ) _jsii_.RegisterInterface( "jsii-calc.IOptionalMethod", reflect.TypeOf((*IOptionalMethod)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "optional", GoMethod: "Optional"}, + }, func() interface{} { - return &iOptionalMethod{} + return &iOptionalMethod_jsiiProxy{} }, ) _jsii_.RegisterInterface( "jsii-calc.IPrivatelyImplemented", reflect.TypeOf((*IPrivatelyImplemented)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "success", GoGetter: "Success"}, + }, func() interface{} { - return &iPrivatelyImplemented{} + return &iPrivatelyImplemented_jsiiProxy{} }, ) _jsii_.RegisterInterface( "jsii-calc.IPublicInterface", reflect.TypeOf((*IPublicInterface)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "bye", GoMethod: "Bye"}, + }, func() interface{} { - return &iPublicInterface{} + return &iPublicInterface_jsiiProxy{} }, ) _jsii_.RegisterInterface( "jsii-calc.IPublicInterface2", reflect.TypeOf((*IPublicInterface2)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "ciao", GoMethod: "Ciao"}, + }, func() interface{} { - return &iPublicInterface2{} + return &iPublicInterface2_jsiiProxy{} }, ) _jsii_.RegisterInterface( "jsii-calc.IRandomNumberGenerator", reflect.TypeOf((*IRandomNumberGenerator)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "next", GoMethod: "Next"}, + }, func() interface{} { - return &iRandomNumberGenerator{} + return &iRandomNumberGenerator_jsiiProxy{} }, ) _jsii_.RegisterInterface( "jsii-calc.IReturnJsii976", reflect.TypeOf((*IReturnJsii976)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "foo", GoGetter: "Foo"}, + }, func() interface{} { - return &iReturnJsii976{} + return &iReturnJsii976_jsiiProxy{} }, ) _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 &iReturnsNumber{} + return &iReturnsNumber_jsiiProxy{} }, ) _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 &iStableInterface{} + return &iStableInterface_jsiiProxy{} }, ) _jsii_.RegisterInterface( "jsii-calc.IStructReturningDelegate", reflect.TypeOf((*IStructReturningDelegate)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "returnStruct", GoMethod: "ReturnStruct"}, + }, func() interface{} { - return &iStructReturningDelegate{} + return &iStructReturningDelegate_jsiiProxy{} }, ) _jsii_.RegisterInterface( "jsii-calc.IWallClock", reflect.TypeOf((*IWallClock)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "iso8601Now", GoMethod: "Iso8601Now"}, + }, func() interface{} { - return &iWallClock{} + return &iWallClock_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.ImplementInternalInterface", reflect.TypeOf((*ImplementInternalInterface)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "prop", GoGetter: "Prop"}, + }, func() interface{} { - return &implementInternalInterface{} + return &implementInternalInterface_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.Implementation", reflect.TypeOf((*Implementation)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "value", GoGetter: "Value"}, + }, func() interface{} { - return &implementation{} + return &implementation_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.ImplementsInterfaceWithInternal", reflect.TypeOf((*ImplementsInterfaceWithInternal)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "visible", GoMethod: "Visible"}, + }, func() interface{} { - i := implementsInterfaceWithInternal{} - _jsii_.InitJsiiProxy(&i.iInterfaceWithInternal) + i := implementsInterfaceWithInternal_jsiiProxy{} + _jsii_.InitJsiiProxy(&i.iInterfaceWithInternal_jsiiProxy) return &i }, ) _jsii_.RegisterClass( "jsii-calc.ImplementsInterfaceWithInternalSubclass", reflect.TypeOf((*ImplementsInterfaceWithInternalSubclass)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "visible", GoMethod: "Visible"}, + }, func() interface{} { - i := implementsInterfaceWithInternalSubclass{} - _jsii_.InitJsiiProxy(&i.implementsInterfaceWithInternal) + i := implementsInterfaceWithInternalSubclass_jsiiProxy{} + _jsii_.InitJsiiProxy(&i.implementsInterfaceWithInternal_jsiiProxy) return &i }, ) _jsii_.RegisterClass( "jsii-calc.ImplementsPrivateInterface", reflect.TypeOf((*ImplementsPrivateInterface)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "private", GoGetter: "Private"}, + }, func() interface{} { - return &implementsPrivateInterface{} + return &implementsPrivateInterface_jsiiProxy{} }, ) _jsii_.RegisterStruct( @@ -13064,116 +13746,225 @@ func init() { _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{} { - i := inbetweenClass{} - _jsii_.InitJsiiProxy(&i.publicClass) - _jsii_.InitJsiiProxy(&i.iPublicInterface2) + i := inbetweenClass_jsiiProxy{} + _jsii_.InitJsiiProxy(&i.publicClass_jsiiProxy) + _jsii_.InitJsiiProxy(&i.iPublicInterface2_jsiiProxy) return &i }, ) _jsii_.RegisterClass( "jsii-calc.InterfaceCollections", reflect.TypeOf((*InterfaceCollections)(nil)).Elem(), + nil, // no members func() interface{} { - return &interfaceCollections{} + return &interfaceCollections_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.InterfacesMaker", reflect.TypeOf((*InterfacesMaker)(nil)).Elem(), + nil, // no members func() interface{} { - return &interfacesMaker{} + return &interfacesMaker_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.Isomorphism", reflect.TypeOf((*Isomorphism)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "myself", GoMethod: "Myself"}, + }, + func() interface{} { + return &isomorphism_jsiiProxy{} + }, + ) + _jsii_.RegisterClass( + "jsii-calc.Issue2638", + reflect.TypeOf((*Issue2638)(nil)).Elem(), + nil, // no members + func() interface{} { + return &issue2638_jsiiProxy{} + }, + ) + _jsii_.RegisterClass( + "jsii-calc.Issue2638B", + reflect.TypeOf((*Issue2638B)(nil)).Elem(), + nil, // no members func() interface{} { - return &isomorphism{} + return &issue2638B_jsiiProxy{} }, ) _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 := jsii417Derived{} - _jsii_.InitJsiiProxy(&j.jsii417PublicBaseOfBase) + j := jsii417Derived_jsiiProxy{} + _jsii_.InitJsiiProxy(&j.jsii417PublicBaseOfBase_jsiiProxy) 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 &jsii417PublicBaseOfBase{} + return &jsii417PublicBaseOfBase_jsiiProxy{} }, ) _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 &jsObjectLiteralForInterface{} + return &jsObjectLiteralForInterface_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.JSObjectLiteralToNative", reflect.TypeOf((*JsObjectLiteralToNative)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "returnLiteral", GoMethod: "ReturnLiteral"}, + }, func() interface{} { - return &jsObjectLiteralToNative{} + return &jsObjectLiteralToNative_jsiiProxy{} }, ) _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 &jsObjectLiteralToNativeClass{} + return &jsObjectLiteralToNativeClass_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.JavaReservedWords", reflect.TypeOf((*JavaReservedWords)(nil)).Elem(), - func() interface{} { - return &javaReservedWords{} + []_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 &javaReservedWords_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.Jsii487Derived", reflect.TypeOf((*Jsii487Derived)(nil)).Elem(), + nil, // no members func() interface{} { - j := jsii487Derived{} - _jsii_.InitJsiiProxy(&j.iJsii487External) - _jsii_.InitJsiiProxy(&j.iJsii487External2) + j := jsii487Derived_jsiiProxy{} + _jsii_.InitJsiiProxy(&j.iJsii487External_jsiiProxy) + _jsii_.InitJsiiProxy(&j.iJsii487External2_jsiiProxy) return &j }, ) _jsii_.RegisterClass( "jsii-calc.Jsii496Derived", reflect.TypeOf((*Jsii496Derived)(nil)).Elem(), + nil, // no members func() interface{} { - j := jsii496Derived{} - _jsii_.InitJsiiProxy(&j.iJsii496) + j := jsii496Derived_jsiiProxy{} + _jsii_.InitJsiiProxy(&j.iJsii496_jsiiProxy) return &j }, ) _jsii_.RegisterClass( "jsii-calc.JsiiAgent", reflect.TypeOf((*JsiiAgent)(nil)).Elem(), + nil, // no members func() interface{} { - return &jsiiAgent{} + return &jsiiAgent_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.JsonFormatter", reflect.TypeOf((*JsonFormatter)(nil)).Elem(), + nil, // no members func() interface{} { - return &jsonFormatter{} + return &jsonFormatter_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.LevelOne", reflect.TypeOf((*LevelOne)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "props", GoGetter: "Props"}, + }, func() interface{} { - return &levelOne{} + return &levelOne_jsiiProxy{} }, ) _jsii_.RegisterStruct( @@ -13195,36 +13986,61 @@ func init() { _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 &methodNamedProperty{} + return &methodNamedProperty_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.Multiply", reflect.TypeOf((*Multiply)(nil)).Elem(), - func() interface{} { - m := multiply{} - _jsii_.InitJsiiProxy(&m.binaryOperation) - _jsii_.InitJsiiProxy(&m.iFriendlier) - _jsii_.InitJsiiProxy(&m.iRandomNumberGenerator) + []_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{} { + m := multiply_jsiiProxy{} + _jsii_.InitJsiiProxy(&m.binaryOperation_jsiiProxy) + _jsii_.InitJsiiProxy(&m.iFriendlier_jsiiProxy) + _jsii_.InitJsiiProxy(&m.iRandomNumberGenerator_jsiiProxy) return &m }, ) _jsii_.RegisterClass( "jsii-calc.Negate", reflect.TypeOf((*Negate)(nil)).Elem(), - func() interface{} { - n := negate{} - _jsii_.InitJsiiProxy(&n.unaryOperation) - _jsii_.InitJsiiProxy(&n.iFriendlier) + []_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{} { + n := negate_jsiiProxy{} + _jsii_.InitJsiiProxy(&n.unaryOperation_jsiiProxy) + _jsii_.InitJsiiProxy(&n.iFriendlier_jsiiProxy) return &n }, ) _jsii_.RegisterClass( "jsii-calc.NestedClassInstance", reflect.TypeOf((*NestedClassInstance)(nil)).Elem(), + nil, // no members func() interface{} { - return &nestedClassInstance{} + return &nestedClassInstance_jsiiProxy{} }, ) _jsii_.RegisterStruct( @@ -13234,15 +14050,27 @@ func init() { _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 &nodeStandardLibrary{} + return &nodeStandardLibrary_jsiiProxy{} }, ) _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 &nullShouldBeTreatedAsUndefined{} + return &nullShouldBeTreatedAsUndefined_jsiiProxy{} }, ) _jsii_.RegisterStruct( @@ -13252,43 +14080,65 @@ func init() { _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 &numberGenerator{} + return &numberGenerator_jsiiProxy{} }, ) _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 &objectRefsInCollections{} + return &objectRefsInCollections_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.ObjectWithPropertyProvider", reflect.TypeOf((*ObjectWithPropertyProvider)(nil)).Elem(), + nil, // no members func() interface{} { - return &objectWithPropertyProvider{} + return &objectWithPropertyProvider_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.Old", reflect.TypeOf((*Old)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "doAThing", GoMethod: "DoAThing"}, + }, func() interface{} { - return &old{} + return &old_jsiiProxy{} }, ) _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 &optionalArgumentInvoker{} + return &optionalArgumentInvoker_jsiiProxy{} }, ) _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 &optionalConstructorArgument{} + return &optionalConstructorArgument_jsiiProxy{} }, ) _jsii_.RegisterStruct( @@ -13298,22 +14148,36 @@ func init() { _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 &optionalStructConsumer{} + return &optionalStructConsumer_jsiiProxy{} }, ) _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 &overridableProtectedMember{} + return &overridableProtectedMember_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.OverrideReturnsObject", reflect.TypeOf((*OverrideReturnsObject)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "test", GoMethod: "Test"}, + }, func() interface{} { - return &overrideReturnsObject{} + return &overrideReturnsObject_jsiiProxy{} }, ) _jsii_.RegisterStruct( @@ -13323,22 +14187,39 @@ func init() { _jsii_.RegisterClass( "jsii-calc.PartiallyInitializedThisConsumer", reflect.TypeOf((*PartiallyInitializedThisConsumer)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "consumePartiallyInitializedThis", GoMethod: "ConsumePartiallyInitializedThis"}, + }, func() interface{} { - return &partiallyInitializedThisConsumer{} + return &partiallyInitializedThisConsumer_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.Polymorphism", reflect.TypeOf((*Polymorphism)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "sayHello", GoMethod: "SayHello"}, + }, func() interface{} { - return &polymorphism{} + return &polymorphism_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.Power", reflect.TypeOf((*Power)(nil)).Elem(), - func() interface{} { - p := power{} + []_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{} { + p := power_jsiiProxy{} _jsii_.InitJsiiProxy(&p.CompositeOperation) return &p }, @@ -13346,36 +14227,85 @@ func init() { _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 &propertyNamedProperty{} + return &propertyNamedProperty_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.PublicClass", reflect.TypeOf((*PublicClass)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, + }, func() interface{} { - return &publicClass{} + return &publicClass_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.PythonReservedWords", reflect.TypeOf((*PythonReservedWords)(nil)).Elem(), - func() interface{} { - return &pythonReservedWords{} + []_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 &pythonReservedWords_jsiiProxy{} }, ) _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 &referenceEnumFromScopedPackage{} + return &referenceEnumFromScopedPackage_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.ReturnsPrivateImplementationOfInterface", reflect.TypeOf((*ReturnsPrivateImplementationOfInterface)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "privateImplementation", GoGetter: "PrivateImplementation"}, + }, func() interface{} { - return &returnsPrivateImplementationOfInterface{} + return &returnsPrivateImplementationOfInterface_jsiiProxy{} }, ) _jsii_.RegisterStruct( @@ -13385,15 +14315,21 @@ func init() { _jsii_.RegisterClass( "jsii-calc.RootStructValidator", reflect.TypeOf((*RootStructValidator)(nil)).Elem(), + nil, // no members func() interface{} { - return &rootStructValidator{} + return &rootStructValidator_jsiiProxy{} }, ) _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 &runtimeTypeChecking{} + return &runtimeTypeChecking_jsiiProxy{} }, ) _jsii_.RegisterStruct( @@ -13403,15 +14339,22 @@ func init() { _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 &singleInstanceTwoTypes{} + return &singleInstanceTwoTypes_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.SingletonInt", reflect.TypeOf((*SingletonInt)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "isSingletonInt", GoMethod: "IsSingletonInt"}, + }, func() interface{} { - return &singletonInt{} + return &singletonInt_jsiiProxy{} }, ) _jsii_.RegisterEnum( @@ -13424,8 +14367,11 @@ func init() { _jsii_.RegisterClass( "jsii-calc.SingletonString", reflect.TypeOf((*SingletonString)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "isSingletonString", GoMethod: "IsSingletonString"}, + }, func() interface{} { - return &singletonString{} + return &singletonString_jsiiProxy{} }, ) _jsii_.RegisterEnum( @@ -13442,15 +14388,21 @@ func init() { _jsii_.RegisterClass( "jsii-calc.SomeTypeJsii976", reflect.TypeOf((*SomeTypeJsii976)(nil)).Elem(), + nil, // no members func() interface{} { - return &someTypeJsii976{} + return &someTypeJsii976_jsiiProxy{} }, ) _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 &stableClass{} + return &stableClass_jsiiProxy{} }, ) _jsii_.RegisterEnum( @@ -13468,31 +14420,38 @@ func init() { _jsii_.RegisterClass( "jsii-calc.StaticContext", reflect.TypeOf((*StaticContext)(nil)).Elem(), + nil, // no members func() interface{} { - return &staticContext{} + return &staticContext_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.StaticHelloChild", reflect.TypeOf((*StaticHelloChild)(nil)).Elem(), + nil, // no members func() interface{} { - s := staticHelloChild{} - _jsii_.InitJsiiProxy(&s.staticHelloParent) + s := staticHelloChild_jsiiProxy{} + _jsii_.InitJsiiProxy(&s.staticHelloParent_jsiiProxy) return &s }, ) _jsii_.RegisterClass( "jsii-calc.StaticHelloParent", reflect.TypeOf((*StaticHelloParent)(nil)).Elem(), + nil, // no members func() interface{} { - return &staticHelloParent{} + return &staticHelloParent_jsiiProxy{} }, ) _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 &statics{} + return &statics_jsiiProxy{} }, ) _jsii_.RegisterEnum( @@ -13507,8 +14466,11 @@ func init() { _jsii_.RegisterClass( "jsii-calc.StripInternal", reflect.TypeOf((*StripInternal)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "youSeeMe", GoGetter: "YouSeeMe"}, + }, func() interface{} { - return &stripInternal{} + return &stripInternal_jsiiProxy{} }, ) _jsii_.RegisterStruct( @@ -13526,17 +14488,23 @@ func init() { _jsii_.RegisterClass( "jsii-calc.StructPassing", reflect.TypeOf((*StructPassing)(nil)).Elem(), + nil, // no members func() interface{} { - return &structPassing{} + return &structPassing_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.StructUnionConsumer", reflect.TypeOf((*StructUnionConsumer)(nil)).Elem(), + nil, // no members func() interface{} { - return &structUnionConsumer{} + return &structUnionConsumer_jsiiProxy{} }, ) + _jsii_.RegisterStruct( + "jsii-calc.StructWithEnum", + reflect.TypeOf((*StructWithEnum)(nil)).Elem(), + ) _jsii_.RegisterStruct( "jsii-calc.StructWithJavaReservedWords", reflect.TypeOf((*StructWithJavaReservedWords)(nil)).Elem(), @@ -13544,8 +14512,18 @@ func init() { _jsii_.RegisterClass( "jsii-calc.Sum", reflect.TypeOf((*Sum)(nil)).Elem(), - func() interface{} { - s := sum{} + []_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{} { + s := sum_jsiiProxy{} _jsii_.InitJsiiProxy(&s.CompositeOperation) return &s }, @@ -13553,9 +14531,15 @@ func init() { _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{} { - s := supportsNiceJavaBuilder{} - _jsii_.InitJsiiProxy(&s.supportsNiceJavaBuilderWithRequiredProps) + s := supportsNiceJavaBuilder_jsiiProxy{} + _jsii_.InitJsiiProxy(&s.supportsNiceJavaBuilderWithRequiredProps_jsiiProxy) return &s }, ) @@ -13566,22 +14550,61 @@ func init() { _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 &supportsNiceJavaBuilderWithRequiredProps{} + return &supportsNiceJavaBuilderWithRequiredProps_jsiiProxy{} }, ) _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 &syncVirtualMethods_jsiiProxy{} + }, + ) + _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 &syncVirtualMethods{} + return &testStructWithEnum_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.Thrower", reflect.TypeOf((*Thrower)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "throwError", GoMethod: "ThrowError"}, + }, func() interface{} { - return &thrower{} + return &thrower_jsiiProxy{} }, ) _jsii_.RegisterStruct( @@ -13591,15 +14614,22 @@ func init() { _jsii_.RegisterClass( "jsii-calc.UmaskCheck", reflect.TypeOf((*UmaskCheck)(nil)).Elem(), + nil, // no members func() interface{} { - return &umaskCheck{} + return &umaskCheck_jsiiProxy{} }, ) _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{} { - u := unaryOperation{} + u := unaryOperation_jsiiProxy{} _jsii_.InitJsiiProxy(&u.Operation) return &u }, @@ -13611,8 +14641,11 @@ func init() { _jsii_.RegisterClass( "jsii-calc.UpcasingReflectable", reflect.TypeOf((*UpcasingReflectable)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "entries", GoGetter: "Entries"}, + }, func() interface{} { - u := upcasingReflectable{} + u := upcasingReflectable_jsiiProxy{} _jsii_.InitJsiiProxy(&u.IReflectable) return &u }, @@ -13620,57 +14653,90 @@ func init() { _jsii_.RegisterClass( "jsii-calc.UseBundledDependency", reflect.TypeOf((*UseBundledDependency)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "value", GoMethod: "Value"}, + }, func() interface{} { - return &useBundledDependency{} + return &useBundledDependency_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.UseCalcBase", reflect.TypeOf((*UseCalcBase)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "hello", GoMethod: "Hello"}, + }, func() interface{} { - return &useCalcBase{} + return &useCalcBase_jsiiProxy{} }, ) _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 &usesInterfaceWithProperties{} + return &usesInterfaceWithProperties_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.VariadicInvoker", reflect.TypeOf((*VariadicInvoker)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "asArray", GoMethod: "AsArray"}, + }, func() interface{} { - return &variadicInvoker{} + return &variadicInvoker_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.VariadicMethod", reflect.TypeOf((*VariadicMethod)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "asArray", GoMethod: "AsArray"}, + }, func() interface{} { - return &variadicMethod{} + return &variadicMethod_jsiiProxy{} }, ) _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 &virtualMethodPlayground{} + return &virtualMethodPlayground_jsiiProxy{} }, ) _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 &voidCallback{} + return &voidCallback_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.WithPrivatePropertyInConstructor", reflect.TypeOf((*WithPrivatePropertyInConstructor)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "success", GoGetter: "Success"}, + }, func() interface{} { - return &withPrivatePropertyInConstructor{} + return &withPrivatePropertyInConstructor_jsiiProxy{} }, ) } @@ -13697,33 +14763,36 @@ type TypeFromSub1 interface { } // The jsii proxy struct for TypeFromSub1 -type typeFromSub1 struct { +type typeFromSub1_jsiiProxy struct { _ byte // padding } func NewTypeFromSub1() TypeFromSub1 { _init_.Initialize() - t := typeFromSub1{} + + t := typeFromSub1_jsiiProxy{} _jsii_.Create( "jsii-calc.nodirect.sub1.TypeFromSub1", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &t, ) + return &t } -func (t *typeFromSub1) Sub1() string { +func (t *typeFromSub1_jsiiProxy) Sub1() string { var returns string + _jsii_.Invoke( t, "sub1", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -13743,8 +14812,11 @@ func init() { _jsii_.RegisterClass( "jsii-calc.nodirect.sub1.TypeFromSub1", reflect.TypeOf((*TypeFromSub1)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "sub1", GoMethod: "Sub1"}, + }, func() interface{} { - return &typeFromSub1{} + return &typeFromSub1_jsiiProxy{} }, ) } @@ -13764,33 +14836,36 @@ type TypeFromSub2 interface { } // The jsii proxy struct for TypeFromSub2 -type typeFromSub2 struct { +type typeFromSub2_jsiiProxy struct { _ byte // padding } func NewTypeFromSub2() TypeFromSub2 { _init_.Initialize() - t := typeFromSub2{} + + t := typeFromSub2_jsiiProxy{} _jsii_.Create( "jsii-calc.nodirect.sub2.TypeFromSub2", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &t, ) + return &t } -func (t *typeFromSub2) Sub2() string { +func (t *typeFromSub2_jsiiProxy) Sub2() string { var returns string + _jsii_.Invoke( t, "sub2", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -13810,8 +14885,11 @@ func init() { _jsii_.RegisterClass( "jsii-calc.nodirect.sub2.TypeFromSub2", reflect.TypeOf((*TypeFromSub2)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "sub2", GoMethod: "Sub2"}, + }, func() interface{} { - return &typeFromSub2{} + return &typeFromSub2_jsiiProxy{} }, ) } @@ -13831,20 +14909,22 @@ type OnlyStaticMethods interface { } // The jsii proxy struct for OnlyStaticMethods -type onlyStaticMethods struct { +type onlyStaticMethods_jsiiProxy struct { _ byte // padding } func OnlyStaticMethods_StaticMethod() string { _init_.Initialize() + var returns string + _jsii_.StaticInvoke( "jsii-calc.onlystatic.OnlyStaticMethods", "staticMethod", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -13864,8 +14944,9 @@ func init() { _jsii_.RegisterClass( "jsii-calc.onlystatic.OnlyStaticMethods", reflect.TypeOf((*OnlyStaticMethods)(nil)).Elem(), + nil, // no members func() interface{} { - return &onlyStaticMethods{} + return &onlyStaticMethods_jsiiProxy{} }, ) } @@ -13886,11 +14967,11 @@ type ClassWithSelf interface { } // The jsii proxy struct for ClassWithSelf -type classWithSelf struct { +type classWithSelf_jsiiProxy struct { _ byte // padding } -func (c *classWithSelf) Self() string { +func (c *classWithSelf_jsiiProxy) Self() string { var returns string _jsii_.Get( c, @@ -13903,27 +14984,30 @@ func (c *classWithSelf) Self() string { func NewClassWithSelf(self string) ClassWithSelf { _init_.Initialize() - c := classWithSelf{} + + c := classWithSelf_jsiiProxy{} _jsii_.Create( "jsii-calc.PythonSelf.ClassWithSelf", []interface{}{self}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &c, ) + return &c } -func (c *classWithSelf) Method(self float64) string { +func (c *classWithSelf_jsiiProxy) Method(self float64) string { var returns string + _jsii_.Invoke( c, "method", []interface{}{self}, - true, &returns, ) + return returns } @@ -13932,11 +15016,11 @@ type ClassWithSelfKwarg interface { } // The jsii proxy struct for ClassWithSelfKwarg -type classWithSelfKwarg struct { +type classWithSelfKwarg_jsiiProxy struct { _ byte // padding } -func (c *classWithSelfKwarg) Props() StructWithSelf { +func (c *classWithSelfKwarg_jsiiProxy) Props() StructWithSelf { var returns StructWithSelf _jsii_.Get( c, @@ -13949,15 +15033,17 @@ func (c *classWithSelfKwarg) Props() StructWithSelf { func NewClassWithSelfKwarg(props StructWithSelf) ClassWithSelfKwarg { _init_.Initialize() - c := classWithSelfKwarg{} + + c := classWithSelfKwarg_jsiiProxy{} _jsii_.Create( "jsii-calc.PythonSelf.ClassWithSelfKwarg", []interface{}{props}, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &c, ) + return &c } @@ -13966,19 +15052,20 @@ type IInterfaceWithSelf interface { } // The jsii proxy for IInterfaceWithSelf -type iInterfaceWithSelf struct { +type iInterfaceWithSelf_jsiiProxy struct { _ byte // padding } -func (i *iInterfaceWithSelf) Method(self float64) string { +func (i *iInterfaceWithSelf_jsiiProxy) Method(self float64) string { var returns string + _jsii_.Invoke( i, "method", []interface{}{self}, - true, &returns, ) + return returns } @@ -14002,22 +15089,32 @@ 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 &classWithSelf{} + return &classWithSelf_jsiiProxy{} }, ) _jsii_.RegisterClass( "jsii-calc.PythonSelf.ClassWithSelfKwarg", reflect.TypeOf((*ClassWithSelfKwarg)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "props", GoGetter: "Props"}, + }, func() interface{} { - return &classWithSelfKwarg{} + return &classWithSelfKwarg_jsiiProxy{} }, ) _jsii_.RegisterInterface( "jsii-calc.PythonSelf.IInterfaceWithSelf", reflect.TypeOf((*IInterfaceWithSelf)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, + }, func() interface{} { - return &iInterfaceWithSelf{} + return &iInterfaceWithSelf_jsiiProxy{} }, ) _jsii_.RegisterStruct( @@ -14086,21 +15183,23 @@ type InnerClass interface { } // The jsii proxy struct for InnerClass -type innerClass struct { +type innerClass_jsiiProxy struct { _ byte // padding } func NewInnerClass() InnerClass { _init_.Initialize() - i := innerClass{} + + i := innerClass_jsiiProxy{} _jsii_.Create( "jsii-calc.submodule.child.InnerClass", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &i, ) + return &i } @@ -14135,11 +15234,11 @@ type OuterClass interface { } // The jsii proxy struct for OuterClass -type outerClass struct { +type outerClass_jsiiProxy struct { _ byte // padding } -func (o *outerClass) InnerClass() InnerClass { +func (o *outerClass_jsiiProxy) InnerClass() InnerClass { var returns InnerClass _jsii_.Get( o, @@ -14152,15 +15251,17 @@ func (o *outerClass) InnerClass() InnerClass { func NewOuterClass() OuterClass { _init_.Initialize() - o := outerClass{} + + o := outerClass_jsiiProxy{} _jsii_.Create( "jsii-calc.submodule.child.OuterClass", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &o, ) + return &o } @@ -14210,8 +15311,9 @@ func init() { _jsii_.RegisterClass( "jsii-calc.submodule.child.InnerClass", reflect.TypeOf((*InnerClass)(nil)).Elem(), + nil, // no members func() interface{} { - return &innerClass{} + return &innerClass_jsiiProxy{} }, ) _jsii_.RegisterStruct( @@ -14221,8 +15323,11 @@ func init() { _jsii_.RegisterClass( "jsii-calc.submodule.child.OuterClass", reflect.TypeOf((*OuterClass)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "innerClass", GoGetter: "InnerClass"}, + }, func() interface{} { - return &outerClass{} + return &outerClass_jsiiProxy{} }, ) _jsii_.RegisterEnum( @@ -14259,20 +15364,22 @@ type Kwargs interface { } // The jsii proxy struct for Kwargs -type kwargs struct { +type kwargs_jsiiProxy struct { _ byte // padding } func Kwargs_Method(props child.KwargsProps) bool { _init_.Initialize() + var returns bool + _jsii_.StaticInvoke( "jsii-calc.submodule.isolated.Kwargs", "method", []interface{}{props}, - true, &returns, ) + return returns } @@ -14292,8 +15399,9 @@ func init() { _jsii_.RegisterClass( "jsii-calc.submodule.isolated.Kwargs", reflect.TypeOf((*Kwargs)(nil)).Elem(), + nil, // no members func() interface{} { - return &kwargs{} + return &kwargs_jsiiProxy{} }, ) } @@ -14312,11 +15420,11 @@ type INamespaced interface { } // The jsii proxy for INamespaced -type iNamespaced struct { +type iNamespaced_jsiiProxy struct { _ byte // padding } -func (i *iNamespaced) DefinedAt() string { +func (i *iNamespaced_jsiiProxy) DefinedAt() string { var returns string _jsii_.Get( i, @@ -14342,8 +15450,11 @@ func init() { _jsii_.RegisterInterface( "jsii-calc.submodule.nested_submodule.deeplyNested.INamespaced", reflect.TypeOf((*INamespaced)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "definedAt", GoGetter: "DefinedAt"}, + }, func() interface{} { - return &iNamespaced{} + return &iNamespaced_jsiiProxy{} }, ) } @@ -14367,11 +15478,11 @@ type Namespaced interface { } // The jsii proxy struct for Namespaced -type namespaced struct { +type namespaced_jsiiProxy struct { deeplynested.INamespaced // implements jsii-calc.submodule.nested_submodule.deeplyNested.INamespaced } -func (n *namespaced) DefinedAt() string { +func (n *namespaced_jsiiProxy) DefinedAt() string { var returns string _jsii_.Get( n, @@ -14381,7 +15492,7 @@ func (n *namespaced) DefinedAt() string { return returns } -func (n *namespaced) Goodness() child.Goodness { +func (n *namespaced_jsiiProxy) Goodness() child.Goodness { var returns child.Goodness _jsii_.Get( n, @@ -14408,8 +15519,12 @@ func init() { _jsii_.RegisterClass( "jsii-calc.submodule.nested_submodule.Namespaced", reflect.TypeOf((*Namespaced)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "definedAt", GoGetter: "DefinedAt"}, + _jsii_.MemberProperty{JsiiProperty: "goodness", GoGetter: "Goodness"}, + }, func() interface{} { - n := namespaced{} + n := namespaced_jsiiProxy{} _jsii_.InitJsiiProxy(&n.INamespaced) return &n }, @@ -14462,33 +15577,36 @@ type ReturnsSpecialParameter interface { } // The jsii proxy struct for ReturnsSpecialParameter -type returnsSpecialParameter struct { +type returnsSpecialParameter_jsiiProxy struct { _ byte // padding } func NewReturnsSpecialParameter() ReturnsSpecialParameter { _init_.Initialize() - r := returnsSpecialParameter{} + + r := returnsSpecialParameter_jsiiProxy{} _jsii_.Create( "jsii-calc.submodule.returnsparam.ReturnsSpecialParameter", - []interface{}{}, + nil /* no parameters */, []_jsii_.FQN{}, - []_jsii_.Override{}, + nil, // no overrides &r, ) + return &r } -func (r *returnsSpecialParameter) ReturnsSpecialParam() param.SpecialParameter { +func (r *returnsSpecialParameter_jsiiProxy) ReturnsSpecialParam() param.SpecialParameter { var returns param.SpecialParameter + _jsii_.Invoke( r, "returnsSpecialParam", - []interface{}{}, - true, + nil /* no parameters */, &returns, ) + return returns } @@ -14508,8 +15626,11 @@ func init() { _jsii_.RegisterClass( "jsii-calc.submodule.returnsparam.ReturnsSpecialParameter", reflect.TypeOf((*ReturnsSpecialParameter)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "returnsSpecialParam", GoMethod: "ReturnsSpecialParam"}, + }, func() interface{} { - return &returnsSpecialParameter{} + return &returnsSpecialParameter_jsiiProxy{} }, ) } @@ -14529,6 +15650,13 @@ import ( "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/submodule/param" ) +// A struct named "Default". +// See: https://github.com/aws/jsii/issues/2637 +// +type Default struct { + Foo float64 \`json:"foo"\` +} + type MyClass interface { deeplynested.INamespaced AllTypes() jsiicalc.AllTypes @@ -14541,11 +15669,11 @@ type MyClass interface { } // The jsii proxy struct for MyClass -type myClass struct { +type myClass_jsiiProxy struct { deeplynested.INamespaced // implements jsii-calc.submodule.nested_submodule.deeplyNested.INamespaced } -func (m *myClass) AllTypes() jsiicalc.AllTypes { +func (m *myClass_jsiiProxy) AllTypes() jsiicalc.AllTypes { var returns jsiicalc.AllTypes _jsii_.Get( m, @@ -14555,7 +15683,7 @@ func (m *myClass) AllTypes() jsiicalc.AllTypes { return returns } -func (m *myClass) Awesomeness() child.Awesomeness { +func (m *myClass_jsiiProxy) Awesomeness() child.Awesomeness { var returns child.Awesomeness _jsii_.Get( m, @@ -14565,7 +15693,7 @@ func (m *myClass) Awesomeness() child.Awesomeness { return returns } -func (m *myClass) DefinedAt() string { +func (m *myClass_jsiiProxy) DefinedAt() string { var returns string _jsii_.Get( m, @@ -14575,7 +15703,7 @@ func (m *myClass) DefinedAt() string { return returns } -func (m *myClass) Goodness() child.Goodness { +func (m *myClass_jsiiProxy) Goodness() child.Goodness { var returns child.Goodness _jsii_.Get( m, @@ -14585,7 +15713,7 @@ func (m *myClass) Goodness() child.Goodness { return returns } -func (m *myClass) Props() child.SomeStruct { +func (m *myClass_jsiiProxy) Props() child.SomeStruct { var returns child.SomeStruct _jsii_.Get( m, @@ -14598,19 +15726,21 @@ func (m *myClass) Props() child.SomeStruct { func NewMyClass(props child.SomeStruct) MyClass { _init_.Initialize() - m := myClass{} + + m := myClass_jsiiProxy{} _jsii_.Create( "jsii-calc.submodule.MyClass", []interface{}{props}, []_jsii_.FQN{"jsii-calc.submodule.nested_submodule.deeplyNested.INamespaced"}, - []_jsii_.Override{}, + nil, // no overrides &m, ) + return &m } -func (m *myClass) SetAllTypes(val jsiicalc.AllTypes) { +func (m *myClass_jsiiProxy) SetAllTypes(val jsiicalc.AllTypes) { _jsii_.Set( m, "allTypes", @@ -14618,15 +15748,16 @@ func (m *myClass) SetAllTypes(val jsiicalc.AllTypes) { ) } -func (m *myClass) MethodWithSpecialParam(param param.SpecialParameter) string { +func (m *myClass_jsiiProxy) MethodWithSpecialParam(param param.SpecialParameter) string { var returns string + _jsii_.Invoke( m, "methodWithSpecialParam", []interface{}{param}, - true, &returns, ) + return returns } @@ -14643,11 +15774,23 @@ 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_.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{} { - m := myClass{} + m := myClass_jsiiProxy{} _jsii_.InitJsiiProxy(&m.INamespaced) return &m }, diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-java.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-java.test.ts.snap index 66da64d930..b734ed9816 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-java.test.ts.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-java.test.ts.snap @@ -3554,6 +3554,7 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 ConsumerCanRingBell.java ┃ ┣━ 📄 ConsumersOfThisCrazyTypeSystem.java ┃ ┣━ 📄 DataRenderer.java + ┃ ┣━ 📄 Default.java ┃ ┣━ 📄 DefaultedConstructorArgument.java ┃ ┣━ 📄 Demonstrate982.java ┃ ┣━ 📄 DeprecatedClass.java @@ -3640,6 +3641,8 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 IReturnJsii976.java ┃ ┣━ 📄 IReturnsNumber.java ┃ ┣━ 📄 Isomorphism.java + ┃ ┣━ 📄 Issue2638.java + ┃ ┣━ 📄 Issue2638B.java ┃ ┣━ 📄 IStableInterface.java ┃ ┣━ 📄 IStructReturningDelegate.java ┃ ┣━ 📄 IWallClock.java @@ -3721,6 +3724,7 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 StructParameterType.java ┃ ┣━ 📄 StructPassing.java ┃ ┣━ 📄 StructUnionConsumer.java + ┃ ┣━ 📄 StructWithEnum.java ┃ ┣━ 📄 StructWithJavaReservedWords.java ┃ ┣━ 📁 submodule ┃ ┃ ┣━ 📁 back_references @@ -3734,6 +3738,7 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┃ ┃ ┣━ 📄 SomeEnum.java ┃ ┃ ┃ ┣━ 📄 SomeStruct.java ┃ ┃ ┃ ┗━ 📄 Structure.java + ┃ ┃ ┣━ 📄 Default.java ┃ ┃ ┣━ 📁 isolated ┃ ┃ ┃ ┗━ 📄 Kwargs.java ┃ ┃ ┣━ 📄 MyClass.java @@ -3750,6 +3755,7 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 SupportsNiceJavaBuilderProps.java ┃ ┣━ 📄 SupportsNiceJavaBuilderWithRequiredProps.java ┃ ┣━ 📄 SyncVirtualMethods.java + ┃ ┣━ 📄 TestStructWithEnum.java ┃ ┣━ 📄 Thrower.java ┃ ┣━ 📄 TopLevelStruct.java ┃ ┣━ 📄 UmaskCheck.java @@ -7117,6 +7123,45 @@ public class DataRenderer extends software.amazon.jsii.JsiiObject { `; +exports[`Generated code for "jsii-calc": /java/src/main/java/software/amazon/jsii/tests/calculator/Default.java 1`] = ` +package software.amazon.jsii.tests.calculator; + +/** + * A class named "Default". + *

+ * @see https://github.com/aws/jsii/issues/2637 + */ +@javax.annotation.Generated(value = "jsii-pacmak") +@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) +@software.amazon.jsii.Jsii(module = software.amazon.jsii.tests.calculator.$Module.class, fqn = "jsii-calc.Default") +public class Default extends software.amazon.jsii.JsiiObject { + + protected Default(final software.amazon.jsii.JsiiObjectRef objRef) { + super(objRef); + } + + protected Default(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) { + super(initializationMode); + } + + /** + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public Default() { + super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); + software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this); + } + + /** + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public void pleaseCompile() { + software.amazon.jsii.Kernel.call(this, "pleaseCompile", software.amazon.jsii.NativeType.VOID); + } +} + +`; + exports[`Generated code for "jsii-calc": /java/src/main/java/software/amazon/jsii/tests/calculator/DefaultedConstructorArgument.java 1`] = ` package software.amazon.jsii.tests.calculator; @@ -13488,6 +13533,70 @@ public abstract class Isomorphism extends software.amazon.jsii.JsiiObject { `; +exports[`Generated code for "jsii-calc": /java/src/main/java/software/amazon/jsii/tests/calculator/Issue2638.java 1`] = ` +package software.amazon.jsii.tests.calculator; + +/** + * Docstrings with period. + *

+ * @see https://github.com/aws/jsii/issues/2638 + */ +@javax.annotation.Generated(value = "jsii-pacmak") +@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) +@software.amazon.jsii.Jsii(module = software.amazon.jsii.tests.calculator.$Module.class, fqn = "jsii-calc.Issue2638") +public class Issue2638 extends software.amazon.jsii.JsiiObject { + + protected Issue2638(final software.amazon.jsii.JsiiObjectRef objRef) { + super(objRef); + } + + protected Issue2638(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) { + super(initializationMode); + } + + /** + * First sentence. + *

+ * Second sentence. Third sentence. + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public Issue2638() { + super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); + software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this); + } +} + +`; + +exports[`Generated code for "jsii-calc": /java/src/main/java/software/amazon/jsii/tests/calculator/Issue2638B.java 1`] = ` +package software.amazon.jsii.tests.calculator; + +/** + */ +@javax.annotation.Generated(value = "jsii-pacmak") +@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) +@software.amazon.jsii.Jsii(module = software.amazon.jsii.tests.calculator.$Module.class, fqn = "jsii-calc.Issue2638B") +public class Issue2638B extends software.amazon.jsii.JsiiObject { + + protected Issue2638B(final software.amazon.jsii.JsiiObjectRef objRef) { + super(objRef); + } + + protected Issue2638B(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) { + super(initializationMode); + } + + /** + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public Issue2638B() { + super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); + software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this); + } +} + +`; + exports[`Generated code for "jsii-calc": /java/src/main/java/software/amazon/jsii/tests/calculator/JSII417Derived.java 1`] = ` package software.amazon.jsii.tests.calculator; @@ -19013,6 +19122,163 @@ public class StructUnionConsumer extends software.amazon.jsii.JsiiObject { `; +exports[`Generated code for "jsii-calc": /java/src/main/java/software/amazon/jsii/tests/calculator/StructWithEnum.java 1`] = ` +package software.amazon.jsii.tests.calculator; + +/** + */ +@javax.annotation.Generated(value = "jsii-pacmak") +@software.amazon.jsii.Jsii(module = software.amazon.jsii.tests.calculator.$Module.class, fqn = "jsii-calc.StructWithEnum") +@software.amazon.jsii.Jsii.Proxy(StructWithEnum.Jsii$Proxy.class) +@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) +public interface StructWithEnum extends software.amazon.jsii.JsiiSerializable { + + /** + * An enum value. + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + @org.jetbrains.annotations.NotNull software.amazon.jsii.tests.calculator.StringEnum getFoo(); + + /** + * Optional enum value (of type integer). + *

+ * Default: AllTypesEnum.YOUR_ENUM_VALUE + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + default @org.jetbrains.annotations.Nullable software.amazon.jsii.tests.calculator.AllTypesEnum getBar() { + return null; + } + + /** + * @return a {@link Builder} of {@link StructWithEnum} + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + static Builder builder() { + return new Builder(); + } + /** + * A builder for {@link StructWithEnum} + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public static final class Builder implements software.amazon.jsii.Builder { + private software.amazon.jsii.tests.calculator.StringEnum foo; + private software.amazon.jsii.tests.calculator.AllTypesEnum bar; + + /** + * Sets the value of {@link StructWithEnum#getFoo} + * @param foo An enum value. This parameter is required. + * @return {@code this} + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public Builder foo(software.amazon.jsii.tests.calculator.StringEnum foo) { + this.foo = foo; + return this; + } + + /** + * Sets the value of {@link StructWithEnum#getBar} + * @param bar Optional enum value (of type integer). + * @return {@code this} + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public Builder bar(software.amazon.jsii.tests.calculator.AllTypesEnum bar) { + this.bar = bar; + return this; + } + + /** + * Builds the configured instance. + * @return a new instance of {@link StructWithEnum} + * @throws NullPointerException if any required attribute was not provided + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + @Override + public StructWithEnum build() { + return new Jsii$Proxy(foo, bar); + } + } + + /** + * An implementation for {@link StructWithEnum} + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + @software.amazon.jsii.Internal + final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements StructWithEnum { + private final software.amazon.jsii.tests.calculator.StringEnum foo; + private final software.amazon.jsii.tests.calculator.AllTypesEnum bar; + + /** + * Constructor that initializes the object based on values retrieved from the JsiiObject. + * @param objRef Reference to the JSII managed object. + */ + protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) { + super(objRef); + this.foo = software.amazon.jsii.Kernel.get(this, "foo", software.amazon.jsii.NativeType.forClass(software.amazon.jsii.tests.calculator.StringEnum.class)); + this.bar = software.amazon.jsii.Kernel.get(this, "bar", software.amazon.jsii.NativeType.forClass(software.amazon.jsii.tests.calculator.AllTypesEnum.class)); + } + + /** + * Constructor that initializes the object based on literal property values passed by the {@link Builder}. + */ + protected Jsii$Proxy(final software.amazon.jsii.tests.calculator.StringEnum foo, final software.amazon.jsii.tests.calculator.AllTypesEnum bar) { + super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); + this.foo = java.util.Objects.requireNonNull(foo, "foo is required"); + this.bar = bar; + } + + @Override + public final software.amazon.jsii.tests.calculator.StringEnum getFoo() { + return this.foo; + } + + @Override + public final software.amazon.jsii.tests.calculator.AllTypesEnum getBar() { + return this.bar; + } + + @Override + @software.amazon.jsii.Internal + public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() { + final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE; + final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); + + data.set("foo", om.valueToTree(this.getFoo())); + if (this.getBar() != null) { + data.set("bar", om.valueToTree(this.getBar())); + } + + final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); + struct.set("fqn", om.valueToTree("jsii-calc.StructWithEnum")); + struct.set("data", data); + + final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); + obj.set("$jsii.struct", struct); + + return obj; + } + + @Override + public final boolean equals(final Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + StructWithEnum.Jsii$Proxy that = (StructWithEnum.Jsii$Proxy) o; + + if (!foo.equals(that.foo)) return false; + return this.bar != null ? this.bar.equals(that.bar) : that.bar == null; + } + + @Override + public final int hashCode() { + int result = this.foo.hashCode(); + result = 31 * result + (this.bar != null ? this.bar.hashCode() : 0); + return result; + } + } +} + +`; + exports[`Generated code for "jsii-calc": /java/src/main/java/software/amazon/jsii/tests/calculator/StructWithJavaReservedWords.java 1`] = ` package software.amazon.jsii.tests.calculator; @@ -19872,6 +20138,71 @@ public class SyncVirtualMethods extends software.amazon.jsii.JsiiObject { `; +exports[`Generated code for "jsii-calc": /java/src/main/java/software/amazon/jsii/tests/calculator/TestStructWithEnum.java 1`] = ` +package software.amazon.jsii.tests.calculator; + +/** + */ +@javax.annotation.Generated(value = "jsii-pacmak") +@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) +@software.amazon.jsii.Jsii(module = software.amazon.jsii.tests.calculator.$Module.class, fqn = "jsii-calc.TestStructWithEnum") +public class TestStructWithEnum extends software.amazon.jsii.JsiiObject { + + protected TestStructWithEnum(final software.amazon.jsii.JsiiObjectRef objRef) { + super(objRef); + } + + protected TestStructWithEnum(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) { + super(initializationMode); + } + + /** + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public TestStructWithEnum() { + super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); + software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this); + } + + /** + * Returns true if \`foo\` is \`StringEnum.A\`. + *

+ * @param input This parameter is required. + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public @org.jetbrains.annotations.NotNull java.lang.Boolean isStringEnumA(final @org.jetbrains.annotations.NotNull software.amazon.jsii.tests.calculator.StructWithEnum input) { + return software.amazon.jsii.Kernel.call(this, "isStringEnumA", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class), new Object[] { java.util.Objects.requireNonNull(input, "input is required") }); + } + + /** + * Returns true if \`foo\` is \`StringEnum.B\` and \`bar\` is \`AllTypesEnum.THIS_IS_GREAT\`. + *

+ * @param input This parameter is required. + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public @org.jetbrains.annotations.NotNull java.lang.Boolean isStringEnumB(final @org.jetbrains.annotations.NotNull software.amazon.jsii.tests.calculator.StructWithEnum input) { + return software.amazon.jsii.Kernel.call(this, "isStringEnumB", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class), new Object[] { java.util.Objects.requireNonNull(input, "input is required") }); + } + + /** + * Returns \`foo: StringEnum.A\`. + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public @org.jetbrains.annotations.NotNull software.amazon.jsii.tests.calculator.StructWithEnum getStructWithFoo() { + return software.amazon.jsii.Kernel.get(this, "structWithFoo", software.amazon.jsii.NativeType.forClass(software.amazon.jsii.tests.calculator.StructWithEnum.class)); + } + + /** + * Returns \`foo: StringEnum.C\` and \`bar: AllTypesEnum.MY_ENUM_VALUE\`. + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public @org.jetbrains.annotations.NotNull software.amazon.jsii.tests.calculator.StructWithEnum getStructWithFooBar() { + return software.amazon.jsii.Kernel.get(this, "structWithFooBar", software.amazon.jsii.NativeType.forClass(software.amazon.jsii.tests.calculator.StructWithEnum.class)); + } +} + +`; + exports[`Generated code for "jsii-calc": /java/src/main/java/software/amazon/jsii/tests/calculator/Thrower.java 1`] = ` package software.amazon.jsii.tests.calculator; @@ -21766,6 +22097,130 @@ public interface StructWithSelf extends software.amazon.jsii.JsiiSerializable { `; +exports[`Generated code for "jsii-calc": /java/src/main/java/software/amazon/jsii/tests/calculator/submodule/Default.java 1`] = ` +package software.amazon.jsii.tests.calculator.submodule; + +/** + * A struct named "Default". + *

+ * @see https://github.com/aws/jsii/issues/2637 + */ +@javax.annotation.Generated(value = "jsii-pacmak") +@software.amazon.jsii.Jsii(module = software.amazon.jsii.tests.calculator.$Module.class, fqn = "jsii-calc.submodule.Default") +@software.amazon.jsii.Jsii.Proxy(Default.Jsii$Proxy.class) +@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) +public interface Default extends software.amazon.jsii.JsiiSerializable { + + /** + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + @org.jetbrains.annotations.NotNull java.lang.Number getFoo(); + + /** + * @return a {@link Builder} of {@link Default} + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + static Builder builder() { + return new Builder(); + } + /** + * A builder for {@link Default} + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public static final class Builder implements software.amazon.jsii.Builder { + private java.lang.Number foo; + + /** + * Sets the value of {@link Default#getFoo} + * @param foo the value to be set. This parameter is required. + * @return {@code this} + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public Builder foo(java.lang.Number foo) { + this.foo = foo; + return this; + } + + /** + * Builds the configured instance. + * @return a new instance of {@link Default} + * @throws NullPointerException if any required attribute was not provided + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + @Override + public Default build() { + return new Jsii$Proxy(foo); + } + } + + /** + * An implementation for {@link Default} + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + @software.amazon.jsii.Internal + final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements Default { + private final java.lang.Number foo; + + /** + * Constructor that initializes the object based on values retrieved from the JsiiObject. + * @param objRef Reference to the JSII managed object. + */ + protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) { + super(objRef); + this.foo = software.amazon.jsii.Kernel.get(this, "foo", software.amazon.jsii.NativeType.forClass(java.lang.Number.class)); + } + + /** + * Constructor that initializes the object based on literal property values passed by the {@link Builder}. + */ + protected Jsii$Proxy(final java.lang.Number foo) { + super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); + this.foo = java.util.Objects.requireNonNull(foo, "foo is required"); + } + + @Override + public final java.lang.Number getFoo() { + return this.foo; + } + + @Override + @software.amazon.jsii.Internal + public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() { + final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE; + final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); + + data.set("foo", om.valueToTree(this.getFoo())); + + final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); + struct.set("fqn", om.valueToTree("jsii-calc.submodule.Default")); + struct.set("data", data); + + final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); + obj.set("$jsii.struct", struct); + + return obj; + } + + @Override + public final boolean equals(final Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Default.Jsii$Proxy that = (Default.Jsii$Proxy) o; + + return this.foo.equals(that.foo); + } + + @Override + public final int hashCode() { + int result = this.foo.hashCode(); + return result; + } + } +} + +`; + exports[`Generated code for "jsii-calc": /java/src/main/java/software/amazon/jsii/tests/calculator/submodule/MyClass.java 1`] = ` package software.amazon.jsii.tests.calculator.submodule; @@ -22872,6 +23327,7 @@ jsii-calc.ConsumePureInterface=software.amazon.jsii.tests.calculator.ConsumePure jsii-calc.ConsumerCanRingBell=software.amazon.jsii.tests.calculator.ConsumerCanRingBell jsii-calc.ConsumersOfThisCrazyTypeSystem=software.amazon.jsii.tests.calculator.ConsumersOfThisCrazyTypeSystem jsii-calc.DataRenderer=software.amazon.jsii.tests.calculator.DataRenderer +jsii-calc.Default=software.amazon.jsii.tests.calculator.Default jsii-calc.DefaultedConstructorArgument=software.amazon.jsii.tests.calculator.DefaultedConstructorArgument jsii-calc.Demonstrate982=software.amazon.jsii.tests.calculator.Demonstrate982 jsii-calc.DeprecatedClass=software.amazon.jsii.tests.calculator.DeprecatedClass @@ -22958,6 +23414,8 @@ jsii-calc.InterfaceInNamespaceIncludesClasses.Hello=software.amazon.jsii.tests.c jsii-calc.InterfaceInNamespaceOnlyInterface.Hello=software.amazon.jsii.tests.calculator.interface_in_namespace_only_interface.Hello jsii-calc.InterfacesMaker=software.amazon.jsii.tests.calculator.InterfacesMaker jsii-calc.Isomorphism=software.amazon.jsii.tests.calculator.Isomorphism +jsii-calc.Issue2638=software.amazon.jsii.tests.calculator.Issue2638 +jsii-calc.Issue2638B=software.amazon.jsii.tests.calculator.Issue2638B jsii-calc.JSII417Derived=software.amazon.jsii.tests.calculator.JSII417Derived jsii-calc.JSII417PublicBaseOfBase=software.amazon.jsii.tests.calculator.JSII417PublicBaseOfBase jsii-calc.JSObjectLiteralForInterface=software.amazon.jsii.tests.calculator.JSObjectLiteralForInterface @@ -23029,12 +23487,14 @@ jsii-calc.StructB=software.amazon.jsii.tests.calculator.StructB jsii-calc.StructParameterType=software.amazon.jsii.tests.calculator.StructParameterType jsii-calc.StructPassing=software.amazon.jsii.tests.calculator.StructPassing jsii-calc.StructUnionConsumer=software.amazon.jsii.tests.calculator.StructUnionConsumer +jsii-calc.StructWithEnum=software.amazon.jsii.tests.calculator.StructWithEnum jsii-calc.StructWithJavaReservedWords=software.amazon.jsii.tests.calculator.StructWithJavaReservedWords jsii-calc.Sum=software.amazon.jsii.tests.calculator.Sum jsii-calc.SupportsNiceJavaBuilder=software.amazon.jsii.tests.calculator.SupportsNiceJavaBuilder jsii-calc.SupportsNiceJavaBuilderProps=software.amazon.jsii.tests.calculator.SupportsNiceJavaBuilderProps jsii-calc.SupportsNiceJavaBuilderWithRequiredProps=software.amazon.jsii.tests.calculator.SupportsNiceJavaBuilderWithRequiredProps jsii-calc.SyncVirtualMethods=software.amazon.jsii.tests.calculator.SyncVirtualMethods +jsii-calc.TestStructWithEnum=software.amazon.jsii.tests.calculator.TestStructWithEnum jsii-calc.Thrower=software.amazon.jsii.tests.calculator.Thrower jsii-calc.TopLevelStruct=software.amazon.jsii.tests.calculator.TopLevelStruct jsii-calc.UmaskCheck=software.amazon.jsii.tests.calculator.UmaskCheck @@ -23054,6 +23514,7 @@ jsii-calc.composition.CompositeOperation.CompositionStringStyle=software.amazon. jsii-calc.nodirect.sub1.TypeFromSub1=software.amazon.jsii.tests.calculator.nodirect.sub1.TypeFromSub1 jsii-calc.nodirect.sub2.TypeFromSub2=software.amazon.jsii.tests.calculator.nodirect.sub2.TypeFromSub2 jsii-calc.onlystatic.OnlyStaticMethods=software.amazon.jsii.tests.calculator.onlystatic.OnlyStaticMethods +jsii-calc.submodule.Default=software.amazon.jsii.tests.calculator.submodule.Default jsii-calc.submodule.MyClass=software.amazon.jsii.tests.calculator.submodule.MyClass jsii-calc.submodule.back_references.MyClassReference=software.amazon.jsii.tests.calculator.submodule.back_references.MyClassReference jsii-calc.submodule.child.Awesomeness=software.amazon.jsii.tests.calculator.submodule.child.Awesomeness diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap index 5771ea5b69..6f302ae5a9 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap @@ -3659,6 +3659,20 @@ class DataRenderer(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.DataRenderer"): return typing.cast(builtins.str, jsii.invoke(self, "renderMap", [map])) +class Default(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Default"): + '''A class named "Default". + + :see: https://github.com/aws/jsii/issues/2637 + ''' + + def __init__(self) -> None: + jsii.create(Default, self, []) + + @jsii.member(jsii_name="pleaseCompile") + def please_compile(self) -> None: + return typing.cast(None, jsii.invoke(self, "pleaseCompile", [])) + + class DefaultedConstructorArgument( metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.DefaultedConstructorArgument", @@ -6246,6 +6260,25 @@ class _IsomorphismProxy(Isomorphism): pass +class Issue2638(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Issue2638"): + '''Docstrings with period. + + :see: https://github.com/aws/jsii/issues/2638 + ''' + + def __init__(self) -> None: + '''First sentence. + + Second sentence. Third sentence. + ''' + jsii.create(Issue2638, self, []) + + +class Issue2638B(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Issue2638B"): + def __init__(self) -> None: + jsii.create(Issue2638B, self, []) + + class JSII417PublicBaseOfBase( metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.JSII417PublicBaseOfBase", @@ -8475,6 +8508,56 @@ class StructUnionConsumer( return typing.cast(builtins.bool, jsii.sinvoke(cls, "isStructB", [struct])) +@jsii.data_type( + jsii_type="jsii-calc.StructWithEnum", + jsii_struct_bases=[], + name_mapping={"foo": "foo", "bar": "bar"}, +) +class StructWithEnum: + def __init__( + self, + *, + foo: StringEnum, + bar: typing.Optional[AllTypesEnum] = None, + ) -> None: + ''' + :param foo: An enum value. + :param bar: Optional enum value (of type integer). Default: AllTypesEnum.YOUR_ENUM_VALUE + ''' + self._values: typing.Dict[str, typing.Any] = { + "foo": foo, + } + if bar is not None: + self._values["bar"] = bar + + @builtins.property + def foo(self) -> StringEnum: + '''An enum value.''' + result = self._values.get("foo") + assert result is not None, "Required property 'foo' is missing" + return typing.cast(StringEnum, result) + + @builtins.property + def bar(self) -> typing.Optional[AllTypesEnum]: + '''Optional enum value (of type integer). + + :default: AllTypesEnum.YOUR_ENUM_VALUE + ''' + result = self._values.get("bar") + return typing.cast(typing.Optional[AllTypesEnum], result) + + def __eq__(self, rhs: typing.Any) -> builtins.bool: + return isinstance(rhs, self.__class__) and rhs._values == self._values + + def __ne__(self, rhs: typing.Any) -> builtins.bool: + return not (rhs == self) + + def __repr__(self) -> str: + return "StructWithEnum(%s)" % ", ".join( + k + "=" + repr(v) for k, v in self._values.items() + ) + + @jsii.data_type( jsii_type="jsii-calc.StructWithJavaReservedWords", jsii_struct_bases=[], @@ -8772,6 +8855,58 @@ class SyncVirtualMethods( jsii.set(self, "valueOfOtherProperty", value) +class TestStructWithEnum( + metaclass=jsii.JSIIMeta, + jsii_type="jsii-calc.TestStructWithEnum", +): + def __init__(self) -> None: + jsii.create(TestStructWithEnum, self, []) + + @jsii.member(jsii_name="isStringEnumA") + def is_string_enum_a( + self, + *, + foo: StringEnum, + bar: typing.Optional[AllTypesEnum] = None, + ) -> builtins.bool: + '''Returns true if \`\`foo\`\` is \`\`StringEnum.A\`\`. + + :param foo: An enum value. + :param bar: Optional enum value (of type integer). Default: AllTypesEnum.YOUR_ENUM_VALUE + ''' + input = StructWithEnum(foo=foo, bar=bar) + + return typing.cast(builtins.bool, jsii.invoke(self, "isStringEnumA", [input])) + + @jsii.member(jsii_name="isStringEnumB") + def is_string_enum_b( + self, + *, + foo: StringEnum, + bar: typing.Optional[AllTypesEnum] = None, + ) -> builtins.bool: + '''Returns true if \`\`foo\`\` is \`\`StringEnum.B\`\` and \`\`bar\`\` is \`\`AllTypesEnum.THIS_IS_GREAT\`\`. + + :param foo: An enum value. + :param bar: Optional enum value (of type integer). Default: AllTypesEnum.YOUR_ENUM_VALUE + ''' + input = StructWithEnum(foo=foo, bar=bar) + + return typing.cast(builtins.bool, jsii.invoke(self, "isStringEnumB", [input])) + + @builtins.property # type: ignore[misc] + @jsii.member(jsii_name="structWithFoo") + def struct_with_foo(self) -> StructWithEnum: + '''Returns \`\`foo: StringEnum.A\`\`.''' + return typing.cast(StructWithEnum, jsii.get(self, "structWithFoo")) + + @builtins.property # type: ignore[misc] + @jsii.member(jsii_name="structWithFooBar") + def struct_with_foo_bar(self) -> StructWithEnum: + '''Returns \`\`foo: StringEnum.C\`\` and \`\`bar: AllTypesEnum.MY_ENUM_VALUE\`\`.''' + return typing.cast(StructWithEnum, jsii.get(self, "structWithFooBar")) + + class Thrower(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Thrower"): def __init__(self) -> None: jsii.create(Thrower, self, []) @@ -9683,6 +9818,7 @@ __all__ = [ "ConsumerCanRingBell", "ConsumersOfThisCrazyTypeSystem", "DataRenderer", + "Default", "DefaultedConstructorArgument", "Demonstrate982", "DeprecatedClass", @@ -9764,6 +9900,8 @@ __all__ = [ "InterfaceCollections", "InterfacesMaker", "Isomorphism", + "Issue2638", + "Issue2638B", "JSII417Derived", "JSII417PublicBaseOfBase", "JSObjectLiteralForInterface", @@ -9829,12 +9967,14 @@ __all__ = [ "StructParameterType", "StructPassing", "StructUnionConsumer", + "StructWithEnum", "StructWithJavaReservedWords", "Sum", "SupportsNiceJavaBuilder", "SupportsNiceJavaBuilderProps", "SupportsNiceJavaBuilderWithRequiredProps", "SyncVirtualMethods", + "TestStructWithEnum", "Thrower", "TopLevelStruct", "UmaskCheck", @@ -10459,6 +10599,41 @@ from .nested_submodule.deeply_nested import INamespaced as _INamespaced_e2f386ad from .param import SpecialParameter as _SpecialParameter_5bbf34a2 +@jsii.data_type( + jsii_type="jsii-calc.submodule.Default", + jsii_struct_bases=[], + name_mapping={"foo": "foo"}, +) +class Default: + def __init__(self, *, foo: jsii.Number) -> None: + '''A struct named "Default". + + :param foo: + + :see: https://github.com/aws/jsii/issues/2637 + ''' + self._values: typing.Dict[str, typing.Any] = { + "foo": foo, + } + + @builtins.property + def foo(self) -> jsii.Number: + result = self._values.get("foo") + assert result is not None, "Required property 'foo' is missing" + return typing.cast(jsii.Number, result) + + def __eq__(self, rhs: typing.Any) -> builtins.bool: + return isinstance(rhs, self.__class__) and rhs._values == self._values + + def __ne__(self, rhs: typing.Any) -> builtins.bool: + return not (rhs == self) + + def __repr__(self) -> str: + return "Default(%s)" % ", ".join( + k + "=" + repr(v) for k, v in self._values.items() + ) + + @jsii.implements(_INamespaced_e2f386ad) class MyClass(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.submodule.MyClass"): def __init__(self, *, prop: _SomeEnum_b2e41d92) -> None: @@ -10509,6 +10684,7 @@ class MyClass(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.submodule.MyClass"): __all__ = [ + "Default", "MyClass", ] diff --git a/packages/jsii-reflect/test/__snapshots__/jsii-tree.test.ts.snap b/packages/jsii-reflect/test/__snapshots__/jsii-tree.test.ts.snap index ef44e72781..415a3c44c6 100644 --- a/packages/jsii-reflect/test/__snapshots__/jsii-tree.test.ts.snap +++ b/packages/jsii-reflect/test/__snapshots__/jsii-tree.test.ts.snap @@ -227,32 +227,38 @@ exports[`jsii-tree --all 1`] = ` │ │ │ └─┬ returnsSpecialParam() method (stable) │ │ │ └── returns: jsii-calc.submodule.param.SpecialParameter │ │ └─┬ types - │ │ └─┬ class MyClass (stable) - │ │ ├── interfaces: INamespaced + │ │ ├─┬ class MyClass (stable) + │ │ │ ├── interfaces: INamespaced + │ │ │ └─┬ members + │ │ │ ├─┬ (props) initializer (stable) + │ │ │ │ └─┬ parameters + │ │ │ │ └─┬ props + │ │ │ │ └── type: jsii-calc.submodule.child.SomeStruct + │ │ │ ├─┬ methodWithSpecialParam(param) method (stable) + │ │ │ │ ├─┬ parameters + │ │ │ │ │ └─┬ param + │ │ │ │ │ └── type: jsii-calc.submodule.param.SpecialParameter + │ │ │ │ └── returns: string + │ │ │ ├─┬ awesomeness property (stable) + │ │ │ │ ├── immutable + │ │ │ │ └── type: jsii-calc.submodule.child.Awesomeness + │ │ │ ├─┬ definedAt property (stable) + │ │ │ │ ├── immutable + │ │ │ │ └── type: string + │ │ │ ├─┬ goodness property (stable) + │ │ │ │ ├── immutable + │ │ │ │ └── type: jsii-calc.submodule.child.Goodness + │ │ │ ├─┬ props property (stable) + │ │ │ │ ├── immutable + │ │ │ │ └── type: jsii-calc.submodule.child.SomeStruct + │ │ │ └─┬ allTypes property (stable) + │ │ │ └── type: Optional + │ │ └─┬ interface Default (stable) │ │ └─┬ members - │ │ ├─┬ (props) initializer (stable) - │ │ │ └─┬ parameters - │ │ │ └─┬ props - │ │ │ └── type: jsii-calc.submodule.child.SomeStruct - │ │ ├─┬ methodWithSpecialParam(param) method (stable) - │ │ │ ├─┬ parameters - │ │ │ │ └─┬ param - │ │ │ │ └── type: jsii-calc.submodule.param.SpecialParameter - │ │ │ └── returns: string - │ │ ├─┬ awesomeness property (stable) - │ │ │ ├── immutable - │ │ │ └── type: jsii-calc.submodule.child.Awesomeness - │ │ ├─┬ definedAt property (stable) - │ │ │ ├── immutable - │ │ │ └── type: string - │ │ ├─┬ goodness property (stable) - │ │ │ ├── immutable - │ │ │ └── type: jsii-calc.submodule.child.Goodness - │ │ ├─┬ props property (stable) - │ │ │ ├── immutable - │ │ │ └── type: jsii-calc.submodule.child.SomeStruct - │ │ └─┬ allTypes property (stable) - │ │ └── type: Optional + │ │ └─┬ foo property (stable) + │ │ ├── abstract + │ │ ├── immutable + │ │ └── type: number │ └─┬ types │ ├─┬ class AbstractClass (stable) │ │ ├── base: AbstractClassBase @@ -745,6 +751,11 @@ exports[`jsii-tree --all 1`] = ` │ │ │ └─┬ map │ │ │ └── type: Map any> │ │ └── returns: string + │ ├─┬ class Default (stable) + │ │ └─┬ members + │ │ ├── () initializer (stable) + │ │ └─┬ pleaseCompile() method (stable) + │ │ └── returns: void │ ├─┬ class DefaultedConstructorArgument (stable) │ │ └─┬ members │ │ ├─┬ (arg1,arg2,arg3) initializer (stable) @@ -1046,6 +1057,12 @@ exports[`jsii-tree --all 1`] = ` │ │ ├── () initializer (stable) │ │ └─┬ myself() method (stable) │ │ └── returns: jsii-calc.Isomorphism + │ ├─┬ class Issue2638 (stable) + │ │ └─┬ members + │ │ └── () initializer (stable) + │ ├─┬ class Issue2638B (stable) + │ │ └─┬ members + │ │ └── () initializer (stable) │ ├─┬ class JSII417Derived (stable) │ │ ├── base: JSII417PublicBaseOfBase │ │ └─┬ members @@ -1885,6 +1902,25 @@ exports[`jsii-tree --all 1`] = ` │ │ │ └── type: string │ │ └─┬ valueOfOtherProperty property (stable) │ │ └── type: string + │ ├─┬ class TestStructWithEnum (stable) + │ │ └─┬ members + │ │ ├── () initializer (stable) + │ │ ├─┬ isStringEnumA(input) method (stable) + │ │ │ ├─┬ parameters + │ │ │ │ └─┬ input + │ │ │ │ └── type: jsii-calc.StructWithEnum + │ │ │ └── returns: boolean + │ │ ├─┬ isStringEnumB(input) method (stable) + │ │ │ ├─┬ parameters + │ │ │ │ └─┬ input + │ │ │ │ └── type: jsii-calc.StructWithEnum + │ │ │ └── returns: boolean + │ │ ├─┬ structWithFoo property (stable) + │ │ │ ├── immutable + │ │ │ └── type: jsii-calc.StructWithEnum + │ │ └─┬ structWithFooBar property (stable) + │ │ ├── immutable + │ │ └── type: jsii-calc.StructWithEnum │ ├─┬ class Thrower (stable) │ │ └─┬ members │ │ ├── () initializer (stable) @@ -2572,6 +2608,16 @@ exports[`jsii-tree --all 1`] = ` │ │ ├── abstract │ │ ├── immutable │ │ └── type: Optional + │ ├─┬ interface StructWithEnum (stable) + │ │ └─┬ members + │ │ ├─┬ foo property (stable) + │ │ │ ├── abstract + │ │ │ ├── immutable + │ │ │ └── type: jsii-calc.StringEnum + │ │ └─┬ bar property (stable) + │ │ ├── abstract + │ │ ├── immutable + │ │ └── type: Optional │ ├─┬ interface StructWithJavaReservedWords (stable) │ │ └─┬ members │ │ ├─┬ default property (stable) @@ -2934,8 +2980,9 @@ exports[`jsii-tree --inheritance 1`] = ` │ │ │ └─┬ types │ │ │ └── class ReturnsSpecialParameter │ │ └─┬ types - │ │ └─┬ class MyClass - │ │ └── interfaces: INamespaced + │ │ ├─┬ class MyClass + │ │ │ └── interfaces: INamespaced + │ │ └── interface Default │ └─┬ types │ ├─┬ class AbstractClass │ │ ├── base: AbstractClassBase @@ -2978,6 +3025,7 @@ exports[`jsii-tree --inheritance 1`] = ` │ ├── class ConsumerCanRingBell │ ├── class ConsumersOfThisCrazyTypeSystem │ ├── class DataRenderer + │ ├── class Default │ ├── class DefaultedConstructorArgument │ ├── class Demonstrate982 │ ├── class DeprecatedClass @@ -3012,6 +3060,8 @@ exports[`jsii-tree --inheritance 1`] = ` │ ├── class InterfaceCollections │ ├── class InterfacesMaker │ ├── class Isomorphism + │ ├── class Issue2638 + │ ├── class Issue2638B │ ├─┬ class JSII417Derived │ │ └── base: JSII417PublicBaseOfBase │ ├── class JSII417PublicBaseOfBase @@ -3075,6 +3125,7 @@ exports[`jsii-tree --inheritance 1`] = ` │ │ └── base: SupportsNiceJavaBuilderWithRequiredProps │ ├── class SupportsNiceJavaBuilderWithRequiredProps │ ├── class SyncVirtualMethods + │ ├── class TestStructWithEnum │ ├── class Thrower │ ├── class UmaskCheck │ ├─┬ class UnaryOperation @@ -3186,6 +3237,7 @@ exports[`jsii-tree --inheritance 1`] = ` │ ├── interface StructA │ ├── interface StructB │ ├── interface StructParameterType + │ ├── interface StructWithEnum │ ├── interface StructWithJavaReservedWords │ ├── interface SupportsNiceJavaBuilderProps │ ├── interface TopLevelStruct @@ -3386,15 +3438,18 @@ exports[`jsii-tree --members 1`] = ` │ │ │ ├── () initializer │ │ │ └── returnsSpecialParam() method │ │ └─┬ types - │ │ └─┬ class MyClass + │ │ ├─┬ class MyClass + │ │ │ └─┬ members + │ │ │ ├── (props) initializer + │ │ │ ├── methodWithSpecialParam(param) method + │ │ │ ├── awesomeness property + │ │ │ ├── definedAt property + │ │ │ ├── goodness property + │ │ │ ├── props property + │ │ │ └── allTypes property + │ │ └─┬ interface Default │ │ └─┬ members - │ │ ├── (props) initializer - │ │ ├── methodWithSpecialParam(param) method - │ │ ├── awesomeness property - │ │ ├── definedAt property - │ │ ├── goodness property - │ │ ├── props property - │ │ └── allTypes property + │ │ └── foo property │ └─┬ types │ ├─┬ class AbstractClass │ │ └─┬ members @@ -3596,6 +3651,10 @@ exports[`jsii-tree --members 1`] = ` │ │ ├── render(data) method │ │ ├── renderArbitrary(data) method │ │ └── renderMap(map) method + │ ├─┬ class Default + │ │ └─┬ members + │ │ ├── () initializer + │ │ └── pleaseCompile() method │ ├─┬ class DefaultedConstructorArgument │ │ └─┬ members │ │ ├── (arg1,arg2,arg3) initializer @@ -3729,6 +3788,12 @@ exports[`jsii-tree --members 1`] = ` │ │ └─┬ members │ │ ├── () initializer │ │ └── myself() method + │ ├─┬ class Issue2638 + │ │ └─┬ members + │ │ └── () initializer + │ ├─┬ class Issue2638B + │ │ └─┬ members + │ │ └── () initializer │ ├─┬ class JSII417Derived │ │ └─┬ members │ │ ├── (property) initializer @@ -4097,6 +4162,13 @@ exports[`jsii-tree --members 1`] = ` │ │ ├── otherProperty property │ │ ├── theProperty property │ │ └── valueOfOtherProperty property + │ ├─┬ class TestStructWithEnum + │ │ └─┬ members + │ │ ├── () initializer + │ │ ├── isStringEnumA(input) method + │ │ ├── isStringEnumB(input) method + │ │ ├── structWithFoo property + │ │ └── structWithFooBar property │ ├─┬ class Thrower │ │ └─┬ members │ │ ├── () initializer @@ -4391,6 +4463,10 @@ exports[`jsii-tree --members 1`] = ` │ │ └─┬ members │ │ ├── scope property │ │ └── props property + │ ├─┬ interface StructWithEnum + │ │ └─┬ members + │ │ ├── foo property + │ │ └── bar property │ ├─┬ interface StructWithJavaReservedWords │ │ └─┬ members │ │ ├── default property @@ -4638,7 +4714,8 @@ exports[`jsii-tree --types 1`] = ` │ │ │ └─┬ types │ │ │ └── class ReturnsSpecialParameter │ │ └─┬ types - │ │ └── class MyClass + │ │ ├── class MyClass + │ │ └── interface Default │ └─┬ types │ ├── class AbstractClass │ ├── class AbstractClassBase @@ -4670,6 +4747,7 @@ exports[`jsii-tree --types 1`] = ` │ ├── class ConsumerCanRingBell │ ├── class ConsumersOfThisCrazyTypeSystem │ ├── class DataRenderer + │ ├── class Default │ ├── class DefaultedConstructorArgument │ ├── class Demonstrate982 │ ├── class DeprecatedClass @@ -4698,6 +4776,8 @@ exports[`jsii-tree --types 1`] = ` │ ├── class InterfaceCollections │ ├── class InterfacesMaker │ ├── class Isomorphism + │ ├── class Issue2638 + │ ├── class Issue2638B │ ├── class JSII417Derived │ ├── class JSII417PublicBaseOfBase │ ├── class JSObjectLiteralForInterface @@ -4750,6 +4830,7 @@ exports[`jsii-tree --types 1`] = ` │ ├── class SupportsNiceJavaBuilder │ ├── class SupportsNiceJavaBuilderWithRequiredProps │ ├── class SyncVirtualMethods + │ ├── class TestStructWithEnum │ ├── class Thrower │ ├── class UmaskCheck │ ├── class UnaryOperation @@ -4830,6 +4911,7 @@ exports[`jsii-tree --types 1`] = ` │ ├── interface StructA │ ├── interface StructB │ ├── interface StructParameterType + │ ├── interface StructWithEnum │ ├── interface StructWithJavaReservedWords │ ├── interface SupportsNiceJavaBuilderProps │ ├── interface TopLevelStruct diff --git a/packages/jsii-reflect/test/__snapshots__/tree.test.ts.snap b/packages/jsii-reflect/test/__snapshots__/tree.test.ts.snap index e847895178..0f057f66c1 100644 --- a/packages/jsii-reflect/test/__snapshots__/tree.test.ts.snap +++ b/packages/jsii-reflect/test/__snapshots__/tree.test.ts.snap @@ -323,32 +323,38 @@ exports[`showAll 1`] = ` │ │ │ └─┬ returnsSpecialParam() method │ │ │ └── returns: jsii-calc.submodule.param.SpecialParameter │ │ └─┬ types - │ │ └─┬ class MyClass - │ │ ├── interfaces: INamespaced + │ │ ├─┬ class MyClass + │ │ │ ├── interfaces: INamespaced + │ │ │ └─┬ members + │ │ │ ├─┬ (props) initializer + │ │ │ │ └─┬ parameters + │ │ │ │ └─┬ props + │ │ │ │ └── type: jsii-calc.submodule.child.SomeStruct + │ │ │ ├─┬ methodWithSpecialParam(param) method + │ │ │ │ ├─┬ parameters + │ │ │ │ │ └─┬ param + │ │ │ │ │ └── type: jsii-calc.submodule.param.SpecialParameter + │ │ │ │ └── returns: string + │ │ │ ├─┬ awesomeness property + │ │ │ │ ├── immutable + │ │ │ │ └── type: jsii-calc.submodule.child.Awesomeness + │ │ │ ├─┬ definedAt property + │ │ │ │ ├── immutable + │ │ │ │ └── type: string + │ │ │ ├─┬ goodness property + │ │ │ │ ├── immutable + │ │ │ │ └── type: jsii-calc.submodule.child.Goodness + │ │ │ ├─┬ props property + │ │ │ │ ├── immutable + │ │ │ │ └── type: jsii-calc.submodule.child.SomeStruct + │ │ │ └─┬ allTypes property + │ │ │ └── type: Optional + │ │ └─┬ interface Default │ │ └─┬ members - │ │ ├─┬ (props) initializer - │ │ │ └─┬ parameters - │ │ │ └─┬ props - │ │ │ └── type: jsii-calc.submodule.child.SomeStruct - │ │ ├─┬ methodWithSpecialParam(param) method - │ │ │ ├─┬ parameters - │ │ │ │ └─┬ param - │ │ │ │ └── type: jsii-calc.submodule.param.SpecialParameter - │ │ │ └── returns: string - │ │ ├─┬ awesomeness property - │ │ │ ├── immutable - │ │ │ └── type: jsii-calc.submodule.child.Awesomeness - │ │ ├─┬ definedAt property - │ │ │ ├── immutable - │ │ │ └── type: string - │ │ ├─┬ goodness property - │ │ │ ├── immutable - │ │ │ └── type: jsii-calc.submodule.child.Goodness - │ │ ├─┬ props property - │ │ │ ├── immutable - │ │ │ └── type: jsii-calc.submodule.child.SomeStruct - │ │ └─┬ allTypes property - │ │ └── type: Optional + │ │ └─┬ foo property + │ │ ├── abstract + │ │ ├── immutable + │ │ └── type: number │ └─┬ types │ ├─┬ class AbstractClass │ │ ├── base: AbstractClassBase @@ -841,6 +847,11 @@ exports[`showAll 1`] = ` │ │ │ └─┬ map │ │ │ └── type: Map any> │ │ └── returns: string + │ ├─┬ class Default + │ │ └─┬ members + │ │ ├── () initializer + │ │ └─┬ pleaseCompile() method + │ │ └── returns: void │ ├─┬ class DefaultedConstructorArgument │ │ └─┬ members │ │ ├─┬ (arg1,arg2,arg3) initializer @@ -1142,6 +1153,12 @@ exports[`showAll 1`] = ` │ │ ├── () initializer │ │ └─┬ myself() method │ │ └── returns: jsii-calc.Isomorphism + │ ├─┬ class Issue2638 + │ │ └─┬ members + │ │ └── () initializer + │ ├─┬ class Issue2638B + │ │ └─┬ members + │ │ └── () initializer │ ├─┬ class JSII417Derived │ │ ├── base: JSII417PublicBaseOfBase │ │ └─┬ members @@ -1981,6 +1998,25 @@ exports[`showAll 1`] = ` │ │ │ └── type: string │ │ └─┬ valueOfOtherProperty property │ │ └── type: string + │ ├─┬ class TestStructWithEnum + │ │ └─┬ members + │ │ ├── () initializer + │ │ ├─┬ isStringEnumA(input) method + │ │ │ ├─┬ parameters + │ │ │ │ └─┬ input + │ │ │ │ └── type: jsii-calc.StructWithEnum + │ │ │ └── returns: boolean + │ │ ├─┬ isStringEnumB(input) method + │ │ │ ├─┬ parameters + │ │ │ │ └─┬ input + │ │ │ │ └── type: jsii-calc.StructWithEnum + │ │ │ └── returns: boolean + │ │ ├─┬ structWithFoo property + │ │ │ ├── immutable + │ │ │ └── type: jsii-calc.StructWithEnum + │ │ └─┬ structWithFooBar property + │ │ ├── immutable + │ │ └── type: jsii-calc.StructWithEnum │ ├─┬ class Thrower │ │ └─┬ members │ │ ├── () initializer @@ -2668,6 +2704,16 @@ exports[`showAll 1`] = ` │ │ ├── abstract │ │ ├── immutable │ │ └── type: Optional + │ ├─┬ interface StructWithEnum + │ │ └─┬ members + │ │ ├─┬ foo property + │ │ │ ├── abstract + │ │ │ ├── immutable + │ │ │ └── type: jsii-calc.StringEnum + │ │ └─┬ bar property + │ │ ├── abstract + │ │ ├── immutable + │ │ └── type: Optional │ ├─┬ interface StructWithJavaReservedWords │ │ └─┬ members │ │ ├─┬ default property @@ -3057,7 +3103,8 @@ exports[`types 1`] = ` │ │ │ └─┬ types │ │ │ └── class ReturnsSpecialParameter │ │ └─┬ types - │ │ └── class MyClass + │ │ ├── class MyClass + │ │ └── interface Default │ └─┬ types │ ├── class AbstractClass │ ├── class AbstractClassBase @@ -3089,6 +3136,7 @@ exports[`types 1`] = ` │ ├── class ConsumerCanRingBell │ ├── class ConsumersOfThisCrazyTypeSystem │ ├── class DataRenderer + │ ├── class Default │ ├── class DefaultedConstructorArgument │ ├── class Demonstrate982 │ ├── class DeprecatedClass @@ -3117,6 +3165,8 @@ exports[`types 1`] = ` │ ├── class InterfaceCollections │ ├── class InterfacesMaker │ ├── class Isomorphism + │ ├── class Issue2638 + │ ├── class Issue2638B │ ├── class JSII417Derived │ ├── class JSII417PublicBaseOfBase │ ├── class JSObjectLiteralForInterface @@ -3169,6 +3219,7 @@ exports[`types 1`] = ` │ ├── class SupportsNiceJavaBuilder │ ├── class SupportsNiceJavaBuilderWithRequiredProps │ ├── class SyncVirtualMethods + │ ├── class TestStructWithEnum │ ├── class Thrower │ ├── class UmaskCheck │ ├── class UnaryOperation @@ -3249,6 +3300,7 @@ exports[`types 1`] = ` │ ├── interface StructA │ ├── interface StructB │ ├── interface StructParameterType + │ ├── interface StructWithEnum │ ├── interface StructWithJavaReservedWords │ ├── interface SupportsNiceJavaBuilderProps │ ├── interface TopLevelStruct diff --git a/packages/jsii-reflect/test/__snapshots__/type-system.test.ts.snap b/packages/jsii-reflect/test/__snapshots__/type-system.test.ts.snap index 0c57a972f7..f7ceb755ab 100644 --- a/packages/jsii-reflect/test/__snapshots__/type-system.test.ts.snap +++ b/packages/jsii-reflect/test/__snapshots__/type-system.test.ts.snap @@ -51,6 +51,7 @@ Array [ "jsii-calc.ConsumerCanRingBell", "jsii-calc.ConsumersOfThisCrazyTypeSystem", "jsii-calc.DataRenderer", + "jsii-calc.Default", "jsii-calc.DefaultedConstructorArgument", "jsii-calc.Demonstrate982", "jsii-calc.DeprecatedClass", @@ -82,6 +83,8 @@ Array [ "jsii-calc.InterfaceInNamespaceIncludesClasses.Foo", "jsii-calc.InterfacesMaker", "jsii-calc.Isomorphism", + "jsii-calc.Issue2638", + "jsii-calc.Issue2638B", "jsii-calc.JSII417Derived", "jsii-calc.JSII417PublicBaseOfBase", "jsii-calc.JSObjectLiteralForInterface", @@ -136,6 +139,7 @@ Array [ "jsii-calc.SupportsNiceJavaBuilder", "jsii-calc.SupportsNiceJavaBuilderWithRequiredProps", "jsii-calc.SyncVirtualMethods", + "jsii-calc.TestStructWithEnum", "jsii-calc.Thrower", "jsii-calc.UmaskCheck", "jsii-calc.UnaryOperation",