-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/core/dep: distinghish inline structs
With an upcoming change, inline structs can be shared and reappropriated as regular structs in some cases. This means that the current algorithm, which assumes that inline structs are always local to the current field, is no longer correct. We modify the algorithm to prepare for this change. One aspect of this is isLocal, which checks whether the field references resolve to within the current scope of dependency analysis (by comparing to empty). Another change is that we now need to be more precise when it comes to checking whether a Vertex is rooted or not. We use IsDetached and MayAttach instead of Rooted for V3 in some cases. Finally, we are now more aggressive with taking the top reference, instead of an interstitial reference, as the representative reference. This results in better output even for V2 Changes: issue2247.txtar: appropriate simplication import.txtar: fixes an issue in v2 let2.txtar: the v3 output seems more correct, as the original reference is more important than the interstitial one. Issue #2854 Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: I618bb38bc6cfe0200f6950a30063bc2fcfa31b34 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1202268 Unity-Result: CUE porcuepine <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Matthew Sackman <[email protected]>
- Loading branch information
Showing
5 changed files
with
75 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters