Skip to content

Conversation

@kythant
Copy link

@kythant kythant commented Nov 25, 2025

No description provided.

@kythant kythant closed this Nov 25, 2025
@kythant kythant reopened this Nov 26, 2025
@kythant kythant closed this Nov 27, 2025
@kythant kythant reopened this Dec 1, 2025
kythant and others added 17 commits December 1, 2025 15:59
Simplifies and clarifies the handling of TypeReference creation, including improved comments and restructuring for primitive and proxy types. Ensures more consistent reporting of TypeKind and streamlines marshalling info usage.
Changed the TypeReference.Name field from string? to ReadOnlySpan<char> for improved memory safety and performance. Updated marshalling logic and related references to accommodate the new type.
Added [WindowsRuntimeMetadata] attributes to ABI type classes in WinRT.Runtime2 to specify their associated Windows contracts. This improves metadata clarity and contract mapping for types such as Boolean, Byte, Char, DateTimeOffset, Double, EventHandler, Exception, Guid, Int16, Int32, Int64, Numerics types, Object, Single, String, TimeSpan, Type, UInt16, UInt32, UInt64, and Uri.
Introduces TypeMapAssociation attributes for DynamicInterfaceCastableImplementationTypeMapGroup to INotifyDataErrorInfo, IDisposable, and IServiceProvider ABI interfaces. Also adds WindowsRuntimeMetadata and WindowsRuntimeClassName attributes to their respective interface implementations for improved WinRT interop.
Added logic to TypeMarshaller to support round-tripping C# primitive types (e.g., System.SByte) that are not Windows Runtime types. This ensures such types can be resolved even if not found in the WindowsRuntimeMarshallingInfo lookup.
Sergio0694 and others added 3 commits January 9, 2026 14:01
Replaces usage of _metadataTypeName with _runtimeClassName when retrieving the cached runtime class name, ensuring the correct value is returned.
@kythant kythant marked this pull request as ready for review January 9, 2026 22:38
kythant and others added 15 commits January 20, 2026 13:57
… test case for where there is a metadata scenario
Added special handling for KeyValuePair<,> types in the TypeMarshaller to ensure the correct runtime class name is used for marshalling. Updated comments to clarify logic and removed outdated TODO.
Replaces Debug.Assert with a NotSupportedException when the WindowsRuntimeMappedTypeAttribute is missing on the metadata provider type in both WindowsRuntimeMarshallingInfo and WindowsRuntimeMetadataInfo. This provides clearer error reporting and guidance for unexpected code generation issues.
Deleted outdated TODO comments regarding type map entries for non-generic interfaces, value types, and delegate types in TypeMarshaller. No functional code changes were made.
Introduces methods and references to handle TypeMap and TypeMapAssociation attributes for WindowsRuntimeMetadataTypeMapGroup in InteropCustomAttributeFactory and InteropReferences. This enables generation and referencing of custom attributes using the new type map group.
Reorganized conditional checks for nullable and projected types in TypeMarshaller. Ensures special handling for types that cannot be used in Nullable<T> and improves clarity by nesting projected and metadata info lookups under a single nullable check.
Introduces handling for the WindowsRuntimeMetadataTypeNameAttribute in InteropTypeDefinitionBuilder and InteropReferences. This allows proxy types to optionally emit the metadata type name attribute and reference the original managed type when required.
@Sergio0694 Sergio0694 force-pushed the user/kythant/TypeHandling branch from 31c9fb6 to 1c5e5b4 Compare January 27, 2026 03:26
Introduces handling for the WindowsRuntimeMappedMetadataAttribute in proxy type generation. Updates relevant builders and references to allow optional inclusion of mapped metadata information when generating interop types.
Introduces a static Proxy method to InteropTypeDefinitionBuilder.KeyValuePair for creating proxy types for KeyValuePair<TKey, TValue>. Updates InteropGenerator.Emit to use the new method, improving clarity and encapsulation for KeyValuePair proxy generation.
Introduces the IsGenericType property to determine if a TypeSignature represents a constructed generic type.
Introduces MetadataTypeNameGenerator to handle Windows Runtime metadata type name generation, including generic and array types. Refactors RuntimeClassNameGenerator to delegate type name formatting to the new helper, improving code reuse and maintainability. Adds error handling for unresolved types and clarifies logic for IReference wrapping.
Updated TypeMapAttributes methods in Delegate and KeyValuePair builders to accept TypeSignature instead of GenericInstanceTypeSignature. Added a static Proxy method to InteropTypeDefinitionBuilder.Delegate for delegate proxy type creation, and updated usage in InteropGenerator.Emit to use the new method.
Expanded the comment to mention that generic delegate types are also handled by using '[WindowsRuntimeMetadataTypeName]'. No code changes were made.
Corrected 'GetMetadataTyoeName' and 'AppendMetadataTyoeName' to 'GetMetadataTypeName' and 'AppendMetadataTypeName' in MetadataTypeNameGenerator and updated all references. This improves code clarity and consistency.
Introduces a new metadataTypeName parameter to TypeMapAttributes and updates all relevant builder calls to include it, defaulting to null where not required. This enables emitting additional type map attributes for metadata type mapping, supporting improved marshalling scenarios such as Windows Runtime delegate types.
Replaces the use of runtimeClassName with metadataTypeName when setting the WindowsRuntimeMetadataTypeNameAttribute. This ensures the correct type name is used in the custom attribute.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants