Retain empty optional import selection evidence
This commit is contained in:
@@ -192,11 +192,21 @@ type SourceInfo struct {
|
||||
UnderlayIndex int
|
||||
ImportedFrom *Location
|
||||
VersionCheck *SourceVersionCheck
|
||||
importSelections []importSelectionEvidence
|
||||
namespace *namespaceToken
|
||||
placementMode placementMode
|
||||
destinationUnresolved bool
|
||||
}
|
||||
|
||||
// importSelectionEvidence records one completed optional declaration whose
|
||||
// selected candidates produced no admitted source.
|
||||
type importSelectionEvidence struct {
|
||||
path Path
|
||||
location Location
|
||||
selector importSelector
|
||||
outcome importSelectionOutcome
|
||||
}
|
||||
|
||||
// SourceInfoPlacementModeForFacade converts private placement evidence to its
|
||||
// root-owned numeric representation.
|
||||
func SourceInfoPlacementModeForFacade(source SourceInfo) uint8 {
|
||||
@@ -293,6 +303,14 @@ func cloneSourceInfo(source SourceInfo) SourceInfo {
|
||||
source.ImportedFrom = cloneLocation(source.ImportedFrom)
|
||||
source.Destination = source.Destination.clone()
|
||||
source.VersionCheck = cloneSourceVersionCheck(source.VersionCheck)
|
||||
if source.importSelections != nil {
|
||||
selections := make([]importSelectionEvidence, len(source.importSelections))
|
||||
for index, selection := range source.importSelections {
|
||||
selection.path = selection.path.clone()
|
||||
selections[index] = selection
|
||||
}
|
||||
source.importSelections = selections
|
||||
}
|
||||
return source
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user