From 210276406b26167c530abc584f39c94a78e49207 Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Thu, 22 Aug 2024 16:02:01 +0100 Subject: [PATCH 1/2] Return a generic value --- Speckle.InterfaceGenerator.Tests/SameName/SameNameClass.1.cs | 1 + Speckle.InterfaceGenerator/SymbolExtensions.cs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Speckle.InterfaceGenerator.Tests/SameName/SameNameClass.1.cs b/Speckle.InterfaceGenerator.Tests/SameName/SameNameClass.1.cs index 2a751d8..9c855f5 100644 --- a/Speckle.InterfaceGenerator.Tests/SameName/SameNameClass.1.cs +++ b/Speckle.InterfaceGenerator.Tests/SameName/SameNameClass.1.cs @@ -18,5 +18,6 @@ public class SameNameClass2 : ISameNameClass2 { public ISameNameClass Return() => throw new InvalidOperationException(); public SymbolToken Return2() => throw new InvalidOperationException(); + public T GetRequiredService() where T : class => throw new InvalidOperationException(); } diff --git a/Speckle.InterfaceGenerator/SymbolExtensions.cs b/Speckle.InterfaceGenerator/SymbolExtensions.cs index 5518ff8..889d8bd 100644 --- a/Speckle.InterfaceGenerator/SymbolExtensions.cs +++ b/Speckle.InterfaceGenerator/SymbolExtensions.cs @@ -10,6 +10,10 @@ internal static class SymbolExtensions private static readonly HashSet _defaults = new() { "System", "Microsoft" }; public static string GetNamespaceAndType(this ITypeSymbol typeSymbol) { + if (typeSymbol is ITypeParameterSymbol t) + { + return t.Name; + } if (typeSymbol.SpecialType != SpecialType.None) { return typeSymbol.ToString(); From 42a1a3ca156666d7fc513a0837c213c70bd9bc98 Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Thu, 22 Aug 2024 16:02:28 +0100 Subject: [PATCH 2/2] 0.9.7 --- Speckle.InterfaceGenerator/Speckle.InterfaceGenerator.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Speckle.InterfaceGenerator/Speckle.InterfaceGenerator.csproj b/Speckle.InterfaceGenerator/Speckle.InterfaceGenerator.csproj index d49b068..0542471 100644 --- a/Speckle.InterfaceGenerator/Speckle.InterfaceGenerator.csproj +++ b/Speckle.InterfaceGenerator/Speckle.InterfaceGenerator.csproj @@ -3,7 +3,7 @@ netstandard2.0 Latest enable - 0.9.6 + 0.9.7 true false false