@@ -331,53 +331,64 @@ internal static bool TryStripFirstCharAndTrailingSpaces(ref ReadOnlySpan<char> s
331
331
}
332
332
333
333
[ DoesNotReturn ]
334
- internal static void ThrowInvalidOperation_MaxNodesExceeded ( int limit ) => throw
335
- #if SYSTEM_REFLECTION_METADATA
336
- new InvalidOperationException ( SR . Format ( SR . InvalidOperation_MaxNodesExceeded , limit ) ) ;
337
- #else // corelib and tools that reference this file as a link
338
- new InvalidOperationException ( ) ;
339
- #endif
334
+ internal static void ThrowArgumentException_InvalidTypeName ( int errorIndex )
335
+ {
336
+ throw new ArgumentException ( SR . Argument_InvalidTypeName , $ "typeName@{ errorIndex } ") ;
337
+ }
340
338
341
339
[ DoesNotReturn ]
342
- internal static void ThrowArgumentException_InvalidTypeName ( int errorIndex ) => throw
343
- #if SYSTEM_PRIVATE_CORELIB
344
- new ArgumentException ( SR . Arg_ArgumentException , $ "typeName@ { errorIndex } " ) ;
345
- #elif SYSTEM_REFLECTION_METADATA
346
- new ArgumentException ( SR . Argument_InvalidTypeName , $ "typeName@ { errorIndex } " ) ;
347
- #else // tools that reference this file as a link
348
- new ArgumentException ( ) ;
340
+ internal static void ThrowInvalidOperation_MaxNodesExceeded ( int limit )
341
+ {
342
+ #if SYSTEM_REFLECTION_METADATA
343
+ throw new InvalidOperationException ( SR . Format ( SR . InvalidOperation_MaxNodesExceeded , limit ) ) ;
344
+ #else
345
+ Debug . Fail ( "Expected to be unreachable" ) ;
346
+ throw new InvalidOperationException ( ) ;
349
347
#endif
348
+ }
350
349
351
350
[ DoesNotReturn ]
352
- internal static void ThrowInvalidOperation_NotGenericType ( ) => throw
353
- #if SYSTEM_REFLECTION_METADATA || SYSTEM_PRIVATE_CORELIB
354
- new InvalidOperationException ( SR . InvalidOperation_NotGenericType ) ;
355
- #else // tools that reference this file as a link
356
- new InvalidOperationException ( ) ;
351
+ internal static void ThrowInvalidOperation_NotGenericType ( )
352
+ {
353
+ #if SYSTEM_REFLECTION_METADATA
354
+ throw new InvalidOperationException ( SR . InvalidOperation_NotGenericType ) ;
355
+ #else
356
+ Debug . Fail ( "Expected to be unreachable" ) ;
357
+ throw new InvalidOperationException ( ) ;
357
358
#endif
359
+ }
358
360
359
361
[ DoesNotReturn ]
360
- internal static void ThrowInvalidOperation_NotNestedType ( ) => throw
362
+ internal static void ThrowInvalidOperation_NotNestedType ( )
363
+ {
361
364
#if SYSTEM_REFLECTION_METADATA
362
- new InvalidOperationException ( SR . InvalidOperation_NotNestedType ) ;
363
- #else // corelib and tools that reference this file as a link
364
- new InvalidOperationException ( ) ;
365
+ throw new InvalidOperationException ( SR . InvalidOperation_NotNestedType ) ;
366
+ #else
367
+ Debug . Fail ( "Expected to be unreachable" ) ;
368
+ throw new InvalidOperationException ( ) ;
365
369
#endif
370
+ }
366
371
367
372
[ DoesNotReturn ]
368
- internal static void ThrowInvalidOperation_NoElement ( ) => throw
373
+ internal static void ThrowInvalidOperation_NoElement ( )
374
+ {
369
375
#if SYSTEM_REFLECTION_METADATA
370
- new InvalidOperationException ( SR . InvalidOperation_NoElement ) ;
371
- #else // corelib and tools that reference this file as a link
372
- new InvalidOperationException ( ) ;
376
+ throw new InvalidOperationException ( SR . InvalidOperation_NoElement ) ;
377
+ #else
378
+ Debug . Fail ( "Expected to be unreachable" ) ;
379
+ throw new InvalidOperationException ( ) ;
373
380
#endif
381
+ }
374
382
375
383
[ DoesNotReturn ]
376
- internal static void ThrowInvalidOperation_HasToBeArrayClass ( ) => throw
377
- #if SYSTEM_REFLECTION_METADATA || SYSTEM_PRIVATE_CORELIB
378
- new InvalidOperationException ( SR . Argument_HasToBeArrayClass ) ;
379
- #else // tools that reference this file as a link
380
- new InvalidOperationException ( ) ;
384
+ internal static void ThrowInvalidOperation_HasToBeArrayClass ( )
385
+ {
386
+ #if SYSTEM_REFLECTION_METADATA
387
+ throw new InvalidOperationException ( SR . Argument_HasToBeArrayClass ) ;
388
+ #else
389
+ Debug . Fail ( "Expected to be unreachable" ) ;
390
+ throw new InvalidOperationException ( ) ;
381
391
#endif
392
+ }
382
393
}
383
394
}
0 commit comments