Fix rendering of exceptions with generic params

Closes #145
This commit is contained in:
Patrik Svensson
2020-11-24 22:03:31 +01:00
committed by Patrik Svensson
parent a5125d640c
commit 4f6eca4fcb
5 changed files with 85 additions and 13 deletions

View File

@ -8,6 +8,9 @@ namespace Spectre.Console.Tests.Data
[SuppressMessage("Usage", "CA1801:Review unused parameters", Justification = "<Pending>")]
public static bool MethodThatThrows(int? number) => throw new InvalidOperationException("Throwing!");
[SuppressMessage("Usage", "CA1801:Review unused parameters", Justification = "<Pending>")]
public static bool GenericMethodThatThrows<T0, T1, TRet>(int? number) => throw new InvalidOperationException("Throwing!");
public static void ThrowWithInnerException()
{
try
@ -19,5 +22,17 @@ namespace Spectre.Console.Tests.Data
throw new InvalidOperationException("Something threw!", ex);
}
}
public static void ThrowWithGenericInnerException()
{
try
{
GenericMethodThatThrows<int, float, double>(null);
}
catch (Exception ex)
{
throw new InvalidOperationException("Something threw!", ex);
}
}
}
}