// Caused evalv2 to stack overflow;
// move to comprehension.txtar once evalv2 is removed so we can avoid the skip line.
#skip-v2
-- in.cue --
issue2229: full_ok: X={
	build: bool | *true
	test:  bool | *true

	make: [ for k, v in X if (v & true) != _|_ { k } ]
}
issue2229: reduced_fail: X={
	x: true
	y: [ for _, v in X if v & true { _ } ]
}

-- out/compile --
--- in.cue
{
  issue2229: {
    full_ok: {
      build: (bool|*true)
      test: (bool|*true)
      make: [
        for k, v in 〈2〉 if ((〈0;v〉 & true) != _|_(explicit error (_|_ literal) in source)) {
          〈1;k〉
        },
      ]
    }
  }
  issue2229: {
    reduced_fail: {
      x: true
      y: [
        for _, v in 〈2〉 if (〈0;v〉 & true) {
          _
        },
      ]
    }
  }
}
-- out/evalalpha --
Errors:
conflicting values true and [for _, v in X if (v & true) {_}] (mismatched types bool and list):
    ./in.cue:9:5
    ./in.cue:9:28
structural cycle:
    ./in.cue:9:24

Result:
(_|_){
  // [eval]
  issue2229: (_|_){
    // [eval]
    full_ok: (struct){
      build: (bool){ |(*(bool){ true }, (bool){ bool }) }
      test: (bool){ |(*(bool){ true }, (bool){ bool }) }
      make: (#list){
        0: (string){ "build" }
        1: (string){ "test" }
      }
    }
    reduced_fail: (_|_){
      // [eval]
      x: (bool){ true }
      y: (_|_){
        // [eval] conflicting values true and [for _, v in X if (v & true) {_}] (mismatched types bool and list):
        //     ./in.cue:9:5
        //     ./in.cue:9:28
        // structural cycle:
        //     ./in.cue:9:24
        0: (_){ _ }
      }
    }
  }
}
