@@ -393,38 +393,26 @@ public static void ValidateGenericInterface()
393
393
Console . WriteLine ( " -- Validate cast" ) ;
394
394
395
395
// ITestGeneric<int, int> -> ITestGenericIntImpl
396
- if ( ! TestLibrary . Utilities . IsNativeAot ) // https://github.com/dotnet/runtime/issues/108229
397
- {
398
- Assert . True ( castableObj is ITestGeneric < int , int > , $ "Should be castable to { nameof ( ITestGeneric < int , int > ) } via is") ;
399
- Assert . NotNull ( castableObj as ITestGeneric < int , int > ) ;
400
- }
396
+ Assert . True ( castableObj is ITestGeneric < int , int > , $ "Should be castable to { nameof ( ITestGeneric < int , int > ) } via is") ;
397
+ Assert . NotNull ( castableObj as ITestGeneric < int , int > ) ;
401
398
ITestGeneric < int , int > testInt = ( ITestGeneric < int , int > ) castableObj ;
402
399
403
400
// ITestGeneric<string, string> -> ITestGenericImpl<string, string>
404
- if ( ! TestLibrary . Utilities . IsNativeAot ) // https://github.com/dotnet/runtime/issues/108229
405
- {
406
- Assert . True ( castableObj is ITestGeneric < string , string > , $ "Should be castable to { nameof ( ITestGeneric < string , string > ) } via is") ;
407
- Assert . NotNull ( castableObj as ITestGeneric < string , string > ) ;
408
- }
401
+ Assert . True ( castableObj is ITestGeneric < string , string > , $ "Should be castable to { nameof ( ITestGeneric < string , string > ) } via is") ;
402
+ Assert . NotNull ( castableObj as ITestGeneric < string , string > ) ;
409
403
ITestGeneric < string , string > testStr = ( ITestGeneric < string , string > ) castableObj ;
410
404
411
405
// Validate Variance
412
406
// ITestGeneric<string, object> -> ITestGenericImpl<object, string>
413
- if ( ! TestLibrary . Utilities . IsNativeAot ) // https://github.com/dotnet/runtime/issues/108229
414
- {
415
- Assert . True ( castableObj is ITestGeneric < string , object > , $ "Should be castable to { nameof ( ITestGeneric < string , object > ) } via is") ;
416
- Assert . NotNull ( castableObj as ITestGeneric < string , object > ) ;
417
- }
407
+ Assert . True ( castableObj is ITestGeneric < string , object > , $ "Should be castable to { nameof ( ITestGeneric < string , object > ) } via is") ;
408
+ Assert . NotNull ( castableObj as ITestGeneric < string , object > ) ;
418
409
ITestGeneric < string , object > testVar = ( ITestGeneric < string , object > ) castableObj ;
419
410
420
- if ( ! TestLibrary . Utilities . IsNativeAot ) // https://github.com/dotnet/runtime/issues/108229
421
- {
422
- // ITestGeneric<bool, bool> is not recognized
423
- Assert . False ( castableObj is ITestGeneric < bool , bool > , $ "Should not be castable to { nameof ( ITestGeneric < bool , bool > ) } via is") ;
424
- Assert . Null ( castableObj as ITestGeneric < bool , bool > ) ;
425
- var ex = Assert . Throws < DynamicInterfaceCastableException > ( ( ) => { var _ = ( ITestGeneric < bool , bool > ) castableObj ; } ) ;
426
- Assert . Equal ( string . Format ( DynamicInterfaceCastableException . ErrorFormat , typeof ( ITestGeneric < bool , bool > ) ) , ex . Message ) ;
427
- }
411
+ // ITestGeneric<bool, bool> is not recognized
412
+ Assert . False ( castableObj is ITestGeneric < bool , bool > , $ "Should not be castable to { nameof ( ITestGeneric < bool , bool > ) } via is") ;
413
+ Assert . Null ( castableObj as ITestGeneric < bool , bool > ) ;
414
+ var ex = Assert . Throws < DynamicInterfaceCastableException > ( ( ) => { var _ = ( ITestGeneric < bool , bool > ) castableObj ; } ) ;
415
+ Assert . Equal ( string . Format ( DynamicInterfaceCastableException . ErrorFormat , typeof ( ITestGeneric < bool , bool > ) ) , ex . Message ) ;
428
416
429
417
int expectedInt = 42 ;
430
418
string expectedStr = "str" ;
0 commit comments