-
-
Notifications
You must be signed in to change notification settings - Fork 186
Fixes for type descriptor with generics #3220
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
Conversation
- Initializing a type descriptor from a signature token now properly handles a VAR in the signature (now uses the assembly from the caller generic type). - Checking the match for type descriptors now looks into the correct type handler.
WalkthroughAdjusts generic handling in the runtime: updates TypeSpec VAR resolution to use the caller’s generic assembly context, and modifies TypeDescriptorsMatch to promote CLASS to GENERICINST based on NANOCLR_INDEX_IS_VALID for the generic handler. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Caller
participant TypeSystem
participant TypeSpec
participant Assemblies as g_CLR_RT_TypeSystem.m_assemblies[caller.genericType.Assembly()-1]
Caller->>TypeSystem: Resolve TypeSpec
TypeSystem->>TypeSpec: Parse next element
alt VAR (!T) encountered
TypeSystem->>Assemblies: FindGenericParamAtTypeSpec(...)
Assemblies-->>TypeSystem: Generic param mapping (concrete type)
TypeSystem-->>Caller: Resolved type (from caller's generic context)
else Non-VAR path
TypeSystem-->>Caller: Resolve via existing flow
end
sequenceDiagram
autonumber
participant Matcher as TypeDescriptorsMatch
participant Actual as actualType
participant Expected as expectedType
Matcher->>Actual: Inspect DataType
alt actualDataType == DATATYPE_CLASS and handler index valid
note right of Matcher: NANOCLR_INDEX_IS_VALID(Actual.m_handlerGenericType)
Matcher->>Matcher: Promote CLASS -> GENERICINST
end
Matcher->>Expected: Proceed with generic-inst matching
Matcher-->>Matcher: Return match result
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Description
Motivation and Context
How Has This Been Tested?
[build with MDP buildId 57148]
Screenshots
Types of changes
Checklist
Summary by CodeRabbit