From 26aa73734b954edceede316ae5288423aa9c8ba1 Mon Sep 17 00:00:00 2001 From: beakona Date: Fri, 30 Jul 2021 01:13:37 +0200 Subject: [PATCH] references are now updated.. --- .../AutoInterfaceSourceGenerator.cs | 6 +++--- .../BeaKona.AutoInterfaceGenerator.csproj | 10 +++++----- BeaKona.AutoInterfaceGenerator/ScopeInfo.cs | 6 +++--- .../BeaKona.AutoInterfaceGeneratorTest.csproj | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/BeaKona.AutoInterfaceGenerator/AutoInterfaceSourceGenerator.cs b/BeaKona.AutoInterfaceGenerator/AutoInterfaceSourceGenerator.cs index ccc017a..9407c7d 100644 --- a/BeaKona.AutoInterfaceGenerator/AutoInterfaceSourceGenerator.cs +++ b/BeaKona.AutoInterfaceGenerator/AutoInterfaceSourceGenerator.cs @@ -144,7 +144,7 @@ public void Execute(GeneratorExecutionContext context) private static List CollectRecords(GeneratorExecutionContext context, ISymbol symbol, ITypeSymbol receiverType, INamedTypeSymbol autoInterfaceAttributeSymbol, INamedTypeSymbol autoInterfaceTemplateAttributeSymbol) { List templateParts = new(); - Dictionary> danglingInterfaceTypesBySymbols = new(); + Dictionary> danglingInterfaceTypesBySymbols = new(SymbolEqualityComparer.Default); foreach (AttributeData attribute in symbol.GetAttributes()) { @@ -235,7 +235,7 @@ private static List CollectRecords(GeneratorExecutionContex templateParts.Add(new PartialTemplate(memberTargets, rxMemberFilter, new TemplateDefinition(templateLanguage ?? "scriban", templateBody.Trim()))); if (danglingInterfaceTypesBySymbols.TryGetValue(symbol, out HashSet interfaceTypes) == false) { - danglingInterfaceTypesBySymbols[symbol] = interfaceTypes = new HashSet(); + danglingInterfaceTypesBySymbols[symbol] = interfaceTypes = new HashSet(SymbolEqualityComparer.Default); } interfaceTypes.Add(interfaceType); @@ -288,7 +288,7 @@ private static List CollectRecords(GeneratorExecutionContex templateParts.Add(new PartialTemplate(memberTargets, rxMemberFilter, new TemplateDefinition(templateLanguage ?? "scriban", content))); if (danglingInterfaceTypesBySymbols.TryGetValue(symbol, out HashSet interfaceTypes) == false) { - danglingInterfaceTypesBySymbols[symbol] = interfaceTypes = new HashSet(); + danglingInterfaceTypesBySymbols[symbol] = interfaceTypes = new HashSet(SymbolEqualityComparer.Default); } interfaceTypes.Add(interfaceType); diff --git a/BeaKona.AutoInterfaceGenerator/BeaKona.AutoInterfaceGenerator.csproj b/BeaKona.AutoInterfaceGenerator/BeaKona.AutoInterfaceGenerator.csproj index 38ca786..49b049c 100644 --- a/BeaKona.AutoInterfaceGenerator/BeaKona.AutoInterfaceGenerator.csproj +++ b/BeaKona.AutoInterfaceGenerator/BeaKona.AutoInterfaceGenerator.csproj @@ -29,11 +29,11 @@ - - - - - + + + + + diff --git a/BeaKona.AutoInterfaceGenerator/ScopeInfo.cs b/BeaKona.AutoInterfaceGenerator/ScopeInfo.cs index ba75c4d..3a04f12 100644 --- a/BeaKona.AutoInterfaceGenerator/ScopeInfo.cs +++ b/BeaKona.AutoInterfaceGenerator/ScopeInfo.cs @@ -25,11 +25,11 @@ public ScopeInfo(ScopeInfo parentScope) public ITypeSymbol Type { get; } private readonly HashSet usedTypeArguments; - private readonly Dictionary aliasTypeParameterNameByCanonicalType = new Dictionary(SymbolEqualityComparer.Default); + private readonly Dictionary aliasTypeParameterNameByCanonicalType = new(SymbolEqualityComparer.Default); private static ImmutableList AllTypeArguments(ISymbol symbol) { - List types = new List(); + List types = new(); for (ISymbol s = symbol; s != null; s = s.ContainingType) { @@ -78,7 +78,7 @@ public bool TryGetAlias(ITypeSymbol symbol, /*[NotNullWhen(true)]*/ out string? return this.aliasTypeParameterNameByCanonicalType.TryGetValue(symbol, out alias); } - private static readonly Regex rxSplitter = new Regex(@"^\s*(?\w+)(?\d+)\s*$", RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.Singleline | RegexOptions.CultureInvariant); + private static readonly Regex rxSplitter = new(@"^\s*(?\w+)(?\d+)\s*$", RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.Singleline | RegexOptions.CultureInvariant); private static bool TrySplitAsBaseNameAndInteger(string name, /*[NotNullWhen(true)]*/ out string? baseName, /*[NotNullWhen(true)]*/ out int? value) { diff --git a/BeaKona.AutoInterfaceGeneratorTest/BeaKona.AutoInterfaceGeneratorTest.csproj b/BeaKona.AutoInterfaceGeneratorTest/BeaKona.AutoInterfaceGeneratorTest.csproj index bdf1c56..6cc1321 100644 --- a/BeaKona.AutoInterfaceGeneratorTest/BeaKona.AutoInterfaceGeneratorTest.csproj +++ b/BeaKona.AutoInterfaceGeneratorTest/BeaKona.AutoInterfaceGeneratorTest.csproj @@ -7,14 +7,14 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all