-- in.cue --
import "list"

cycles: {
	a: {
		let A = {c: B}
		let B = A
		out: A
	}

	b: {
		let A = {c: B}
		let B = {A.c}
		out: A
	}

	issue1042: {
		#FullAdder: {
			// IN
			a: bool
			b: bool
			c: bool
			// OUT
			sum:   bool
			carry: bool
		}

		#Add16: {
			a:   [bool] * 16
			b:   [bool] * 16
			out: [bool] * 16

			let fulladders = [
				for i in list.Range(0, 4, 1) {
					#FullAdder & {"a": a[i], "b": b[i], c: carries[i]}
				},
			]
			let carries = [
				false,
				for i in list.Range(0, 4, 1) {fulladders[i].carry},
			]
			out: [
				for i in list.Range(0, 4, 1) {fulladders[i].sum},
			]
		}
	}
}
-- out/compile --
cycles.a.let[].c.c: cyclic references in let clause or alias:
    ./in.cue:5:15
cycles.b.let[].c.c: cyclic references in let clause or alias:
    ./in.cue:11:15
cycles.issue1042.#Add16.let[].for[].c.for[].for[].c: cyclic references in let clause or alias:
    ./in.cue:34:45
--- in.cue
{
  cycles: {
    a: {
      let A#1 = {
        c: 〈1;let B#2〉
      }
      let B#2 = 〈0;let A#1〉
      out: 〈0;let A#1〉
    }
    b: {
      let A#3 = {
        c: 〈1;let B#4〉
      }
      let B#4 = {
        〈1;let A#3〉.c
      }
      out: 〈0;let A#3〉
    }
    issue1042: {
      #FullAdder: {
        a: bool
        b: bool
        c: bool
        sum: bool
        carry: bool
      }
      #Add16: {
        a: ([
          bool,
        ] * 16)
        b: ([
          bool,
        ] * 16)
        out: ([
          bool,
        ] * 16)
        let fulladders#5 = [
          for _, i in 〈import;list〉.Range(0, 4, 1) {
            (〈4;#FullAdder〉 & {
              a: 〈4;a〉[〈2;i〉]
              b: 〈4;b〉[〈2;i〉]
              c: 〈4;let carries#6〉[〈2;i〉]
            })
          },
        ]
        let carries#6 = [
          false,
          for _, i in 〈import;list〉.Range(0, 4, 1) {
            〈3;let fulladders#5〉[〈1;i〉].carry
          },
        ]
        out: [
          for _, i in 〈import;list〉.Range(0, 4, 1) {
            〈3;let fulladders#5〉[〈1;i〉].sum
          },
        ]
      }
    }
  }
}
-- out/eval --
cycles.a.let[].c.c: cyclic references in let clause or alias:
    ./in.cue:5:15
cycles.b.let[].c.c: cyclic references in let clause or alias:
    ./in.cue:11:15
cycles.issue1042.#Add16.let[].for[].c.for[].for[].c: cyclic references in let clause or alias:
    ./in.cue:34:45
