#inlinetest:exclude compile-time alias errors prevent CUE source compilation; @test(err) requires successful compile
-- old.cue --
// issue2527: self-referential alias in key `x=(x):` caused an "unreachable"
// panic (https://cuelang.org/issue/2527).
issue2527: {
	x=(x): 3
}
// issue2094: alias Y referring to a dynamic-key field X declared afterward
// caused a panic due to ordering sensitivity (https://cuelang.org/issue/2094).
issue2094: {
	Y=(X): string
	X=("foo"): "bar"
}
-- new.cue --
@experiment(aliasv2)

// issue2527: self-referential alias in key `(x)~x:` caused an "unreachable"
// panic (https://cuelang.org/issue/2527).
issue2527: {
	(x)~x: 3
}
// issue2094: alias Y referring to a dynamic-key field X declared afterward
// caused a panic due to ordering sensitivity (https://cuelang.org/issue/2094).
issue2094: {
	(X)~Y: string
	("foo")~X: "bar"
}
-- out/compile --
issue2527: cyclic reference in field alias:
    ./new.cue:6:3
issue2094: cyclic reference in field alias:
    ./new.cue:11:3
issue2094: unreferenced alias or let clause Y:
    ./new.cue:11:5
issue2527: cyclic reference in field alias:
    ./old.cue:4:5
issue2094: unreferenced alias or let clause Y:
    ./old.cue:9:2
issue2094: cyclic reference in field alias:
    ./old.cue:9:5
--- new.cue
{
  issue2527: {
    〈0;(_|_(cyclic reference in field alias))〉: 3
  }
  issue2094: {
    〈0;("foo")〉: string
    "foo": "bar"
  }
}
--- old.cue
{
  issue2527: {
    〈0;(_|_(cyclic reference in field alias))〉: 3
  }
  issue2094: {
    〈0;("foo")〉: string
    "foo": "bar"
  }
}
