-
Notifications
You must be signed in to change notification settings - Fork 302
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
cmd/cue: def roundtrip breaks for zero width bound #1340
Comments
This is where I am finding the inconsistencies for what various literal values are cast to. Sometimes it is a Note that the
|
No, I'm sorry that I was unclear. I wanted to demonstrate the bug that when cue def exports |
Agreed. This therefore looks like a bug to me. Linking to #253. |
For completeness a txtar repro (tested against e8550b8):
gives:
|
Noting also that we should ensure the spec examples mentioned in #1339 are accurate with respect to whatever we decide here. |
What version of CUE are you using (
cue version
)?Does this issue reproduce with the latest release?
Yes, with v0.4.0.
What did you do?
What did you expect to see?
Not an error.
What did you see instead?
The output of the first cue def is:
I bumped into this when looking at #1310 . What I think goes on here is that
>= 5 & <= 5
resolves to a concrete value of type number and magnitude 5 (both int 5 and float 5.0 are instances of this value). When exporting (cue def), value.Syntax() outputs this number as "5". This when taken as input is a literal 5 and is an int only (not a more general number,) so doesn't unify with float.As far as I know there are only float and int literals, no way to directly specify a number literal. I guess the meaning of
5 | 5.0
would be close, but is that then that much better than>= 5 & <= 5
.For completeness sake, cue export :
and even
The text was updated successfully, but these errors were encountered: