Skip to content

Commit 3d8f535

Browse files
committed
tools/flow: support task results when defined via definitions
This is not a very common use case, but it should not panic, and it should work just like it does when tasks do not have results. Fixes #2633. Signed-off-by: Daniel Martí <[email protected]> Change-Id: I45a939d2e55ae756ee9a3a809722e86637a2084d Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1224695 TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Roger Peppe <[email protected]>
1 parent 2ae2665 commit 3d8f535

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

cmd/cue/cmd/testdata/script/cmd_hidden.txtar

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
! exec cue cmd test
2-
stderr 'panic: unexpected label type'
1+
exec cue cmd test
2+
cmp stdout stdout.want
3+
4+
-- stdout.want --
5+
hello world
6+
7+
hello world
8+
9+
hello world
10+
11+
hello world
312

413
-- read.txt --
514
hello world

tools/flow/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ func (c *Controller) updateTaskResults(t *Task) bool {
211211
expr := t.update
212212
for _, label := range slices.Backward(t.labels) {
213213
switch label.Typ() {
214-
case adt.StringLabel, adt.HiddenLabel:
214+
case adt.StringLabel, adt.HiddenLabel, adt.DefinitionLabel, adt.HiddenDefinitionLabel, adt.LetLabel:
215215
expr = &adt.StructLit{
216216
Decls: []adt.Decl{
217217
&adt.Field{

0 commit comments

Comments
 (0)