# Cross-package embedded disjunction of definitions should correctly
# eliminate branches when unified with a concrete field.
# From issue #4197.
-- cue.mod/module.cue --
module: "foo.test/main"
language: version: "v0.14.0"
-- in.cue --
package main

import "foo.test/main/imported"

out: imported
out: either: foo: "world"
-- imported/imported.cue --
package imported

#Foo: foo: _
#Bar: bar: _

{either: #Foo | #Bar}
-- out/compile --
--- in.cue
{
  out: 〈import;"foo.test/main/imported"〉
  out: {
    either: {
      foo: "world"
    }
  }
}
