11 instantiations of SpecialTypeInfo
Microsoft.Interop.SourceGeneration (11)
ManagedTypeInfo.cs (11)
37return new SpecialTypeInfo(typeName, diagnosticFormattedName, type.SpecialType); 73public static readonly SpecialTypeInfo Byte = new("byte", "byte", SpecialType.System_Byte); 74public static readonly SpecialTypeInfo SByte = new("sbyte", "sbyte", SpecialType.System_SByte); 75public static readonly SpecialTypeInfo Int16 = new("short", "short", SpecialType.System_Int16); 76public static readonly SpecialTypeInfo UInt16 = new("ushort", "ushort", SpecialType.System_UInt16); 77public static readonly SpecialTypeInfo Int32 = new("int", "int", SpecialType.System_Int32); 78public static readonly SpecialTypeInfo UInt32 = new("uint", "uint", SpecialType.System_UInt32); 79public static readonly SpecialTypeInfo Void = new("void", "void", SpecialType.System_Void); 80public static readonly SpecialTypeInfo String = new("string", "string", SpecialType.System_String); 81public static readonly SpecialTypeInfo Boolean = new("bool", "bool", SpecialType.System_Boolean); 82public static readonly SpecialTypeInfo IntPtr = new("nint", "nint", SpecialType.System_IntPtr);
64 references to SpecialTypeInfo
Microsoft.Interop.ComInterfaceGenerator (3)
ComInterfaceGenerator.cs (2)
224SpecialTypeInfo.Int32, 246&& ((managedReturnInfo.ManagedType is SpecialTypeInfo { SpecialType: SpecialType.System_Int32 or SpecialType.System_Enum } or EnumTypeInfo
Marshallers\StructAsHResultMarshallerFactory.cs (1)
25public ManagedTypeInfo AsNativeType(TypePositionInfo info) => SpecialTypeInfo.Int32;
Microsoft.Interop.JavaScript.JSImportGenerator (4)
JSExportGenerator.cs (2)
174if (allElements[i].IsNativeReturnPosition && allElements[i].ManagedType != SpecialTypeInfo.Void) 240hasReturn = nativeArgument.ManagedType != SpecialTypeInfo.Void;
JSImportGenerator.cs (2)
117SpecialTypeInfo.Void, 147hasReturn = info.ManagedType != SpecialTypeInfo.Void;
Microsoft.Interop.SourceGeneration (57)
BoundGenerators.cs (3)
20IBoundMarshallingGenerator defaultBoundGenerator = fallbackGenerator.Bind(new TypePositionInfo(SpecialTypeInfo.Void, NoMarshallingInfo.Instance), context); 255public bool IsManagedVoidReturn => ManagedReturnMarshaller.TypeInfo.ManagedType == SpecialTypeInfo.Void; 257public bool IsUnmanagedVoidReturn => NativeReturnMarshaller.TypeInfo.ManagedType == SpecialTypeInfo.Void;
GeneratedStatements.cs (2)
113if (marshallers.NativeReturnMarshaller.TypeInfo.ManagedType == SpecialTypeInfo.Void) 127if (marshallers.ManagedReturnMarshaller.TypeInfo.ManagedType == SpecialTypeInfo.Void)
ManagedToNativeStubGenerator.cs (1)
78HasForwardedTypes |= generator.IsForwarder() && generator is { TypeInfo.ManagedType: not SpecialTypeInfo { SpecialType: Microsoft.CodeAnalysis.SpecialType.System_Void } };
ManagedTypeInfo.cs (11)
73public static readonly SpecialTypeInfo Byte = new("byte", "byte", SpecialType.System_Byte); 74public static readonly SpecialTypeInfo SByte = new("sbyte", "sbyte", SpecialType.System_SByte); 75public static readonly SpecialTypeInfo Int16 = new("short", "short", SpecialType.System_Int16); 76public static readonly SpecialTypeInfo UInt16 = new("ushort", "ushort", SpecialType.System_UInt16); 77public static readonly SpecialTypeInfo Int32 = new("int", "int", SpecialType.System_Int32); 78public static readonly SpecialTypeInfo UInt32 = new("uint", "uint", SpecialType.System_UInt32); 79public static readonly SpecialTypeInfo Void = new("void", "void", SpecialType.System_Void); 80public static readonly SpecialTypeInfo String = new("string", "string", SpecialType.System_String); 81public static readonly SpecialTypeInfo Boolean = new("bool", "bool", SpecialType.System_Boolean); 82public static readonly SpecialTypeInfo IntPtr = new("nint", "nint", SpecialType.System_IntPtr); 84public bool Equals(SpecialTypeInfo? other)
Marshalling\AttributedMarshallingModelGeneratorResolver.cs (2)
87if (type is not SpecialTypeInfo specialType || !specialType.SpecialType.IsIntegralType()) 106if (marshallerData.NativeType is SpecialTypeInfo specialType && specialType.SpecialType.IsAlwaysBlittable())
Marshalling\BoolMarshaller.cs (6)
26Debug.Assert(info.ManagedType is SpecialTypeInfo { SpecialType: SpecialType.System_Boolean }); 99: base(signed ? SpecialTypeInfo.SByte : SpecialTypeInfo.Byte, trueValue: 1, falseValue: 0, compareToTrue: false) 117: base(signed ? SpecialTypeInfo.Int32 : SpecialTypeInfo.UInt32, trueValue: 1, falseValue: 0, compareToTrue: false) 130: base(SpecialTypeInfo.Int16, trueValue: VARIANT_TRUE, falseValue: VARIANT_FALSE, compareToTrue: true)
Marshalling\CharMarshaller.cs (2)
11private static readonly ManagedTypeInfo s_nativeType = SpecialTypeInfo.UInt16; 33Debug.Assert(info.ManagedType is SpecialTypeInfo {SpecialType: SpecialType.System_Char });
Marshalling\CharMarshallingGeneratorResolver.cs (1)
26if (info.ManagedType is SpecialTypeInfo { SpecialType: SpecialType.System_Char })
Marshalling\DelegateMarshaller.cs (1)
10return SpecialTypeInfo.IntPtr;
Marshalling\MarshalAsMarshallingGeneratorResolver.cs (18)
41case { ManagedType: SpecialTypeInfo { SpecialType: SpecialType.System_SByte }, MarshallingAttributeInfo: NoMarshallingInfo or MarshalAsInfo(UnmanagedType.I1, _) } 42or { ManagedType: SpecialTypeInfo { SpecialType: SpecialType.System_Byte }, MarshallingAttributeInfo: NoMarshallingInfo or MarshalAsInfo(UnmanagedType.U1, _) } 43or { ManagedType: SpecialTypeInfo { SpecialType: SpecialType.System_Int16 }, MarshallingAttributeInfo: NoMarshallingInfo or MarshalAsInfo(UnmanagedType.I2, _) } 44or { ManagedType: SpecialTypeInfo { SpecialType: SpecialType.System_UInt16 }, MarshallingAttributeInfo: NoMarshallingInfo or MarshalAsInfo(UnmanagedType.U2, _) } 45or { ManagedType: SpecialTypeInfo { SpecialType: SpecialType.System_Int32 }, MarshallingAttributeInfo: NoMarshallingInfo or MarshalAsInfo(UnmanagedType.I4 or UnmanagedType.Error, _) } 46or { ManagedType: SpecialTypeInfo { SpecialType: SpecialType.System_UInt32 }, MarshallingAttributeInfo: NoMarshallingInfo or MarshalAsInfo(UnmanagedType.U4 or UnmanagedType.Error, _) } 47or { ManagedType: SpecialTypeInfo { SpecialType: SpecialType.System_Int64 }, MarshallingAttributeInfo: NoMarshallingInfo or MarshalAsInfo(UnmanagedType.I8, _) } 48or { ManagedType: SpecialTypeInfo { SpecialType: SpecialType.System_UInt64 }, MarshallingAttributeInfo: NoMarshallingInfo or MarshalAsInfo(UnmanagedType.U8, _) } 49or { ManagedType: SpecialTypeInfo { SpecialType: SpecialType.System_IntPtr }, MarshallingAttributeInfo: NoMarshallingInfo or MarshalAsInfo(UnmanagedType.SysInt, _) } 50or { ManagedType: SpecialTypeInfo { SpecialType: SpecialType.System_UIntPtr }, MarshallingAttributeInfo: NoMarshallingInfo or MarshalAsInfo(UnmanagedType.SysUInt, _) } 51or { ManagedType: SpecialTypeInfo { SpecialType: SpecialType.System_Single }, MarshallingAttributeInfo: NoMarshallingInfo or MarshalAsInfo(UnmanagedType.R4, _) } 52or { ManagedType: SpecialTypeInfo { SpecialType: SpecialType.System_Double }, MarshallingAttributeInfo: NoMarshallingInfo or MarshalAsInfo(UnmanagedType.R8, _) }: 75case { ManagedType: SpecialTypeInfo { SpecialType: SpecialType.System_Boolean }, MarshallingAttributeInfo: MarshalAsInfo(UnmanagedType.U1, _) }: 77case { ManagedType: SpecialTypeInfo { SpecialType: SpecialType.System_Boolean }, MarshallingAttributeInfo: MarshalAsInfo(UnmanagedType.I1, _) }: 79case { ManagedType: SpecialTypeInfo { SpecialType: SpecialType.System_Boolean }, MarshallingAttributeInfo: MarshalAsInfo(UnmanagedType.U4, _) }: 81case { ManagedType: SpecialTypeInfo { SpecialType: SpecialType.System_Boolean }, MarshallingAttributeInfo: MarshalAsInfo(UnmanagedType.I4 or UnmanagedType.Bool, _) }: 83case { ManagedType: SpecialTypeInfo { SpecialType: SpecialType.System_Boolean }, MarshallingAttributeInfo: MarshalAsInfo(UnmanagedType.VariantBool, _) }: 95case { ManagedType: SpecialTypeInfo { SpecialType: SpecialType.System_Void } }:
Marshalling\NoMarshallingInfoErrorResolver.cs (2)
43{ SpecialTypeInfo.String, string.Format(SR.MarshallingStringOrCharAsUndefinedNotSupported, stringMarshallingAttribute) }, 44{ SpecialTypeInfo.Boolean, SR.MarshallingBoolAsUndefinedNotSupported },
Marshalling\StatefulMarshallingStrategy.cs (1)
241new TypePositionInfo(SpecialTypeInfo.Int32, NoMarshallingInfo.Instance)
Marshalling\StatelessMarshallingStrategy.cs (2)
42if (unmanagedType == SpecialTypeInfo.Void) 241new TypePositionInfo(SpecialTypeInfo.Int32, NoMarshallingInfo.Instance)
MarshallingAttributeInfo.cs (1)
171return (unmanagedReturnType as SpecialTypeInfo)?.SpecialType switch
MarshallingInfoParser.cs (2)
318info = new TypePositionInfo(SpecialTypeInfo.Void, NoMarshallingInfo.Instance); 347info = new TypePositionInfo(SpecialTypeInfo.Void, NoMarshallingInfo.Instance);
SignatureContext.cs (2)
180else if (returnInfo.ManagedType == SpecialTypeInfo.Void) 190if (hiddenReturnInfo.ManagedType == SpecialTypeInfo.Void)