1- // ReSharper disable All
1+ // ReSharper disable All
22namespace ValidCode . DelegateCreateDelegate
33{
44 using System ;
@@ -12,49 +12,49 @@ public void Valid()
1212 {
1313 Assert . AreEqual ( 3 , ( ( Func < C , string , int > ) Delegate . CreateDelegate (
1414 typeof ( Func < C , string , int > ) ,
15- typeof ( C ) . GetMethod ( nameof ( C . StringInt ) , BindingFlags . Public | BindingFlags . Instance | BindingFlags . DeclaredOnly , null , new [ ] { typeof ( string ) } , null ) ) )
15+ typeof ( C ) . GetMethod ( nameof ( C . StringInt ) , BindingFlags . Public | BindingFlags . Instance | BindingFlags . DeclaredOnly , null , new [ ] { typeof ( string ) } , null ) ! ) )
1616 . Invoke ( new C ( ) , "abc" ) ) ;
1717
1818 Assert . AreEqual ( 3 , ( ( Func < string , int > ) Delegate . CreateDelegate (
1919 typeof ( Func < string , int > ) ,
2020 new C ( ) ,
21- typeof ( C ) . GetMethod ( nameof ( C . StringInt ) , BindingFlags . Public | BindingFlags . Instance | BindingFlags . DeclaredOnly , null , new [ ] { typeof ( string ) } , null ) ) )
21+ typeof ( C ) . GetMethod ( nameof ( C . StringInt ) , BindingFlags . Public | BindingFlags . Instance | BindingFlags . DeclaredOnly , null , new [ ] { typeof ( string ) } , null ) ! ) )
2222 . Invoke ( "abc" ) ) ;
2323
2424 ( ( Action < C , int > ) Delegate . CreateDelegate (
2525 typeof ( Action < C , int > ) ,
26- typeof ( C ) . GetMethod ( nameof ( C . IntVoid ) , BindingFlags . Public | BindingFlags . Instance | BindingFlags . DeclaredOnly , null , new [ ] { typeof ( int ) } , null ) ) )
26+ typeof ( C ) . GetMethod ( nameof ( C . IntVoid ) , BindingFlags . Public | BindingFlags . Instance | BindingFlags . DeclaredOnly , null , new [ ] { typeof ( int ) } , null ) ! ) )
2727 . Invoke ( new C ( ) , 1 ) ;
2828
2929 ( ( Action ) Delegate . CreateDelegate (
3030 typeof ( Action ) ,
3131 new C ( ) ,
32- typeof ( C ) . GetMethod ( nameof ( C . Void ) , BindingFlags . Public | BindingFlags . Instance | BindingFlags . DeclaredOnly , null , Type . EmptyTypes , null ) ) )
32+ typeof ( C ) . GetMethod ( nameof ( C . Void ) , BindingFlags . Public | BindingFlags . Instance | BindingFlags . DeclaredOnly , null , Type . EmptyTypes , null ) ! ) )
3333 . Invoke ( ) ;
3434
3535 ( ( Action < int > ) Delegate . CreateDelegate (
3636 typeof ( Action < int > ) ,
3737 new C ( ) ,
38- typeof ( C ) . GetMethod ( nameof ( C . IntVoid ) , BindingFlags . Public | BindingFlags . Instance | BindingFlags . DeclaredOnly , null , new [ ] { typeof ( int ) } , null ) ) )
38+ typeof ( C ) . GetMethod ( nameof ( C . IntVoid ) , BindingFlags . Public | BindingFlags . Instance | BindingFlags . DeclaredOnly , null , new [ ] { typeof ( int ) } , null ) ! ) )
3939 . Invoke ( 1 ) ;
4040
4141 ( ( Action < string > ) Delegate . CreateDelegate (
4242 typeof ( Action < string > ) ,
4343 new C ( ) ,
44- typeof ( C ) . GetMethod ( nameof ( C . StringVoid ) , BindingFlags . Public | BindingFlags . Instance | BindingFlags . DeclaredOnly , null , new [ ] { typeof ( string ) } , null ) ) )
44+ typeof ( C ) . GetMethod ( nameof ( C . StringVoid ) , BindingFlags . Public | BindingFlags . Instance | BindingFlags . DeclaredOnly , null , new [ ] { typeof ( string ) } , null ) ! ) )
4545 . Invoke ( "abc" ) ;
4646
4747 Assert . AreEqual ( 1 , ( ( Func < C , int > ) Delegate . CreateDelegate (
4848 typeof ( Func < C , int > ) ,
4949 typeof ( C ) . GetProperty (
5050 nameof ( C . Value ) ,
51- BindingFlags . Public | BindingFlags . Instance | BindingFlags . DeclaredOnly ) . GetMethod ) ) . Invoke ( new C ( ) ) ) ;
51+ BindingFlags . Public | BindingFlags . Instance | BindingFlags . DeclaredOnly ) ! . GetMethod ! ) ) . Invoke ( new C ( ) ) ) ;
5252
5353 Assert . AreEqual ( 1 , ( ( Func < C , int > ) Delegate . CreateDelegate (
5454 typeof ( Func < C , int > ) ,
5555 typeof ( C ) . GetProperty (
5656 nameof ( C . Value ) ,
57- BindingFlags . Public | BindingFlags . Instance | BindingFlags . DeclaredOnly ) . GetGetMethod ( ) ) ) . Invoke ( new C ( ) ) ) ;
57+ BindingFlags . Public | BindingFlags . Instance | BindingFlags . DeclaredOnly ! ) ! . GetGetMethod ( ) ! ) ) . Invoke ( new C ( ) ) ) ;
5858 }
5959
6060 private class C
0 commit comments