-
-
Notifications
You must be signed in to change notification settings - Fork 186
Fix handling generic type in MethodDef instance #3217
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
Fix handling generic type in MethodDef instance #3217
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughTightens generic-type validity checks across execution, type system, and diagnostics, and propagates generic context during virtual call resolution. Conditions now require valid indices and non-empty tokens before treating types as generic. Diagnostics printing respects these constraints. No public APIs changed. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant IL as IL Interpreter
participant TS as TypeSystem
participant MR as Method Resolver
participant Callee as calleeInst
IL->>MR: Resolve instance/virtual call
MR->>TS: Select virtual method (calleeReal)
alt Generic context available and valid
MR->>Callee: Initialize with (calleeReal, *genericType)
else No valid generic context
MR->>Callee: InitializeFromIndex(calleeReal)
end
IL->>Callee: Invoke
sequenceDiagram
autonumber
participant Exec as Execution.InitializeLocals
participant TS as TypeSystem
Exec->>Exec: Check local's genericType
alt Index valid AND token != CLR_EmptyToken
Exec->>TS: Handle as generic parameter (init from method/type context)
else
Exec->>Exec: Bypass generic-param handling
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
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.
|
- Hardned check for generic type when using MethodDef. - Simplified getting and setting TypeSpec for generic type. - Now using pointers all the way instead of creating new TypeSpecs along the path. - Remove wrong this accessor.
046de42 to
af81651
Compare
Description
Motivation and Context
How Has This Been Tested?
[build with MDP buildId 57148]
Screenshots
Types of changes
Checklist
Summary by CodeRabbit