You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Cover GetType, return, field and parameter types of T.
- Cover SetValue, statics and Invoke on closed generic types.
- Update tests that expected T to be unresolved.
Assisted by: Claude Sonnet 5.5 <noreply@anthropic.com>
Expanded coverage for reflection on closed generic types, including type identity, resolved parameter and return types, fields, static fields, constructors, and method invocation.
Added checks for handling mismatched generic arguments and values, including expected exceptions.
Updated invocation tests to verify that type parameters resolve from a constructed generic type and that incompatible arguments are rejected.
The project adds generic reflection tests for closed-type metadata, fields, static storage, construction, and method invocation. Existing invocation and parameter metadata tests now expect type parameters on closed generic types to resolve from the closed type.
Changes: Generic Reflection
Layer / File(s)
Summary
Closed generic metadata and invocation expectations Tests/NFUnitTestSystemLibReflection/NFUnitTestSystemLibReflection.nfproj, Tests/NFUnitTestSystemLibReflection/UnitTestGenericReflectionTests.cs, Tests/NFUnitTestSystemLibReflection/UnitTestReflectionInvokeTests.cs, Tests/NFUnitTestSystemLibReflection/UnitTestGenericArgumentTests.cs
New tests cover closed generic identity and reflected property types. Updated tests expect closed-type parameter metadata and invocation to resolve from the type argument, and check rejection of mismatched arguments.
Generic field access and static storage Tests/NFUnitTestSystemLibReflection/UnitTestGenericReflectionTests.cs
New tests cover generic field types and access, mismatched field values, per-instantiation static values, static initialization, and reads through a generic type definition.
Reflective construction and method calls Tests/NFUnitTestSystemLibReflection/UnitTestGenericReflectionTests.cs
New tests cover constructor invocation, closed-type creation, setter and getter invocation, and mismatched arguments or methods. The project compiles the new test file.
nanoframework/CoreLibrary#291: Covers invocation of a parameter typed as T; this PR updates the corresponding test expectations for a closed generic type.
nanoframework/CoreLibrary#285: Covers generic parameters in reflection invocation and parameter metadata; this PR updates expectations for closed generic types.
Suggested labels:Area: Config-and-Build
Merge Risk: Minimal · up to 6c984
No actionable issue remains that should delay merging these reflection tests after normal checks.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title clearly summarizes the changes: adding generic reflection tests. It is concise and does not end with a period.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description matches the changes. It identifies the new generic reflection tests, the updated expectations for closed generic types, and the reported test coverage.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.
Rename the tests to match their new behavior.
Invoke_UnresolvedMethodTypeParameter_IsNotSupported still has the old name. The test now asserts that G<int>.TakesT works. It also asserts the NotSupportedException case for the method-level TakesMethodT. GetParameters_UnresolvedMethodTypeParameter_HasNullType now mostly asserts resolved types. The names give a wrong description of the intended behavior. Use names that state both outcomes, for example Invoke_TypeParameterOnClosedType_IsResolved_MethodTypeParameter_IsNotSupported.
Also applies to: 530-530
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Central YAML; Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Advanced
Run ID: d8327ca1-11fa-4ec9-a0e5-2c8f80d9398e
Commits
Reviewing files that changed from the base of the PR and between f9a6ba8 and 6c98496.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
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
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.
Description
Motivation and Context
How Has This Been Tested?
Screenshots
Types of changes
Checklist: