# Cycle errors report no source position information, making it impossible
# to locate the offending code.
# https://cuelang.org/issue/3118
-- in.cue --
#TimeSpan: {
	start:    float
	duration: float
	end:      float

	start:    end - duration
	duration: end - start
	end:      start + duration

	start: <=end
}

examples: [string]: #TimeSpan

examples: eg1: {
	start:    10.0
	duration: 2.1
}

examples: eg2: {
	start: 10.0
}

examples: eg3: {
	end: 10.0
}
-- out/compile --
--- in.cue
{
  #TimeSpan: {
    start: float
    duration: float
    end: float
    start: (〈0;end〉 - 〈0;duration〉)
    duration: (〈0;end〉 - 〈0;start〉)
    end: (〈0;start〉 + 〈0;duration〉)
    start: <=〈0;end〉
  }
  examples: {
    [string]: 〈1;#TimeSpan〉
  }
  examples: {
    eg1: {
      start: 10.0
      duration: 2.1
    }
  }
  examples: {
    eg2: {
      start: 10.0
    }
  }
  examples: {
    eg3: {
      end: 10.0
    }
  }
}
