-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/core/adt: allow pattern constraints alongside fields
This was already allowed, but now adjust examples to show this. Note that this is just reverting to v0.2 behavior. Change-Id: I77aacf3867dc118c075d9a57420f12f174c4df04 Reviewed-on: https://cue-review.googlesource.com/c/cue/+/8926 Reviewed-by: CUE cueckoo <cueckoo@gmail.com> Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
- Loading branch information
Showing
8 changed files
with
58 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
-- in.cue -- | ||
bulkToSelf: { | ||
a: { | ||
foo: [string]: int | ||
foo: bar: "3" // error | ||
} | ||
} | ||
-- out/compile -- | ||
--- in.cue | ||
{ | ||
bulkToSelf: { | ||
a: { | ||
foo: { | ||
[string]: int | ||
} | ||
foo: { | ||
bar: "3" | ||
} | ||
} | ||
} | ||
} | ||
-- out/eval -- | ||
Errors: | ||
bulkToSelf.a.foo.bar: conflicting values "3" and int (mismatched types string and int): | ||
./in.cue:3:24 | ||
./in.cue:4:19 | ||
|
||
Result: | ||
(_|_){ | ||
// [eval] | ||
bulkToSelf: (_|_){ | ||
// [eval] | ||
a: (_|_){ | ||
// [eval] | ||
foo: (_|_){ | ||
// [eval] | ||
bar: (_|_){ | ||
// [eval] bulkToSelf.a.foo.bar: conflicting values "3" and int (mismatched types string and int): | ||
// ./in.cue:3:24 | ||
// ./in.cue:4:19 | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters