aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core/Link/ReportConflictingSymbolsCommand.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.Core/Link/ReportConflictingSymbolsCommand.cs')
-rw-r--r--src/WixToolset.Core/Link/ReportConflictingSymbolsCommand.cs20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/WixToolset.Core/Link/ReportConflictingSymbolsCommand.cs b/src/WixToolset.Core/Link/ReportConflictingSymbolsCommand.cs
index 39c3a5c2..ac0dd7ec 100644
--- a/src/WixToolset.Core/Link/ReportConflictingSymbolsCommand.cs
+++ b/src/WixToolset.Core/Link/ReportConflictingSymbolsCommand.cs
@@ -6,17 +6,18 @@ namespace WixToolset.Link
6 using System.Linq; 6 using System.Linq;
7 using WixToolset.Data; 7 using WixToolset.Data;
8 8
9 public class ReportConflictingSymbolsCommand : ICommand 9 public class ReportConflictingSymbolsCommand
10 { 10 {
11 private IEnumerable<Symbol> possibleConflicts; 11 public ReportConflictingSymbolsCommand(IEnumerable<Symbol> possibleConflicts, IEnumerable<IntermediateSection> resolvedSections)
12 private IEnumerable<Section> resolvedSections;
13
14 public ReportConflictingSymbolsCommand(IEnumerable<Symbol> possibleConflicts, IEnumerable<Section> resolvedSections)
15 { 12 {
16 this.possibleConflicts = possibleConflicts; 13 this.PossibleConflicts = possibleConflicts;
17 this.resolvedSections = resolvedSections; 14 this.ResolvedSections = resolvedSections;
18 } 15 }
19 16
17 private IEnumerable<Symbol> PossibleConflicts { get; }
18
19 private IEnumerable<IntermediateSection> ResolvedSections { get; }
20
20 public void Execute() 21 public void Execute()
21 { 22 {
22 // Do a quick check if there are any possibly conflicting symbols that don't come from tables that allow 23 // Do a quick check if there are any possibly conflicting symbols that don't come from tables that allow
@@ -25,10 +26,11 @@ namespace WixToolset.Link
25 // symbols are in sections we actually referenced. From the resulting set, show an error for each duplicate 26 // symbols are in sections we actually referenced. From the resulting set, show an error for each duplicate
26 // (aka: conflicting) symbol. This should catch any rows with colliding primary keys (since symbols are based 27 // (aka: conflicting) symbol. This should catch any rows with colliding primary keys (since symbols are based
27 // on the primary keys of rows). 28 // on the primary keys of rows).
28 List<Symbol> illegalDuplicates = possibleConflicts.Where(s => "WixAction" != s.Row.Table.Name && "WixVariable" != s.Row.Table.Name).ToList(); 29 var illegalDuplicates = this.PossibleConflicts.Where(s => s.Row.Definition.Type != TupleDefinitionType.WixAction && s.Row.Definition.Type != TupleDefinitionType.WixVariable).ToList();
29 if (0 < illegalDuplicates.Count) 30 if (0 < illegalDuplicates.Count)
30 { 31 {
31 HashSet<Section> referencedSections = new HashSet<Section>(resolvedSections); 32 var referencedSections = new HashSet<IntermediateSection>(this.ResolvedSections);
33
32 foreach (Symbol referencedDuplicateSymbol in illegalDuplicates.Where(s => referencedSections.Contains(s.Section))) 34 foreach (Symbol referencedDuplicateSymbol in illegalDuplicates.Where(s => referencedSections.Contains(s.Section)))
33 { 35 {
34 List<Symbol> actuallyReferencedDuplicateSymbols = referencedDuplicateSymbol.PossiblyConflictingSymbols.Where(s => referencedSections.Contains(s.Section)).ToList(); 36 List<Symbol> actuallyReferencedDuplicateSymbols = referencedDuplicateSymbol.PossiblyConflictingSymbols.Where(s => referencedSections.Contains(s.Section)).ToList();