-- 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)
}

issue3584: reduced: t2: {
	x: math.Abs(y)
	y: *6 | 5
}
-- out/compile --
--- in.cue
{
  issue3584: {
    reduced: {
      t1: {
        ref: 〈0;out〉
        trigger: (*1|2)
        out: 〈import;strings〉.SliceRunes("ABC", 0, 〈0;trigger〉)
      }
    }
  }
  issue3584: {
    reduced: {
      t2: {
        x: 〈import;math〉.Abs(〈0;y〉)
        y: (*6|5)
      }
    }
  }
}
