Miscellaneous fixes related with generics#3347
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 ⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR enhances generic type handling in the CLR runtime by introducing stricter parameter resolution, propagating generic context through IL interpretation (CALL, CALLVIRT, NEWOBJ, UNBOX.ANY), extending signature parsing for nested generics, and adding comprehensive diagnostic instrumentation to aid debugging. ChangesGeneric Type Resolution & Propagation
TI Platform Memory Layout Update
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Suggested labels
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
- Add ResolveMethodRef() TypeSpec fallback chain. - Runtime MethodRef TypeSpec handling to reuses the startup-resolved target. - InitializeReference() now has VAR fallback. - ResolveGenericTypeParameter() now returns failure to allow caller to handle it properly (otherwise it will go into an infinite loop). - Fix generic parameter check in DumpOpcode().
- Now outputting correctly resolved generic types.
- Relax _ASSERTE(DataSize == 1) to DataSize <= 1 in Assign/AssignId/AssignData/AssignAndPreserveType/AssignPreserveTypeCheckPinned. Zero-initialized field blocks (DataSize == 0, default value of a field that was never written) are valid single-block copies; only DataSize > 1 should be forbidden (partial copy of an embedded value-type struct). - When a valid genericType context is in scope but the per-TypeSpec field lookup still fails after on-demand allocation, return nullptr instead of falling through to the assembly-level fallback. Generic static fields have no assembly-level slot (fdCross.offset == CLR_EmptyIndex), so reaching the fallback always fired _ASSERTE(fdCross.offset != CLR_EmptyIndex). - Add NANOCLR_TRACE_GENERICS to output generics resolution. Needed to help debugging hard type resolutions.
- Relaxing the assert was wrong and was only a workaround.
Automated fixes for code style.
- Fixed conditions to publish dump files artifacts.
- Runtime-inferred element types can now close open VAR and MVAR slots even when there is no normal TypeSpec or MethodSpec context. - Also fixed array-element type handling for generic enumeration and ldelem.any, so element byrefs are validated as the element type rather than the enclosing array type.
Automated fixes for code style.
|
@josesimoes there are issues with the code style on the source files. Make sure to follow the project code style. Check the details here on how it works and the tools required to help you with that. |
…70456-09ff-4288-a498-78245dd67462 Code style fixes for nanoframework/nf-interpreter PR#3347
Description
Motivation and Context
How Has This Been Tested?
Dictionary<TKey, TValue>System.Collections#169.Screenshots
Types of changes
Checklist