-- in.cue --
import (
	"math"
	"strings"
)

// issue3584: builtin functions with default-valued disjunction arguments
// (e.g. *1 | 2) caused an "error in call" panic in evalv3.
// https://cuelang.org/issue/3584
issue3584: reduced: t1: {
	ref: out
	trigger: *1 | 2
	out: strings.SliceRunes("ABC", 0, trigger)
	@test(eq, {
		ref:     "A"
		trigger: *1 | 2
		out:     "A"
	})
}

issue3584: reduced: t2: {
	x: math.Abs(y)
	y: *6 | 5
	@test(eq, {x: 6, y: *6 | 5})
}
-- out/eval/stats --
Leaks:  0
Freed:  14
Reused: 4
Allocs: 10
Retain: 0

Unifications: 10
Conjuncts:    16
Disjuncts:    4
