public TypeConstraintSystemDiagnostics(TypeConstraintSystemDiagnostics other) : this() { foreach (var kvp in other.erroneousTypes) { erroneousTypes[kvp.Key].AddRange(kvp.Value); } foreach (var kvp in other.erroneousInheritedTypeParameters) { erroneousInheritedTypeParameters[kvp.Key].AddRange(kvp.Value); } foreach (var kvp in other.erroneousInheritedProfiles) { erroneousInheritedProfiles[kvp.Key].AddRange(kvp.Value); } }
public void RegisterDiagnostics(TypeConstraintSystemDiagnostics typeDiagnostics) { RegisterDuplicateTypes(typeDiagnostics.DuplicateTypes); RegisterConflictingTypes(typeDiagnostics.ConflictingTypes); foreach (var kvp in typeDiagnostics.erroneousTypes) { // This should avoid directly adding elements that were previously handled switch (kvp.Key) { case DiagnosticType.Conflicting: case DiagnosticType.Duplicate: continue; } erroneousTypes[kvp.Key].AddRange(kvp.Value); } erroneousInheritedTypeParameters.AddRange(typeDiagnostics.erroneousInheritedTypeParameters); erroneousInheritedProfiles.AddRange(typeDiagnostics.erroneousInheritedProfiles); }