-
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 type validation code #1321
Comments
I don't think this is a breaking change (it'd prohibit cases that won't have worked). I also believe we should start off by issuing warnings instead of breaking the run-time (which makes it even less breaking). Possibly have an environment-controlled "strict" mode that throws instead of warning. |
Isn't it possible that there exists cases with "accidental" compatibility? Where the property names just happen to match?
I agree this would prevent the breakage, at the first iteration anyway. |
dup with #75? |
@eladb - it's related, but I think adding checks in Python code can be delivered faster and stop the "bleeding". |
This issue has not received any attention in 2 years. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
🚀 Feature Request
Add type validation code to dynamic languages.
Affected Languages
TypeScript
orJavascript
(Javascript)Python
Java
C#
,F#
, ...)General Information
Description
We currently have quite a few issues coming from users who mistakenly pass L1 objects to L2 constructs.
For example: aws/aws-cdk#6540
These types of errors are not presented in typed languages because they actually cause a compile time error. It would be nice to provide a similar experience in dynamic languages as well.
Proposed Solution
JSII can generate some sort of type validation code in the proxy objects, something like:
The text was updated successfully, but these errors were encountered: