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

Audit examples/darwin-framework-tool/templates/tests/partials/checks/maybeCheckExpectedConstraints.zapt #19151

Closed
vivien-apple opened this issue Jun 3, 2022 · 2 comments · Fixed by #19479

Comments

@vivien-apple
Copy link
Contributor

Should this have a check for optionality and being missing if optional? I think it should...

As in, we should not have "is actual value nil" checks scattered about with specific constraints. For example, for an optional thing a minLength constraint should pass if not present, but the code below will treat the actual length as 0, I think...

I guess this just got moved; can you please file a followup to fix this up?

Originally posted by @bzbarsky-apple in #19042 (comment)

@vivien-apple
Copy link
Contributor Author

I have also noticed something that looks broken for string handling when I moved the code at examples/darwin-framework-tool/templates/tests/partials/checks/maybeCheckExpectedConstraints.zapt

It is unclear to me what asTypedLiteral is here for strings.

@bzbarsky-apple
Copy link
Contributor

asTypedLiteral is broken for strings, but it's broken in the same way for chip-tool, fwiw... notValue constraints for strings only work if the notValue points to a variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants