-
Notifications
You must be signed in to change notification settings - Fork 120
User/kythant/type handling #2129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
kythant
wants to merge
69
commits into
staging/3.0
Choose a base branch
from
user/kythant/TypeHandling
base: staging/3.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+1,562
−400
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This reverts commit ff83e55.
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.
…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.
…oft/CsWinRT into user/kythant/TypeHandling
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.
…oft/CsWinRT into user/kythant/TypeHandling
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.
…oft/CsWinRT into user/kythant/TypeHandling
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.