Return a generic value
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();
|
||||
|
||||
}
|
||||
|
||||
@@ -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