// Issue #3881
-- in.cue --
import "list"

out: #Output & {#input: _input}

_input: {
	for n in list.Range(1, 100, 1) {
		"A\(n)": "B\(n)": name: "name\(n)"
	}
}
#Embed: [string]: string
#Output: {
	#Embed
	#input: _

	for _, lvlA in #input {
		for nameB, lvlB in lvlA {
			(nameB): lvlB.name
		}
	}
}

_checkB1:  out.B1  @test(eq, "name1")
_checkB50: out.B50 @test(eq, "name50")
_checkB99: out.B99 @test(eq, "name99")
-- out/errors.txt --
[incomplete] #Output: cannot range over #input (incomplete type _):
    ./in.cue:15:17
-- out/eval/stats --
Leaks:  0
Freed:  703
Reused: 298
Allocs: 405
Retain: 0

Unifications: 703
Conjuncts:    1305
Disjuncts:    0

NumCloseIDs: 212

ConjunctInfos:       908
MaxConjunctInfos:    103
MaxReqSets:          104
