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

[BUG] having a numeric field constrained to a negative number fails #68

Closed
FredTreg opened this issue Dec 4, 2024 · 0 comments
Closed

Comments

@FredTreg
Copy link
Contributor

FredTreg commented Dec 4, 2024

Describe the bug
When using such a type:

interface User {
    name: string,
    id: 1 | -1
}

ts-runtime-checks will fail with: Error: Debug Failure. False expression: Negative numbers should be created in combination with createPrefixUnaryExpression

Playground link
playground

Expected behavior
Either this works out of the box, or the documentation should indicate what to do (could not find what the error createPrefixUnaryExpression meant)

Additional context

ts-runtime-checks: 0.6.2
typescript 5.6.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant