-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(jsii): Correctly handle singleton enums
When an enum has only one option, TypeScript handles it in a special way and tries very hard to hide the enum declaration in favor of the sole member. This caused incorrect type names and kinds to be emitted in the JSII assembly, resulting in incorrect behavior. This uses a non-public part of the TSC API (possibly an omission from the hand-written type model), so it includes an additional guard check to fail explicitly in case the API's behavior happens to change in a breaking way. Fixes #231
- Loading branch information
1 parent
e804cab
commit 907df8f
Showing
3 changed files
with
174 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters