diff --git a/ICSharpCode.Decompiler/TypeSystem/IParameter.cs b/ICSharpCode.Decompiler/TypeSystem/IParameter.cs
index 530f2406a..481613318 100644
--- a/ICSharpCode.Decompiler/TypeSystem/IParameter.cs
+++ b/ICSharpCode.Decompiler/TypeSystem/IParameter.cs
@@ -105,44 +105,4 @@ namespace ICSharpCode.Decompiler.TypeSystem
///
IParameterizedMember? Owner { get; }
}
-
- internal static class IParameterExtensions
- {
- ///
- /// Checks if the parameter is allowed to be assigned a default value.
- ///
- ///
- /// This checks , , ,
- /// and on this parameter and all subsequent parameters.
- /// If the parameter has no , it does not check subsequent parameters.
- ///
- /// The parameter
- /// True if the has a default value and is allowed to be assigned a default value.
- public static bool IsDefaultValueAssignmentAllowed(this IParameter parameter)
- {
- if (!DefaultValueAssignmentAllowedIndividual(parameter))
- return false;
-
- if (parameter.Owner == null)
- return true;
-
- for (int i = parameter.Owner.Parameters.Count - 1; i >= 0; i--)
- {
- IParameter otherParameter = parameter.Owner.Parameters[i];
- if (otherParameter == parameter)
- break;
-
- if (DefaultValueAssignmentAllowedIndividual(otherParameter) || otherParameter.IsParams)
- continue;
-
- return false;
- }
- return true;
-
- static bool DefaultValueAssignmentAllowedIndividual(IParameter parameter)
- {
- return parameter.IsOptional && parameter.HasConstantValueInSignature && parameter.ReferenceKind is ReferenceKind.None or ReferenceKind.In or ReferenceKind.RefReadOnly;
- }
- }
- }
}
diff --git a/ICSharpCode.Decompiler/TypeSystem/TypeSystemExtensions.cs b/ICSharpCode.Decompiler/TypeSystem/TypeSystemExtensions.cs
index e26781cfb..8689fc95f 100644
--- a/ICSharpCode.Decompiler/TypeSystem/TypeSystemExtensions.cs
+++ b/ICSharpCode.Decompiler/TypeSystem/TypeSystemExtensions.cs
@@ -612,6 +612,45 @@ namespace ICSharpCode.Decompiler.TypeSystem
}
#endregion
+ #region IParameter.IsDefaultValueAssignmentAllowed
+ ///
+ /// Checks if the parameter is allowed to be assigned a default value.
+ ///
+ ///
+ /// This checks , , ,
+ /// and on this parameter and all subsequent parameters.
+ /// If the parameter has no , it does not check subsequent parameters.
+ ///
+ /// The parameter
+ /// True if the has a default value and is allowed to be assigned a default value.
+ public static bool IsDefaultValueAssignmentAllowed(this IParameter parameter)
+ {
+ if (!DefaultValueAssignmentAllowedIndividual(parameter))
+ return false;
+
+ if (parameter.Owner == null)
+ return true;
+
+ for (int i = parameter.Owner.Parameters.Count - 1; i >= 0; i--)
+ {
+ IParameter otherParameter = parameter.Owner.Parameters[i];
+ if (otherParameter == parameter)
+ break;
+
+ if (DefaultValueAssignmentAllowedIndividual(otherParameter) || otherParameter.IsParams)
+ continue;
+
+ return false;
+ }
+ return true;
+
+ static bool DefaultValueAssignmentAllowedIndividual(IParameter parameter)
+ {
+ return parameter.IsOptional && parameter.HasConstantValueInSignature && parameter.ReferenceKind is ReferenceKind.None or ReferenceKind.In or ReferenceKind.RefReadOnly;
+ }
+ }
+ #endregion
+
#region IAssembly.GetTypeDefinition(string,string,int)
///
/// Gets the type definition for a top-level type.