Merge pull request #3 from specklesystems/return-generic-type
Return generic type
This commit is contained in:
@@ -18,5 +18,6 @@ public class SameNameClass2 : ISameNameClass2
|
||||
{
|
||||
public ISameNameClass Return() => throw new InvalidOperationException();
|
||||
public SymbolToken Return2() => throw new InvalidOperationException();
|
||||
public T GetRequiredService<T>() where T : class => throw new InvalidOperationException();
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<LangVersion>Latest</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<PackageVersion>0.9.6</PackageVersion>
|
||||
<PackageVersion>0.9.7</PackageVersion>
|
||||
<developmentDependency>true</developmentDependency>
|
||||
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
|
||||
<IncludeBuildOutput>false</IncludeBuildOutput>
|
||||
|
||||
@@ -10,6 +10,10 @@ internal static class SymbolExtensions
|
||||
private static readonly HashSet<string> _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();
|
||||
|
||||
Reference in New Issue
Block a user