#Issue: 1405

# TODO:
# One X.enabled should be a.#combined.enabled

-- in.cue --
a: {
	command: alias: {
		// TODO: fix inner referene.
		val: (instance & outer & {enabled: true}).value
		echo: cmd: val
	}

	#base: {
		enabled: bool | *false
		value?:  string
	}

	#combined: X=#base & {
		if X.enabled {
			value: "123456"
		}
	}

	instance: #combined & {enabled: true}
}

outer: k: l: int

-- out/dependencies/field --
line  reference    path of resulting vertex
-- out/dependencies/all --
line  reference    path of resulting vertex
4:    outer     => outer
-- diff/dependencies-v3/todo/p1 --
bring in line with evalv2
-- out/dependencies/dynamic --
line  reference                                     path of resulting vertex
14:   X.enabled                                  => a.instance.enabled
4:    outer                                      => outer
4:    (instance & outer & {enabled: true}).value => a.instance.value
4:    outer                                      => outer
5:    val                                        => a.command.alias.val
13:   #base                                      => a.#base
19:   #combined                                  => a.#combined
14:   X.enabled                                  => a.instance.enabled
