From 39923a5885f33e99cc8c9181b8f36f20b6208551 Mon Sep 17 00:00:00 2001 From: Romain Marcadier Date: Thu, 18 Aug 2022 12:13:18 +0200 Subject: [PATCH] feat(pacmak): allow opt-out of runtime type checking generation (#3710) Adds a new CLI flag `--no-runtime-type-checking` to allow library authors to opt out of generating runtime type checking code if they are not interested in those. --- By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license]. [Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0 --- packages/jsii-pacmak/bin/jsii-pacmak.ts | 10 + packages/jsii-pacmak/lib/builder.ts | 27 +- packages/jsii-pacmak/lib/generator.ts | 12 +- packages/jsii-pacmak/lib/index.ts | 20 +- packages/jsii-pacmak/lib/target.ts | 11 +- packages/jsii-pacmak/lib/targets/dotnet.ts | 9 +- .../lib/targets/dotnet/dotnetgenerator.ts | 20 +- packages/jsii-pacmak/lib/targets/java.ts | 19 +- packages/jsii-pacmak/lib/targets/js.ts | 5 + packages/jsii-pacmak/lib/targets/python.ts | 16 +- packages/jsii-pacmak/package.json | 2 + .../__snapshots__/target-dotnet.test.js.snap | 459 ++ .../__snapshots__/target-go.test.js.snap | 20 + .../__snapshots__/target-java.test.js.snap | 20 + .../__snapshots__/target-python.test.js.snap | 3920 +++++++++++++++++ .../test/generated-code/harness.ts | 142 +- packages/jsii-pacmak/test/targets/go.test.ts | 1 + yarn.lock | 5 + 18 files changed, 4664 insertions(+), 54 deletions(-) diff --git a/packages/jsii-pacmak/bin/jsii-pacmak.ts b/packages/jsii-pacmak/bin/jsii-pacmak.ts index 5b4eea34c0..b5c402ea44 100644 --- a/packages/jsii-pacmak/bin/jsii-pacmak.ts +++ b/packages/jsii-pacmak/bin/jsii-pacmak.ts @@ -44,6 +44,15 @@ import { VERSION_DESC } from '../lib/version'; desc: 'generate code only (instead of building and packaging)', default: false, }) + .option('runtime-type-checking', { + type: 'boolean', + desc: [ + 'generate runtime type checking code where compile-time type checking is not possible.', + 'Disabling this will generate less code, but will produce less helpful error messages when', + 'developers pass invalid values to the generated bindings.', + ].join(' '), + default: true, + }) .option('fingerprint', { type: 'boolean', desc: 'attach a fingerprint to the generated artifacts, and skip generation if outdir contains artifacts that have a matching fingerprint', @@ -171,6 +180,7 @@ import { VERSION_DESC } from '../lib/version'; recurse: argv.recurse, rosettaUnknownSnippets, rosettaTablet: argv['rosetta-tablet'], + runtimeTypeChecking: argv['runtime-type-checking'], targets: argv.targets?.map((target) => target as TargetName), updateNpmIgnoreFiles: argv.npmignore, validateAssemblies: argv['validate-assemblies'], diff --git a/packages/jsii-pacmak/lib/builder.ts b/packages/jsii-pacmak/lib/builder.ts index d6cd623eba..3544bf3573 100644 --- a/packages/jsii-pacmak/lib/builder.ts +++ b/packages/jsii-pacmak/lib/builder.ts @@ -13,38 +13,44 @@ export interface BuildOptions { * Whether to fingerprint the produced artifacts. * @default true */ - fingerprint?: boolean; + readonly fingerprint?: boolean; /** * Whether artifacts should be re-build even if their fingerprints look up-to-date. * @default false */ - force?: boolean; + readonly force?: boolean; /** * Arguments provided by the user (how they are used is target-dependent) */ - arguments: { readonly [name: string]: any }; + readonly arguments: { readonly [name: string]: any }; /** * Only generate code, don't build */ - codeOnly?: boolean; + readonly codeOnly?: boolean; /** * Whether or not to clean */ - clean?: boolean; + readonly clean?: boolean; /** * Whether to add an additional subdirectory for the target language */ - languageSubdirectory?: boolean; + readonly languageSubdirectory?: boolean; /** * The Rosetta instance to load examples from */ - rosetta: Rosetta; + readonly rosetta: Rosetta; + + /** + * Whether to generate runtime type checking code in places where compile-time + * type checking is not possible. + */ + readonly runtimeTypeChecking: boolean; } /** @@ -130,13 +136,14 @@ export class IndependentPackageBuilder implements TargetBuilder { private makeTarget(module: JsiiModule, options: BuildOptions): Target { return new this.targetConstructor({ - targetName: this.targetName, - packageDir: module.moduleDirectory, + arguments: options.arguments, assembly: module.assembly, fingerprint: options.fingerprint, force: options.force, - arguments: options.arguments, + packageDir: module.moduleDirectory, rosetta: options.rosetta, + runtimeTypeChecking: options.runtimeTypeChecking, + targetName: this.targetName, }); } diff --git a/packages/jsii-pacmak/lib/generator.ts b/packages/jsii-pacmak/lib/generator.ts index 0e7be32f55..954abe1af2 100644 --- a/packages/jsii-pacmak/lib/generator.ts +++ b/packages/jsii-pacmak/lib/generator.ts @@ -29,6 +29,12 @@ export interface GeneratorOptions { * If this property is set, the generator will add "Base" to abstract class names */ addBasePostfixToAbstractClassNames?: boolean; + + /** + * If this property is set, the generator will add runtime type checking code in places + * where compile-time type checking is not possible. + */ + runtimeTypeChecking: boolean; } export interface IGenerator { @@ -88,7 +94,11 @@ export abstract class Generator implements IGenerator { protected _reflectAssembly?: reflect.Assembly; private fingerprint?: string; - public constructor(private readonly options: GeneratorOptions = {}) {} + public constructor(private readonly options: GeneratorOptions) {} + + protected get runtimeTypeChecking() { + return this.options.runtimeTypeChecking; + } protected get assembly(): spec.Assembly { if (!this._assembly) { diff --git a/packages/jsii-pacmak/lib/index.ts b/packages/jsii-pacmak/lib/index.ts index b4b34d571b..035e4d83b5 100644 --- a/packages/jsii-pacmak/lib/index.ts +++ b/packages/jsii-pacmak/lib/index.ts @@ -32,9 +32,10 @@ export async function pacmak({ parallel = true, recurse = false, rosettaTablet, + rosettaUnknownSnippets = undefined, + runtimeTypeChecking = true, targets = Object.values(TargetName), timers = new Timers(), - rosettaUnknownSnippets = undefined, updateNpmIgnoreFiles = false, validateAssemblies = false, }: PacmakOptions): Promise { @@ -126,6 +127,7 @@ export async function pacmak({ force, perLanguageDirectory, rosetta, + runtimeTypeChecking, }, ), ) @@ -251,6 +253,13 @@ export interface PacmakOptions { */ readonly rosettaTablet?: string; + /** + * Whether to inject runtime type checks in places where compile-time type checking is not performed. + * + * @default true + */ + readonly runtimeTypeChecking?: boolean; + /** * The list of targets for which code should be generated. Unless `forceTarget` is `true`, a given target will only * be generated for assemblies that have configured it. @@ -295,6 +304,7 @@ async function buildTargetsForLanguage( force, perLanguageDirectory, rosetta, + runtimeTypeChecking, }: { argv: { readonly [name: string]: any }; clean: boolean; @@ -303,6 +313,7 @@ async function buildTargetsForLanguage( force: boolean; perLanguageDirectory: boolean; rosetta: Rosetta; + runtimeTypeChecking: boolean; }, ): Promise { // ``argv.target`` is guaranteed valid by ``yargs`` through the ``choices`` directive. @@ -312,13 +323,14 @@ async function buildTargetsForLanguage( } return factory(modules, { + arguments: argv, clean: clean, codeOnly: codeOnly, - rosetta, - force: force, fingerprint: fingerprint, - arguments: argv, + force: force, languageSubdirectory: perLanguageDirectory, + rosetta, + runtimeTypeChecking, }).buildModules(); } diff --git a/packages/jsii-pacmak/lib/target.ts b/packages/jsii-pacmak/lib/target.ts index a4006af8c3..4949f29690 100644 --- a/packages/jsii-pacmak/lib/target.ts +++ b/packages/jsii-pacmak/lib/target.ts @@ -17,16 +17,18 @@ export abstract class Target { protected readonly targetName: string; protected readonly assembly: reflect.Assembly; protected readonly rosetta: Rosetta; + protected readonly runtimeTypeChecking: boolean; protected abstract readonly generator: IGenerator; public constructor(options: TargetOptions) { - this.packageDir = options.packageDir; + this.arguments = options.arguments; this.assembly = options.assembly; - this.rosetta = options.rosetta; this.fingerprint = options.fingerprint ?? true; this.force = options.force ?? false; - this.arguments = options.arguments; + this.packageDir = options.packageDir; + this.rosetta = options.rosetta; + this.runtimeTypeChecking = options.runtimeTypeChecking; this.targetName = options.targetName; } @@ -211,6 +213,9 @@ export interface TargetOptions { /** The Rosetta instance */ rosetta: Rosetta; + /** Whether to generate runtime type-checking code */ + runtimeTypeChecking: boolean; + /** * Whether to fingerprint the produced artifacts. * @default true diff --git a/packages/jsii-pacmak/lib/targets/dotnet.ts b/packages/jsii-pacmak/lib/targets/dotnet.ts index 6bf03fc524..70727b8c9b 100644 --- a/packages/jsii-pacmak/lib/targets/dotnet.ts +++ b/packages/jsii-pacmak/lib/targets/dotnet.ts @@ -240,13 +240,14 @@ export class DotnetBuilder implements TargetBuilder { private makeTarget(module: JsiiModule): Dotnet { return new Dotnet( { - targetName: this.targetName, - packageDir: module.moduleDirectory, + arguments: this.options.arguments, assembly: module.assembly, fingerprint: this.options.fingerprint, force: this.options.force, - arguments: this.options.arguments, + packageDir: module.moduleDirectory, rosetta: this.options.rosetta, + runtimeTypeChecking: this.options.runtimeTypeChecking, + targetName: this.targetName, }, this.modules.map((m) => m.name), ); @@ -316,7 +317,7 @@ export default class Dotnet extends Target { this.generator = new DotNetGenerator( assembliesCurrentlyBeingCompiled, - options.rosetta, + options, ); } diff --git a/packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts b/packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts index 4e69f54564..f2bffea976 100644 --- a/packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts +++ b/packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts @@ -21,28 +21,35 @@ import { DotNetNameUtils } from './nameutils'; * CODE GENERATOR V2 */ export class DotNetGenerator extends Generator { + private readonly nameutils: DotNetNameUtils = new DotNetNameUtils(); + + private readonly rosetta: Rosetta; + // Flags that tracks if we have already wrote the first member of the class private firstMemberWritten = false; private typeresolver!: DotNetTypeResolver; - private readonly nameutils: DotNetNameUtils = new DotNetNameUtils(); - private dotnetRuntimeGenerator!: DotNetRuntimeGenerator; private dotnetDocGenerator!: DotNetDocGenerator; public constructor( private readonly assembliesCurrentlyBeingCompiled: string[], - private readonly rosetta: Rosetta, + options: { + readonly rosetta: Rosetta; + readonly runtimeTypeChecking: boolean; + }, ) { - super(); + super(options); // Override the openBlock to get a correct C# looking code block with the curly brace after the line this.code.openBlock = function (text) { this.line(text); this.open('{'); }; + + this.rosetta = options.rosetta; } public async load( @@ -646,6 +653,11 @@ export class DotNetGenerator extends Generator { parameters?: readonly spec.Parameter[], { noMangle = false }: { noMangle?: boolean } = {}, ): void { + if (!this.runtimeTypeChecking) { + // We were configured not to emit those, so bail out now. + return; + } + const unionParameters = parameters?.filter(({ type }) => containsUnionType(type), ); diff --git a/packages/jsii-pacmak/lib/targets/java.ts b/packages/jsii-pacmak/lib/targets/java.ts index daea91e5f6..39c003a63e 100644 --- a/packages/jsii-pacmak/lib/targets/java.ts +++ b/packages/jsii-pacmak/lib/targets/java.ts @@ -328,13 +328,14 @@ export class JavaBuilder implements TargetBuilder { private makeTarget(module: JsiiModule, options: BuildOptions): Target { return new Java({ - targetName: this.targetName, - packageDir: module.moduleDirectory, + arguments: options.arguments, assembly: module.assembly, fingerprint: options.fingerprint, force: options.force, - arguments: options.arguments, + packageDir: module.moduleDirectory, rosetta: options.rosetta, + runtimeTypeChecking: options.runtimeTypeChecking, + targetName: this.targetName, }); } } @@ -421,7 +422,7 @@ export default class Java extends Target { public constructor(options: TargetOptions) { super(options); - this.generator = new JavaGenerator(options.rosetta); + this.generator = new JavaGenerator(options); } public async build(sourceDir: string, outDir: string): Promise { @@ -619,8 +620,14 @@ class JavaGenerator extends Generator { [name: string]: spec.AssemblyConfiguration; } = {}; - public constructor(private readonly rosetta: Rosetta) { - super({ generateOverloadsForMethodWithOptionals: true }); + private readonly rosetta: Rosetta; + + public constructor(options: { + readonly rosetta: Rosetta; + readonly runtimeTypeChecking: boolean; + }) { + super({ ...options, generateOverloadsForMethodWithOptionals: true }); + this.rosetta = options.rosetta; } protected onBeginAssembly(assm: spec.Assembly, fingerprint: boolean) { diff --git a/packages/jsii-pacmak/lib/targets/js.ts b/packages/jsii-pacmak/lib/targets/js.ts index 26ec7a8670..594fea0557 100644 --- a/packages/jsii-pacmak/lib/targets/js.ts +++ b/packages/jsii-pacmak/lib/targets/js.ts @@ -62,6 +62,11 @@ export default class JavaScript extends Target { // ################## class PackOnly extends Generator { + public constructor() { + // NB: This does not generate code, so runtime type checking is irrelevant + super({ runtimeTypeChecking: false }); + } + public async save(outdir: string, tarball: string, _: Legalese) { // Intentionally ignore the Legalese field here... it's not useful here. return super.save(outdir, tarball, {}); diff --git a/packages/jsii-pacmak/lib/targets/python.ts b/packages/jsii-pacmak/lib/targets/python.ts index 3fc811f6c2..63493f0eba 100644 --- a/packages/jsii-pacmak/lib/targets/python.ts +++ b/packages/jsii-pacmak/lib/targets/python.ts @@ -50,7 +50,7 @@ export default class Python extends Target { public constructor(options: TargetOptions) { super(options); - this.generator = new PythonGenerator(options.rosetta); + this.generator = new PythonGenerator(options.rosetta, options); } public async generateCode(outDir: string, tarball: string): Promise { @@ -120,6 +120,9 @@ export default class Python extends Target { interface EmitContext extends NamingContext { /** @deprecated The TypeResolver */ readonly resolver: TypeResolver; + + /** Whether to emit runtime type checking code */ + readonly runtimeTypeChecking: boolean; } const pythonModuleNameToFilename = (name: string): string => { @@ -662,6 +665,7 @@ abstract class BaseMethod implements PythonBase { ) { emitParameterTypeChecks( code, + context, pythonParams.slice(1), `${toPythonFullName(this.parent.fqn, context.assembly)}.${ this.pythonName @@ -942,6 +946,7 @@ abstract class BaseProperty implements PythonBase { ) { emitParameterTypeChecks( code, + context, [`value: ${pythonType}`], // In order to get a property accessor, we must resort to getting the // attribute on the type, instead of the value (where the getter would @@ -1138,6 +1143,7 @@ class Struct extends BasePythonClassType { } emitParameterTypeChecks( code, + context, kwargs, `${toPythonFullName(this.spec.fqn, context.assembly)}.__init__`, ); @@ -2319,7 +2325,7 @@ class PythonGenerator extends Generator { public constructor( private readonly rosetta: Rosetta, - options: GeneratorOptions = {}, + options: GeneratorOptions, ) { super(options); @@ -2534,6 +2540,7 @@ class PythonGenerator extends Generator { assembly: assm, emittedTypes: new Set(), resolver, + runtimeTypeChecking: this.runtimeTypeChecking, submodule: assm.name, typeResolver: (fqn) => resolver.dereference(fqn), }); @@ -3051,9 +3058,14 @@ function openSignature( */ function emitParameterTypeChecks( code: CodeMaker, + context: EmitContext, params: readonly string[], typedEntity: string, ): void { + if (!context.runtimeTypeChecking) { + return; + } + const paramInfo = params.map((param) => { const [name] = param.split(/\s*[:=#]\s*/, 1); if (name === '*') { diff --git a/packages/jsii-pacmak/package.json b/packages/jsii-pacmak/package.json index 838e7e7d46..69084253ac 100644 --- a/packages/jsii-pacmak/package.json +++ b/packages/jsii-pacmak/package.json @@ -57,9 +57,11 @@ "@jsii/go-runtime": "^0.0.0", "@scope/jsii-calc-lib": "^0.0.0", "@types/clone": "^2.1.1", + "@types/diff": "^5.0.2", "@types/commonmark": "^0.27.5", "@types/fs-extra": "^9.0.13", "@types/semver": "^7.3.10", + "diff": "^5.1.0", "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-calc": "^3.20.120", diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-dotnet.test.js.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-dotnet.test.js.snap index fe6fd9b345..99fb2fcba7 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-dotnet.test.js.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-dotnet.test.js.snap @@ -518,6 +518,11 @@ exports[`Generated code for "@scope/jsii-calc-base": /dotnet/Amazon.JSII exports[`Generated code for "@scope/jsii-calc-base": /dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/scope-jsii-calc-base-0.0.0.tgz 1`] = `dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/scope-jsii-calc-base-0.0.0.tgz is a tarball`; +exports[`Generated code for "@scope/jsii-calc-base": / 1`] = ` + +┗━ 🕳 There is nothing here +`; + exports[`Generated code for "@scope/jsii-calc-base-of-base": / 1`] = ` ┗━ 📁 dotnet @@ -991,6 +996,11 @@ Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. exports[`Generated code for "@scope/jsii-calc-base-of-base": /dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/scope-jsii-calc-base-of-base-2.1.1.tgz 1`] = `dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/scope-jsii-calc-base-of-base-2.1.1.tgz is a tarball`; +exports[`Generated code for "@scope/jsii-calc-base-of-base": / 1`] = ` + +┗━ 🕳 There is nothing here +`; + exports[`Generated code for "@scope/jsii-calc-lib": / 1`] = ` ┗━ 📁 dotnet @@ -2786,6 +2796,11 @@ Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. exports[`Generated code for "@scope/jsii-calc-lib": /dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/scope-jsii-calc-lib-0.0.0.tgz 1`] = `dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/scope-jsii-calc-lib-0.0.0.tgz is a tarball`; +exports[`Generated code for "@scope/jsii-calc-lib": / 1`] = ` + +┗━ 🕳 There is nothing here +`; + exports[`Generated code for "jsii-calc": / 1`] = ` ┗━ 📁 dotnet @@ -20665,3 +20680,447 @@ Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/jsii-calc-3.20.120.tgz 1`] = `dotnet/Amazon.JSII.Tests.CalculatorPackageId/jsii-calc-3.20.120.tgz is a tarball`; exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/resources/AWSLogo128x128.png 1`] = `dotnet/Amazon.JSII.Tests.CalculatorPackageId/resources/AWSLogo128x128.png is a binary file`; + +exports[`Generated code for "jsii-calc": / 1`] = ` + + ┗━ 📁 dotnet + ┗━ 📁 Amazon.JSII.Tests.CalculatorPackageId + ┗━ 📁 Amazon + ┗━ 📁 JSII + ┗━ 📁 Tests + ┗━ 📁 CalculatorNamespace + ┣━ 📄 AllTypes.cs.diff + ┣━ 📁 Anonymous + ┃ ┗━ 📄 UseOptions.cs.diff + ┣━ 📄 Calculator.cs.diff + ┣━ 📄 ClassWithCollectionOfUnions.cs.diff + ┣━ 📄 ConfusingToJackson.cs.diff + ┣━ 📄 ConfusingToJacksonStruct.cs.diff + ┣━ 📄 StructUnionConsumer.cs.diff + ┣━ 📄 StructWithCollectionOfUnionts.cs.diff + ┣━ 📄 TopLevelStruct.cs.diff + ┗━ 📄 UnionProperties.cs.diff +`; + +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypes.cs.diff 1`] = ` +--- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypes.cs --runtime-type-checking ++++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypes.cs --no-runtime-type-checking +@@ -141,72 +141,30 @@ + public virtual object[] UnionArrayProperty + { + get => GetInstanceProperty()!; + set + { +- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) +- { +- for (int __idx_cd4240 = 0 ; __idx_cd4240 < value.Length ; __idx_cd4240++) +- { +- if ( +- !(value[__idx_cd4240] is byte || value[__idx_cd4240] is decimal || value[__idx_cd4240] is double || value[__idx_cd4240] is float || value[__idx_cd4240] is int || value[__idx_cd4240] is long || value[__idx_cd4240] is sbyte || value[__idx_cd4240] is short || value[__idx_cd4240] is uint || value[__idx_cd4240] is ulong || value[__idx_cd4240] is ushort) +- && !(value[__idx_cd4240] is Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.NumericValue) +- ) +- +- { +- throw new System.ArgumentException($"Expected value[{__idx_cd4240}] to be one of: double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.NumericValue).FullName}; received {value[__idx_cd4240].GetType().FullName}", $"value"); +- } +- } +- } + SetInstanceProperty(value); + } + } + + [JsiiProperty(name: "unionMapProperty", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"union\\":{\\"types\\":[{\\"primitive\\":\\"string\\"},{\\"primitive\\":\\"number\\"},{\\"fqn\\":\\"@scope/jsii-calc-lib.Number\\"}]}},\\"kind\\":\\"map\\"}}")] + public virtual System.Collections.Generic.IDictionary UnionMapProperty + { + get => GetInstanceProperty>()!; + set + { +- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) +- { +- foreach (var __item_cd4240 in value) +- { +- if ( +- !(__item_cd4240.Value is string) +- && !(__item_cd4240.Value is byte || __item_cd4240.Value is decimal || __item_cd4240.Value is double || __item_cd4240.Value is float || __item_cd4240.Value is int || __item_cd4240.Value is long || __item_cd4240.Value is sbyte || __item_cd4240.Value is short || __item_cd4240.Value is uint || __item_cd4240.Value is ulong || __item_cd4240.Value is ushort) +- && !(__item_cd4240.Value is Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Number) +- ) +- +- { +- throw new System.ArgumentException($"Expected value[\\"{__item_cd4240.Key}\\"] to be one of: string, double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Number).FullName}; received {__item_cd4240.Value.GetType().FullName}", $"value"); +- } +- } +- } + SetInstanceProperty(value); + } + } + + [JsiiProperty(name: "unionProperty", typeJson: "{\\"union\\":{\\"types\\":[{\\"primitive\\":\\"string\\"},{\\"primitive\\":\\"number\\"},{\\"fqn\\":\\"@scope/jsii-calc-lib.Number\\"},{\\"fqn\\":\\"jsii-calc.Multiply\\"}]}}")] + public virtual object UnionProperty + { + get => GetInstanceProperty()!; + set + { +- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) +- { +- if ( +- !(value is string) +- && !(value is byte || value is decimal || value is double || value is float || value is int || value is long || value is sbyte || value is short || value is uint || value is ulong || value is ushort) +- && !(value is Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Number) +- && !(value is Amazon.JSII.Tests.CalculatorNamespace.Multiply) +- ) +- +- { +- throw new System.ArgumentException($"Expected value to be one of: string, double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Number).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.Multiply).FullName}; received {value.GetType().FullName}", $"value"); +- } +- } + SetInstanceProperty(value); + } + } + + [JsiiProperty(name: "unknownArrayProperty", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"primitive\\":\\"any\\"},\\"kind\\":\\"array\\"}}")] +`; + +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Anonymous/UseOptions.cs.diff 1`] = ` +--- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Anonymous/UseOptions.cs --runtime-type-checking ++++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Anonymous/UseOptions.cs --no-runtime-type-checking +@@ -22,22 +22,10 @@ + } + + [JsiiMethod(name: "consume", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", parametersJson: "[{\\"name\\":\\"option\\",\\"type\\":{\\"union\\":{\\"types\\":[{\\"fqn\\":\\"jsii-calc.anonymous.IOptionA\\"},{\\"fqn\\":\\"jsii-calc.anonymous.IOptionB\\"}]}}}]")] + public static string Consume(object option) + { +- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) +- { +- if ( +- !(option is Amazon.JSII.Tests.CalculatorNamespace.Anonymous.IOptionA) +- && !(option is Amazon.JSII.Tests.CalculatorNamespace.Anonymous.IOptionB) +- && !(option is Amazon.JSII.Runtime.Deputy.AnonymousObject) +- ) +- +- { +- throw new System.ArgumentException($"Expected argument {nameof(option)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.Anonymous.IOptionA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.Anonymous.IOptionB).FullName}; received {option.GetType().FullName}", $"{nameof(option)}"); +- } +- } + return InvokeStaticMethod(typeof(Amazon.JSII.Tests.CalculatorNamespace.Anonymous.UseOptions), new System.Type[]{typeof(object)}, new object[]{option})!; + } + + [JsiiMethod(name: "privideAsAny", returnsJson: "{\\"type\\":{\\"primitive\\":\\"any\\"}}", parametersJson: "[{\\"name\\":\\"which\\",\\"type\\":{\\"primitive\\":\\"string\\"}}]")] + public static object PrivideAsAny(string which) +`; + +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Calculator.cs.diff 1`] = ` +--- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Calculator.cs --runtime-type-checking ++++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Calculator.cs --no-runtime-type-checking +@@ -131,25 +131,10 @@ + public virtual object? UnionProperty + { + get => GetInstanceProperty(); + set + { +- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) +- { +- if (value != null) +- { +- if ( +- !(value is Amazon.JSII.Tests.CalculatorNamespace.Add) +- && !(value is Amazon.JSII.Tests.CalculatorNamespace.Multiply) +- && !(value is Amazon.JSII.Tests.CalculatorNamespace.Power) +- ) +- +- { +- throw new System.ArgumentException($"Expected value to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.Add).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.Multiply).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.Power).FullName}; received {value.GetType().FullName}", $"value"); +- } +- } +- } + SetInstanceProperty(value); + } + } + } + } +`; + +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithCollectionOfUnions.cs.diff 1`] = ` +--- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithCollectionOfUnions.cs --runtime-type-checking ++++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithCollectionOfUnions.cs --no-runtime-type-checking +@@ -12,28 +12,10 @@ + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static DeputyProps _MakeDeputyProps(System.Collections.Generic.IDictionary[] unionProperty) + { +- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) +- { +- for (int __idx_452e2d = 0 ; __idx_452e2d < unionProperty.Length ; __idx_452e2d++) +- { +- foreach (var __item_f994c5 in unionProperty[__idx_452e2d]) +- { +- if ( +- !(__item_f994c5.Value is Amazon.JSII.Tests.CalculatorNamespace.IStructA) +- && !(__item_f994c5.Value is Amazon.JSII.Tests.CalculatorNamespace.IStructB) +- && !(__item_f994c5.Value is Amazon.JSII.Runtime.Deputy.AnonymousObject) +- ) +- +- { +- throw new System.ArgumentException($"Expected argument {nameof(unionProperty)}[{__idx_452e2d}][\\"{__item_f994c5.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {__item_f994c5.Value.GetType().FullName}", $"{nameof(unionProperty)}"); +- } +- } +- } +- } + return new DeputyProps(new object?[]{unionProperty}); + } + + /// Used by jsii to construct an instance of this class from a Javascript-owned object reference + /// The Javascript-owned object reference +@@ -53,28 +35,10 @@ + public virtual System.Collections.Generic.IDictionary[] UnionProperty + { + get => GetInstanceProperty[]>()!; + set + { +- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) +- { +- for (int __idx_cd4240 = 0 ; __idx_cd4240 < value.Length ; __idx_cd4240++) +- { +- foreach (var __item_db0d7d in value[__idx_cd4240]) +- { +- if ( +- !(__item_db0d7d.Value is Amazon.JSII.Tests.CalculatorNamespace.IStructA) +- && !(__item_db0d7d.Value is Amazon.JSII.Tests.CalculatorNamespace.IStructB) +- && !(__item_db0d7d.Value is Amazon.JSII.Runtime.Deputy.AnonymousObject) +- ) +- +- { +- throw new System.ArgumentException($"Expected value[{__idx_cd4240}][\\"{__item_db0d7d.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {__item_db0d7d.Value.GetType().FullName}", $"value"); +- } +- } +- } +- } + SetInstanceProperty(value); + } + } + } + } +`; + +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ConfusingToJackson.cs.diff 1`] = ` +--- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ConfusingToJackson.cs --runtime-type-checking ++++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ConfusingToJackson.cs --no-runtime-type-checking +@@ -42,25 +42,10 @@ + public virtual object? UnionProperty + { + get => GetInstanceProperty(); + set + { +- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) +- { +- if (value != null) +- { +- if ( +- !(value is Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly) +- && !(value is object[]) +- && !(value is Amazon.JSII.Runtime.Deputy.AnonymousObject) +- ) +- +- { +- throw new System.ArgumentException($"Expected value to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly).FullName}, {$"{"object"}[]"}; received {value.GetType().FullName}", $"value"); +- } +- } +- } + SetInstanceProperty(value); + } + } + } + } +`; + +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ConfusingToJacksonStruct.cs.diff 1`] = ` +--- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ConfusingToJacksonStruct.cs --runtime-type-checking ++++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ConfusingToJacksonStruct.cs --no-runtime-type-checking +@@ -14,25 +14,10 @@ + public object? UnionProperty + { + get => _unionProperty; + set + { +- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) +- { +- if (value != null) +- { +- if ( +- !(value is Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly) +- && !(value is object[]) +- && !(value is Amazon.JSII.Runtime.Deputy.AnonymousObject) +- ) +- +- { +- throw new System.ArgumentException($"Expected value to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.IFriendly).FullName}, {$"{"object"}[]"}; received {value.GetType().FullName}", $"value"); +- } +- } +- } + _unionProperty = value; + } + } + } + } +`; + +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructUnionConsumer.cs.diff 1`] = ` +--- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructUnionConsumer.cs --runtime-type-checking ++++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructUnionConsumer.cs --no-runtime-type-checking +@@ -22,40 +22,16 @@ + } + + [JsiiMethod(name: "isStructA", returnsJson: "{\\"type\\":{\\"primitive\\":\\"boolean\\"}}", parametersJson: "[{\\"name\\":\\"struct\\",\\"type\\":{\\"union\\":{\\"types\\":[{\\"fqn\\":\\"jsii-calc.StructA\\"},{\\"fqn\\":\\"jsii-calc.StructB\\"}]}}}]")] + public static bool IsStructA(object @struct) + { +- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) +- { +- if ( +- !(@struct is Amazon.JSII.Tests.CalculatorNamespace.IStructA) +- && !(@struct is Amazon.JSII.Tests.CalculatorNamespace.IStructB) +- && !(@struct is Amazon.JSII.Runtime.Deputy.AnonymousObject) +- ) +- +- { +- throw new System.ArgumentException($"Expected argument {nameof(@struct)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {@struct.GetType().FullName}", $"{nameof(@struct)}"); +- } +- } + return InvokeStaticMethod(typeof(Amazon.JSII.Tests.CalculatorNamespace.StructUnionConsumer), new System.Type[]{typeof(object)}, new object[]{@struct})!; + } + + [JsiiMethod(name: "isStructB", returnsJson: "{\\"type\\":{\\"primitive\\":\\"boolean\\"}}", parametersJson: "[{\\"name\\":\\"struct\\",\\"type\\":{\\"union\\":{\\"types\\":[{\\"fqn\\":\\"jsii-calc.StructA\\"},{\\"fqn\\":\\"jsii-calc.StructB\\"}]}}}]")] + public static bool IsStructB(object @struct) + { +- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) +- { +- if ( +- !(@struct is Amazon.JSII.Tests.CalculatorNamespace.IStructA) +- && !(@struct is Amazon.JSII.Tests.CalculatorNamespace.IStructB) +- && !(@struct is Amazon.JSII.Runtime.Deputy.AnonymousObject) +- ) +- +- { +- throw new System.ArgumentException($"Expected argument {nameof(@struct)} to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {@struct.GetType().FullName}", $"{nameof(@struct)}"); +- } +- } + return InvokeStaticMethod(typeof(Amazon.JSII.Tests.CalculatorNamespace.StructUnionConsumer), new System.Type[]{typeof(object)}, new object[]{@struct})!; + } + + [JsiiMethod(name: "provideStruct", returnsJson: "{\\"type\\":{\\"union\\":{\\"types\\":[{\\"fqn\\":\\"jsii-calc.StructA\\"},{\\"fqn\\":\\"jsii-calc.StructB\\"}]}}}", parametersJson: "[{\\"name\\":\\"which\\",\\"type\\":{\\"primitive\\":\\"string\\"}}]")] + public static object ProvideStruct(string which) +`; + +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructWithCollectionOfUnionts.cs.diff 1`] = ` +--- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructWithCollectionOfUnionts.cs --runtime-type-checking ++++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StructWithCollectionOfUnionts.cs --no-runtime-type-checking +@@ -15,28 +15,10 @@ + public System.Collections.Generic.IDictionary[] UnionProperty + { + get => _unionProperty; + set + { +- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) +- { +- for (int __idx_cd4240 = 0 ; __idx_cd4240 < value.Length ; __idx_cd4240++) +- { +- foreach (var __item_db0d7d in value[__idx_cd4240]) +- { +- if ( +- !(__item_db0d7d.Value is Amazon.JSII.Tests.CalculatorNamespace.IStructA) +- && !(__item_db0d7d.Value is Amazon.JSII.Tests.CalculatorNamespace.IStructB) +- && !(__item_db0d7d.Value is Amazon.JSII.Runtime.Deputy.AnonymousObject) +- ) +- +- { +- throw new System.ArgumentException($"Expected value[{__idx_cd4240}][\\"{__item_db0d7d.Key}\\"] to be one of: {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructA).FullName}, {typeof(Amazon.JSII.Tests.CalculatorNamespace.IStructB).FullName}; received {__item_db0d7d.Value.GetType().FullName}", $"value"); +- } +- } +- } +- } + _unionProperty = value; + } + } + } + } +`; + +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/TopLevelStruct.cs.diff 1`] = ` +--- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/TopLevelStruct.cs --runtime-type-checking ++++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/TopLevelStruct.cs --no-runtime-type-checking +@@ -24,22 +24,10 @@ + public object SecondLevel + { + get => _secondLevel; + set + { +- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) +- { +- if ( +- !(value is byte || value is decimal || value is double || value is float || value is int || value is long || value is sbyte || value is short || value is uint || value is ulong || value is ushort) +- && !(value is Amazon.JSII.Tests.CalculatorNamespace.ISecondLevelStruct) +- && !(value is Amazon.JSII.Runtime.Deputy.AnonymousObject) +- ) +- +- { +- throw new System.ArgumentException($"Expected value to be one of: double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.ISecondLevelStruct).FullName}; received {value.GetType().FullName}", $"value"); +- } +- } + _secondLevel = value; + } + } + + /// You don't have to pass this. +`; + +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionProperties.cs.diff 1`] = ` +--- dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionProperties.cs --runtime-type-checking ++++ dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionProperties.cs --no-runtime-type-checking +@@ -15,22 +15,10 @@ + public object Bar + { + get => _bar; + set + { +- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) +- { +- if ( +- !(value is string) +- && !(value is byte || value is decimal || value is double || value is float || value is int || value is long || value is sbyte || value is short || value is uint || value is ulong || value is ushort) +- && !(value is Amazon.JSII.Tests.CalculatorNamespace.AllTypes) +- ) +- +- { +- throw new System.ArgumentException($"Expected value to be one of: string, double, {typeof(Amazon.JSII.Tests.CalculatorNamespace.AllTypes).FullName}; received {value.GetType().FullName}", $"value"); +- } +- } + _bar = value; + } + } + + private object? _foo; +@@ -40,24 +28,10 @@ + public object? Foo + { + get => _foo; + set + { +- if (Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking) +- { +- if (value != null) +- { +- if ( +- !(value is string) +- && !(value is byte || value is decimal || value is double || value is float || value is int || value is long || value is sbyte || value is short || value is uint || value is ulong || value is ushort) +- ) +- +- { +- throw new System.ArgumentException($"Expected value to be one of: string, double; received {value.GetType().FullName}", $"value"); +- } +- } +- } + _foo = value; + } + } + } + } +`; diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.js.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.js.snap index 3fc51b44a8..7257564953 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.js.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.js.snap @@ -492,6 +492,11 @@ exports[`Generated code for "@scope/jsii-calc-base": /go/jcb/version 1`] `; +exports[`Generated code for "@scope/jsii-calc-base": / 1`] = ` + +┗━ 🕳 There is nothing here +`; + exports[`Generated code for "@scope/jsii-calc-base-of-base": / 1`] = ` ┗━ 📁 go @@ -948,6 +953,11 @@ exports[`Generated code for "@scope/jsii-calc-base-of-base": /go/scopejs `; +exports[`Generated code for "@scope/jsii-calc-base-of-base": / 1`] = ` + +┗━ 🕳 There is nothing here +`; + exports[`Generated code for "@scope/jsii-calc-lib": / 1`] = ` ┗━ 📁 go @@ -2198,6 +2208,11 @@ exports[`Generated code for "@scope/jsii-calc-lib": /go/scopejsiicalclib `; +exports[`Generated code for "@scope/jsii-calc-lib": / 1`] = ` + +┗━ 🕳 There is nothing here +`; + exports[`Generated code for "jsii-calc": / 1`] = ` ┗━ 📁 go @@ -23765,3 +23780,8 @@ exports[`Generated code for "jsii-calc": /go/jsiicalc/version 1`] = ` 3.20.120 `; + +exports[`Generated code for "jsii-calc": / 1`] = ` + +┗━ 🕳 There is nothing here +`; diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-java.test.js.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-java.test.js.snap index adb218006c..f884cceeca 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-java.test.js.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-java.test.js.snap @@ -723,6 +723,11 @@ exports[`Generated code for "@scope/jsii-calc-base": /java/src/main/reso exports[`Generated code for "@scope/jsii-calc-base": /java/src/main/resources/software/amazon/jsii/tests/calculator/base/jsii-calc-base@0.0.0.jsii.tgz 1`] = `java/src/main/resources/software/amazon/jsii/tests/calculator/base/jsii-calc-base@0.0.0.jsii.tgz is a tarball`; +exports[`Generated code for "@scope/jsii-calc-base": / 1`] = ` + +┗━ 🕳 There is nothing here +`; + exports[`Generated code for "@scope/jsii-calc-base-of-base": / 1`] = ` ┗━ 📁 java @@ -1401,6 +1406,11 @@ exports[`Generated code for "@scope/jsii-calc-base-of-base": /java/src/m exports[`Generated code for "@scope/jsii-calc-base-of-base": /java/src/main/resources/software/amazon/jsii/tests/calculator/baseofbase/jsii-calc-base-of-base@2.1.1.jsii.tgz 1`] = `java/src/main/resources/software/amazon/jsii/tests/calculator/baseofbase/jsii-calc-base-of-base@2.1.1.jsii.tgz is a tarball`; +exports[`Generated code for "@scope/jsii-calc-base-of-base": / 1`] = ` + +┗━ 🕳 There is nothing here +`; + exports[`Generated code for "@scope/jsii-calc-lib": / 1`] = ` ┗━ 📁 java @@ -3564,6 +3574,11 @@ exports[`Generated code for "@scope/jsii-calc-lib": /java/src/main/resou exports[`Generated code for "@scope/jsii-calc-lib": /java/src/main/resources/software/amazon/jsii/tests/calculator/lib/jsii-calc-lib@0.0.0.jsii.tgz 1`] = `java/src/main/resources/software/amazon/jsii/tests/calculator/lib/jsii-calc-lib@0.0.0.jsii.tgz is a tarball`; +exports[`Generated code for "@scope/jsii-calc-lib": / 1`] = ` + +┗━ 🕳 There is nothing here +`; + exports[`Generated code for "jsii-calc": / 1`] = ` ┗━ 📁 java @@ -27767,3 +27782,8 @@ jsii-calc.submodule.returnsparam.ReturnsSpecialParameter=software.amazon.jsii.te `; exports[`Generated code for "jsii-calc": /java/src/main/resources/software/amazon/jsii/tests/calculator/jsii-calc@3.20.120.jsii.tgz 1`] = `java/src/main/resources/software/amazon/jsii/tests/calculator/jsii-calc@3.20.120.jsii.tgz is a tarball`; + +exports[`Generated code for "jsii-calc": / 1`] = ` + +┗━ 🕳 There is nothing here +`; diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.js.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.js.snap index d2b5f99700..bcebf4e2ac 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.js.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.js.snap @@ -498,6 +498,49 @@ exports[`Generated code for "@scope/jsii-calc-base": /python/src/scope/j `; +exports[`Generated code for "@scope/jsii-calc-base": / 1`] = ` + + ┗━ 📁 python + ┗━ 📁 src + ┗━ 📁 scope + ┗━ 📁 jsii_calc_base + ┗━ 📄 __init__.py.diff +`; + +exports[`Generated code for "@scope/jsii-calc-base": /python/src/scope/jsii_calc_base/__init__.py.diff 1`] = ` +--- python/src/scope/jsii_calc_base/__init__.py --runtime-type-checking ++++ python/src/scope/jsii_calc_base/__init__.py --no-runtime-type-checking +@@ -50,14 +50,10 @@ + ) -> None: + ''' + :param foo: - + :param bar: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(BaseProps.__init__) +- check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) +- check_type(argname="argument bar", value=bar, expected_type=type_hints["bar"]) + self._values: typing.Dict[str, typing.Any] = { + "foo": foo, + "bar": bar, + } + +@@ -121,13 +117,10 @@ + @builtins.classmethod + def consume(cls, *args: typing.Any) -> None: + ''' + :param args: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(StaticConsumer.consume) +- check_type(argname="argument args", value=args, expected_type=typing.Tuple[type_hints["args"], ...]) # pyright: ignore [reportGeneralTypeIssues] + return typing.cast(None, jsii.sinvoke(cls, "consume", [*args])) + + + __all__ = [ + "Base", +`; + exports[`Generated code for "@scope/jsii-calc-base-of-base": / 1`] = ` ┗━ 📁 python @@ -966,6 +1009,48 @@ exports[`Generated code for "@scope/jsii-calc-base-of-base": /python/src `; +exports[`Generated code for "@scope/jsii-calc-base-of-base": / 1`] = ` + + ┗━ 📁 python + ┗━ 📁 src + ┗━ 📁 scope + ┗━ 📁 jsii_calc_base_of_base + ┗━ 📄 __init__.py.diff +`; + +exports[`Generated code for "@scope/jsii-calc-base-of-base": /python/src/scope/jsii_calc_base_of_base/__init__.py.diff 1`] = ` +--- python/src/scope/jsii_calc_base_of_base/__init__.py --runtime-type-checking ++++ python/src/scope/jsii_calc_base_of_base/__init__.py --no-runtime-type-checking +@@ -39,13 +39,10 @@ + @builtins.classmethod + def consume(cls, *_args: typing.Any) -> None: + ''' + :param _args: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(StaticConsumer.consume) +- check_type(argname="argument _args", value=_args, expected_type=typing.Tuple[type_hints["_args"], ...]) # pyright: ignore [reportGeneralTypeIssues] + return typing.cast(None, jsii.sinvoke(cls, "consume", [*_args])) + + + class Very(metaclass=jsii.JSIIMeta, jsii_type="@scope/jsii-calc-base-of-base.Very"): + '''(experimental) Something here. +@@ -72,13 +69,10 @@ + class VeryBaseProps: + def __init__(self, *, foo: Very) -> None: + ''' + :param foo: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(VeryBaseProps.__init__) +- check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) + self._values: typing.Dict[str, typing.Any] = { + "foo": foo, + } + + @builtins.property +`; + exports[`Generated code for "@scope/jsii-calc-lib": / 1`] = ` ┗━ 📁 python @@ -2166,6 +2251,172 @@ exports[`Generated code for "@scope/jsii-calc-lib": /python/src/scope/js `; +exports[`Generated code for "@scope/jsii-calc-lib": / 1`] = ` + + ┗━ 📁 python + ┗━ 📁 src + ┗━ 📁 scope + ┗━ 📁 jsii_calc_lib + ┣━ 📄 __init__.py.diff + ┗━ 📁 custom_submodule_name + ┗━ 📄 __init__.py.diff +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /python/src/scope/jsii_calc_lib/__init__.py.diff 1`] = ` +--- python/src/scope/jsii_calc_lib/__init__.py --runtime-type-checking ++++ python/src/scope/jsii_calc_lib/__init__.py --no-runtime-type-checking +@@ -34,25 +34,19 @@ + ''' + :param very: - + + :stability: deprecated + ''' +- if __debug__: +- type_hints = typing.get_type_hints(BaseFor2647.__init__) +- check_type(argname="argument very", value=very, expected_type=type_hints["very"]) + jsii.create(self.__class__, self, [very]) + + @jsii.member(jsii_name="foo") + def foo(self, obj: scope.jsii_calc_base.IBaseInterface) -> None: + ''' + :param obj: - + + :stability: deprecated + ''' +- if __debug__: +- type_hints = typing.get_type_hints(BaseFor2647.foo) +- check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) + return typing.cast(None, jsii.invoke(self, "foo", [obj])) + + + @jsii.data_type( + jsii_type="@scope/jsii-calc-lib.DiamondLeft", +@@ -70,14 +64,10 @@ + :param hoisted_top: + :param left: + + :stability: deprecated + ''' +- if __debug__: +- type_hints = typing.get_type_hints(DiamondLeft.__init__) +- check_type(argname="argument hoisted_top", value=hoisted_top, expected_type=type_hints["hoisted_top"]) +- check_type(argname="argument left", value=left, expected_type=type_hints["left"]) + self._values: typing.Dict[str, typing.Any] = {} + if hoisted_top is not None: + self._values["hoisted_top"] = hoisted_top + if left is not None: + self._values["left"] = left +@@ -126,14 +116,10 @@ + :param hoisted_top: + :param right: + + :stability: deprecated + ''' +- if __debug__: +- type_hints = typing.get_type_hints(DiamondRight.__init__) +- check_type(argname="argument hoisted_top", value=hoisted_top, expected_type=type_hints["hoisted_top"]) +- check_type(argname="argument right", value=right, expected_type=type_hints["right"]) + self._values: typing.Dict[str, typing.Any] = {} + if hoisted_top is not None: + self._values["hoisted_top"] = hoisted_top + if right is not None: + self._values["right"] = right +@@ -331,15 +317,10 @@ + :param astring: (deprecated) A string value. + :param first_optional: + + :stability: deprecated + ''' +- if __debug__: +- type_hints = typing.get_type_hints(MyFirstStruct.__init__) +- check_type(argname="argument anumber", value=anumber, expected_type=type_hints["anumber"]) +- check_type(argname="argument astring", value=astring, expected_type=type_hints["astring"]) +- check_type(argname="argument first_optional", value=first_optional, expected_type=type_hints["first_optional"]) + self._values: typing.Dict[str, typing.Any] = { + "anumber": anumber, + "astring": astring, + } + if first_optional is not None: +@@ -496,15 +477,10 @@ + :param optional2: + :param optional3: + + :stability: deprecated + ''' +- if __debug__: +- type_hints = typing.get_type_hints(StructWithOnlyOptionals.__init__) +- check_type(argname="argument optional1", value=optional1, expected_type=type_hints["optional1"]) +- check_type(argname="argument optional2", value=optional2, expected_type=type_hints["optional2"]) +- check_type(argname="argument optional3", value=optional3, expected_type=type_hints["optional3"]) + self._values: typing.Dict[str, typing.Any] = {} + if optional1 is not None: + self._values["optional1"] = optional1 + if optional2 is not None: + self._values["optional2"] = optional2 +@@ -564,13 +540,10 @@ + + :param value: The number. + + :stability: deprecated + ''' +- if __debug__: +- type_hints = typing.get_type_hints(Number.__init__) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.create(self.__class__, self, [value]) + + @builtins.property + @jsii.member(jsii_name="doubleValue") + def double_value(self) -> jsii.Number: +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /python/src/scope/jsii_calc_lib/custom_submodule_name/__init__.py.diff 1`] = ` +--- python/src/scope/jsii_calc_lib/custom_submodule_name/__init__.py --runtime-type-checking ++++ python/src/scope/jsii_calc_lib/custom_submodule_name/__init__.py --no-runtime-type-checking +@@ -97,13 +97,10 @@ + + :param name: + + :stability: deprecated + ''' +- if __debug__: +- type_hints = typing.get_type_hints(NestingClass.NestedStruct.__init__) +- check_type(argname="argument name", value=name, expected_type=type_hints["name"]) + self._values: typing.Dict[str, typing.Any] = { + "name": name, + } + + @builtins.property +@@ -138,14 +135,10 @@ + :param key: + :param value: + + :stability: deprecated + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ReflectableEntry.__init__) +- check_type(argname="argument key", value=key, expected_type=type_hints["key"]) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + self._values: typing.Dict[str, typing.Any] = { + "key": key, + "value": value, + } + +@@ -201,13 +194,10 @@ + ''' + :param reflectable: - + + :stability: deprecated + ''' +- if __debug__: +- type_hints = typing.get_type_hints(Reflector.as_map) +- check_type(argname="argument reflectable", value=reflectable, expected_type=type_hints["reflectable"]) + return typing.cast(typing.Mapping[builtins.str, typing.Any], jsii.invoke(self, "asMap", [reflectable])) + + + __all__ = [ + "IReflectable", +`; + exports[`Generated code for "jsii-calc": / 1`] = ` ┗━ 📁 python @@ -14248,3 +14499,3672 @@ __all__ = [ publication.publish() `; + +exports[`Generated code for "jsii-calc": / 1`] = ` + + ┗━ 📁 python + ┗━ 📁 src + ┗━ 📁 jsii_calc + ┣━ 📄 __init__.py.diff + ┣━ 📁 anonymous + ┃ ┗━ 📄 __init__.py.diff + ┣━ 📁 cdk16625 + ┃ ┣━ 📄 __init__.py.diff + ┃ ┗━ 📁 donotimport + ┃ ┗━ 📄 __init__.py.diff + ┣━ 📁 composition + ┃ ┗━ 📄 __init__.py.diff + ┣━ 📁 derived_class_has_no_properties + ┃ ┗━ 📄 __init__.py.diff + ┣━ 📁 interface_in_namespace_includes_classes + ┃ ┗━ 📄 __init__.py.diff + ┣━ 📁 interface_in_namespace_only_interface + ┃ ┗━ 📄 __init__.py.diff + ┣━ 📁 jsii3656 + ┃ ┗━ 📄 __init__.py.diff + ┣━ 📁 module2530 + ┃ ┗━ 📄 __init__.py.diff + ┣━ 📁 module2647 + ┃ ┗━ 📄 __init__.py.diff + ┣━ 📁 module2689 + ┃ ┣━ 📁 methods + ┃ ┃ ┗━ 📄 __init__.py.diff + ┃ ┗━ 📁 structs + ┃ ┗━ 📄 __init__.py.diff + ┣━ 📁 module2692 + ┃ ┣━ 📁 submodule1 + ┃ ┃ ┗━ 📄 __init__.py.diff + ┃ ┗━ 📁 submodule2 + ┃ ┗━ 📄 __init__.py.diff + ┣━ 📁 python_self + ┃ ┗━ 📄 __init__.py.diff + ┗━ 📁 submodule + ┣━ 📄 __init__.py.diff + ┣━ 📁 back_references + ┃ ┗━ 📄 __init__.py.diff + ┣━ 📁 child + ┃ ┗━ 📄 __init__.py.diff + ┗━ 📁 param + ┗━ 📄 __init__.py.diff +`; + +exports[`Generated code for "jsii-calc": /python/src/jsii_calc/__init__.py.diff 1`] = ` +--- python/src/jsii_calc/__init__.py --runtime-type-checking ++++ python/src/jsii_calc/__init__.py --no-runtime-type-checking +@@ -111,13 +111,10 @@ + def work_it_all(self, seed: builtins.str) -> builtins.str: + '''Sets \`\`seed\`\` to \`\`this.property\`\`, then calls \`\`someMethod\`\` with \`\`this.property\`\` and returns the result. + + :param seed: a \`\`string\`\`. + ''' +- if __debug__: +- type_hints = typing.get_type_hints(AbstractSuite.work_it_all) +- check_type(argname="argument seed", value=seed, expected_type=type_hints["seed"]) + return typing.cast(builtins.str, jsii.invoke(self, "workItAll", [seed])) + + @builtins.property + @jsii.member(jsii_name="property") + @abc.abstractmethod +@@ -134,25 +131,19 @@ + @jsii.member(jsii_name="someMethod") + def _some_method(self, str: builtins.str) -> builtins.str: + ''' + :param str: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(AbstractSuite._some_method) +- check_type(argname="argument str", value=str, expected_type=type_hints["str"]) + return typing.cast(builtins.str, jsii.invoke(self, "someMethod", [str])) + + @builtins.property + @jsii.member(jsii_name="property") + def _property(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "property")) + + @_property.setter + def _property(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(AbstractSuite, "_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "property", value) + + # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class + typing.cast(typing.Any, AbstractSuite).__jsii_proxy_class__ = lambda : _AbstractSuiteProxy + +@@ -170,13 +161,10 @@ + @jsii.member(jsii_name="anyIn") + def any_in(self, inp: typing.Any) -> None: + ''' + :param inp: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(AllTypes.any_in) +- check_type(argname="argument inp", value=inp, expected_type=type_hints["inp"]) + return typing.cast(None, jsii.invoke(self, "anyIn", [inp])) + + @jsii.member(jsii_name="anyOut") + def any_out(self) -> typing.Any: + return typing.cast(typing.Any, jsii.invoke(self, "anyOut", [])) +@@ -184,13 +172,10 @@ + @jsii.member(jsii_name="enumMethod") + def enum_method(self, value: "StringEnum") -> "StringEnum": + ''' + :param value: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(AllTypes.enum_method) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + return typing.cast("StringEnum", jsii.invoke(self, "enumMethod", [value])) + + @builtins.property + @jsii.member(jsii_name="enumPropertyValue") + def enum_property_value(self) -> jsii.Number: +@@ -201,97 +186,73 @@ + def any_array_property(self) -> typing.List[typing.Any]: + return typing.cast(typing.List[typing.Any], jsii.get(self, "anyArrayProperty")) + + @any_array_property.setter + def any_array_property(self, value: typing.List[typing.Any]) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(AllTypes, "any_array_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "anyArrayProperty", value) + + @builtins.property + @jsii.member(jsii_name="anyMapProperty") + def any_map_property(self) -> typing.Mapping[builtins.str, typing.Any]: + return typing.cast(typing.Mapping[builtins.str, typing.Any], jsii.get(self, "anyMapProperty")) + + @any_map_property.setter + def any_map_property(self, value: typing.Mapping[builtins.str, typing.Any]) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(AllTypes, "any_map_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "anyMapProperty", value) + + @builtins.property + @jsii.member(jsii_name="anyProperty") + def any_property(self) -> typing.Any: + return typing.cast(typing.Any, jsii.get(self, "anyProperty")) + + @any_property.setter + def any_property(self, value: typing.Any) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(AllTypes, "any_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "anyProperty", value) + + @builtins.property + @jsii.member(jsii_name="arrayProperty") + def array_property(self) -> typing.List[builtins.str]: + return typing.cast(typing.List[builtins.str], jsii.get(self, "arrayProperty")) + + @array_property.setter + def array_property(self, value: typing.List[builtins.str]) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(AllTypes, "array_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "arrayProperty", value) + + @builtins.property + @jsii.member(jsii_name="booleanProperty") + def boolean_property(self) -> builtins.bool: + return typing.cast(builtins.bool, jsii.get(self, "booleanProperty")) + + @boolean_property.setter + def boolean_property(self, value: builtins.bool) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(AllTypes, "boolean_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "booleanProperty", value) + + @builtins.property + @jsii.member(jsii_name="dateProperty") + def date_property(self) -> datetime.datetime: + return typing.cast(datetime.datetime, jsii.get(self, "dateProperty")) + + @date_property.setter + def date_property(self, value: datetime.datetime) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(AllTypes, "date_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "dateProperty", value) + + @builtins.property + @jsii.member(jsii_name="enumProperty") + def enum_property(self) -> "AllTypesEnum": + return typing.cast("AllTypesEnum", jsii.get(self, "enumProperty")) + + @enum_property.setter + def enum_property(self, value: "AllTypesEnum") -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(AllTypes, "enum_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "enumProperty", value) + + @builtins.property + @jsii.member(jsii_name="jsonProperty") + def json_property(self) -> typing.Mapping[typing.Any, typing.Any]: + return typing.cast(typing.Mapping[typing.Any, typing.Any], jsii.get(self, "jsonProperty")) + + @json_property.setter + def json_property(self, value: typing.Mapping[typing.Any, typing.Any]) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(AllTypes, "json_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "jsonProperty", value) + + @builtins.property + @jsii.member(jsii_name="mapProperty") + def map_property(self) -> typing.Mapping[builtins.str, scope.jsii_calc_lib.Number]: +@@ -300,37 +261,28 @@ + @map_property.setter + def map_property( + self, + value: typing.Mapping[builtins.str, scope.jsii_calc_lib.Number], + ) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(AllTypes, "map_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "mapProperty", value) + + @builtins.property + @jsii.member(jsii_name="numberProperty") + def number_property(self) -> jsii.Number: + return typing.cast(jsii.Number, jsii.get(self, "numberProperty")) + + @number_property.setter + def number_property(self, value: jsii.Number) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(AllTypes, "number_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "numberProperty", value) + + @builtins.property + @jsii.member(jsii_name="stringProperty") + def string_property(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "stringProperty")) + + @string_property.setter + def string_property(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(AllTypes, "string_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "stringProperty", value) + + @builtins.property + @jsii.member(jsii_name="unionArrayProperty") + def union_array_property( +@@ -341,13 +293,10 @@ + @union_array_property.setter + def union_array_property( + self, + value: typing.List[typing.Union[jsii.Number, scope.jsii_calc_lib.NumericValue]], + ) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(AllTypes, "union_array_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "unionArrayProperty", value) + + @builtins.property + @jsii.member(jsii_name="unionMapProperty") + def union_map_property( +@@ -358,13 +307,10 @@ + @union_map_property.setter + def union_map_property( + self, + value: typing.Mapping[builtins.str, typing.Union[builtins.str, jsii.Number, scope.jsii_calc_lib.Number]], + ) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(AllTypes, "union_map_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "unionMapProperty", value) + + @builtins.property + @jsii.member(jsii_name="unionProperty") + def union_property( +@@ -375,25 +321,19 @@ + @union_property.setter + def union_property( + self, + value: typing.Union[builtins.str, jsii.Number, scope.jsii_calc_lib.Number, "Multiply"], + ) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(AllTypes, "union_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "unionProperty", value) + + @builtins.property + @jsii.member(jsii_name="unknownArrayProperty") + def unknown_array_property(self) -> typing.List[typing.Any]: + return typing.cast(typing.List[typing.Any], jsii.get(self, "unknownArrayProperty")) + + @unknown_array_property.setter + def unknown_array_property(self, value: typing.List[typing.Any]) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(AllTypes, "unknown_array_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "unknownArrayProperty", value) + + @builtins.property + @jsii.member(jsii_name="unknownMapProperty") + def unknown_map_property(self) -> typing.Mapping[builtins.str, typing.Any]: +@@ -402,37 +342,28 @@ + @unknown_map_property.setter + def unknown_map_property( + self, + value: typing.Mapping[builtins.str, typing.Any], + ) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(AllTypes, "unknown_map_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "unknownMapProperty", value) + + @builtins.property + @jsii.member(jsii_name="unknownProperty") + def unknown_property(self) -> typing.Any: + return typing.cast(typing.Any, jsii.get(self, "unknownProperty")) + + @unknown_property.setter + def unknown_property(self, value: typing.Any) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(AllTypes, "unknown_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "unknownProperty", value) + + @builtins.property + @jsii.member(jsii_name="optionalEnumValue") + def optional_enum_value(self) -> typing.Optional["StringEnum"]: + return typing.cast(typing.Optional["StringEnum"], jsii.get(self, "optionalEnumValue")) + + @optional_enum_value.setter + def optional_enum_value(self, value: typing.Optional["StringEnum"]) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(AllTypes, "optional_enum_value").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "optionalEnumValue", value) + + + @jsii.enum(jsii_type="jsii-calc.AllTypesEnum") + class AllTypesEnum(enum.Enum): +@@ -452,52 +383,36 @@ + def get_bar(self, _p1: builtins.str, _p2: jsii.Number) -> None: + ''' + :param _p1: - + :param _p2: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(AllowedMethodNames.get_bar) +- check_type(argname="argument _p1", value=_p1, expected_type=type_hints["_p1"]) +- check_type(argname="argument _p2", value=_p2, expected_type=type_hints["_p2"]) + return typing.cast(None, jsii.invoke(self, "getBar", [_p1, _p2])) + + @jsii.member(jsii_name="getFoo") + def get_foo(self, with_param: builtins.str) -> builtins.str: + '''getXxx() is not allowed (see negatives), but getXxx(a, ...) is okay. + + :param with_param: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(AllowedMethodNames.get_foo) +- check_type(argname="argument with_param", value=with_param, expected_type=type_hints["with_param"]) + return typing.cast(builtins.str, jsii.invoke(self, "getFoo", [with_param])) + + @jsii.member(jsii_name="setBar") + def set_bar(self, _x: builtins.str, _y: jsii.Number, _z: builtins.bool) -> None: + ''' + :param _x: - + :param _y: - + :param _z: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(AllowedMethodNames.set_bar) +- check_type(argname="argument _x", value=_x, expected_type=type_hints["_x"]) +- check_type(argname="argument _y", value=_y, expected_type=type_hints["_y"]) +- check_type(argname="argument _z", value=_z, expected_type=type_hints["_z"]) + return typing.cast(None, jsii.invoke(self, "setBar", [_x, _y, _z])) + + @jsii.member(jsii_name="setFoo") + def set_foo(self, _x: builtins.str, _y: jsii.Number) -> None: + '''setFoo(x) is not allowed (see negatives), but setXxx(a, b, ...) is okay. + + :param _x: - + :param _y: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(AllowedMethodNames.set_foo) +- check_type(argname="argument _x", value=_x, expected_type=type_hints["_x"]) +- check_type(argname="argument _y", value=_y, expected_type=type_hints["_y"]) + return typing.cast(None, jsii.invoke(self, "setFoo", [_x, _y])) + + + class AmbiguousParameters( + metaclass=jsii.JSIIMeta, +@@ -513,13 +428,10 @@ + ''' + :param scope_: - + :param scope: + :param props: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(AmbiguousParameters.__init__) +- check_type(argname="argument scope_", value=scope_, expected_type=type_hints["scope_"]) + props_ = StructParameterType(scope=scope, props=props) + + jsii.create(self.__class__, self, [scope_, props_]) + + @builtins.property +@@ -566,13 +478,10 @@ + @jsii.member(jsii_name="overrideMe") + def override_me(self, mult: jsii.Number) -> jsii.Number: + ''' + :param mult: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(AsyncVirtualMethods.override_me) +- check_type(argname="argument mult", value=mult, expected_type=type_hints["mult"]) + return typing.cast(jsii.Number, jsii.ainvoke(self, "overrideMe", [mult])) + + @jsii.member(jsii_name="overrideMeToo") + def override_me_too(self) -> jsii.Number: + return typing.cast(jsii.Number, jsii.ainvoke(self, "overrideMeToo", [])) +@@ -633,14 +542,10 @@ + '''Creates a BinaryOperation. + + :param lhs: Left-hand side operand. + :param rhs: Right-hand side operand. + ''' +- if __debug__: +- type_hints = typing.get_type_hints(BinaryOperation.__init__) +- check_type(argname="argument lhs", value=lhs, expected_type=type_hints["lhs"]) +- check_type(argname="argument rhs", value=rhs, expected_type=type_hints["rhs"]) + jsii.create(self.__class__, self, [lhs, rhs]) + + @jsii.member(jsii_name="hello") + def hello(self) -> builtins.str: + '''Say hello!''' +@@ -701,13 +606,10 @@ + + :param value: the value that should be returned. + + :return: \`\`value\`\` + ''' +- if __debug__: +- type_hints = typing.get_type_hints(BurriedAnonymousObject.give_it_back) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + return typing.cast(typing.Any, jsii.invoke(self, "giveItBack", [value])) + + # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class + typing.cast(typing.Any, BurriedAnonymousObject).__jsii_proxy_class__ = lambda : _BurriedAnonymousObjectProxy + +@@ -757,24 +659,18 @@ + def add(self, value: jsii.Number) -> None: + '''Adds a number to the current value. + + :param value: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(Calculator.add) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + return typing.cast(None, jsii.invoke(self, "add", [value])) + + @jsii.member(jsii_name="mul") + def mul(self, value: jsii.Number) -> None: + '''Multiplies the current value by a number. + + :param value: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(Calculator.mul) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + return typing.cast(None, jsii.invoke(self, "mul", [value])) + + @jsii.member(jsii_name="neg") + def neg(self) -> None: + '''Negates the current value.''' +@@ -784,13 +680,10 @@ + def pow(self, value: jsii.Number) -> None: + '''Raises the current value by a power. + + :param value: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(Calculator.pow) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + return typing.cast(None, jsii.invoke(self, "pow", [value])) + + @jsii.member(jsii_name="readUnionValue") + def read_union_value(self) -> jsii.Number: + '''Returns teh value of the union property (if defined).''' +@@ -822,26 +715,20 @@ + '''The current value.''' + return typing.cast(scope.jsii_calc_lib.NumericValue, jsii.get(self, "curr")) + + @curr.setter + def curr(self, value: scope.jsii_calc_lib.NumericValue) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(Calculator, "curr").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "curr", value) + + @builtins.property + @jsii.member(jsii_name="maxValue") + def max_value(self) -> typing.Optional[jsii.Number]: + '''The maximum value allows in this calculator.''' + return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "maxValue")) + + @max_value.setter + def max_value(self, value: typing.Optional[jsii.Number]) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(Calculator, "max_value").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "maxValue", value) + + @builtins.property + @jsii.member(jsii_name="unionProperty") + def union_property( +@@ -853,13 +740,10 @@ + @union_property.setter + def union_property( + self, + value: typing.Optional[typing.Union["Add", "Multiply", "Power"]], + ) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(Calculator, "union_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "unionProperty", value) + + + @jsii.data_type( + jsii_type="jsii-calc.CalculatorProps", +@@ -876,14 +760,10 @@ + '''Properties for Calculator. + + :param initial_value: The initial value of the calculator. NOTE: Any number works here, it's fine. Default: 0 + :param maximum_value: The maximum value the calculator can store. Default: none + ''' +- if __debug__: +- type_hints = typing.get_type_hints(CalculatorProps.__init__) +- check_type(argname="argument initial_value", value=initial_value, expected_type=type_hints["initial_value"]) +- check_type(argname="argument maximum_value", value=maximum_value, expected_type=type_hints["maximum_value"]) + self._values: typing.Dict[str, typing.Any] = {} + if initial_value is not None: + self._values["initial_value"] = initial_value + if maximum_value is not None: + self._values["maximum_value"] = maximum_value +@@ -929,13 +809,10 @@ + union_property: typing.Sequence[typing.Mapping[builtins.str, typing.Union[typing.Union["StructA", typing.Dict[str, typing.Any]], typing.Union["StructB", typing.Dict[str, typing.Any]]]]], + ) -> None: + ''' + :param union_property: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ClassWithCollectionOfUnions.__init__) +- check_type(argname="argument union_property", value=union_property, expected_type=type_hints["union_property"]) + jsii.create(self.__class__, self, [union_property]) + + @builtins.property + @jsii.member(jsii_name="unionProperty") + def union_property( +@@ -946,13 +823,10 @@ + @union_property.setter + def union_property( + self, + value: typing.List[typing.Mapping[builtins.str, typing.Union["StructA", "StructB"]]], + ) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(ClassWithCollectionOfUnions, "union_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "unionProperty", value) + + + class ClassWithCollections( + metaclass=jsii.JSIIMeta, +@@ -965,14 +839,10 @@ + ) -> None: + ''' + :param map: - + :param array: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ClassWithCollections.__init__) +- check_type(argname="argument map", value=map, expected_type=type_hints["map"]) +- check_type(argname="argument array", value=array, expected_type=type_hints["array"]) + jsii.create(self.__class__, self, [map, array]) + + @jsii.member(jsii_name="createAList") + @builtins.classmethod + def create_a_list(cls) -> typing.List[builtins.str]: +@@ -988,49 +858,37 @@ + def static_array(cls) -> typing.List[builtins.str]: # pyright: ignore [reportGeneralTypeIssues] + return typing.cast(typing.List[builtins.str], jsii.sget(cls, "staticArray")) + + @static_array.setter # type: ignore[no-redef] + def static_array(cls, value: typing.List[builtins.str]) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(ClassWithCollections, "static_array").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.sset(cls, "staticArray", value) + + @jsii.python.classproperty + @jsii.member(jsii_name="staticMap") + def static_map(cls) -> typing.Mapping[builtins.str, builtins.str]: # pyright: ignore [reportGeneralTypeIssues] + return typing.cast(typing.Mapping[builtins.str, builtins.str], jsii.sget(cls, "staticMap")) + + @static_map.setter # type: ignore[no-redef] + def static_map(cls, value: typing.Mapping[builtins.str, builtins.str]) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(ClassWithCollections, "static_map").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.sset(cls, "staticMap", value) + + @builtins.property + @jsii.member(jsii_name="array") + def array(self) -> typing.List[builtins.str]: + return typing.cast(typing.List[builtins.str], jsii.get(self, "array")) + + @array.setter + def array(self, value: typing.List[builtins.str]) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(ClassWithCollections, "array").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "array", value) + + @builtins.property + @jsii.member(jsii_name="map") + def map(self) -> typing.Mapping[builtins.str, builtins.str]: + return typing.cast(typing.Mapping[builtins.str, builtins.str], jsii.get(self, "map")) + + @map.setter + def map(self, value: typing.Mapping[builtins.str, builtins.str]) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(ClassWithCollections, "map").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "map", value) + + + class ClassWithContainerTypes( + metaclass=jsii.JSIIMeta, +@@ -1052,15 +910,10 @@ + :param obj: - + :param array_prop: + :param obj_prop: + :param record_prop: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ClassWithContainerTypes.__init__) +- check_type(argname="argument array", value=array, expected_type=type_hints["array"]) +- check_type(argname="argument record", value=record, expected_type=type_hints["record"]) +- check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) + props = ContainerProps( + array_prop=array_prop, obj_prop=obj_prop, record_prop=record_prop + ) + + jsii.create(self.__class__, self, [array, record, obj, props]) +@@ -1110,23 +963,17 @@ + ): + def __init__(self, int: builtins.str) -> None: + ''' + :param int: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ClassWithJavaReservedWords.__init__) +- check_type(argname="argument int", value=int, expected_type=type_hints["int"]) + jsii.create(self.__class__, self, [int]) + + @jsii.member(jsii_name="import") + def import_(self, assert_: builtins.str) -> builtins.str: + ''' + :param assert_: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ClassWithJavaReservedWords.import_) +- check_type(argname="argument assert_", value=assert_, expected_type=type_hints["assert_"]) + return typing.cast(builtins.str, jsii.invoke(self, "import", [assert_])) + + @builtins.property + @jsii.member(jsii_name="int") + def int(self) -> builtins.str: +@@ -1145,13 +992,10 @@ + def mutable_object(self) -> "IMutableObjectLiteral": + return typing.cast("IMutableObjectLiteral", jsii.get(self, "mutableObject")) + + @mutable_object.setter + def mutable_object(self, value: "IMutableObjectLiteral") -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(ClassWithMutableObjectLiteralProperty, "mutable_object").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "mutableObject", value) + + + class ConfusingToJackson( + metaclass=jsii.JSIIMeta, +@@ -1182,13 +1026,10 @@ + @union_property.setter + def union_property( + self, + value: typing.Optional[typing.Union[scope.jsii_calc_lib.IFriendly, typing.List[typing.Union[scope.jsii_calc_lib.IFriendly, "AbstractClass"]]]], + ) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(ConfusingToJackson, "union_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "unionProperty", value) + + + @jsii.data_type( + jsii_type="jsii-calc.ConfusingToJacksonStruct", +@@ -1202,13 +1043,10 @@ + union_property: typing.Optional[typing.Union[scope.jsii_calc_lib.IFriendly, typing.Sequence[typing.Union[scope.jsii_calc_lib.IFriendly, "AbstractClass"]]]] = None, + ) -> None: + ''' + :param union_property: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ConfusingToJacksonStruct.__init__) +- check_type(argname="argument union_property", value=union_property, expected_type=type_hints["union_property"]) + self._values: typing.Dict[str, typing.Any] = {} + if union_property is not None: + self._values["union_property"] = union_property + + @builtins.property +@@ -1236,13 +1074,10 @@ + ): + def __init__(self, consumer: "PartiallyInitializedThisConsumer") -> None: + ''' + :param consumer: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ConstructorPassesThisOut.__init__) +- check_type(argname="argument consumer", value=consumer, expected_type=type_hints["consumer"]) + jsii.create(self.__class__, self, [consumer]) + + + class Constructors(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Constructors"): + def __init__(self) -> None: +@@ -1290,13 +1125,10 @@ + ): + def __init__(self, delegate: "IStructReturningDelegate") -> None: + ''' + :param delegate: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ConsumePureInterface.__init__) +- check_type(argname="argument delegate", value=delegate, expected_type=type_hints["delegate"]) + jsii.create(self.__class__, self, [delegate]) + + @jsii.member(jsii_name="workItBaby") + def work_it_baby(self) -> "StructB": + return typing.cast("StructB", jsii.invoke(self, "workItBaby", [])) +@@ -1325,13 +1157,10 @@ + + Returns whether the bell was rung. + + :param ringer: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ConsumerCanRingBell.static_implemented_by_object_literal) +- check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) + return typing.cast(builtins.bool, jsii.sinvoke(cls, "staticImplementedByObjectLiteral", [ringer])) + + @jsii.member(jsii_name="staticImplementedByPrivateClass") + @builtins.classmethod + def static_implemented_by_private_class( +@@ -1342,13 +1171,10 @@ + + Return whether the bell was rung. + + :param ringer: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ConsumerCanRingBell.static_implemented_by_private_class) +- check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) + return typing.cast(builtins.bool, jsii.sinvoke(cls, "staticImplementedByPrivateClass", [ringer])) + + @jsii.member(jsii_name="staticImplementedByPublicClass") + @builtins.classmethod + def static_implemented_by_public_class(cls, ringer: "IBellRinger") -> builtins.bool: +@@ -1356,13 +1182,10 @@ + + Return whether the bell was rung. + + :param ringer: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ConsumerCanRingBell.static_implemented_by_public_class) +- check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) + return typing.cast(builtins.bool, jsii.sinvoke(cls, "staticImplementedByPublicClass", [ringer])) + + @jsii.member(jsii_name="staticWhenTypedAsClass") + @builtins.classmethod + def static_when_typed_as_class(cls, ringer: "IConcreteBellRinger") -> builtins.bool: +@@ -1370,65 +1193,50 @@ + + Return whether the bell was rung. + + :param ringer: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ConsumerCanRingBell.static_when_typed_as_class) +- check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) + return typing.cast(builtins.bool, jsii.sinvoke(cls, "staticWhenTypedAsClass", [ringer])) + + @jsii.member(jsii_name="implementedByObjectLiteral") + def implemented_by_object_literal(self, ringer: "IBellRinger") -> builtins.bool: + '''...if the interface is implemented using an object literal. + + Returns whether the bell was rung. + + :param ringer: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ConsumerCanRingBell.implemented_by_object_literal) +- check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) + return typing.cast(builtins.bool, jsii.invoke(self, "implementedByObjectLiteral", [ringer])) + + @jsii.member(jsii_name="implementedByPrivateClass") + def implemented_by_private_class(self, ringer: "IBellRinger") -> builtins.bool: + '''...if the interface is implemented using a private class. + + Return whether the bell was rung. + + :param ringer: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ConsumerCanRingBell.implemented_by_private_class) +- check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) + return typing.cast(builtins.bool, jsii.invoke(self, "implementedByPrivateClass", [ringer])) + + @jsii.member(jsii_name="implementedByPublicClass") + def implemented_by_public_class(self, ringer: "IBellRinger") -> builtins.bool: + '''...if the interface is implemented using a public class. + + Return whether the bell was rung. + + :param ringer: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ConsumerCanRingBell.implemented_by_public_class) +- check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) + return typing.cast(builtins.bool, jsii.invoke(self, "implementedByPublicClass", [ringer])) + + @jsii.member(jsii_name="whenTypedAsClass") + def when_typed_as_class(self, ringer: "IConcreteBellRinger") -> builtins.bool: + '''If the parameter is a concrete class instead of an interface. + + Return whether the bell was rung. + + :param ringer: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ConsumerCanRingBell.when_typed_as_class) +- check_type(argname="argument ringer", value=ringer, expected_type=type_hints["ringer"]) + return typing.cast(builtins.bool, jsii.invoke(self, "whenTypedAsClass", [ringer])) + + + class ConsumersOfThisCrazyTypeSystem( + metaclass=jsii.JSIIMeta, +@@ -1443,26 +1251,20 @@ + obj: "IAnotherPublicInterface", + ) -> builtins.str: + ''' + :param obj: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ConsumersOfThisCrazyTypeSystem.consume_another_public_interface) +- check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) + return typing.cast(builtins.str, jsii.invoke(self, "consumeAnotherPublicInterface", [obj])) + + @jsii.member(jsii_name="consumeNonInternalInterface") + def consume_non_internal_interface( + self, + obj: "INonInternalInterface", + ) -> typing.Any: + ''' + :param obj: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ConsumersOfThisCrazyTypeSystem.consume_non_internal_interface) +- check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) + return typing.cast(typing.Any, jsii.invoke(self, "consumeNonInternalInterface", [obj])) + + + @jsii.data_type( + jsii_type="jsii-calc.ContainerProps", +@@ -1484,15 +1286,10 @@ + ''' + :param array_prop: + :param obj_prop: + :param record_prop: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ContainerProps.__init__) +- check_type(argname="argument array_prop", value=array_prop, expected_type=type_hints["array_prop"]) +- check_type(argname="argument obj_prop", value=obj_prop, expected_type=type_hints["obj_prop"]) +- check_type(argname="argument record_prop", value=record_prop, expected_type=type_hints["record_prop"]) + self._values: typing.Dict[str, typing.Any] = { + "array_prop": array_prop, + "obj_prop": obj_prop, + "record_prop": record_prop, + } +@@ -1558,23 +1355,17 @@ + data: typing.Mapping[builtins.str, typing.Any], + ) -> builtins.str: + ''' + :param data: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(DataRenderer.render_arbitrary) +- check_type(argname="argument data", value=data, expected_type=type_hints["data"]) + return typing.cast(builtins.str, jsii.invoke(self, "renderArbitrary", [data])) + + @jsii.member(jsii_name="renderMap") + def render_map(self, map: typing.Mapping[builtins.str, typing.Any]) -> builtins.str: + ''' + :param map: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(DataRenderer.render_map) +- check_type(argname="argument map", value=map, expected_type=type_hints["map"]) + return typing.cast(builtins.str, jsii.invoke(self, "renderMap", [map])) + + + class Default(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Default"): + '''A class named "Default". +@@ -1603,15 +1394,10 @@ + ''' + :param arg1: - + :param arg2: - + :param arg3: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(DefaultedConstructorArgument.__init__) +- check_type(argname="argument arg1", value=arg1, expected_type=type_hints["arg1"]) +- check_type(argname="argument arg2", value=arg2, expected_type=type_hints["arg2"]) +- check_type(argname="argument arg3", value=arg3, expected_type=type_hints["arg3"]) + jsii.create(self.__class__, self, [arg1, arg2, arg3]) + + @builtins.property + @jsii.member(jsii_name="arg1") + def arg1(self) -> jsii.Number: +@@ -1669,14 +1455,10 @@ + + :deprecated: this constructor is "just" okay + + :stability: deprecated + ''' +- if __debug__: +- type_hints = typing.get_type_hints(DeprecatedClass.__init__) +- check_type(argname="argument readonly_string", value=readonly_string, expected_type=type_hints["readonly_string"]) +- check_type(argname="argument mutable_number", value=mutable_number, expected_type=type_hints["mutable_number"]) + jsii.create(self.__class__, self, [readonly_string, mutable_number]) + + @jsii.member(jsii_name="method") + def method(self) -> None: + ''' +@@ -1706,13 +1488,10 @@ + ''' + return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "mutableProperty")) + + @mutable_property.setter + def mutable_property(self, value: typing.Optional[jsii.Number]) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(DeprecatedClass, "mutable_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "mutableProperty", value) + + + @jsii.enum(jsii_type="jsii-calc.DeprecatedEnum") + class DeprecatedEnum(enum.Enum): +@@ -1748,13 +1527,10 @@ + + :deprecated: it just wraps a string + + :stability: deprecated + ''' +- if __debug__: +- type_hints = typing.get_type_hints(DeprecatedStruct.__init__) +- check_type(argname="argument readonly_property", value=readonly_property, expected_type=type_hints["readonly_property"]) + self._values: typing.Dict[str, typing.Any] = { + "readonly_property": readonly_property, + } + + @builtins.property +@@ -1819,21 +1595,10 @@ + :param non_primitive: An example of a non primitive property. + :param another_optional: This is optional. + :param optional_any: + :param optional_array: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(DerivedStruct.__init__) +- check_type(argname="argument anumber", value=anumber, expected_type=type_hints["anumber"]) +- check_type(argname="argument astring", value=astring, expected_type=type_hints["astring"]) +- check_type(argname="argument first_optional", value=first_optional, expected_type=type_hints["first_optional"]) +- check_type(argname="argument another_required", value=another_required, expected_type=type_hints["another_required"]) +- check_type(argname="argument bool", value=bool, expected_type=type_hints["bool"]) +- check_type(argname="argument non_primitive", value=non_primitive, expected_type=type_hints["non_primitive"]) +- check_type(argname="argument another_optional", value=another_optional, expected_type=type_hints["another_optional"]) +- check_type(argname="argument optional_any", value=optional_any, expected_type=type_hints["optional_any"]) +- check_type(argname="argument optional_array", value=optional_array, expected_type=type_hints["optional_array"]) + self._values: typing.Dict[str, typing.Any] = { + "anumber": anumber, + "astring": astring, + "another_required": another_required, + "bool": bool, +@@ -1950,16 +1715,10 @@ + :param hoisted_top: + :param left: + :param right: + :param bottom: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(DiamondBottom.__init__) +- check_type(argname="argument hoisted_top", value=hoisted_top, expected_type=type_hints["hoisted_top"]) +- check_type(argname="argument left", value=left, expected_type=type_hints["left"]) +- check_type(argname="argument right", value=right, expected_type=type_hints["right"]) +- check_type(argname="argument bottom", value=bottom, expected_type=type_hints["bottom"]) + self._values: typing.Dict[str, typing.Any] = {} + if hoisted_top is not None: + self._values["hoisted_top"] = hoisted_top + if left is not None: + self._values["left"] = left +@@ -2017,13 +1776,10 @@ + class DiamondInheritanceBaseLevelStruct: + def __init__(self, *, base_level_property: builtins.str) -> None: + ''' + :param base_level_property: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(DiamondInheritanceBaseLevelStruct.__init__) +- check_type(argname="argument base_level_property", value=base_level_property, expected_type=type_hints["base_level_property"]) + self._values: typing.Dict[str, typing.Any] = { + "base_level_property": base_level_property, + } + + @builtins.property +@@ -2061,14 +1817,10 @@ + ) -> None: + ''' + :param base_level_property: + :param first_mid_level_property: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(DiamondInheritanceFirstMidLevelStruct.__init__) +- check_type(argname="argument base_level_property", value=base_level_property, expected_type=type_hints["base_level_property"]) +- check_type(argname="argument first_mid_level_property", value=first_mid_level_property, expected_type=type_hints["first_mid_level_property"]) + self._values: typing.Dict[str, typing.Any] = { + "base_level_property": base_level_property, + "first_mid_level_property": first_mid_level_property, + } + +@@ -2113,14 +1865,10 @@ + ) -> None: + ''' + :param base_level_property: + :param second_mid_level_property: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(DiamondInheritanceSecondMidLevelStruct.__init__) +- check_type(argname="argument base_level_property", value=base_level_property, expected_type=type_hints["base_level_property"]) +- check_type(argname="argument second_mid_level_property", value=second_mid_level_property, expected_type=type_hints["second_mid_level_property"]) + self._values: typing.Dict[str, typing.Any] = { + "base_level_property": base_level_property, + "second_mid_level_property": second_mid_level_property, + } + +@@ -2176,16 +1924,10 @@ + :param base_level_property: + :param first_mid_level_property: + :param second_mid_level_property: + :param top_level_property: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(DiamondInheritanceTopLevelStruct.__init__) +- check_type(argname="argument base_level_property", value=base_level_property, expected_type=type_hints["base_level_property"]) +- check_type(argname="argument first_mid_level_property", value=first_mid_level_property, expected_type=type_hints["first_mid_level_property"]) +- check_type(argname="argument second_mid_level_property", value=second_mid_level_property, expected_type=type_hints["second_mid_level_property"]) +- check_type(argname="argument top_level_property", value=top_level_property, expected_type=type_hints["top_level_property"]) + self._values: typing.Dict[str, typing.Any] = { + "base_level_property": base_level_property, + "first_mid_level_property": first_mid_level_property, + "second_mid_level_property": second_mid_level_property, + "top_level_property": top_level_property, +@@ -2265,13 +2007,10 @@ + @jsii.member(jsii_name="changePrivatePropertyValue") + def change_private_property_value(self, new_value: builtins.str) -> None: + ''' + :param new_value: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(DoNotOverridePrivates.change_private_property_value) +- check_type(argname="argument new_value", value=new_value, expected_type=type_hints["new_value"]) + return typing.cast(None, jsii.invoke(self, "changePrivatePropertyValue", [new_value])) + + @jsii.member(jsii_name="privateMethodValue") + def private_method_value(self) -> builtins.str: + return typing.cast(builtins.str, jsii.invoke(self, "privateMethodValue", [])) +@@ -2300,15 +2039,10 @@ + ''' + :param _required_any: - + :param _optional_any: - + :param _optional_string: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(DoNotRecognizeAnyAsOptional.method) +- check_type(argname="argument _required_any", value=_required_any, expected_type=type_hints["_required_any"]) +- check_type(argname="argument _optional_any", value=_optional_any, expected_type=type_hints["_optional_any"]) +- check_type(argname="argument _optional_string", value=_optional_string, expected_type=type_hints["_optional_string"]) + return typing.cast(None, jsii.invoke(self, "method", [_required_any, _optional_any, _optional_string])) + + + class DocumentedClass(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.DocumentedClass"): + '''Here's the first line of the TSDoc comment. +@@ -2372,14 +2106,10 @@ + ) -> builtins.str: + ''' + :param optional: - + :param things: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(DontComplainAboutVariadicAfterOptional.optional_and_variadic) +- check_type(argname="argument optional", value=optional, expected_type=type_hints["optional"]) +- check_type(argname="argument things", value=things, expected_type=typing.Tuple[type_hints["things"], ...]) # pyright: ignore [reportGeneralTypeIssues] + return typing.cast(builtins.str, jsii.invoke(self, "optionalAndVariadic", [optional, *things])) + + + @jsii.data_type( + jsii_type="jsii-calc.DummyObj", +@@ -2389,13 +2119,10 @@ + class DummyObj: + def __init__(self, *, example: builtins.str) -> None: + ''' + :param example: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(DummyObj.__init__) +- check_type(argname="argument example", value=example, expected_type=type_hints["example"]) + self._values: typing.Dict[str, typing.Any] = { + "example": example, + } + + @builtins.property +@@ -2424,37 +2151,28 @@ + + def __init__(self, value_store: builtins.str) -> None: + ''' + :param value_store: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(DynamicPropertyBearer.__init__) +- check_type(argname="argument value_store", value=value_store, expected_type=type_hints["value_store"]) + jsii.create(self.__class__, self, [value_store]) + + @builtins.property + @jsii.member(jsii_name="dynamicProperty") + def dynamic_property(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "dynamicProperty")) + + @dynamic_property.setter + def dynamic_property(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(DynamicPropertyBearer, "dynamic_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "dynamicProperty", value) + + @builtins.property + @jsii.member(jsii_name="valueStore") + def value_store(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "valueStore")) + + @value_store.setter + def value_store(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(DynamicPropertyBearer, "value_store").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "valueStore", value) + + + class DynamicPropertyBearerChild( + DynamicPropertyBearer, +@@ -2463,26 +2181,20 @@ + ): + def __init__(self, original_value: builtins.str) -> None: + ''' + :param original_value: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(DynamicPropertyBearerChild.__init__) +- check_type(argname="argument original_value", value=original_value, expected_type=type_hints["original_value"]) + jsii.create(self.__class__, self, [original_value]) + + @jsii.member(jsii_name="overrideValue") + def override_value(self, new_value: builtins.str) -> builtins.str: + '''Sets \`\`this.dynamicProperty\`\` to the new value, and returns the old value. + + :param new_value: the new value to be set. + + :return: the old value that was set. + ''' +- if __debug__: +- type_hints = typing.get_type_hints(DynamicPropertyBearerChild.override_value) +- check_type(argname="argument new_value", value=new_value, expected_type=type_hints["new_value"]) + return typing.cast(builtins.str, jsii.invoke(self, "overrideValue", [new_value])) + + @builtins.property + @jsii.member(jsii_name="originalValue") + def original_value(self) -> builtins.str: +@@ -2495,13 +2207,10 @@ + def __init__(self, clock: "IWallClock") -> None: + '''Creates a new instance of Entropy. + + :param clock: your implementation of \`\`WallClock\`\`. + ''' +- if __debug__: +- type_hints = typing.get_type_hints(Entropy.__init__) +- check_type(argname="argument clock", value=clock, expected_type=type_hints["clock"]) + jsii.create(self.__class__, self, [clock]) + + @jsii.member(jsii_name="increase") + def increase(self) -> builtins.str: + '''Increases entropy by consuming time from the clock (yes, this is a long shot, please don't judge). +@@ -2529,13 +2238,10 @@ + + :param word: the value to return. + + :return: \`\`word\`\`. + ''' +- if __debug__: +- type_hints = typing.get_type_hints(Entropy.repeat) +- check_type(argname="argument word", value=word, expected_type=type_hints["word"]) + return typing.cast(builtins.str, jsii.invoke(self, "repeat", [word])) + + # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class + typing.cast(typing.Any, Entropy).__jsii_proxy_class__ = lambda : _EntropyProxy + +@@ -2572,14 +2278,10 @@ + are being erased when sending values from native code to JS. + + :param opts: - + :param key: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(EraseUndefinedHashValues.does_key_exist) +- check_type(argname="argument opts", value=opts, expected_type=type_hints["opts"]) +- check_type(argname="argument key", value=key, expected_type=type_hints["key"]) + return typing.cast(builtins.bool, jsii.sinvoke(cls, "doesKeyExist", [opts, key])) + + @jsii.member(jsii_name="prop1IsNull") + @builtins.classmethod + def prop1_is_null(cls) -> typing.Mapping[builtins.str, typing.Any]: +@@ -2607,14 +2309,10 @@ + ) -> None: + ''' + :param option1: + :param option2: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(EraseUndefinedHashValuesOptions.__init__) +- check_type(argname="argument option1", value=option1, expected_type=type_hints["option1"]) +- check_type(argname="argument option2", value=option2, expected_type=type_hints["option2"]) + self._values: typing.Dict[str, typing.Any] = {} + if option1 is not None: + self._values["option1"] = option1 + if option2 is not None: + self._values["option2"] = option2 +@@ -2658,14 +2356,10 @@ + :param readonly_string: - + :param mutable_number: - + + :stability: experimental + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ExperimentalClass.__init__) +- check_type(argname="argument readonly_string", value=readonly_string, expected_type=type_hints["readonly_string"]) +- check_type(argname="argument mutable_number", value=mutable_number, expected_type=type_hints["mutable_number"]) + jsii.create(self.__class__, self, [readonly_string, mutable_number]) + + @jsii.member(jsii_name="method") + def method(self) -> None: + ''' +@@ -2689,13 +2383,10 @@ + ''' + return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "mutableProperty")) + + @mutable_property.setter + def mutable_property(self, value: typing.Optional[jsii.Number]) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(ExperimentalClass, "mutable_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "mutableProperty", value) + + + @jsii.enum(jsii_type="jsii-calc.ExperimentalEnum") + class ExperimentalEnum(enum.Enum): +@@ -2723,13 +2414,10 @@ + ''' + :param readonly_property: + + :stability: experimental + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ExperimentalStruct.__init__) +- check_type(argname="argument readonly_property", value=readonly_property, expected_type=type_hints["readonly_property"]) + self._values: typing.Dict[str, typing.Any] = { + "readonly_property": readonly_property, + } + + @builtins.property +@@ -2759,13 +2447,10 @@ + ): + def __init__(self, success: builtins.bool) -> None: + ''' + :param success: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ExportedBaseClass.__init__) +- check_type(argname="argument success", value=success, expected_type=type_hints["success"]) + jsii.create(self.__class__, self, [success]) + + @builtins.property + @jsii.member(jsii_name="success") + def success(self) -> builtins.bool: +@@ -2781,14 +2466,10 @@ + def __init__(self, *, boom: builtins.bool, prop: builtins.str) -> None: + ''' + :param boom: + :param prop: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ExtendsInternalInterface.__init__) +- check_type(argname="argument boom", value=boom, expected_type=type_hints["boom"]) +- check_type(argname="argument prop", value=prop, expected_type=type_hints["prop"]) + self._values: typing.Dict[str, typing.Any] = { + "boom": boom, + "prop": prop, + } + +@@ -2830,14 +2511,10 @@ + :param readonly_string: - + :param mutable_number: - + + :external: true + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ExternalClass.__init__) +- check_type(argname="argument readonly_string", value=readonly_string, expected_type=type_hints["readonly_string"]) +- check_type(argname="argument mutable_number", value=mutable_number, expected_type=type_hints["mutable_number"]) + jsii.create(self.__class__, self, [readonly_string, mutable_number]) + + @jsii.member(jsii_name="method") + def method(self) -> None: + ''' +@@ -2861,13 +2538,10 @@ + ''' + return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "mutableProperty")) + + @mutable_property.setter + def mutable_property(self, value: typing.Optional[jsii.Number]) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(ExternalClass, "mutable_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "mutableProperty", value) + + + @jsii.enum(jsii_type="jsii-calc.ExternalEnum") + class ExternalEnum(enum.Enum): +@@ -2895,13 +2569,10 @@ + ''' + :param readonly_property: + + :external: true + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ExternalStruct.__init__) +- check_type(argname="argument readonly_property", value=readonly_property, expected_type=type_hints["readonly_property"]) + self._values: typing.Dict[str, typing.Any] = { + "readonly_property": readonly_property, + } + + @builtins.property +@@ -3044,13 +2715,10 @@ + def __init__(self, *, name: typing.Optional[builtins.str] = None) -> None: + '''These are some arguments you can pass to a method. + + :param name: The name of the greetee. Default: world + ''' +- if __debug__: +- type_hints = typing.get_type_hints(Greetee.__init__) +- check_type(argname="argument name", value=name, expected_type=type_hints["name"]) + self._values: typing.Dict[str, typing.Any] = {} + if name is not None: + self._values["name"] = name + + @builtins.property +@@ -3084,13 +2752,10 @@ + @jsii.member(jsii_name="betterGreeting") + def better_greeting(self, friendly: scope.jsii_calc_lib.IFriendly) -> builtins.str: + ''' + :param friendly: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(GreetingAugmenter.better_greeting) +- check_type(argname="argument friendly", value=friendly, expected_type=type_hints["friendly"]) + return typing.cast(builtins.str, jsii.invoke(self, "betterGreeting", [friendly])) + + + @jsii.interface(jsii_type="jsii-calc.IAnonymousImplementationProvider") + class IAnonymousImplementationProvider(typing_extensions.Protocol): +@@ -3170,13 +2835,10 @@ + def a(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "a")) + + @a.setter + def a(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(IAnotherPublicInterface, "a").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "a", value) + + # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface + typing.cast(typing.Any, IAnotherPublicInterface).__jsii_proxy_class__ = lambda : _IAnotherPublicInterfaceProxy + +@@ -3219,13 +2881,10 @@ + @jsii.member(jsii_name="yourTurn") + def your_turn(self, bell: IBell) -> None: + ''' + :param bell: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(IBellRinger.your_turn) +- check_type(argname="argument bell", value=bell, expected_type=type_hints["bell"]) + return typing.cast(None, jsii.invoke(self, "yourTurn", [bell])) + + # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface + typing.cast(typing.Any, IBellRinger).__jsii_proxy_class__ = lambda : _IBellRingerProxy + +@@ -3250,13 +2909,10 @@ + @jsii.member(jsii_name="yourTurn") + def your_turn(self, bell: "Bell") -> None: + ''' + :param bell: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(IConcreteBellRinger.your_turn) +- check_type(argname="argument bell", value=bell, expected_type=type_hints["bell"]) + return typing.cast(None, jsii.invoke(self, "yourTurn", [bell])) + + # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface + typing.cast(typing.Any, IConcreteBellRinger).__jsii_proxy_class__ = lambda : _IConcreteBellRingerProxy + +@@ -3312,13 +2968,10 @@ + ''' + return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "mutableProperty")) + + @mutable_property.setter + def mutable_property(self, value: typing.Optional[jsii.Number]) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(IDeprecatedInterface, "mutable_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "mutableProperty", value) + + @jsii.member(jsii_name="method") + def method(self) -> None: + ''' +@@ -3373,13 +3026,10 @@ + ''' + return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "mutableProperty")) + + @mutable_property.setter + def mutable_property(self, value: typing.Optional[jsii.Number]) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(IExperimentalInterface, "mutable_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "mutableProperty", value) + + @jsii.member(jsii_name="method") + def method(self) -> None: + ''' +@@ -3421,13 +3071,10 @@ + def private(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "private")) + + @private.setter + def private(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(IExtendsPrivateInterface, "private").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "private", value) + + # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface + typing.cast(typing.Any, IExtendsPrivateInterface).__jsii_proxy_class__ = lambda : _IExtendsPrivateInterfaceProxy + +@@ -3473,13 +3120,10 @@ + ''' + return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "mutableProperty")) + + @mutable_property.setter + def mutable_property(self, value: typing.Optional[jsii.Number]) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(IExternalInterface, "mutable_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "mutableProperty", value) + + @jsii.member(jsii_name="method") + def method(self) -> None: + ''' +@@ -3661,14 +3305,10 @@ + ) -> None: + ''' + :param arg1: - + :param arg2: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(IInterfaceWithOptionalMethodArguments.hello) +- check_type(argname="argument arg1", value=arg1, expected_type=type_hints["arg1"]) +- check_type(argname="argument arg2", value=arg2, expected_type=type_hints["arg2"]) + return typing.cast(None, jsii.invoke(self, "hello", [arg1, arg2])) + + # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface + typing.cast(typing.Any, IInterfaceWithOptionalMethodArguments).__jsii_proxy_class__ = lambda : _IInterfaceWithOptionalMethodArgumentsProxy + +@@ -3703,13 +3343,10 @@ + def read_write_string(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "readWriteString")) + + @read_write_string.setter + def read_write_string(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(IInterfaceWithProperties, "read_write_string").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "readWriteString", value) + + # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface + typing.cast(typing.Any, IInterfaceWithProperties).__jsii_proxy_class__ = lambda : _IInterfaceWithPropertiesProxy + +@@ -3739,13 +3376,10 @@ + def foo(self) -> jsii.Number: + return typing.cast(jsii.Number, jsii.get(self, "foo")) + + @foo.setter + def foo(self, value: jsii.Number) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(IInterfaceWithPropertiesExtension, "foo").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "foo", value) + + # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface + typing.cast(typing.Any, IInterfaceWithPropertiesExtension).__jsii_proxy_class__ = lambda : _IInterfaceWithPropertiesExtensionProxy + +@@ -4265,13 +3899,10 @@ + def value(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "value")) + + @value.setter + def value(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(IMutableObjectLiteral, "value").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "value", value) + + # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface + typing.cast(typing.Any, IMutableObjectLiteral).__jsii_proxy_class__ = lambda : _IMutableObjectLiteralProxy + +@@ -4307,25 +3938,19 @@ + def b(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "b")) + + @b.setter + def b(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(INonInternalInterface, "b").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "b", value) + + @builtins.property + @jsii.member(jsii_name="c") + def c(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "c")) + + @c.setter + def c(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(INonInternalInterface, "c").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "c", value) + + # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface + typing.cast(typing.Any, INonInternalInterface).__jsii_proxy_class__ = lambda : _INonInternalInterfaceProxy + +@@ -4358,13 +3983,10 @@ + def property(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "property")) + + @property.setter + def property(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(IObjectWithProperty, "property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "property", value) + + @jsii.member(jsii_name="wasSet") + def was_set(self) -> builtins.bool: + return typing.cast(builtins.bool, jsii.invoke(self, "wasSet", [])) +@@ -4557,13 +4179,10 @@ + def mutable_property(self) -> typing.Optional[jsii.Number]: + return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "mutableProperty")) + + @mutable_property.setter + def mutable_property(self, value: typing.Optional[jsii.Number]) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(IStableInterface, "mutable_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "mutableProperty", value) + + @jsii.member(jsii_name="method") + def method(self) -> None: + return typing.cast(None, jsii.invoke(self, "method", [])) +@@ -4630,13 +4249,10 @@ + def prop(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "prop")) + + @prop.setter + def prop(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(ImplementInternalInterface, "prop").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "prop", value) + + + class Implementation(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Implementation"): + def __init__(self) -> None: +@@ -4682,13 +4298,10 @@ + def private(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "private")) + + @private.setter + def private(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(ImplementsPrivateInterface, "private").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "private", value) + + + @jsii.data_type( + jsii_type="jsii-calc.ImplictBaseOfBase", +@@ -4706,15 +4319,10 @@ + ''' + :param foo: - + :param bar: - + :param goo: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ImplictBaseOfBase.__init__) +- check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) +- check_type(argname="argument bar", value=bar, expected_type=type_hints["bar"]) +- check_type(argname="argument goo", value=goo, expected_type=type_hints["goo"]) + self._values: typing.Dict[str, typing.Any] = { + "foo": foo, + "bar": bar, + "goo": goo, + } +@@ -4789,13 +4397,10 @@ + count: jsii.Number, + ) -> typing.List[scope.jsii_calc_lib.IDoublable]: + ''' + :param count: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(InterfacesMaker.make_interfaces) +- check_type(argname="argument count", value=count, expected_type=type_hints["count"]) + return typing.cast(typing.List[scope.jsii_calc_lib.IDoublable], jsii.sinvoke(cls, "makeInterfaces", [count])) + + + class Isomorphism(metaclass=jsii.JSIIAbstractClass, jsii_type="jsii-calc.Isomorphism"): + '''Checks the "same instance" isomorphism is preserved within the constructor. +@@ -4900,25 +4505,19 @@ + def prop_a(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "propA")) + + @prop_a.setter + def prop_a(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(JSObjectLiteralToNativeClass, "prop_a").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "propA", value) + + @builtins.property + @jsii.member(jsii_name="propB") + def prop_b(self) -> jsii.Number: + return typing.cast(jsii.Number, jsii.get(self, "propB")) + + @prop_b.setter + def prop_b(self, value: jsii.Number) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(JSObjectLiteralToNativeClass, "prop_b").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "propB", value) + + + class JavaReservedWords( + metaclass=jsii.JSIIMeta, +@@ -5140,13 +4739,10 @@ + def while_(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "while")) + + @while_.setter + def while_(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(JavaReservedWords, "while_").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "while", value) + + + @jsii.implements(IJsii487External2, IJsii487External) + class Jsii487Derived(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Jsii487Derived"): +@@ -5248,13 +4844,10 @@ + @builtins.classmethod + def stringify(cls, value: typing.Any = None) -> typing.Optional[builtins.str]: + ''' + :param value: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(JsonFormatter.stringify) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + return typing.cast(typing.Optional[builtins.str], jsii.sinvoke(cls, "stringify", [value])) + + + class LevelOne(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.LevelOne"): + '''Validates that nested classes get correct code generation for the occasional forward reference.''' +@@ -5284,13 +4877,10 @@ + class PropBooleanValue: + def __init__(self, *, value: builtins.bool) -> None: + ''' + :param value: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(LevelOne.PropBooleanValue.__init__) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + self._values: typing.Dict[str, typing.Any] = { + "value": value, + } + + @builtins.property +@@ -5324,13 +4914,10 @@ + ''' + :param prop: + ''' + if isinstance(prop, dict): + prop = LevelOne.PropBooleanValue(**prop) +- if __debug__: +- type_hints = typing.get_type_hints(LevelOne.PropProperty.__init__) +- check_type(argname="argument prop", value=prop, expected_type=type_hints["prop"]) + self._values: typing.Dict[str, typing.Any] = { + "prop": prop, + } + + @builtins.property +@@ -5365,13 +4952,10 @@ + ''' + :param prop: + ''' + if isinstance(prop, dict): + prop = LevelOne.PropProperty(**prop) +- if __debug__: +- type_hints = typing.get_type_hints(LevelOneProps.__init__) +- check_type(argname="argument prop", value=prop, expected_type=type_hints["prop"]) + self._values: typing.Dict[str, typing.Any] = { + "prop": prop, + } + + @builtins.property +@@ -5419,17 +5003,10 @@ + :param cpu: The number of cpu units used by the task. Valid values, which determines your range of valid values for the memory parameter: 256 (.25 vCPU) - Available memory values: 0.5GB, 1GB, 2GB 512 (.5 vCPU) - Available memory values: 1GB, 2GB, 3GB, 4GB 1024 (1 vCPU) - Available memory values: 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB 2048 (2 vCPU) - Available memory values: Between 4GB and 16GB in 1GB increments 4096 (4 vCPU) - Available memory values: Between 8GB and 30GB in 1GB increments This default is set in the underlying FargateTaskDefinition construct. Default: 256 + :param memory_mib: The amount (in MiB) of memory used by the task. This field is required and you must use one of the following values, which determines your range of valid values for the cpu parameter: 0.5GB, 1GB, 2GB - Available cpu values: 256 (.25 vCPU) 1GB, 2GB, 3GB, 4GB - Available cpu values: 512 (.5 vCPU) 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB - Available cpu values: 1024 (1 vCPU) Between 4GB and 16GB in 1GB increments - Available cpu values: 2048 (2 vCPU) Between 8GB and 30GB in 1GB increments - Available cpu values: 4096 (4 vCPU) This default is set in the underlying FargateTaskDefinition construct. Default: 512 + :param public_load_balancer: Determines whether the Application Load Balancer will be internet-facing. Default: true + :param public_tasks: Determines whether your Fargate Service will be assigned a public IP address. Default: false + ''' +- if __debug__: +- type_hints = typing.get_type_hints(LoadBalancedFargateServiceProps.__init__) +- check_type(argname="argument container_port", value=container_port, expected_type=type_hints["container_port"]) +- check_type(argname="argument cpu", value=cpu, expected_type=type_hints["cpu"]) +- check_type(argname="argument memory_mib", value=memory_mib, expected_type=type_hints["memory_mib"]) +- check_type(argname="argument public_load_balancer", value=public_load_balancer, expected_type=type_hints["public_load_balancer"]) +- check_type(argname="argument public_tasks", value=public_tasks, expected_type=type_hints["public_tasks"]) + self._values: typing.Dict[str, typing.Any] = {} + if container_port is not None: + self._values["container_port"] = container_port + if cpu is not None: + self._values["cpu"] = cpu +@@ -5556,14 +5133,10 @@ + '''Creates a BinaryOperation. + + :param lhs: Left-hand side operand. + :param rhs: Right-hand side operand. + ''' +- if __debug__: +- type_hints = typing.get_type_hints(Multiply.__init__) +- check_type(argname="argument lhs", value=lhs, expected_type=type_hints["lhs"]) +- check_type(argname="argument rhs", value=rhs, expected_type=type_hints["rhs"]) + jsii.create(self.__class__, self, [lhs, rhs]) + + @jsii.member(jsii_name="farewell") + def farewell(self) -> builtins.str: + '''Say farewell.''' +@@ -5611,13 +5184,10 @@ + class NestedStruct: + def __init__(self, *, number_prop: jsii.Number) -> None: + ''' + :param number_prop: When provided, must be > 0. + ''' +- if __debug__: +- type_hints = typing.get_type_hints(NestedStruct.__init__) +- check_type(argname="argument number_prop", value=number_prop, expected_type=type_hints["number_prop"]) + self._values: typing.Dict[str, typing.Any] = { + "number_prop": number_prop, + } + + @builtins.property +@@ -5688,24 +5258,17 @@ + def __init__(self, _param1: builtins.str, optional: typing.Any = None) -> None: + ''' + :param _param1: - + :param optional: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(NullShouldBeTreatedAsUndefined.__init__) +- check_type(argname="argument _param1", value=_param1, expected_type=type_hints["_param1"]) +- check_type(argname="argument optional", value=optional, expected_type=type_hints["optional"]) + jsii.create(self.__class__, self, [_param1, optional]) + + @jsii.member(jsii_name="giveMeUndefined") + def give_me_undefined(self, value: typing.Any = None) -> None: + ''' + :param value: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(NullShouldBeTreatedAsUndefined.give_me_undefined) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + return typing.cast(None, jsii.invoke(self, "giveMeUndefined", [value])) + + @jsii.member(jsii_name="giveMeUndefinedInsideAnObject") + def give_me_undefined_inside_an_object( + self, +@@ -5733,13 +5296,10 @@ + def change_me_to_undefined(self) -> typing.Optional[builtins.str]: + return typing.cast(typing.Optional[builtins.str], jsii.get(self, "changeMeToUndefined")) + + @change_me_to_undefined.setter + def change_me_to_undefined(self, value: typing.Optional[builtins.str]) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(NullShouldBeTreatedAsUndefined, "change_me_to_undefined").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "changeMeToUndefined", value) + + + @jsii.data_type( + jsii_type="jsii-calc.NullShouldBeTreatedAsUndefinedData", +@@ -5758,14 +5318,10 @@ + ) -> None: + ''' + :param array_with_three_elements_and_undefined_as_second_argument: + :param this_should_be_undefined: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(NullShouldBeTreatedAsUndefinedData.__init__) +- check_type(argname="argument array_with_three_elements_and_undefined_as_second_argument", value=array_with_three_elements_and_undefined_as_second_argument, expected_type=type_hints["array_with_three_elements_and_undefined_as_second_argument"]) +- check_type(argname="argument this_should_be_undefined", value=this_should_be_undefined, expected_type=type_hints["this_should_be_undefined"]) + self._values: typing.Dict[str, typing.Any] = { + "array_with_three_elements_and_undefined_as_second_argument": array_with_three_elements_and_undefined_as_second_argument, + } + if this_should_be_undefined is not None: + self._values["this_should_be_undefined"] = this_should_be_undefined +@@ -5800,23 +5356,17 @@ + + def __init__(self, generator: IRandomNumberGenerator) -> None: + ''' + :param generator: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(NumberGenerator.__init__) +- check_type(argname="argument generator", value=generator, expected_type=type_hints["generator"]) + jsii.create(self.__class__, self, [generator]) + + @jsii.member(jsii_name="isSameGenerator") + def is_same_generator(self, gen: IRandomNumberGenerator) -> builtins.bool: + ''' + :param gen: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(NumberGenerator.is_same_generator) +- check_type(argname="argument gen", value=gen, expected_type=type_hints["gen"]) + return typing.cast(builtins.bool, jsii.invoke(self, "isSameGenerator", [gen])) + + @jsii.member(jsii_name="nextTimes100") + def next_times100(self) -> jsii.Number: + return typing.cast(jsii.Number, jsii.invoke(self, "nextTimes100", [])) +@@ -5826,13 +5376,10 @@ + def generator(self) -> IRandomNumberGenerator: + return typing.cast(IRandomNumberGenerator, jsii.get(self, "generator")) + + @generator.setter + def generator(self, value: IRandomNumberGenerator) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(NumberGenerator, "generator").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "generator", value) + + + class ObjectRefsInCollections( + metaclass=jsii.JSIIMeta, +@@ -5850,13 +5397,10 @@ + ) -> jsii.Number: + '''Returns the sum of all values. + + :param values: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ObjectRefsInCollections.sum_from_array) +- check_type(argname="argument values", value=values, expected_type=type_hints["values"]) + return typing.cast(jsii.Number, jsii.invoke(self, "sumFromArray", [values])) + + @jsii.member(jsii_name="sumFromMap") + def sum_from_map( + self, +@@ -5864,13 +5408,10 @@ + ) -> jsii.Number: + '''Returns the sum of all values in a map. + + :param values: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ObjectRefsInCollections.sum_from_map) +- check_type(argname="argument values", value=values, expected_type=type_hints["values"]) + return typing.cast(jsii.Number, jsii.invoke(self, "sumFromMap", [values])) + + + class ObjectWithPropertyProvider( + metaclass=jsii.JSIIMeta, +@@ -5911,13 +5452,10 @@ + ): + def __init__(self, delegate: IInterfaceWithOptionalMethodArguments) -> None: + ''' + :param delegate: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(OptionalArgumentInvoker.__init__) +- check_type(argname="argument delegate", value=delegate, expected_type=type_hints["delegate"]) + jsii.create(self.__class__, self, [delegate]) + + @jsii.member(jsii_name="invokeWithOptional") + def invoke_with_optional(self) -> None: + return typing.cast(None, jsii.invoke(self, "invokeWithOptional", [])) +@@ -5940,15 +5478,10 @@ + ''' + :param arg1: - + :param arg2: - + :param arg3: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(OptionalConstructorArgument.__init__) +- check_type(argname="argument arg1", value=arg1, expected_type=type_hints["arg1"]) +- check_type(argname="argument arg2", value=arg2, expected_type=type_hints["arg2"]) +- check_type(argname="argument arg3", value=arg3, expected_type=type_hints["arg3"]) + jsii.create(self.__class__, self, [arg1, arg2, arg3]) + + @builtins.property + @jsii.member(jsii_name="arg1") + def arg1(self) -> jsii.Number: +@@ -5973,13 +5506,10 @@ + class OptionalStruct: + def __init__(self, *, field: typing.Optional[builtins.str] = None) -> None: + ''' + :param field: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(OptionalStruct.__init__) +- check_type(argname="argument field", value=field, expected_type=type_hints["field"]) + self._values: typing.Dict[str, typing.Any] = {} + if field is not None: + self._values["field"] = field + + @builtins.property +@@ -6055,13 +5585,10 @@ + def _override_read_write(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "overrideReadWrite")) + + @_override_read_write.setter + def _override_read_write(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(OverridableProtectedMember, "_override_read_write").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "overrideReadWrite", value) + + + class OverrideReturnsObject( + metaclass=jsii.JSIIMeta, +@@ -6073,13 +5600,10 @@ + @jsii.member(jsii_name="test") + def test(self, obj: IReturnsNumber) -> jsii.Number: + ''' + :param obj: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(OverrideReturnsObject.test) +- check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) + return typing.cast(jsii.Number, jsii.invoke(self, "test", [obj])) + + + @jsii.data_type( + jsii_type="jsii-calc.ParentStruct982", +@@ -6090,13 +5614,10 @@ + def __init__(self, *, foo: builtins.str) -> None: + '''https://github.com/aws/jsii/issues/982. + + :param foo: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ParentStruct982.__init__) +- check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) + self._values: typing.Dict[str, typing.Any] = { + "foo": foo, + } + + @builtins.property +@@ -6151,15 +5672,10 @@ + ''' + :param obj: - + :param dt: - + :param ev: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(PartiallyInitializedThisConsumer.consume_partially_initialized_this) +- check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) +- check_type(argname="argument dt", value=dt, expected_type=type_hints["dt"]) +- check_type(argname="argument ev", value=ev, expected_type=type_hints["ev"]) + return typing.cast(builtins.str, jsii.invoke(self, "consumePartiallyInitializedThis", [obj, dt, ev])) + + # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class + typing.cast(typing.Any, PartiallyInitializedThisConsumer).__jsii_proxy_class__ = lambda : _PartiallyInitializedThisConsumerProxy + +@@ -6171,13 +5687,10 @@ + @jsii.member(jsii_name="sayHello") + def say_hello(self, friendly: scope.jsii_calc_lib.IFriendly) -> builtins.str: + ''' + :param friendly: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(Polymorphism.say_hello) +- check_type(argname="argument friendly", value=friendly, expected_type=type_hints["friendly"]) + return typing.cast(builtins.str, jsii.invoke(self, "sayHello", [friendly])) + + + class Power( + _CompositeOperation_1c4d123b, +@@ -6194,14 +5707,10 @@ + '''Creates a Power operation. + + :param base: The base of the power. + :param pow: The number of times to multiply. + ''' +- if __debug__: +- type_hints = typing.get_type_hints(Power.__init__) +- check_type(argname="argument base", value=base, expected_type=type_hints["base"]) +- check_type(argname="argument pow", value=pow, expected_type=type_hints["pow"]) + jsii.create(self.__class__, self, [base, pow]) + + @builtins.property + @jsii.member(jsii_name="base") + def base(self) -> scope.jsii_calc_lib.NumericValue: +@@ -6405,13 +5914,10 @@ + @jsii.member(jsii_name="saveFoo") + def save_foo(self, value: scope.jsii_calc_lib.EnumFromScopedModule) -> None: + ''' + :param value: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ReferenceEnumFromScopedPackage.save_foo) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + return typing.cast(None, jsii.invoke(self, "saveFoo", [value])) + + @builtins.property + @jsii.member(jsii_name="foo") + def foo(self) -> typing.Optional[scope.jsii_calc_lib.EnumFromScopedModule]: +@@ -6420,13 +5926,10 @@ + @foo.setter + def foo( + self, + value: typing.Optional[scope.jsii_calc_lib.EnumFromScopedModule], + ) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(ReferenceEnumFromScopedPackage, "foo").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "foo", value) + + + class ReturnsPrivateImplementationOfInterface( + metaclass=jsii.JSIIMeta, +@@ -6468,14 +5971,10 @@ + :param string_prop: May not be empty. + :param nested_struct: + ''' + if isinstance(nested_struct, dict): + nested_struct = NestedStruct(**nested_struct) +- if __debug__: +- type_hints = typing.get_type_hints(RootStruct.__init__) +- check_type(argname="argument string_prop", value=string_prop, expected_type=type_hints["string_prop"]) +- check_type(argname="argument nested_struct", value=nested_struct, expected_type=type_hints["nested_struct"]) + self._values: typing.Dict[str, typing.Any] = { + "string_prop": string_prop, + } + if nested_struct is not None: + self._values["nested_struct"] = nested_struct +@@ -6542,25 +6041,17 @@ + ''' + :param arg1: - + :param arg2: - + :param arg3: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(RuntimeTypeChecking.method_with_defaulted_arguments) +- check_type(argname="argument arg1", value=arg1, expected_type=type_hints["arg1"]) +- check_type(argname="argument arg2", value=arg2, expected_type=type_hints["arg2"]) +- check_type(argname="argument arg3", value=arg3, expected_type=type_hints["arg3"]) + return typing.cast(None, jsii.invoke(self, "methodWithDefaultedArguments", [arg1, arg2, arg3])) + + @jsii.member(jsii_name="methodWithOptionalAnyArgument") + def method_with_optional_any_argument(self, arg: typing.Any = None) -> None: + ''' + :param arg: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(RuntimeTypeChecking.method_with_optional_any_argument) +- check_type(argname="argument arg", value=arg, expected_type=type_hints["arg"]) + return typing.cast(None, jsii.invoke(self, "methodWithOptionalAnyArgument", [arg])) + + @jsii.member(jsii_name="methodWithOptionalArguments") + def method_with_optional_arguments( + self, +@@ -6572,15 +6063,10 @@ + + :param arg1: - + :param arg2: - + :param arg3: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(RuntimeTypeChecking.method_with_optional_arguments) +- check_type(argname="argument arg1", value=arg1, expected_type=type_hints["arg1"]) +- check_type(argname="argument arg2", value=arg2, expected_type=type_hints["arg2"]) +- check_type(argname="argument arg3", value=arg3, expected_type=type_hints["arg3"]) + return typing.cast(None, jsii.invoke(self, "methodWithOptionalArguments", [arg1, arg2, arg3])) + + + @jsii.data_type( + jsii_type="jsii-calc.SecondLevelStruct", +@@ -6599,14 +6085,10 @@ + ) -> None: + ''' + :param deeper_required_prop: It's long and required. + :param deeper_optional_prop: It's long, but you'll almost never pass it. + ''' +- if __debug__: +- type_hints = typing.get_type_hints(SecondLevelStruct.__init__) +- check_type(argname="argument deeper_required_prop", value=deeper_required_prop, expected_type=type_hints["deeper_required_prop"]) +- check_type(argname="argument deeper_optional_prop", value=deeper_optional_prop, expected_type=type_hints["deeper_optional_prop"]) + self._values: typing.Dict[str, typing.Any] = { + "deeper_required_prop": deeper_required_prop, + } + if deeper_optional_prop is not None: + self._values["deeper_optional_prop"] = deeper_optional_prop +@@ -6668,13 +6150,10 @@ + @jsii.member(jsii_name="isSingletonInt") + def is_singleton_int(self, value: jsii.Number) -> builtins.bool: + ''' + :param value: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(SingletonInt.is_singleton_int) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + return typing.cast(builtins.bool, jsii.invoke(self, "isSingletonInt", [value])) + + + @jsii.enum(jsii_type="jsii-calc.SingletonIntEnum") + class SingletonIntEnum(enum.Enum): +@@ -6693,13 +6172,10 @@ + @jsii.member(jsii_name="isSingletonString") + def is_singleton_string(self, value: builtins.str) -> builtins.bool: + ''' + :param value: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(SingletonString.is_singleton_string) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + return typing.cast(builtins.bool, jsii.invoke(self, "isSingletonString", [value])) + + + @jsii.enum(jsii_type="jsii-calc.SingletonStringEnum") + class SingletonStringEnum(enum.Enum): +@@ -6723,14 +6199,10 @@ + ) -> None: + ''' + :param property: + :param yet_anoter_one: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(SmellyStruct.__init__) +- check_type(argname="argument property", value=property, expected_type=type_hints["property"]) +- check_type(argname="argument yet_anoter_one", value=yet_anoter_one, expected_type=type_hints["yet_anoter_one"]) + self._values: typing.Dict[str, typing.Any] = { + "property": property, + "yet_anoter_one": yet_anoter_one, + } + +@@ -6781,14 +6253,10 @@ + ) -> None: + ''' + :param readonly_string: - + :param mutable_number: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(StableClass.__init__) +- check_type(argname="argument readonly_string", value=readonly_string, expected_type=type_hints["readonly_string"]) +- check_type(argname="argument mutable_number", value=mutable_number, expected_type=type_hints["mutable_number"]) + jsii.create(self.__class__, self, [readonly_string, mutable_number]) + + @jsii.member(jsii_name="method") + def method(self) -> None: + return typing.cast(None, jsii.invoke(self, "method", [])) +@@ -6803,13 +6271,10 @@ + def mutable_property(self) -> typing.Optional[jsii.Number]: + return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "mutableProperty")) + + @mutable_property.setter + def mutable_property(self, value: typing.Optional[jsii.Number]) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(StableClass, "mutable_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "mutableProperty", value) + + + @jsii.enum(jsii_type="jsii-calc.StableEnum") + class StableEnum(enum.Enum): +@@ -6825,13 +6290,10 @@ + class StableStruct: + def __init__(self, *, readonly_property: builtins.str) -> None: + ''' + :param readonly_property: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(StableStruct.__init__) +- check_type(argname="argument readonly_property", value=readonly_property, expected_type=type_hints["readonly_property"]) + self._values: typing.Dict[str, typing.Any] = { + "readonly_property": readonly_property, + } + + @builtins.property +@@ -6868,13 +6330,10 @@ + def static_variable(cls) -> builtins.bool: # pyright: ignore [reportGeneralTypeIssues] + return typing.cast(builtins.bool, jsii.sget(cls, "staticVariable")) + + @static_variable.setter # type: ignore[no-redef] + def static_variable(cls, value: builtins.bool) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(StaticContext, "static_variable").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.sset(cls, "staticVariable", value) + + + class StaticHelloParent( + metaclass=jsii.JSIIMeta, +@@ -6904,25 +6363,19 @@ + class Statics(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Statics"): + def __init__(self, value: builtins.str) -> None: + ''' + :param value: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(Statics.__init__) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.create(self.__class__, self, [value]) + + @jsii.member(jsii_name="staticMethod") + @builtins.classmethod + def static_method(cls, name: builtins.str) -> builtins.str: + '''Jsdocs for static method. + + :param name: The name of the person to say hello to. + ''' +- if __debug__: +- type_hints = typing.get_type_hints(Statics.static_method) +- check_type(argname="argument name", value=name, expected_type=type_hints["name"]) + return typing.cast(builtins.str, jsii.sinvoke(cls, "staticMethod", [name])) + + @jsii.member(jsii_name="justMethod") + def just_method(self) -> builtins.str: + return typing.cast(builtins.str, jsii.invoke(self, "justMethod", [])) +@@ -6959,25 +6412,19 @@ + ''' + return typing.cast("Statics", jsii.sget(cls, "instance")) + + @instance.setter # type: ignore[no-redef] + def instance(cls, value: "Statics") -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(Statics, "instance").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.sset(cls, "instance", value) + + @jsii.python.classproperty + @jsii.member(jsii_name="nonConstStatic") + def non_const_static(cls) -> jsii.Number: # pyright: ignore [reportGeneralTypeIssues] + return typing.cast(jsii.Number, jsii.sget(cls, "nonConstStatic")) + + @non_const_static.setter # type: ignore[no-redef] + def non_const_static(cls, value: jsii.Number) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(Statics, "non_const_static").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.sset(cls, "nonConstStatic", value) + + @builtins.property + @jsii.member(jsii_name="value") + def value(self) -> builtins.str: +@@ -7000,13 +6447,10 @@ + def you_see_me(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "youSeeMe")) + + @you_see_me.setter + def you_see_me(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(StripInternal, "you_see_me").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "youSeeMe", value) + + + @jsii.data_type( + jsii_type="jsii-calc.StructA", +@@ -7029,15 +6473,10 @@ + + :param required_string: + :param optional_number: + :param optional_string: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(StructA.__init__) +- check_type(argname="argument required_string", value=required_string, expected_type=type_hints["required_string"]) +- check_type(argname="argument optional_number", value=optional_number, expected_type=type_hints["optional_number"]) +- check_type(argname="argument optional_string", value=optional_string, expected_type=type_hints["optional_string"]) + self._values: typing.Dict[str, typing.Any] = { + "required_string": required_string, + } + if optional_number is not None: + self._values["optional_number"] = optional_number +@@ -7095,15 +6534,10 @@ + :param optional_boolean: + :param optional_struct_a: + ''' + if isinstance(optional_struct_a, dict): + optional_struct_a = StructA(**optional_struct_a) +- if __debug__: +- type_hints = typing.get_type_hints(StructB.__init__) +- check_type(argname="argument required_string", value=required_string, expected_type=type_hints["required_string"]) +- check_type(argname="argument optional_boolean", value=optional_boolean, expected_type=type_hints["optional_boolean"]) +- check_type(argname="argument optional_struct_a", value=optional_struct_a, expected_type=type_hints["optional_struct_a"]) + self._values: typing.Dict[str, typing.Any] = { + "required_string": required_string, + } + if optional_boolean is not None: + self._values["optional_boolean"] = optional_boolean +@@ -7155,14 +6589,10 @@ + See: https://github.com/aws/aws-cdk/issues/4302 + + :param scope: + :param props: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(StructParameterType.__init__) +- check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"]) +- check_type(argname="argument props", value=props, expected_type=type_hints["props"]) + self._values: typing.Dict[str, typing.Any] = { + "scope": scope, + } + if props is not None: + self._values["props"] = props +@@ -7205,14 +6635,10 @@ + ) -> jsii.Number: + ''' + :param _positional: - + :param inputs: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(StructPassing.how_many_var_args_did_i_pass) +- check_type(argname="argument _positional", value=_positional, expected_type=type_hints["_positional"]) +- check_type(argname="argument inputs", value=inputs, expected_type=typing.Tuple[type_hints["inputs"], ...]) # pyright: ignore [reportGeneralTypeIssues] + return typing.cast(jsii.Number, jsii.sinvoke(cls, "howManyVarArgsDidIPass", [_positional, *inputs])) + + @jsii.member(jsii_name="roundTrip") + @builtins.classmethod + def round_trip( +@@ -7227,13 +6653,10 @@ + :param _positional: - + :param required: This is a required field. + :param second_level: A union to really stress test our serialization. + :param optional: You don't have to pass this. + ''' +- if __debug__: +- type_hints = typing.get_type_hints(StructPassing.round_trip) +- check_type(argname="argument _positional", value=_positional, expected_type=type_hints["_positional"]) + input = TopLevelStruct( + required=required, second_level=second_level, optional=optional + ) + + return typing.cast("TopLevelStruct", jsii.sinvoke(cls, "roundTrip", [_positional, input])) +@@ -7250,13 +6673,10 @@ + struct: typing.Union[typing.Union[StructA, typing.Dict[str, typing.Any]], typing.Union[StructB, typing.Dict[str, typing.Any]]], + ) -> builtins.bool: + ''' + :param struct: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(StructUnionConsumer.is_struct_a) +- check_type(argname="argument struct", value=struct, expected_type=type_hints["struct"]) + return typing.cast(builtins.bool, jsii.sinvoke(cls, "isStructA", [struct])) + + @jsii.member(jsii_name="isStructB") + @builtins.classmethod + def is_struct_b( +@@ -7264,24 +6684,18 @@ + struct: typing.Union[typing.Union[StructA, typing.Dict[str, typing.Any]], typing.Union[StructB, typing.Dict[str, typing.Any]]], + ) -> builtins.bool: + ''' + :param struct: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(StructUnionConsumer.is_struct_b) +- check_type(argname="argument struct", value=struct, expected_type=type_hints["struct"]) + return typing.cast(builtins.bool, jsii.sinvoke(cls, "isStructB", [struct])) + + @jsii.member(jsii_name="provideStruct") + @builtins.classmethod + def provide_struct(cls, which: builtins.str) -> typing.Union[StructA, StructB]: + ''' + :param which: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(StructUnionConsumer.provide_struct) +- check_type(argname="argument which", value=which, expected_type=type_hints["which"]) + return typing.cast(typing.Union[StructA, StructB], jsii.sinvoke(cls, "provideStruct", [which])) + + + @jsii.data_type( + jsii_type="jsii-calc.StructWithCollectionOfUnionts", +@@ -7295,13 +6709,10 @@ + union_property: typing.Sequence[typing.Mapping[builtins.str, typing.Union[typing.Union[StructA, typing.Dict[str, typing.Any]], typing.Union[StructB, typing.Dict[str, typing.Any]]]]], + ) -> None: + ''' + :param union_property: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(StructWithCollectionOfUnionts.__init__) +- check_type(argname="argument union_property", value=union_property, expected_type=type_hints["union_property"]) + self._values: typing.Dict[str, typing.Any] = { + "union_property": union_property, + } + + @builtins.property +@@ -7338,14 +6749,10 @@ + ) -> None: + ''' + :param foo: An enum value. + :param bar: Optional enum value (of type integer). Default: AllTypesEnum.YOUR_ENUM_VALUE + ''' +- if __debug__: +- type_hints = typing.get_type_hints(StructWithEnum.__init__) +- check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) +- check_type(argname="argument bar", value=bar, expected_type=type_hints["bar"]) + self._values: typing.Dict[str, typing.Any] = { + "foo": foo, + } + if bar is not None: + self._values["bar"] = bar +@@ -7401,16 +6808,10 @@ + :param default: + :param assert_: + :param result: + :param that: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(StructWithJavaReservedWords.__init__) +- check_type(argname="argument default", value=default, expected_type=type_hints["default"]) +- check_type(argname="argument assert_", value=assert_, expected_type=type_hints["assert_"]) +- check_type(argname="argument result", value=result, expected_type=type_hints["result"]) +- check_type(argname="argument that", value=that, expected_type=type_hints["that"]) + self._values: typing.Dict[str, typing.Any] = { + "default": default, + } + if assert_ is not None: + self._values["assert_"] = assert_ +@@ -7477,13 +6878,10 @@ + '''The parts to sum.''' + return typing.cast(typing.List[scope.jsii_calc_lib.NumericValue], jsii.get(self, "parts")) + + @parts.setter + def parts(self, value: typing.List[scope.jsii_calc_lib.NumericValue]) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(Sum, "parts").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "parts", value) + + + @jsii.data_type( + jsii_type="jsii-calc.SupportsNiceJavaBuilderProps", +@@ -7499,14 +6897,10 @@ + ) -> None: + ''' + :param bar: Some number, like 42. + :param id: An \`\`id\`\` field here is terrible API design, because the constructor of \`\`SupportsNiceJavaBuilder\`\` already has a parameter named \`\`id\`\`. But here we are, doing it like we didn't care. + ''' +- if __debug__: +- type_hints = typing.get_type_hints(SupportsNiceJavaBuilderProps.__init__) +- check_type(argname="argument bar", value=bar, expected_type=type_hints["bar"]) +- check_type(argname="argument id", value=id, expected_type=type_hints["id"]) + self._values: typing.Dict[str, typing.Any] = { + "bar": bar, + } + if id is not None: + self._values["id"] = id +@@ -7555,13 +6949,10 @@ + ''' + :param id_: some identifier of your choice. + :param bar: Some number, like 42. + :param id: An \`\`id\`\` field here is terrible API design, because the constructor of \`\`SupportsNiceJavaBuilder\`\` already has a parameter named \`\`id\`\`. But here we are, doing it like we didn't care. + ''' +- if __debug__: +- type_hints = typing.get_type_hints(SupportsNiceJavaBuilderWithRequiredProps.__init__) +- check_type(argname="argument id_", value=id_, expected_type=type_hints["id_"]) + props = SupportsNiceJavaBuilderProps(bar=bar, id=id) + + jsii.create(self.__class__, self, [id_, props]) + + @builtins.property +@@ -7599,23 +6990,17 @@ + @jsii.member(jsii_name="modifyOtherProperty") + def modify_other_property(self, value: builtins.str) -> None: + ''' + :param value: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(SyncVirtualMethods.modify_other_property) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + return typing.cast(None, jsii.invoke(self, "modifyOtherProperty", [value])) + + @jsii.member(jsii_name="modifyValueOfTheProperty") + def modify_value_of_the_property(self, value: builtins.str) -> None: + ''' + :param value: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(SyncVirtualMethods.modify_value_of_the_property) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + return typing.cast(None, jsii.invoke(self, "modifyValueOfTheProperty", [value])) + + @jsii.member(jsii_name="readA") + def read_a(self) -> jsii.Number: + return typing.cast(jsii.Number, jsii.invoke(self, "readA", [])) +@@ -7635,23 +7020,17 @@ + @jsii.member(jsii_name="virtualMethod") + def virtual_method(self, n: jsii.Number) -> jsii.Number: + ''' + :param n: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(SyncVirtualMethods.virtual_method) +- check_type(argname="argument n", value=n, expected_type=type_hints["n"]) + return typing.cast(jsii.Number, jsii.invoke(self, "virtualMethod", [n])) + + @jsii.member(jsii_name="writeA") + def write_a(self, value: jsii.Number) -> None: + ''' + :param value: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(SyncVirtualMethods.write_a) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + return typing.cast(None, jsii.invoke(self, "writeA", [value])) + + @builtins.property + @jsii.member(jsii_name="readonlyProperty") + def readonly_property(self) -> builtins.str: +@@ -7662,61 +7041,46 @@ + def a(self) -> jsii.Number: + return typing.cast(jsii.Number, jsii.get(self, "a")) + + @a.setter + def a(self, value: jsii.Number) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(SyncVirtualMethods, "a").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "a", value) + + @builtins.property + @jsii.member(jsii_name="callerIsProperty") + def caller_is_property(self) -> jsii.Number: + return typing.cast(jsii.Number, jsii.get(self, "callerIsProperty")) + + @caller_is_property.setter + def caller_is_property(self, value: jsii.Number) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(SyncVirtualMethods, "caller_is_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "callerIsProperty", value) + + @builtins.property + @jsii.member(jsii_name="otherProperty") + def other_property(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "otherProperty")) + + @other_property.setter + def other_property(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(SyncVirtualMethods, "other_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "otherProperty", value) + + @builtins.property + @jsii.member(jsii_name="theProperty") + def the_property(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "theProperty")) + + @the_property.setter + def the_property(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(SyncVirtualMethods, "the_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "theProperty", value) + + @builtins.property + @jsii.member(jsii_name="valueOfOtherProperty") + def value_of_other_property(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "valueOfOtherProperty")) + + @value_of_other_property.setter + def value_of_other_property(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(SyncVirtualMethods, "value_of_other_property").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "valueOfOtherProperty", value) + + + class TestStructWithEnum( + metaclass=jsii.JSIIMeta, +@@ -7799,15 +7163,10 @@ + ''' + :param required: This is a required field. + :param second_level: A union to really stress test our serialization. + :param optional: You don't have to pass this. + ''' +- if __debug__: +- type_hints = typing.get_type_hints(TopLevelStruct.__init__) +- check_type(argname="argument required", value=required, expected_type=type_hints["required"]) +- check_type(argname="argument second_level", value=second_level, expected_type=type_hints["second_level"]) +- check_type(argname="argument optional", value=optional, expected_type=type_hints["optional"]) + self._values: typing.Dict[str, typing.Any] = { + "required": required, + "second_level": second_level, + } + if optional is not None: +@@ -7898,13 +7257,10 @@ + + def __init__(self, operand: scope.jsii_calc_lib.NumericValue) -> None: + ''' + :param operand: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(UnaryOperation.__init__) +- check_type(argname="argument operand", value=operand, expected_type=type_hints["operand"]) + jsii.create(self.__class__, self, [operand]) + + @builtins.property + @jsii.member(jsii_name="operand") + def operand(self) -> scope.jsii_calc_lib.NumericValue: +@@ -7935,14 +7291,10 @@ + ) -> None: + ''' + :param bar: + :param foo: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(UnionProperties.__init__) +- check_type(argname="argument bar", value=bar, expected_type=type_hints["bar"]) +- check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) + self._values: typing.Dict[str, typing.Any] = { + "bar": bar, + } + if foo is not None: + self._values["foo"] = foo +@@ -7979,13 +7331,10 @@ + + def __init__(self, delegate: typing.Mapping[builtins.str, typing.Any]) -> None: + ''' + :param delegate: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(UpcasingReflectable.__init__) +- check_type(argname="argument delegate", value=delegate, expected_type=type_hints["delegate"]) + jsii.create(self.__class__, self, [delegate]) + + @jsii.python.classproperty + @jsii.member(jsii_name="reflector") + def REFLECTOR(cls) -> scope.jsii_calc_lib.custom_submodule_name.Reflector: +@@ -8028,13 +7377,10 @@ + ): + def __init__(self, obj: IInterfaceWithProperties) -> None: + ''' + :param obj: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(UsesInterfaceWithProperties.__init__) +- check_type(argname="argument obj", value=obj, expected_type=type_hints["obj"]) + jsii.create(self.__class__, self, [obj]) + + @jsii.member(jsii_name="justRead") + def just_read(self) -> builtins.str: + return typing.cast(builtins.str, jsii.invoke(self, "justRead", [])) +@@ -8045,23 +7391,17 @@ + ext: IInterfaceWithPropertiesExtension, + ) -> builtins.str: + ''' + :param ext: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(UsesInterfaceWithProperties.read_string_and_number) +- check_type(argname="argument ext", value=ext, expected_type=type_hints["ext"]) + return typing.cast(builtins.str, jsii.invoke(self, "readStringAndNumber", [ext])) + + @jsii.member(jsii_name="writeAndRead") + def write_and_read(self, value: builtins.str) -> builtins.str: + ''' + :param value: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(UsesInterfaceWithProperties.write_and_read) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + return typing.cast(builtins.str, jsii.invoke(self, "writeAndRead", [value])) + + @builtins.property + @jsii.member(jsii_name="obj") + def obj(self) -> IInterfaceWithProperties: +@@ -8071,34 +7411,25 @@ + class VariadicInvoker(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.VariadicInvoker"): + def __init__(self, method: "VariadicMethod") -> None: + ''' + :param method: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(VariadicInvoker.__init__) +- check_type(argname="argument method", value=method, expected_type=type_hints["method"]) + jsii.create(self.__class__, self, [method]) + + @jsii.member(jsii_name="asArray") + def as_array(self, *values: jsii.Number) -> typing.List[jsii.Number]: + ''' + :param values: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(VariadicInvoker.as_array) +- check_type(argname="argument values", value=values, expected_type=typing.Tuple[type_hints["values"], ...]) # pyright: ignore [reportGeneralTypeIssues] + return typing.cast(typing.List[jsii.Number], jsii.invoke(self, "asArray", [*values])) + + + class VariadicMethod(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.VariadicMethod"): + def __init__(self, *prefix: jsii.Number) -> None: + ''' + :param prefix: a prefix that will be use for all values returned by \`\`#asArray\`\`. + ''' +- if __debug__: +- type_hints = typing.get_type_hints(VariadicMethod.__init__) +- check_type(argname="argument prefix", value=prefix, expected_type=typing.Tuple[type_hints["prefix"], ...]) # pyright: ignore [reportGeneralTypeIssues] + jsii.create(self.__class__, self, [*prefix]) + + @jsii.member(jsii_name="asArray") + def as_array( + self, +@@ -8107,14 +7438,10 @@ + ) -> typing.List[jsii.Number]: + ''' + :param first: the first element of the array to be returned (after the \`\`prefix\`\` provided at construction time). + :param others: other elements to be included in the array. + ''' +- if __debug__: +- type_hints = typing.get_type_hints(VariadicMethod.as_array) +- check_type(argname="argument first", value=first, expected_type=type_hints["first"]) +- check_type(argname="argument others", value=others, expected_type=typing.Tuple[type_hints["others"], ...]) # pyright: ignore [reportGeneralTypeIssues] + return typing.cast(typing.List[jsii.Number], jsii.invoke(self, "asArray", [first, *others])) + + + class VirtualMethodPlayground( + metaclass=jsii.JSIIMeta, +@@ -8126,53 +7453,38 @@ + @jsii.member(jsii_name="overrideMeAsync") + def override_me_async(self, index: jsii.Number) -> jsii.Number: + ''' + :param index: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(VirtualMethodPlayground.override_me_async) +- check_type(argname="argument index", value=index, expected_type=type_hints["index"]) + return typing.cast(jsii.Number, jsii.ainvoke(self, "overrideMeAsync", [index])) + + @jsii.member(jsii_name="overrideMeSync") + def override_me_sync(self, index: jsii.Number) -> jsii.Number: + ''' + :param index: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(VirtualMethodPlayground.override_me_sync) +- check_type(argname="argument index", value=index, expected_type=type_hints["index"]) + return typing.cast(jsii.Number, jsii.invoke(self, "overrideMeSync", [index])) + + @jsii.member(jsii_name="parallelSumAsync") + def parallel_sum_async(self, count: jsii.Number) -> jsii.Number: + ''' + :param count: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(VirtualMethodPlayground.parallel_sum_async) +- check_type(argname="argument count", value=count, expected_type=type_hints["count"]) + return typing.cast(jsii.Number, jsii.ainvoke(self, "parallelSumAsync", [count])) + + @jsii.member(jsii_name="serialSumAsync") + def serial_sum_async(self, count: jsii.Number) -> jsii.Number: + ''' + :param count: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(VirtualMethodPlayground.serial_sum_async) +- check_type(argname="argument count", value=count, expected_type=type_hints["count"]) + return typing.cast(jsii.Number, jsii.ainvoke(self, "serialSumAsync", [count])) + + @jsii.member(jsii_name="sumSync") + def sum_sync(self, count: jsii.Number) -> jsii.Number: + ''' + :param count: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(VirtualMethodPlayground.sum_sync) +- check_type(argname="argument count", value=count, expected_type=type_hints["count"]) + return typing.cast(jsii.Number, jsii.invoke(self, "sumSync", [count])) + + + class VoidCallback( + metaclass=jsii.JSIIAbstractClass, +@@ -8220,13 +7532,10 @@ + + def __init__(self, private_field: typing.Optional[builtins.str] = None) -> None: + ''' + :param private_field: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(WithPrivatePropertyInConstructor.__init__) +- check_type(argname="argument private_field", value=private_field, expected_type=type_hints["private_field"]) + jsii.create(self.__class__, self, [private_field]) + + @builtins.property + @jsii.member(jsii_name="success") + def success(self) -> builtins.bool: +@@ -8267,13 +7576,10 @@ + @jsii.member(jsii_name="abstractMethod") + def abstract_method(self, name: builtins.str) -> builtins.str: + ''' + :param name: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(AbstractClass.abstract_method) +- check_type(argname="argument name", value=name, expected_type=type_hints["name"]) + return typing.cast(builtins.str, jsii.invoke(self, "abstractMethod", [name])) + + # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class + typing.cast(typing.Any, AbstractClass).__jsii_proxy_class__ = lambda : _AbstractClassProxy + +@@ -8289,14 +7595,10 @@ + '''Creates a BinaryOperation. + + :param lhs: Left-hand side operand. + :param rhs: Right-hand side operand. + ''' +- if __debug__: +- type_hints = typing.get_type_hints(Add.__init__) +- check_type(argname="argument lhs", value=lhs, expected_type=type_hints["lhs"]) +- check_type(argname="argument rhs", value=rhs, expected_type=type_hints["rhs"]) + jsii.create(self.__class__, self, [lhs, rhs]) + + @jsii.member(jsii_name="toString") + def to_string(self) -> builtins.str: + '''String representation of the value.''' +@@ -8340,13 +7642,10 @@ + def rung(self) -> builtins.bool: + return typing.cast(builtins.bool, jsii.get(self, "rung")) + + @rung.setter + def rung(self, value: builtins.bool) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(Bell, "rung").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "rung", value) + + + @jsii.data_type( + jsii_type="jsii-calc.ChildStruct982", +@@ -8357,14 +7656,10 @@ + def __init__(self, *, foo: builtins.str, bar: jsii.Number) -> None: + ''' + :param foo: + :param bar: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ChildStruct982.__init__) +- check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) +- check_type(argname="argument bar", value=bar, expected_type=type_hints["bar"]) + self._values: typing.Dict[str, typing.Any] = { + "foo": foo, + "bar": bar, + } + +@@ -8405,49 +7700,37 @@ + def a(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "a")) + + @a.setter + def a(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(ClassThatImplementsTheInternalInterface, "a").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "a", value) + + @builtins.property + @jsii.member(jsii_name="b") + def b(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "b")) + + @b.setter + def b(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(ClassThatImplementsTheInternalInterface, "b").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "b", value) + + @builtins.property + @jsii.member(jsii_name="c") + def c(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "c")) + + @c.setter + def c(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(ClassThatImplementsTheInternalInterface, "c").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "c", value) + + @builtins.property + @jsii.member(jsii_name="d") + def d(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "d")) + + @d.setter + def d(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(ClassThatImplementsTheInternalInterface, "d").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "d", value) + + + @jsii.implements(INonInternalInterface) + class ClassThatImplementsThePrivateInterface( +@@ -8462,49 +7745,37 @@ + def a(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "a")) + + @a.setter + def a(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(ClassThatImplementsThePrivateInterface, "a").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "a", value) + + @builtins.property + @jsii.member(jsii_name="b") + def b(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "b")) + + @b.setter + def b(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(ClassThatImplementsThePrivateInterface, "b").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "b", value) + + @builtins.property + @jsii.member(jsii_name="c") + def c(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "c")) + + @c.setter + def c(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(ClassThatImplementsThePrivateInterface, "c").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "c", value) + + @builtins.property + @jsii.member(jsii_name="e") + def e(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "e")) + + @e.setter + def e(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(ClassThatImplementsThePrivateInterface, "e").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "e", value) + + + @jsii.implements(IInterfaceWithProperties) + class ClassWithPrivateConstructorAndAutomaticProperties( +@@ -8522,14 +7793,10 @@ + ) -> "ClassWithPrivateConstructorAndAutomaticProperties": + ''' + :param read_only_string: - + :param read_write_string: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ClassWithPrivateConstructorAndAutomaticProperties.create) +- check_type(argname="argument read_only_string", value=read_only_string, expected_type=type_hints["read_only_string"]) +- check_type(argname="argument read_write_string", value=read_write_string, expected_type=type_hints["read_write_string"]) + return typing.cast("ClassWithPrivateConstructorAndAutomaticProperties", jsii.sinvoke(cls, "create", [read_only_string, read_write_string])) + + @builtins.property + @jsii.member(jsii_name="readOnlyString") + def read_only_string(self) -> builtins.str: +@@ -8540,13 +7807,10 @@ + def read_write_string(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "readWriteString")) + + @read_write_string.setter + def read_write_string(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(ClassWithPrivateConstructorAndAutomaticProperties, "read_write_string").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "readWriteString", value) + + + @jsii.implements(IIndirectlyImplemented) + class FullCombo(BaseClass, metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.FullCombo"): +@@ -8661,13 +7925,10 @@ + ): + def __init__(self, property: builtins.str) -> None: + ''' + :param property: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(JSII417Derived.__init__) +- check_type(argname="argument property", value=property, expected_type=type_hints["property"]) + jsii.create(self.__class__, self, [property]) + + @jsii.member(jsii_name="bar") + def bar(self) -> None: + return typing.cast(None, jsii.invoke(self, "bar", [])) +@@ -8688,13 +7949,10 @@ + + def __init__(self, operand: scope.jsii_calc_lib.NumericValue) -> None: + ''' + :param operand: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(Negate.__init__) +- check_type(argname="argument operand", value=operand, expected_type=type_hints["operand"]) + jsii.create(self.__class__, self, [operand]) + + @jsii.member(jsii_name="farewell") + def farewell(self) -> builtins.str: + '''Say farewell.''' +@@ -8754,16 +8012,10 @@ + :param id: some identifier. + :param default_bar: the default value of \`\`bar\`\`. + :param props: some props once can provide. + :param rest: a variadic continuation. + ''' +- if __debug__: +- type_hints = typing.get_type_hints(SupportsNiceJavaBuilder.__init__) +- check_type(argname="argument id", value=id, expected_type=type_hints["id"]) +- check_type(argname="argument default_bar", value=default_bar, expected_type=type_hints["default_bar"]) +- check_type(argname="argument props", value=props, expected_type=type_hints["props"]) +- check_type(argname="argument rest", value=rest, expected_type=typing.Tuple[type_hints["rest"], ...]) # pyright: ignore [reportGeneralTypeIssues] + jsii.create(self.__class__, self, [id, default_bar, props, *rest]) + + @builtins.property + @jsii.member(jsii_name="id") + def id(self) -> jsii.Number: +`; + +exports[`Generated code for "jsii-calc": /python/src/jsii_calc/anonymous/__init__.py.diff 1`] = ` +--- python/src/jsii_calc/anonymous/__init__.py --runtime-type-checking ++++ python/src/jsii_calc/anonymous/__init__.py --no-runtime-type-checking +@@ -54,35 +54,26 @@ + @builtins.classmethod + def consume(cls, option: typing.Union[IOptionA, IOptionB]) -> builtins.str: + ''' + :param option: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(UseOptions.consume) +- check_type(argname="argument option", value=option, expected_type=type_hints["option"]) + return typing.cast(builtins.str, jsii.sinvoke(cls, "consume", [option])) + + @jsii.member(jsii_name="privideAsAny") + @builtins.classmethod + def privide_as_any(cls, which: builtins.str) -> typing.Any: + ''' + :param which: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(UseOptions.privide_as_any) +- check_type(argname="argument which", value=which, expected_type=type_hints["which"]) + return typing.cast(typing.Any, jsii.sinvoke(cls, "privideAsAny", [which])) + + @jsii.member(jsii_name="provide") + @builtins.classmethod + def provide(cls, which: builtins.str) -> typing.Union[IOptionA, IOptionB]: + ''' + :param which: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(UseOptions.provide) +- check_type(argname="argument which", value=which, expected_type=type_hints["which"]) + return typing.cast(typing.Union[IOptionA, IOptionB], jsii.sinvoke(cls, "provide", [which])) + + + __all__ = [ + "IOptionA", +`; + +exports[`Generated code for "jsii-calc": /python/src/jsii_calc/cdk16625/__init__.py.diff 1`] = ` +--- python/src/jsii_calc/cdk16625/__init__.py --runtime-type-checking ++++ python/src/jsii_calc/cdk16625/__init__.py --no-runtime-type-checking +@@ -42,13 +42,10 @@ + def _unwrap(self, gen: _IRandomNumberGenerator_9643a8b9) -> jsii.Number: + '''Implement this functin to return \`\`gen.next()\`\`. It is extremely important that the \`\`donotimport\`\` submodule is NEVER explicitly loaded in the testing application (otherwise this test is void). + + :param gen: a VERY pseudo random number generator. + ''' +- if __debug__: +- type_hints = typing.get_type_hints(Cdk16625._unwrap) +- check_type(argname="argument gen", value=gen, expected_type=type_hints["gen"]) + return typing.cast(jsii.Number, jsii.invoke(self, "unwrap", [gen])) + + # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class + typing.cast(typing.Any, Cdk16625).__jsii_proxy_class__ = lambda : _Cdk16625Proxy +`; + +exports[`Generated code for "jsii-calc": /python/src/jsii_calc/cdk16625/donotimport/__init__.py.diff 1`] = ` +--- python/src/jsii_calc/cdk16625/donotimport/__init__.py --runtime-type-checking ++++ python/src/jsii_calc/cdk16625/donotimport/__init__.py --no-runtime-type-checking +@@ -31,13 +31,10 @@ + + def __init__(self, value: jsii.Number) -> None: + ''' + :param value: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(UnimportedSubmoduleType.__init__) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.create(self.__class__, self, [value]) + + @jsii.member(jsii_name="next") + def next(self) -> jsii.Number: + '''Not quite random, but it'll do. +`; + +exports[`Generated code for "jsii-calc": /python/src/jsii_calc/composition/__init__.py.diff 1`] = ` +--- python/src/jsii_calc/composition/__init__.py --runtime-type-checking ++++ python/src/jsii_calc/composition/__init__.py --no-runtime-type-checking +@@ -52,39 +52,30 @@ + '''A set of postfixes to include in a decorated .toString().''' + return typing.cast(typing.List[builtins.str], jsii.get(self, "decorationPostfixes")) + + @decoration_postfixes.setter + def decoration_postfixes(self, value: typing.List[builtins.str]) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(CompositeOperation, "decoration_postfixes").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "decorationPostfixes", value) + + @builtins.property + @jsii.member(jsii_name="decorationPrefixes") + def decoration_prefixes(self) -> typing.List[builtins.str]: + '''A set of prefixes to include in a decorated .toString().''' + return typing.cast(typing.List[builtins.str], jsii.get(self, "decorationPrefixes")) + + @decoration_prefixes.setter + def decoration_prefixes(self, value: typing.List[builtins.str]) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(CompositeOperation, "decoration_prefixes").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "decorationPrefixes", value) + + @builtins.property + @jsii.member(jsii_name="stringStyle") + def string_style(self) -> "CompositeOperation.CompositionStringStyle": + '''The .toString() style.''' + return typing.cast("CompositeOperation.CompositionStringStyle", jsii.get(self, "stringStyle")) + + @string_style.setter + def string_style(self, value: "CompositeOperation.CompositionStringStyle") -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(CompositeOperation, "string_style").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "stringStyle", value) + + @jsii.enum( + jsii_type="jsii-calc.composition.CompositeOperation.CompositionStringStyle" + ) +`; + +exports[`Generated code for "jsii-calc": /python/src/jsii_calc/derived_class_has_no_properties/__init__.py.diff 1`] = ` +--- python/src/jsii_calc/derived_class_has_no_properties/__init__.py --runtime-type-checking ++++ python/src/jsii_calc/derived_class_has_no_properties/__init__.py --no-runtime-type-checking +@@ -25,13 +25,10 @@ + def prop(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "prop")) + + @prop.setter + def prop(self, value: builtins.str) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(Base, "prop").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "prop", value) + + + class Derived( + Base, +`; + +exports[`Generated code for "jsii-calc": /python/src/jsii_calc/interface_in_namespace_includes_classes/__init__.py.diff 1`] = ` +--- python/src/jsii_calc/interface_in_namespace_includes_classes/__init__.py --runtime-type-checking ++++ python/src/jsii_calc/interface_in_namespace_includes_classes/__init__.py --no-runtime-type-checking +@@ -25,13 +25,10 @@ + def bar(self) -> typing.Optional[builtins.str]: + return typing.cast(typing.Optional[builtins.str], jsii.get(self, "bar")) + + @bar.setter + def bar(self, value: typing.Optional[builtins.str]) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(Foo, "bar").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "bar", value) + + + @jsii.data_type( + jsii_type="jsii-calc.InterfaceInNamespaceIncludesClasses.Hello", +@@ -41,13 +38,10 @@ + class Hello: + def __init__(self, *, foo: jsii.Number) -> None: + ''' + :param foo: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(Hello.__init__) +- check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) + self._values: typing.Dict[str, typing.Any] = { + "foo": foo, + } + + @builtins.property +`; + +exports[`Generated code for "jsii-calc": /python/src/jsii_calc/interface_in_namespace_only_interface/__init__.py.diff 1`] = ` +--- python/src/jsii_calc/interface_in_namespace_only_interface/__init__.py --runtime-type-checking ++++ python/src/jsii_calc/interface_in_namespace_only_interface/__init__.py --no-runtime-type-checking +@@ -21,13 +21,10 @@ + class Hello: + def __init__(self, *, foo: jsii.Number) -> None: + ''' + :param foo: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(Hello.__init__) +- check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) + self._values: typing.Dict[str, typing.Any] = { + "foo": foo, + } + + @builtins.property +`; + +exports[`Generated code for "jsii-calc": /python/src/jsii_calc/jsii3656/__init__.py.diff 1`] = ` +--- python/src/jsii_calc/jsii3656/__init__.py --runtime-type-checking ++++ python/src/jsii_calc/jsii3656/__init__.py --no-runtime-type-checking +@@ -27,14 +27,10 @@ + ) -> None: + ''' + :param name: + :param count: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ImplementMeOpts.__init__) +- check_type(argname="argument name", value=name, expected_type=type_hints["name"]) +- check_type(argname="argument count", value=count, expected_type=type_hints["count"]) + self._values: typing.Dict[str, typing.Any] = { + "name": name, + } + if count is not None: + self._values["count"] = count +@@ -73,13 +69,10 @@ + @builtins.classmethod + def call_abstract(cls, receiver: "OverrideMe") -> builtins.bool: + ''' + :param receiver: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(OverrideMe.call_abstract) +- check_type(argname="argument receiver", value=receiver, expected_type=type_hints["receiver"]) + return typing.cast(builtins.bool, jsii.sinvoke(cls, "callAbstract", [receiver])) + + @jsii.member(jsii_name="implementMe") + @abc.abstractmethod + def implement_me( +`; + +exports[`Generated code for "jsii-calc": /python/src/jsii_calc/module2530/__init__.py.diff 1`] = ` +--- python/src/jsii_calc/module2530/__init__.py --runtime-type-checking ++++ python/src/jsii_calc/module2530/__init__.py --no-runtime-type-checking +@@ -21,34 +21,25 @@ + + def __init__(self, _: jsii.Number) -> None: + ''' + :param _: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(MyClass.__init__) +- check_type(argname="argument _", value=_, expected_type=type_hints["_"]) + jsii.create(self.__class__, self, [_]) + + @jsii.member(jsii_name="bar") + @builtins.classmethod + def bar(cls, _: builtins.bool) -> None: + ''' + :param _: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(MyClass.bar) +- check_type(argname="argument _", value=_, expected_type=type_hints["_"]) + return typing.cast(None, jsii.sinvoke(cls, "bar", [_])) + + @jsii.member(jsii_name="foo") + def foo(self, _: builtins.str) -> None: + ''' + :param _: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(MyClass.foo) +- check_type(argname="argument _", value=_, expected_type=type_hints["_"]) + return typing.cast(None, jsii.invoke(self, "foo", [_])) + + + __all__ = [ + "MyClass", +`; + +exports[`Generated code for "jsii-calc": /python/src/jsii_calc/module2647/__init__.py.diff 1`] = ` +--- python/src/jsii_calc/module2647/__init__.py --runtime-type-checking ++++ python/src/jsii_calc/module2647/__init__.py --no-runtime-type-checking +@@ -31,13 +31,10 @@ + ''' + :param very: - + + :stability: deprecated + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ExtendAndImplement.__init__) +- check_type(argname="argument very", value=very, expected_type=type_hints["very"]) + jsii.create(self.__class__, self, [very]) + + @jsii.member(jsii_name="hello") + def hello(self) -> builtins.str: + '''Say hello!''' +`; + +exports[`Generated code for "jsii-calc": /python/src/jsii_calc/module2689/methods/__init__.py.diff 1`] = ` +--- python/src/jsii_calc/module2689/methods/__init__.py --runtime-type-checking ++++ python/src/jsii_calc/module2689/methods/__init__.py --no-runtime-type-checking +@@ -29,23 +29,17 @@ + _bar: typing.Mapping[builtins.str, typing.Union[scope.jsii_calc_base.BaseProps, typing.Dict[str, typing.Any]]], + ) -> None: + ''' + :param _bar: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(MyClass.bar) +- check_type(argname="argument _bar", value=_bar, expected_type=type_hints["_bar"]) + return typing.cast(None, jsii.invoke(self, "bar", [_bar])) + + @jsii.member(jsii_name="foo") + def foo(self, _values: typing.Sequence[scope.jsii_calc_lib.Number]) -> None: + ''' + :param _values: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(MyClass.foo) +- check_type(argname="argument _values", value=_values, expected_type=type_hints["_values"]) + return typing.cast(None, jsii.invoke(self, "foo", [_values])) + + + __all__ = [ + "MyClass", +`; + +exports[`Generated code for "jsii-calc": /python/src/jsii_calc/module2689/structs/__init__.py.diff 1`] = ` +--- python/src/jsii_calc/module2689/structs/__init__.py --runtime-type-checking ++++ python/src/jsii_calc/module2689/structs/__init__.py --no-runtime-type-checking +@@ -30,14 +30,10 @@ + ) -> None: + ''' + :param base_map: + :param numbers: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(MyStruct.__init__) +- check_type(argname="argument base_map", value=base_map, expected_type=type_hints["base_map"]) +- check_type(argname="argument numbers", value=numbers, expected_type=type_hints["numbers"]) + self._values: typing.Dict[str, typing.Any] = { + "base_map": base_map, + "numbers": numbers, + } +`; + +exports[`Generated code for "jsii-calc": /python/src/jsii_calc/module2692/submodule1/__init__.py.diff 1`] = ` +--- python/src/jsii_calc/module2692/submodule1/__init__.py --runtime-type-checking ++++ python/src/jsii_calc/module2692/submodule1/__init__.py --no-runtime-type-checking +@@ -21,13 +21,10 @@ + class Bar: + def __init__(self, *, bar1: builtins.str) -> None: + ''' + :param bar1: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(Bar.__init__) +- check_type(argname="argument bar1", value=bar1, expected_type=type_hints["bar1"]) + self._values: typing.Dict[str, typing.Any] = { + "bar1": bar1, + } + + @builtins.property +`; + +exports[`Generated code for "jsii-calc": /python/src/jsii_calc/module2692/submodule2/__init__.py.diff 1`] = ` +--- python/src/jsii_calc/module2692/submodule2/__init__.py --runtime-type-checking ++++ python/src/jsii_calc/module2692/submodule2/__init__.py --no-runtime-type-checking +@@ -23,13 +23,10 @@ + class Bar: + def __init__(self, *, bar2: builtins.str) -> None: + ''' + :param bar2: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(Bar.__init__) +- check_type(argname="argument bar2", value=bar2, expected_type=type_hints["bar2"]) + self._values: typing.Dict[str, typing.Any] = { + "bar2": bar2, + } + + @builtins.property +@@ -66,15 +63,10 @@ + ''' + :param bar2: + :param bar1: + :param foo2: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(Foo.__init__) +- check_type(argname="argument bar2", value=bar2, expected_type=type_hints["bar2"]) +- check_type(argname="argument bar1", value=bar1, expected_type=type_hints["bar1"]) +- check_type(argname="argument foo2", value=foo2, expected_type=type_hints["foo2"]) + self._values: typing.Dict[str, typing.Any] = { + "bar2": bar2, + "bar1": bar1, + "foo2": foo2, + } +`; + +exports[`Generated code for "jsii-calc": /python/src/jsii_calc/python_self/__init__.py.diff 1`] = ` +--- python/src/jsii_calc/python_self/__init__.py --runtime-type-checking ++++ python/src/jsii_calc/python_self/__init__.py --no-runtime-type-checking +@@ -19,23 +19,17 @@ + ): + def __init__(self_, self: builtins.str) -> None: + ''' + :param self: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ClassWithSelf.__init__) +- check_type(argname="argument self", value=self, expected_type=type_hints["self"]) + jsii.create(self_.__class__, self_, [self]) + + @jsii.member(jsii_name="method") + def method(self_, self: jsii.Number) -> builtins.str: + ''' + :param self: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(ClassWithSelf.method) +- check_type(argname="argument self", value=self, expected_type=type_hints["self"]) + return typing.cast(builtins.str, jsii.invoke(self_, "method", [self])) + + @builtins.property + @jsii.member(jsii_name="self") + def self(self) -> builtins.str: +@@ -76,13 +70,10 @@ + @jsii.member(jsii_name="method") + def method(self_, self: jsii.Number) -> builtins.str: + ''' + :param self: - + ''' +- if __debug__: +- type_hints = typing.get_type_hints(IInterfaceWithSelf.method) +- check_type(argname="argument self", value=self, expected_type=type_hints["self"]) + return typing.cast(builtins.str, jsii.invoke(self_, "method", [self])) + + # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface + typing.cast(typing.Any, IInterfaceWithSelf).__jsii_proxy_class__ = lambda : _IInterfaceWithSelfProxy + +@@ -95,13 +86,10 @@ + class StructWithSelf: + def __init__(self_, *, self: builtins.str) -> None: + ''' + :param self: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(StructWithSelf.__init__) +- check_type(argname="argument self", value=self, expected_type=type_hints["self"]) + self_._values: typing.Dict[str, typing.Any] = { + "self": self, + } + + @builtins.property +`; + +exports[`Generated code for "jsii-calc": /python/src/jsii_calc/submodule/__init__.py.diff 1`] = ` +--- python/src/jsii_calc/submodule/__init__.py --runtime-type-checking ++++ python/src/jsii_calc/submodule/__init__.py --no-runtime-type-checking +@@ -39,13 +39,10 @@ + + :param foo: + + :see: https://github.com/aws/jsii/issues/2637 + ''' +- if __debug__: +- type_hints = typing.get_type_hints(Default.__init__) +- check_type(argname="argument foo", value=foo, expected_type=type_hints["foo"]) + self._values: typing.Dict[str, typing.Any] = { + "foo": foo, + } + + @builtins.property +@@ -110,13 +107,10 @@ + def all_types(self) -> typing.Optional[_AllTypes_b08307c5]: + return typing.cast(typing.Optional[_AllTypes_b08307c5], jsii.get(self, "allTypes")) + + @all_types.setter + def all_types(self, value: typing.Optional[_AllTypes_b08307c5]) -> None: +- if __debug__: +- type_hints = typing.get_type_hints(getattr(MyClass, "all_types").fset) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + jsii.set(self, "allTypes", value) + + + __all__ = [ + "Default", +`; + +exports[`Generated code for "jsii-calc": /python/src/jsii_calc/submodule/back_references/__init__.py.diff 1`] = ` +--- python/src/jsii_calc/submodule/back_references/__init__.py --runtime-type-checking ++++ python/src/jsii_calc/submodule/back_references/__init__.py --no-runtime-type-checking +@@ -23,13 +23,10 @@ + class MyClassReference: + def __init__(self, *, reference: _MyClass_a2fdc0b6) -> None: + ''' + :param reference: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(MyClassReference.__init__) +- check_type(argname="argument reference", value=reference, expected_type=type_hints["reference"]) + self._values: typing.Dict[str, typing.Any] = { + "reference": reference, + } + + @builtins.property +`; + +exports[`Generated code for "jsii-calc": /python/src/jsii_calc/submodule/child/__init__.py.diff 1`] = ` +--- python/src/jsii_calc/submodule/child/__init__.py --runtime-type-checking ++++ python/src/jsii_calc/submodule/child/__init__.py --no-runtime-type-checking +@@ -73,13 +73,10 @@ + class SomeStruct: + def __init__(self, *, prop: SomeEnum) -> None: + ''' + :param prop: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(SomeStruct.__init__) +- check_type(argname="argument prop", value=prop, expected_type=type_hints["prop"]) + self._values: typing.Dict[str, typing.Any] = { + "prop": prop, + } + + @builtins.property +@@ -108,13 +105,10 @@ + class Structure: + def __init__(self, *, bool: builtins.bool) -> None: + ''' + :param bool: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(Structure.__init__) +- check_type(argname="argument bool", value=bool, expected_type=type_hints["bool"]) + self._values: typing.Dict[str, typing.Any] = { + "bool": bool, + } + + @builtins.property +@@ -149,14 +143,10 @@ + ) -> None: + ''' + :param prop: + :param extra: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(KwargsProps.__init__) +- check_type(argname="argument prop", value=prop, expected_type=type_hints["prop"]) +- check_type(argname="argument extra", value=extra, expected_type=type_hints["extra"]) + self._values: typing.Dict[str, typing.Any] = { + "prop": prop, + } + if extra is not None: + self._values["extra"] = extra +`; + +exports[`Generated code for "jsii-calc": /python/src/jsii_calc/submodule/param/__init__.py.diff 1`] = ` +--- python/src/jsii_calc/submodule/param/__init__.py --runtime-type-checking ++++ python/src/jsii_calc/submodule/param/__init__.py --no-runtime-type-checking +@@ -21,13 +21,10 @@ + class SpecialParameter: + def __init__(self, *, value: builtins.str) -> None: + ''' + :param value: + ''' +- if __debug__: +- type_hints = typing.get_type_hints(SpecialParameter.__init__) +- check_type(argname="argument value", value=value, expected_type=type_hints["value"]) + self._values: typing.Dict[str, typing.Any] = { + "value": value, + } + + @builtins.property +`; diff --git a/packages/jsii-pacmak/test/generated-code/harness.ts b/packages/jsii-pacmak/test/generated-code/harness.ts index 5400754bac..5a7d588cc7 100644 --- a/packages/jsii-pacmak/test/generated-code/harness.ts +++ b/packages/jsii-pacmak/test/generated-code/harness.ts @@ -1,3 +1,4 @@ +import { createPatch } from 'diff'; import * as fs from 'fs-extra'; import * as os from 'os'; import * as path from 'path'; @@ -13,37 +14,44 @@ export const JSII_TEST_PACKAGES: readonly string[] = [ 'jsii-calc', ]; +const DIFF = Symbol('diff'); const FILE = Symbol('file'); const MISSING = Symbol('missing'); const TARBALL = Symbol('tarball'); const BINARY = Symbol('binary'); export const TREE = Symbol('tree'); +const TREE_ROOT = Symbol('treeRoot'); // Custom serializers so we can see the source without escape sequences expect.addSnapshotSerializer({ - test: (val) => val?.[FILE] != null, + test: (val) => DIFF in val, + serialize: (val) => val[DIFF], +}); + +expect.addSnapshotSerializer({ + test: (val) => FILE in val, serialize: (val) => val[FILE], }); expect.addSnapshotSerializer({ - test: (val) => val?.[MISSING] != null, + test: (val) => MISSING in val, serialize: (val) => `${val[MISSING]} does not exist`, }); expect.addSnapshotSerializer({ - test: (val) => val?.[TARBALL] != null, + test: (val) => TARBALL in val, serialize: (val) => `${val[TARBALL]} ${ val[TARBALL].endsWith('.tgz') ? 'is' : 'embeds' } a tarball`, }); expect.addSnapshotSerializer({ - test: (val) => val?.[BINARY] != null, + test: (val) => BINARY in val, serialize: (val) => `${val[BINARY]} is a binary file`, }); expect.addSnapshotSerializer({ - test: (val) => val?.[TREE] != null, + test: (val) => TREE in val, serialize: (val) => { - return `\n${formatTree(val[TREE])}`; + return `${val[TREE_ROOT] ?? ''}\n${formatTree(val[TREE])}`; }, }); @@ -70,14 +78,34 @@ export function verifyGeneratedCodeFor( test(`Generated code for ${JSON.stringify(pkg)}`, async () => { const pkgRoot = path.resolve(__dirname, '..', '..', '..', pkg); - await runPacmak(pkgRoot, targetName, outDir); - - expect({ [TREE]: checkTree(outDir) }).toMatchSnapshot('/'); - if (targetName !== TargetName.PYTHON || process.env.SKIP_MYPY_CHECK) { - return Promise.resolve(); + const outDirRuntimeTypeChecked = path.join( + outDir, + 'runtime-type-checking', + ); + await runPacmak(pkgRoot, targetName, outDirRuntimeTypeChecked); + expect({ [TREE]: checkTree(outDirRuntimeTypeChecked) }).toMatchSnapshot( + '/', + ); + if (targetName === TargetName.PYTHON && !process.env.SKIP_MYPY_CHECK) { + await runMypy(path.join(outDirRuntimeTypeChecked, targetName)); } - return runMypy(path.join(outDir, targetName)); + + // Now we'll generate WITHOUT runtime type-checks, and assert on the differences + const outDirNotRuntimeTypeChecked = path.join( + outDir, + 'no-runtime-type-checking', + ); + await runPacmak(pkgRoot, targetName, outDirNotRuntimeTypeChecked, { + runtimeTypeChecking: false, + }); + expect({ + [TREE]: diffTrees( + outDirRuntimeTypeChecked, + outDirNotRuntimeTypeChecked, + ), + [TREE_ROOT]: '', + }).toMatchSnapshot('/'); }); } } @@ -131,16 +159,82 @@ export function checkTree( } return tree; }, {} as { [name: string]: TreeStructure }); +} - function tryStat(at: string) { - try { - return fs.statSync(at); - } catch (e: any) { - if (e.code !== os.constants.errno.ENOENT) { - throw e; - } +export function diffTrees( + original: string, + updated: string, + { root = original }: { root?: string } = {}, +): TreeStructure | undefined { + const originalStat = tryStat(original); + const updatedStat = tryStat(updated); + + // Should exist on both sides AND have the same file type + expect(originalStat?.isDirectory()).toBe(updatedStat?.isDirectory()); + expect(originalStat?.isFile()).toBe(updatedStat?.isFile()); + + const relativeFile = path.relative(root, original).replace(/\\/g, '/'); + if (originalStat?.isFile()) { + if (original.endsWith('.tgz') || original.endsWith('.png')) { + // This is a binary object, these should match exactly + expect(fs.readFileSync(original)).toEqual(fs.readFileSync(updated)); + return undefined; + } + const patch = createPatch( + relativeFile, + fs.readFileSync(original, 'utf-8'), + fs.readFileSync(updated, 'utf-8'), + '--runtime-type-checking', + '--no-runtime-type-checking', + { + context: 5, + ignoreWhitespace: false, + newlineIsToken: true, + }, + ) + .trimEnd() + .split(/\n/) + .slice(2); + + if (patch.length === 2) { return undefined; } + + const snapshotName = `/${relativeFile}.diff`; + expect({ [DIFF]: patch.join('\n') }).toMatchSnapshot(snapshotName); + return `${path.basename(original)}.diff`; + } + + return fs + .readdirSync(original) + .map((entry) => ({ + entry, + subtree: diffTrees( + path.join(original, entry), + path.join(updated, entry), + { root }, + ), + })) + .reduce((tree, { entry, subtree }) => { + if (subtree != null) { + tree = tree ?? {}; + if (typeof subtree === 'string' && subtree.startsWith(entry)) { + entry = subtree; + } + tree[entry] = subtree; + } + return tree; + }, undefined as { [name: string]: TreeStructure } | undefined); +} + +function tryStat(at: string) { + try { + return fs.statSync(at); + } catch (e: any) { + if (e.code !== os.constants.errno.ENOENT) { + throw e; + } + return undefined; } } @@ -148,6 +242,9 @@ async function runPacmak( root: string, targetName: TargetName, outdir: string, + { + runtimeTypeChecking = true, + }: { readonly runtimeTypeChecking?: boolean } = {}, ): Promise { return expect( pacmak({ @@ -155,6 +252,7 @@ async function runPacmak( fingerprint: false, inputDirectories: [root], outputDirectory: outdir, + runtimeTypeChecking, targets: [targetName], }), ).resolves.not.toThrowError(); @@ -268,7 +366,11 @@ async function runMypy(pythonRoot: string): Promise { type TreeStructure = string | { [name: string]: TreeStructure }; -function formatTree(tree: TreeStructure): string { +function formatTree(tree: TreeStructure | undefined): string { + if (tree == null) { + return `┗━ 🕳 There is nothing here`; + } + if (typeof tree === 'string') { return `┗━ 📄 ${tree}`; } diff --git a/packages/jsii-pacmak/test/targets/go.test.ts b/packages/jsii-pacmak/test/targets/go.test.ts index 07c39eeeaa..a259b6dc7f 100644 --- a/packages/jsii-pacmak/test/targets/go.test.ts +++ b/packages/jsii-pacmak/test/targets/go.test.ts @@ -24,6 +24,7 @@ test('does not generate imports for unused types', async () => { assembly, packageDir: '', rosetta, + runtimeTypeChecking: true, targetName: 'golang', }); diff --git a/yarn.lock b/yarn.lock index e926e3e29a..bb42fff8c2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1874,6 +1874,11 @@ resolved "https://registry.yarnpkg.com/@types/deep-equal/-/deep-equal-1.0.1.tgz#71cfabb247c22bcc16d536111f50c0ed12476b03" integrity sha512-mMUu4nWHLBlHtxXY17Fg6+ucS/MnndyOWyOe7MmwkoMYxvfQU2ajtRaEvqSUv+aVkMqH/C0NCI8UoVfRNQ10yg== +"@types/diff@^5.0.2": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@types/diff/-/diff-5.0.2.tgz#dd565e0086ccf8bc6522c6ebafd8a3125c91c12b" + integrity sha512-uw8eYMIReOwstQ0QKF0sICefSy8cNO/v7gOTiIy9SbwuHyEecJUm7qlgueOO5S1udZ5I/irVydHVwMchgzbKTg== + "@types/eslint-scope@^3.7.3": version "3.7.4" resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.4.tgz#37fc1223f0786c39627068a12e94d6e6fc61de16"