Fix execution of static constructors#3168
Conversation
- These are now skipped if they contain generic parameters or they live in a generic type definition.
WalkthroughThe update refines internal logic in the type system implementation. It enhances the static constructor search by adding checks to exclude generic methods and types, consolidates a macro call for array creation into a single line, and performs minor whitespace cleanup in debug output. No public interfaces or signatures are changed. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant TypeSystem
participant MethodDef
participant TypeDef
Caller->>TypeSystem: FindNextStaticConstructor()
TypeSystem->>MethodDef: Get method definition by index
TypeSystem->>TypeDef: Initialize type from method
TypeSystem->>TypeDef: Check genericParamCount == 0
TypeSystem->>MethodDef: Check MD_ContainsGenericParameter flag
alt Not generic and no generic params
TypeSystem-->>Caller: Return static constructor
else
TypeSystem-->>Caller: Skip and continue search
end
Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (5)
🔇 Additional comments (2)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Automated fixes for code style.
…99ec-4eac-403b-96d4-2430ec7623b0 Code style fixes for nanoframework/nf-interpreter PR#3168
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Description
Motivation and Context
How Has This Been Tested?
[build with MDP buildId 55899]
Screenshots
Types of changes
Checklist
Summary by CodeRabbit
Bug Fixes
Style