cuelang/cue

cue trim bug: conjunctions and definitions

vikstrous2 opened this issue · 1 comments

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

$ cue version
cue version v0.4.0 linux/amd64

Does this issue reproduce with the latest release?

yes, also tested with master

What did you do?

#def2: {
	in2: string
}
#def1: {
	in1: string
	out: #def2 & {
		in2: in1
	}
}
a: #def1 & {
    in1: "test"
}

This is as much as I was able to simplify the bug. There might be a bit more it could be simplified though. Inlining #def1 or #def2 seems to "fix" it.

What did you expect to see?

probably no change

What did you see instead?

  {
      #def2: {
        in2: string
      }
      #def1: {
        in1: string
        out: {
                in2: string
        }
      }
      a: {
          in1: "test"
          out: {
-             in2: "test"
+             in2: string
          }
      }
  }
Aborting trim, output differs after trimming. This is a bug! Use -i to force trim.
You can file a bug here: https://github.com/cuelang/cue/issues/new?assignees=&labels=NeedsInvestigation&template=bug_report.md&title=

This issue has been migrated to cue-lang/cue#1062.

For more details about CUE's migration to a new home, please see cue-lang/cue#1078.