Skip to content

Commit d389ab9

Browse files
authored
Fix issue references in ConvertToLibraryImportAnalyzerTests (#89225)
1 parent 6e79f94 commit d389ab9

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/ConvertToLibraryImportAnalyzerTests.cs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ public static IEnumerable<object[]> NoMarshallingRequiredTypes() => new[]
3434
new object[] { typeof(int*) },
3535
new object[] { typeof(bool*) },
3636
new object[] { typeof(char*) },
37-
// See issue https://github.com/dotnet/runtime/issues/71891
38-
// new object[] { typeof(delegate* <void>) },
3937
new object[] { typeof(IntPtr) },
4038
new object[] { typeof(ConsoleKey) }, // enum
4139
};
@@ -50,7 +48,6 @@ public static IEnumerable<object[]> UnsupportedTypes() => new[]
5048
[Theory]
5149
[MemberData(nameof(MarshallingRequiredTypes))]
5250
[MemberData(nameof(NoMarshallingRequiredTypes))]
53-
[ActiveIssue("https://github.com/dotnet/runtime/issues/60909", typeof(PlatformDetection), nameof(PlatformDetection.IsArm64Process), nameof(PlatformDetection.IsWindows))]
5451
public async Task TypeRequiresMarshalling_ReportsDiagnostic(Type type)
5552
{
5653
string source = DllImportWithType(type.FullName!);
@@ -64,6 +61,20 @@ await VerifyCS.VerifyAnalyzerAsync(
6461
.WithArguments("Method_Return"));
6562
}
6663

64+
[Fact]
65+
public async Task FunctionPointer_ReportsDiagnostic()
66+
{
67+
string source = DllImportWithType("delegate* unmanaged<void>");
68+
await VerifyCS.VerifyAnalyzerAsync(
69+
source,
70+
VerifyCS.Diagnostic(ConvertToLibraryImport)
71+
.WithLocation(0)
72+
.WithArguments("Method_Parameter"),
73+
VerifyCS.Diagnostic(ConvertToLibraryImport)
74+
.WithLocation(1)
75+
.WithArguments("Method_Return"));
76+
}
77+
6778
[Theory]
6879
[MemberData(nameof(MarshallingRequiredTypes))]
6980
[MemberData(nameof(NoMarshallingRequiredTypes))]

0 commit comments

Comments
 (0)