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

Fix logic for indeterminate nullable/required #2597

Open
LukeAbby opened this issue Jul 7, 2024 · 1 comment
Open

Fix logic for indeterminate nullable/required #2597

LukeAbby opened this issue Jul 7, 2024 · 1 comment
Assignees
Labels
data model This issue is relevant to data models or data fields foundry v11 This belongs to Foundry VTT version 11
Milestone

Comments

@LukeAbby
Copy link
Collaborator

LukeAbby commented Jul 7, 2024

When nullable: boolean users must assume that when getting null is a valid option as nullable may be true. When setting users must assume nullable may be false and therefore be an error. This means that indeterminate values for nullable must be treated differently in different contexts.

The same logic applies for required.

@JPMeehan JPMeehan added data model This issue is relevant to data models or data fields foundry v11 This belongs to Foundry VTT version 11 labels Jul 7, 2024
@JPMeehan JPMeehan added this to the v11 Release milestone Jul 7, 2024
@LukeAbby
Copy link
Collaborator Author

If microsoft/TypeScript#43826 were to be solved this could be perfectly done but I believe at the moment we probably have to be a bit overly conservative to prevent soundness holes.

Fortunately we can tell people to specify required/nullable exactly rather than indeterminately if they care.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data model This issue is relevant to data models or data fields foundry v11 This belongs to Foundry VTT version 11
Projects
None yet
Development

No branches or pull requests

2 participants