-
Notifications
You must be signed in to change notification settings - Fork 246
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
Generate dynamic type-checks in .NET bindings #3640
Comments
RomainMuller
added a commit
that referenced
this issue
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 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
mergify bot
pushed a commit
that referenced
this issue
Aug 9, 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]. [Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Generate dynamic type-checking code as part of the generated bindings, so that users get language-specific error messages when they fail to comply with the type requirements of members.
Since this language is statically type-checked by the compiler, runtime type-checking is only useful/necessary in places where type unions are involved (those being implemented as opaque types in the language).
The text was updated successfully, but these errors were encountered: