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

jsii build succeeds when using Omit<T, K> #1707

Closed
nija-at opened this issue Jun 2, 2020 · 2 comments · Fixed by #1708
Closed

jsii build succeeds when using Omit<T, K> #1707

nija-at opened this issue Jun 2, 2020 · 2 comments · Fixed by #1708
Assignees
Labels
bug This issue is a bug. p2

Comments

@nija-at
Copy link
Contributor

nija-at commented Jun 2, 2020

🐛 Bug Report

What is the problem?

jsii does not support the Omit type but jsii build does not fail. It's likely that the jsii compiler is ignoring the Omit type.

Props class uses Omit utility type - PR commit

Successful build (account: 260708760616) - https://us-east-1.console.aws.amazon.com/codesuite/codebuild/260708760616/projects/AutoBuildProject6AEA49D1-qxepHUsryhcu/build/AutoBuildProject6AEA49D1-qxepHUsryhcu%3A531f3f72-e613-425b-b692-c041b756d515?region=us-east-1

@nija-at nija-at added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 2, 2020
@RomainMuller RomainMuller self-assigned this Jun 2, 2020
@RomainMuller RomainMuller added p2 and removed needs-triage This issue or PR still needs to be triaged. labels Jun 2, 2020
RomainMuller added a commit that referenced this issue Jun 2, 2020
When using the `Omit<T, K>` helper type (a mapped type) on an exported
API, `jsii` should detect this and fail, instead of allowing the
application to compile.

An additional bug caused use of this type to result in a successful exit
code from `jsii`, while the `.jsii` file was never written. This has
also been fixed.

Fixes #1707
@mergify mergify bot closed this as completed in #1708 Jun 8, 2020
mergify bot pushed a commit that referenced this issue Jun 8, 2020
When using the `Omit<T, K>` helper type (a mapped type) on an exported
API, `jsii` should detect this and fail, instead of allowing the
application to compile.

An additional bug caused use of this type to result in a successful exit
code from `jsii`, while the `.jsii` file was never written. This was caused
by the mapped types symbols not having a `valueDeclaration`, triggering
an attempt to read `undefined.parent`, which threw an exception caught
by the `Compiler` class, but not signaled back to the caller.

Fixes #1707



---

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
@hoegertn
Copy link
Contributor

Is there any chance to support Omit in the future?

mergify bot pushed a commit to cdklabs/cdk-monitoring-constructs that referenced this issue Mar 5, 2022
Ref: https://github.com/cdklabs/cdk-watchful/blob/main/src/aspect.ts

The concept of `MyMonitoringOptions` for every monitoring is needed because `Omit` is not supported by JSII. Please refer this issue and the comment on the linked PR for the way to handle that.
aws/jsii#1707

Opened an issue to add aspects for other left-out resources: #41
@blimmer
Copy link

blimmer commented Apr 28, 2023

@mrgrain pointed me at https://github.com/mrgrain/jsii-struct-builder, which could help others looking to Omit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants