@@ -203,8 +203,6 @@ private static void FillStack(int depth)
203203
204204 public static IEnumerable < object [ ] > GetUninitializedObject_NegativeTestCases ( )
205205 {
206- // TODO: Test actual function pointer types when typeof(delegate*<...>) support is available
207-
208206 yield return new [ ] { typeof ( string ) , typeof ( ArgumentException ) } ; // variable-length type
209207 yield return new [ ] { typeof ( int [ ] ) , typeof ( ArgumentException ) } ; // variable-length type
210208 yield return new [ ] { typeof ( int [ , ] ) , typeof ( ArgumentException ) } ; // variable-length type
@@ -227,11 +225,18 @@ public static IEnumerable<object[]> GetUninitializedObject_NegativeTestCases()
227225 yield return new [ ] { typeof ( Delegate ) , typeof ( MemberAccessException ) } ; // abstract type
228226
229227 yield return new [ ] { typeof ( void ) , typeof ( ArgumentException ) } ; // explicit block in place
230- yield return new [ ] { typeof ( int ) . MakePointerType ( ) , typeof ( ArgumentException ) } ; // pointer typedesc
231- yield return new [ ] { typeof ( int ) . MakeByRefType ( ) , typeof ( ArgumentException ) } ; // byref typedesc
228+ yield return new [ ] { typeof ( int ) . MakePointerType ( ) , typeof ( ArgumentException ) } ; // pointer
229+ yield return new [ ] { typeof ( int ) . MakeByRefType ( ) , typeof ( ArgumentException ) } ; // byref
230+
231+ // https://github.com/dotnet/runtime/issues/71095
232+ if ( ! PlatformDetection . IsMonoRuntime )
233+ {
234+ yield return new [ ] { FunctionPointerType ( ) , typeof ( ArgumentException ) } ; // function pointer
235+ static unsafe Type FunctionPointerType ( ) => typeof ( delegate * < void > ) ;
236+ }
232237
233- yield return new [ ] { typeof ( ReadOnlySpan < int > ) , typeof ( NotSupportedException ) } ; // byref type
234- yield return new [ ] { typeof ( ArgIterator ) , typeof ( NotSupportedException ) } ; // byref type
238+ yield return new [ ] { typeof ( ReadOnlySpan < int > ) , typeof ( NotSupportedException ) } ; // byref-like type
239+ yield return new [ ] { typeof ( ArgIterator ) , typeof ( NotSupportedException ) } ; // byref-like type
235240
236241 Type canonType = typeof ( object ) . Assembly . GetType ( "System.__Canon" , throwOnError : false ) ;
237242 if ( canonType != null )
0 commit comments