@@ -221,6 +221,7 @@ public static string FormatParameterList(
221221 parameterList : ( m ?? throw new ArgumentNullException ( nameof ( m ) ) ) . GetParameters ( ) ,
222222#if SYSTEM_REFLECTION_NULLABILITYINFOCONTEXT
223223 nullabilityInfoContext : null ,
224+ nullabilityInfoContextLockObject: null ,
224225#endif
225226 typeWithNamespace: typeWithNamespace,
226227 useDefaultLiteral : useDefaultLiteral
@@ -236,6 +237,22 @@ public static string FormatParameterList(
236237 => FormatParameterListCore (
237238 parameterList : ( m ?? throw new ArgumentNullException ( nameof ( m ) ) ) . GetParameters ( ) ,
238239 nullabilityInfoContext : nullabilityInfoContext ,
240+ nullabilityInfoContextLockObject : null ,
241+ typeWithNamespace : typeWithNamespace ,
242+ useDefaultLiteral : useDefaultLiteral
243+ ) ;
244+
245+ public static string FormatParameterList (
246+ MethodBase m ,
247+ NullabilityInfoContext ? nullabilityInfoContext ,
248+ object ? nullabilityInfoContextLockObject ,
249+ bool typeWithNamespace = true ,
250+ bool useDefaultLiteral = false
251+ )
252+ => FormatParameterListCore (
253+ parameterList : ( m ?? throw new ArgumentNullException ( nameof ( m ) ) ) . GetParameters ( ) ,
254+ nullabilityInfoContext : nullabilityInfoContext ,
255+ nullabilityInfoContextLockObject : nullabilityInfoContextLockObject ,
239256 typeWithNamespace : typeWithNamespace ,
240257 useDefaultLiteral : useDefaultLiteral
241258 ) ;
@@ -250,6 +267,7 @@ public static string FormatParameterList(
250267 parameterList : parameterList ?? throw new ArgumentNullException ( nameof ( parameterList ) ) ,
251268#if SYSTEM_REFLECTION_NULLABILITYINFOCONTEXT
252269 nullabilityInfoContext : null ,
270+ nullabilityInfoContextLockObject: null ,
253271#endif
254272 typeWithNamespace: typeWithNamespace,
255273 useDefaultLiteral : useDefaultLiteral
@@ -265,6 +283,22 @@ public static string FormatParameterList(
265283 => FormatParameterListCore (
266284 parameterList : parameterList ?? throw new ArgumentNullException ( nameof ( parameterList ) ) ,
267285 nullabilityInfoContext : nullabilityInfoContext ,
286+ nullabilityInfoContextLockObject : null ,
287+ typeWithNamespace : typeWithNamespace ,
288+ useDefaultLiteral : useDefaultLiteral
289+ ) ;
290+
291+ public static string FormatParameterList (
292+ ParameterInfo [ ] parameterList ,
293+ NullabilityInfoContext ? nullabilityInfoContext ,
294+ object ? nullabilityInfoContextLockObject ,
295+ bool typeWithNamespace = true ,
296+ bool useDefaultLiteral = false
297+ )
298+ => FormatParameterListCore (
299+ parameterList : parameterList ?? throw new ArgumentNullException ( nameof ( parameterList ) ) ,
300+ nullabilityInfoContext : nullabilityInfoContext ,
301+ nullabilityInfoContextLockObject : nullabilityInfoContextLockObject ,
268302 typeWithNamespace : typeWithNamespace ,
269303 useDefaultLiteral : useDefaultLiteral
270304 ) ;
@@ -274,6 +308,7 @@ private static string FormatParameterListCore(
274308 ParameterInfo [ ] parameterList ,
275309#if SYSTEM_REFLECTION_NULLABILITYINFOCONTEXT
276310 NullabilityInfoContext ? nullabilityInfoContext ,
311+ object ? nullabilityInfoContextLockObject ,
277312#endif
278313 bool typeWithNamespace = true ,
279314 bool useDefaultLiteral = false
@@ -285,6 +320,7 @@ private static string FormatParameterListCore(
285320 p ,
286321#if SYSTEM_REFLECTION_NULLABILITYINFOCONTEXT
287322 nullabilityInfoContext : nullabilityInfoContext,
323+ nullabilityInfoContextLockObject: nullabilityInfoContextLockObject,
288324#endif
289325 typeWithNamespace: typeWithNamespace,
290326 useDefaultLiteral : useDefaultLiteral
@@ -297,10 +333,11 @@ public static string FormatParameter(
297333 bool typeWithNamespace = true ,
298334 bool useDefaultLiteral = false
299335 )
300- => FormatParameter (
336+ => FormatParameterCore (
301337 p : p ?? throw new ArgumentNullException ( nameof ( p ) ) ,
302338#if SYSTEM_REFLECTION_NULLABILITYINFOCONTEXT
303339 nullabilityInfoContext : null ,
340+ nullabilityInfoContextLockObject: null ,
304341#endif
305342 typeWithNamespace: typeWithNamespace,
306343 typeWithDeclaringTypeName : true ,
@@ -323,6 +360,22 @@ public static string FormatParameter(
323360 => FormatParameter (
324361 p : p ?? throw new ArgumentNullException ( nameof ( p ) ) ,
325362 nullabilityInfoContext : nullabilityInfoContext ,
363+ nullabilityInfoContextLockObject : null ,
364+ typeWithNamespace : typeWithNamespace ,
365+ useDefaultLiteral : useDefaultLiteral
366+ ) ;
367+
368+ public static string FormatParameter (
369+ ParameterInfo p ,
370+ NullabilityInfoContext ? nullabilityInfoContext ,
371+ object ? nullabilityInfoContextLockObject ,
372+ bool typeWithNamespace = true ,
373+ bool useDefaultLiteral = false
374+ )
375+ => FormatParameterCore (
376+ p : p ?? throw new ArgumentNullException ( nameof ( p ) ) ,
377+ nullabilityInfoContext : nullabilityInfoContext ,
378+ nullabilityInfoContextLockObject : nullabilityInfoContextLockObject ,
326379 typeWithNamespace : typeWithNamespace ,
327380 typeWithDeclaringTypeName : true ,
328381 valueFormatOptions : new (
@@ -335,10 +388,11 @@ public static string FormatParameter(
335388 ) ;
336389#endif
337390
338- internal static string FormatParameter (
391+ internal static string FormatParameterCore (
339392 ParameterInfo p ,
340393#if SYSTEM_REFLECTION_NULLABILITYINFOCONTEXT
341394 NullabilityInfoContext ? nullabilityInfoContext ,
395+ object ? nullabilityInfoContextLockObject ,
342396#endif
343397 bool typeWithNamespace ,
344398 bool typeWithDeclaringTypeName ,
@@ -368,6 +422,7 @@ ValueFormatOptions valueFormatOptions
368422#pragma warning disable SA1114
369423#if SYSTEM_REFLECTION_NULLABILITYINFOCONTEXT
370424 nullabilityInfoContext : nullabilityInfoContext,
425+ nullabilityInfoContextLockObject: nullabilityInfoContextLockObject,
371426#endif
372427 typeWithNamespace: typeWithNamespace,
373428 withDeclaringTypeName : typeWithDeclaringTypeName
0 commit comments