Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(.net): dynmic type checking for union-typed parameters #3668

Merged
merged 18 commits into from
Aug 9, 2022

Conversation

RomainMuller
Copy link
Contributor

@RomainMuller RomainMuller commented Jul 21, 2022

Weaving runtime type checks around union-typed parameters to help
developers receive actionable error messages in case mistakes are made.
The checks are only performed if the
Amazon.JSII.Runtime.Configuration.RuntimeTypeChecking configuration
property is true (which it is by default).

A pre-processor macro such as DEBUG could not be used as the packages
published to NuGet are already built and this does not afford any control
to the end-user.

Fixes #3640


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Weaving runtime type checks around union-typed parameters to help
developers receive actionable error messages in case mistakes are made.
The checks are only woven if the `DEBUG` preprocessor constant is set,
which means these checks will not be done on `Release` builds, which
optimize for speed.

Fixes #3640
@RomainMuller RomainMuller requested a review from a team July 21, 2022 08:00
@RomainMuller RomainMuller self-assigned this Jul 21, 2022
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Jul 21, 2022
@RomainMuller RomainMuller marked this pull request as ready for review July 21, 2022 13:57
@RomainMuller RomainMuller force-pushed the rmuller/type-check-dotnet-unions branch from a7b6d14 to 29be798 Compare July 22, 2022 12:42
@RomainMuller RomainMuller force-pushed the rmuller/type-check-dotnet-unions branch from 4c81c76 to ae33199 Compare August 2, 2022 09:56
RomainMuller and others added 5 commits August 3, 2022 14:41
Co-authored-by: Calvin Combs <66279577+comcalvi@users.noreply.github.com>
…tnet-unions

# Conflicts:
#	packages/jsii-calc/test/assembly.jsii
…tnet-unions

# Conflicts:
#	packages/jsii-calc/test/assembly.jsii
#	packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts
@mergify
Copy link
Contributor

mergify bot commented Aug 9, 2022

Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it!

@mergify mergify bot added the pr/ready-to-merge This PR is ready to be merged. label Aug 9, 2022
@mergify
Copy link
Contributor

mergify bot commented Aug 9, 2022

Merging (with squash)...

1 similar comment
@mergify
Copy link
Contributor

mergify bot commented Aug 9, 2022

Merging (with squash)...

@mergify mergify bot merged commit f5e0603 into main Aug 9, 2022
@mergify mergify bot deleted the rmuller/type-check-dotnet-unions branch August 9, 2022 17:36
@mergify
Copy link
Contributor

mergify bot commented Aug 9, 2022

Merging (with squash)...

@mergify mergify bot removed the pr/ready-to-merge This PR is ready to be merged. label Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate dynamic type-checks in .NET bindings
2 participants