cue icon indicating copy to clipboard operation
cue copied to clipboard

evaluator: unresolved aliases in definitions fail to work after embedding

Open cuematthew opened this issue 1 year ago • 2 comments

What version of CUE are you using (cue version)?

2f19b1a709a724cd5cb0aca19769e6ad7bd2efd6

Does this issue reproduce with the latest stable release?

Yes, eval v2 and v3 show this

What did you do?

env CUE_EXPERIMENT=evalv3
exec cue eval in.cue
cmp stdout golden.cue
-- in.cue --
#s: L={x: L.y}
out: {#s, y: 3}
-- golden.cue --
out: {
    y: 3
    x: 3
}

cuematthew avatar Aug 22 '24 20:08 cuematthew

#s is closed, so that is why it reports an error.

We could argue whether it should be, but this is how things are supposed to work at the moment.

mpvl avatar Oct 07 '24 10:10 mpvl

Huh, I barely recall filing this.

That's a curious extra property then that I'd not thought about: you're suggesting that within a definition, all paths must resolve without further unification?

It seems to me not quite right to say the declaration of #s is closed: as the spec says, definitions are only closed when they're used, but this example errors in the same way (#s.x: undefined field: y) without the out: line. I think you've recently worked on many cases where there are unifications going on within a definition declaration that rely on the definition not being closed at that point.

cuematthew avatar Oct 07 '24 12:10 cuematthew