cue icon indicating copy to clipboard operation
cue copied to clipboard

evaluator: unification of closed struct in subfield does not close it

Open rogpeppe opened this issue 3 years ago • 0 comments

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

cue version v0.0.0-20220815180243-e187f9fe5d45

       -compiler gc
     CGO_ENABLED 1
          GOARCH amd64
            GOOS linux
         GOAMD64 v1
             vcs git
    vcs.revision e187f9fe5d456f14073645670a98803d3048849e
        vcs.time 2022-08-15T18:02:43Z
    vcs.modified false

Does this issue reproduce with the latest release?

yes

What did you do?

! exec cue export ok1.cue
! exec cue export ok2.cue
! exec cue export bug.cue

-- ok1.cue --
#T: close({})
#T: {...}
x: #T
x: foo: "foo"

-- ok2.cue --
#S: {}
#T: s: #S
#T: s: {...}
x: #T.s
x: foo: "foo"

-- bug.cue --
#T: s: close({})
#T: s: {...}
x: #T.s
x: foo: "foo"

What did you expect to see?

The testscript should pass (i.e. all those CUE examples should fail to export)

What did you see instead?

The bug.cue example succeeds inappropriately.

rogpeppe avatar Aug 22 '22 10:08 rogpeppe