Fix for Explicit DefaultValue is not defined (#31)
* Fix for Explicit DefaultValue is not defined * .
This commit is contained in:
@@ -26,8 +26,16 @@ internal static class ParameterSymbolExtensions
|
||||
public static string GetParamsPrefix(this IParameterSymbol ps) =>
|
||||
ps.IsParams ? "params " : string.Empty;
|
||||
|
||||
public static string GetDefaultValue(this IParameterSymbol ps) =>
|
||||
ps.HasExplicitDefaultValue ? $" = {ps.ExplicitDefaultValue}" : string.Empty;
|
||||
public static string GetDefaultValue(this IParameterSymbol ps)
|
||||
{
|
||||
if (!ps.HasExplicitDefaultValue)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
var defaultValue = ps.ExplicitDefaultValue ?? "null";
|
||||
return $" = {defaultValue}";
|
||||
}
|
||||
|
||||
public static TypeEnum GetTypeEnum(this IParameterSymbol p) =>
|
||||
p.Type.GetTypeEnum();
|
||||
|
||||
Reference in New Issue
Block a user