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.
kythant and others added 30 commits December 5, 2025 01:51
…ribute' may break functionality when AOT compiling
Introduces the WindowsRuntimeReferenceTypeAttribute for annotating Windows Runtime value types with their associated reference types. This attribute is intended for use with the type marshalling infrastructure and is marked obsolete for internal implementation details.
Introduces a ReferenceType property to WindowsRuntimeMarshallingInfo to provide the constructed Nullable<T> type for value types. Updates TypeMarshaller to use this property for value types instead of constructing Nullable<T> directly, improving type resolution and attribute validation.
Replaces the ReferenceType property with GetReferenceType and TryGetReferenceType methods for improved error handling and caching. Introduces a placeholder WindowsRuntimeReferenceTypeAttribute for cases where the reference type is missing. Also updates placeholder attribute instance declarations to be readonly.
Introduces a volatile field to cache the metadata type name and implements GetMetadataTypeName and TryGetMetadataTypeName methods for retrieving it. This enables efficient access to metadata type names for marshalling scenarios, with error handling for unsupported types.
Replaces the cached WindowsRuntimeReferenceTypeAttribute with a cached Type for reference type. Removes GetReferenceType and TryGetReferenceType methods, introducing a ReferenceType property for direct access and caching. This simplifies reference type retrieval and improves code clarity.
Refactors Type marshalling logic to use WindowsRuntimeMarshallingInfo for improved detection of projected and custom-mapped Windows Runtime types. Adds new assembly and class attributes for TypeName metadata, updates handling of nullable types, and clarifies logic for primitive and metadata type name resolution. Also adds TODOs for further handling of specific IReference and delegate types.
Introduces [TypeMap] and related attributes for WindowsRuntime type mapping in ABI classes, including metadata type names and reference types. Updates marshaller and interface implementations to use fully qualified type names for clarity and consistency with WindowsRuntime interop.
Refactored TypeMarshaller and WindowsRuntimeMarshallingInfo to use a new TryGetRuntimeClassName method for safer and more flexible runtime class name retrieval. This change improves handling of cases where metadata type names are unavailable and ensures better error reporting for unsupported types.
Added logic to use WindowsRuntimeMetadataInfo lookup for interface types that do not have proxy type map entries or projected types, ensuring correct metadata type name is used during marshalling.
Introduced TypeMapAssociation attributes for WindowsRuntimeMetadataTypeMapGroup in ABI types including IDisposable, IServiceProvider, AsyncActionCompletedHandler, IVectorChangedEventArgs, IAsyncAction, and IAsyncInfo to improve type mapping and metadata handling.
Replaces WindowsRuntimeComWrappersTypeMapGroup with WindowsRuntimeMetadataTypeMapGroup in Matrix3x2, Matrix4x4, Plane, Quaternion, and Vector2 type map attributes for improved metadata handling.
Deleted the [WindowsRuntimeMetadataTypeName("Object")] attribute from the Object class as it was unnecessary. This helps clean up the code and avoid redundant metadata.
Added TypeMapAssemblyTarget attributes for WindowsRuntimeMetadataTypeMapGroup and DynamicInterfaceCastableImplementationTypeMapGroup to support additional type mapping scenarios in generated assemblies.
Refactored ABI.System.ComponentModel.INotifyDataErrorInfo to consistently use fully qualified type names for global::System.ComponentModel.INotifyDataErrorInfo throughout the file. Added new TypeMap and TypeMapAssociation attributes for WindowsRuntimeMetadataTypeMapGroup, and improved documentation comments for clarity. This enhances type safety and interoperability with Windows Runtime metadata.
Replaces PlaceholderWindowsRuntimeComWrappersMarshallerAttribute with WindowsRuntimeComWrappersMarshallerAttributePlaceholder in a new file and updates all references. Removes the old placeholder and related reference type attribute from WindowsRuntimeMarshallingInfo.cs for improved clarity and maintainability.
Replaces PlaceholderDynamicInterfaceCastableImplementationForwarderAttribute with DynamicInterfaceCastableImplementationForwarderAttributePlaceholder and moves its implementation to a new file. Updates all references to use the new class name, improving clarity and organization.
Refactors ContextAwareObjectReference to use NullPlaceholder.Instance instead of PlaceholderNullAgileReference.Instance. Removes the now-unused PlaceholderNullAgileReference class.
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