internal/core/adt: remove StructInfo for unused structs
Since the introduction of the new comprehension implementation,
it is possible to have uninitialized StructInfos in the list. We should
skip these for the purpose of feature set analysis.
We picked the solution to remove these after completing the arcs,
rather than filtering out ununitialized structs when needed. This
throws away some information, but it seems more robust overall.
It may reorder some fields, because the features in dropped
StructLits, which are now no longer there, can no longer
influence the topological ordering computed in feature
extraction. This should improve the ordering as the user
probably does not expect to have fields in dropped
comprehensions influenece order.
Fixes #1879
Change-Id: I86a08cb87c26a3a1463fc1e4e8ff6fb383283530
Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/543404
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
Reviewed-by: Paul Jolly <paul@myitcv.io>