Skip to content

Add tests for two instantiations of one generic interface - #313

Merged
josesimoes merged 1 commit into
nanoframework:developfrom
josesimoes:dual-interface-insta
Nov 25, 2026
Merged

josesimoes merged 1 commit into
nanoframework:developfrom
josesimoes:dual-interface-insta

Conversation

@josesimoes

@josesimoes josesimoes commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Description

  • Explicit, implicit and mixed implementations, base and derived classes, generic classes.
  • Properties, events, generic methods, inherited interfaces, variance, structs.

Motivation and Context

How Has This Been Tested?

  • [tested against nanoclr BuildId 68585]

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue with code or algorithm)
  • New feature (non-breaking change which adds functionality to code)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dependencies (update dependencies and changes associated, has no impact on code or features)
  • Unit Tests (add new Unit Test(s) or improved existing one(s), has no impact on code or features)
  • Documentation (changes or updates in the documentation, has no impact on code or features)

Checklist:

  • My code follows the code style of this project (only if there are changes in source code).
  • My changes require an update to the documentation (there are changes that require the docs website to be updated).
  • I have updated the documentation accordingly (the changes require an update on the docs in this repo).
  • I have read the CONTRIBUTING document.
  • I have tested everything locally and all new and existing tests passed (only if there are changes in source code).
  • I have added new tests to cover my changes.

- Explicit, implicit and mixed implementations, base and derived classes, generic classes.
- Properties, events, generic methods, inherited interfaces, variance, structs.

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Tests
    • Added coverage for generic interface dispatch across multiple type instantiations, including inheritance, explicit and implicit implementations, properties, events, variance, structs, and reflection.
    • Added checks for generic methods and constraints, including expected errors for invalid type arguments.

The change adds a test suite for dispatch across multiple generic-interface instantiations. It covers implementation mappings, members, inheritance, variance, structs, and generic methods, and adds the test file to the project compile items.

Changes: Generic-interface dispatch tests

Layer / File(s) Summary
Dispatch scenarios and project inclusion
Tests/NFUnitTestSystemLibReflection3/UnitTestDualInstantiationTests.cs, Tests/NFUnitTestSystemLibReflection3/NFUnitTestSystemLibReflection3.nfproj
Adds fixtures and tests for dispatch across generic-interface instantiations, including calls through constraints, delegates, and reflection. Adds the test file to the project compile items.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Other

Merge Risk: Minimal · up to d7bb7

This is a test-only addition with no production code changes. It carries minimal merge risk, and no blocking issues were found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "Add tests for two instantiations of one generic interface" matches the main change: the PR adds the UnitTestDualInstantiationTests suite, which covers dispatch across two closed instantiati…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description names the changed areas: explicit, implicit and mixed interface implementations, base and derived classes, generic classes, properties, events, generic methods, inherited interfaces, v…
Full details: Title check

Explanation

The title "Add tests for two instantiations of one generic interface" matches the main change: the PR adds the UnitTestDualInstantiationTests suite, which covers dispatch across two closed instantiations of one generic interface. It is 57 characters, which exceeds the preferred 50-character guideline. It has no PR or issue references and no trailing full stop, so the other title requirements are met.

Full details: Description check

Explanation

The description names the changed areas: explicit, implicit and mixed interface implementations, base and derived classes, generic classes, properties, events, generic methods, inherited interfaces, variance, and structs. These match the added UnitTestDualInstantiationTests suite. It also links the work to nanoframework/Home#782 and marks the change as a unit test addition.

  • 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.

Share

Recent 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: 7f23ab6e-d59e-4ac6-8bfb-bd9d3c957d0c
Commits

Reviewing files that changed from the base of the PR and between 9785212 and d7bb73c.

Files selected for processing: 2

  • Tests/NFUnitTestSystemLibReflection3/NFUnitTestSystemLibReflection3.nfproj
  • Tests/NFUnitTestSystemLibReflection3/UnitTestDualInstantiationTests.cs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@josesimoes

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

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.

@josesimoes

Copy link
Copy Markdown
Member Author

/azp run

@josesimoes

Copy link
Copy Markdown
Member Author

@coderabbitai approve

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@coderabbitai

coderabbitai Bot commented Nov 25, 2026

Copy link
Copy Markdown
Action performed

Comments resolved and changes approved.

@sonarqubecloud

Copy link
Copy Markdown

@nfbot

nfbot commented Nov 25, 2026

Copy link
Copy Markdown
Member

⚠️ Native declaration update required!

The native contract hash of nanoFramework.CoreLibrary has changed. The native declaration in nf-interpreter must be updated before this package can be released.

Previously published This build
Native contract hash 0x940E6E23 0x272B0DC7

👉 Tracking issue: nanoframework/Home#1957

The issue contains a link to the stubs artifact from this build and instructions for GitHub Copilot to perform the update.

@josesimoes
josesimoes merged commit b69a712 into nanoframework:develop Nov 25, 2026
7 checks passed
@josesimoes
josesimoes deleted the dual-interface-insta branch November 25, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants