diff --git a/src/Common/ITypeSymbolExtensions.cs b/src/Common/ITypeSymbolExtensions.cs
index 23134f5e..307a8afe 100644
--- a/src/Common/ITypeSymbolExtensions.cs
+++ b/src/Common/ITypeSymbolExtensions.cs
@@ -12,7 +12,7 @@ internal static class ITypeSymbolExtensions
/// The type and any inherited types.
public static IEnumerable GetBaseTypesAndThis(this ITypeSymbol type)
{
- var current = type;
+ ITypeSymbol? current = type;
while (current is not null)
{
yield return current;