@@ -393,38 +393,26 @@ public static void ValidateGenericInterface()
393393 Console . WriteLine ( " -- Validate cast" ) ;
394394
395395 // 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 > ) ;
401398 ITestGeneric < int , int > testInt = ( ITestGeneric < int , int > ) castableObj ;
402399
403400 // 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 > ) ;
409403 ITestGeneric < string , string > testStr = ( ITestGeneric < string , string > ) castableObj ;
410404
411405 // Validate Variance
412406 // 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 > ) ;
418409 ITestGeneric < string , object > testVar = ( ITestGeneric < string , object > ) castableObj ;
419410
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 ) ;
428416
429417 int expectedInt = 42 ;
430418 string expectedStr = "str" ;
0 commit comments