diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/ConvertToLibraryImportAnalyzerTests.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/ConvertToLibraryImportAnalyzerTests.cs index 8e8470e08805b..376f604439c23 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/ConvertToLibraryImportAnalyzerTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/ConvertToLibraryImportAnalyzerTests.cs @@ -34,8 +34,6 @@ public static IEnumerable NoMarshallingRequiredTypes() => new[] new object[] { typeof(int*) }, new object[] { typeof(bool*) }, new object[] { typeof(char*) }, - // See issue https://github.com/dotnet/runtime/issues/71891 - // new object[] { typeof(delegate* ) }, new object[] { typeof(IntPtr) }, new object[] { typeof(ConsoleKey) }, // enum }; @@ -50,7 +48,6 @@ public static IEnumerable UnsupportedTypes() => new[] [Theory] [MemberData(nameof(MarshallingRequiredTypes))] [MemberData(nameof(NoMarshallingRequiredTypes))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/60909", typeof(PlatformDetection), nameof(PlatformDetection.IsArm64Process), nameof(PlatformDetection.IsWindows))] public async Task TypeRequiresMarshalling_ReportsDiagnostic(Type type) { string source = DllImportWithType(type.FullName!); @@ -64,6 +61,20 @@ await VerifyCS.VerifyAnalyzerAsync( .WithArguments("Method_Return")); } + [Fact] + public async Task FunctionPointer_ReportsDiagnostic() + { + string source = DllImportWithType("delegate* unmanaged"); + await VerifyCS.VerifyAnalyzerAsync( + source, + VerifyCS.Diagnostic(ConvertToLibraryImport) + .WithLocation(0) + .WithArguments("Method_Parameter"), + VerifyCS.Diagnostic(ConvertToLibraryImport) + .WithLocation(1) + .WithArguments("Method_Return")); + } + [Theory] [MemberData(nameof(MarshallingRequiredTypes))] [MemberData(nameof(NoMarshallingRequiredTypes))]