Skip to content
Prev Previous commit
Next Next commit
Simplify type checking to only allow primitive types and string
Co-authored-by: benbp <1020379+benbp@users.noreply.github.com>
  • Loading branch information
Copilot and benbp committed Aug 7, 2025
commit 22286418ef0c88d78d4af893635111fead9f80be
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ private static bool IsValidReturnType(ITypeSymbol returnType, Compilation compil

private static bool IsBuiltInValueTypeOrString(ITypeSymbol type)
{
// Check for primitive types by SpecialType
switch (type.SpecialType)
{
case SpecialType.System_Boolean:
Expand All @@ -154,13 +155,11 @@ private static bool IsBuiltInValueTypeOrString(ITypeSymbol type)
case SpecialType.System_UInt32:
case SpecialType.System_Int64:
case SpecialType.System_UInt64:
case SpecialType.System_Decimal:
case SpecialType.System_Single:
case SpecialType.System_Double:
case SpecialType.System_String:
case SpecialType.System_IntPtr:
case SpecialType.System_UIntPtr:
case SpecialType.System_DateTime:
case SpecialType.System_String:
return true;
default:
return false;
Expand Down
Loading