From e11c602be879bed207e77fd3ca7f5f5d57e26582 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Thu, 11 Jul 2024 14:25:48 -0700 Subject: [PATCH 1/2] Qualify the well-known IntPtr SpecialTypeInfo instance Fixes https://github.com/dotnet/runtime/issues/104567 --- .../gen/Microsoft.Interop.SourceGeneration/ManagedTypeInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/ManagedTypeInfo.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/ManagedTypeInfo.cs index caa9df8aa325d9..460098ecc90b66 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/ManagedTypeInfo.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/ManagedTypeInfo.cs @@ -88,7 +88,7 @@ public sealed record SpecialTypeInfo(string FullTypeName, string DiagnosticForma public static readonly SpecialTypeInfo Void = new("void", "void", SpecialType.System_Void); public static readonly SpecialTypeInfo String = new("string", "string", SpecialType.System_String); public static readonly SpecialTypeInfo Boolean = new("bool", "bool", SpecialType.System_Boolean); - public static readonly SpecialTypeInfo IntPtr = new("System.IntPtr", "System.IntPtr", SpecialType.System_IntPtr); + public static readonly SpecialTypeInfo IntPtr = new("global::System.IntPtr", "System.IntPtr", SpecialType.System_IntPtr); public bool Equals(SpecialTypeInfo? other) { From 0fd9db73692f02e675533dd7be6152b0ec4a8698 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Tue, 16 Jul 2024 15:11:50 -0700 Subject: [PATCH 2/2] Use nint instead of System.IntPtr --- .../gen/Microsoft.Interop.SourceGeneration/ManagedTypeInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/ManagedTypeInfo.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/ManagedTypeInfo.cs index 460098ecc90b66..e76e66981ed424 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/ManagedTypeInfo.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/ManagedTypeInfo.cs @@ -88,7 +88,7 @@ public sealed record SpecialTypeInfo(string FullTypeName, string DiagnosticForma public static readonly SpecialTypeInfo Void = new("void", "void", SpecialType.System_Void); public static readonly SpecialTypeInfo String = new("string", "string", SpecialType.System_String); public static readonly SpecialTypeInfo Boolean = new("bool", "bool", SpecialType.System_Boolean); - public static readonly SpecialTypeInfo IntPtr = new("global::System.IntPtr", "System.IntPtr", SpecialType.System_IntPtr); + public static readonly SpecialTypeInfo IntPtr = new("nint", "nint", SpecialType.System_IntPtr); public bool Equals(SpecialTypeInfo? other) {