internal/core/adt: strengthen field-set and arc-type checks
CompleteArcsOnly now waits for allKnown &^ subFieldsProcessed
rather than fieldSetKnown, so pending arcs are reliably
detected and reported as undefined fields.
unifyNode now requests arcTypeKnown|fieldSetKnown so that
resolving a selector also confirms the target's field set.
processAncestors: guard against a nil parent state. When
p.state is nil the parent has not entered evaluation yet.
The added fieldSetKnown condition causes handleParents to
reach processAncestors for nodes whose parents were never
unified; without the guard it crashes.
Reproducer: TestScript/cmd_typocheck.
Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: Ife4f4e10b2f1a51e9312ce45eee64f2032a35604
Reviewed-on: https://cue.gerrithub.io/c/cue-lang/cue/+/1236068
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>