-
Notifications
You must be signed in to change notification settings - Fork 9
SPICE-0026: Power Assertions #29
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
base: main
Are you sure you want to change the base?
Conversation
d9e8369 to
0a6bedf
Compare
0a6bedf to
b56bebf
Compare
| ---- | ||
|
|
||
| Literal values include stdlib types like IntSeq, List, Map whose members are also literal. | ||
| Here, `List(1, 2, 3)` is excluded because it's considered a literal: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this also work for Map()? What about Listing of literals?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, already mentioned Map on line 127.
Didn't include this for objects, because there's a lot of sugar that can happen with object literals. But, maybe we can support this for objects that have explicitly declared types, e.g. new Listing { 1; 2; 3 }.
|
|
||
| [source,pkl] | ||
| ---- | ||
| assert(1 == 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this a future direction, but would assert short circuit if it fails, like throw?
If so it has the same problem as throw, which is, it doesn't compose.
If we can solve this, we'd be able to replace throw as the way to show custom messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this would be the replacement for throw, but, I'm also not sure if this should be short-circuiting or not.
Reference implementation: apple/pkl#1384