Comments (5)
This snippet appears verbatim in the spec and results in the same error:
a: {
foo: string // foo is a string
["^i"]: int // all other fields starting with i are integers
["^b"]: bool // all other fields starting with b are booleans
...string // all other fields must be a string
}
from cue.
I tried going back a few versions:
$ go get cuelang.org/go/cmd/[email protected]
go: downloading cuelang.org/go v0.4.0-beta.2
$ cue eval ./test.cue
missing ',' in struct literal:
./test.cue:5:8
expected '}', found 'EOF':
./test.cue:6:3
$ go get cuelang.org/go/cmd/[email protected]
go: downloading cuelang.org/go v0.4.0-beta.1
$ cue eval ./test.cue
a: conflicting values string and {foo:string,["^i"]:int,["^b"]:bool,...,string} (mismatched types string and struct):
./test.cue:1:4
./test.cue:5:8
$ go get cuelang.org/go/cmd/[email protected]
go: downloading cuelang.org/go v0.4.0-alpha.2
$ cue eval ./test.cue
combining bulk optional fields with other fields deprecated as of v0.2.1: try running `cue fix` using CUE v0.2.2 on the file or module to upgrade:
./test.cue:6:1
It looks like this syntax is deprecated. I also tried cue fix
with a few different versions (including v0.2.2
) but nothing actually fixed it.
from cue.
FWIW, I achieved this with the following:
type: {
field1: int
[string]: ...string
}
from cue.
@lytedev, what version are you on? This fails for me on v0.4.0:
$ cue version
cue version v0.4.0 linux/amd64
$ cat test.cue
type: {
field1: int
[string]: ...string
}
$ cue eval test.cue
expected operand, found '...':
./test.cue:3:12
expected '}', found 'EOF':
./test.cue:4:2
from cue.
This issue has been migrated to cue-lang/cue#1065.
For more details about CUE's migration to a new home, please see cue-lang/cue#1078.
from cue.
Related Issues (20)
- cmd/cue: import/export (go|rust|...) HOT 3
- cmd/cue: import should ignore null documents HOT 4
- cmd/cue: fmt converts tabs to spaces in comments HOT 2
- cue eval panic instead of erroing with circular definition HOT 2
- Intermittent #FileInfo errors when parsing cue HOT 3
- cue vet hangs with template, list and default value HOT 1
- cmd/cue: simplify ["k"]: v to "k": v HOT 1
- Exporting binary & text protos via protoreflect HOT 1
- cuelang.org: document cue export for all conversions HOT 1
- panic in `cue get go github.com/argoproj/argo-cd/v2/...` HOT 2
- import cycle causes infinite loop HOT 2
- [regression] cue def openapi fails to handle disjunctions HOT 2
- cue segfault HOT 2
- exec.Run runner of kind "XXX" not found with k8s resources HOT 1
- cue trim bug: conjunctions and definitions HOT 1
- Tags across packages HOT 3
- YAML exports with strings in certain formats are interpreted as datetimes HOT 9
- `command "dump" is not defined` when running `cue dump ./...` HOT 2
- CUE has moved to a new home! HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cue.