Closed
Conversation
There was a problem hiding this comment.
Pull request overview
Updates NSubstitute’s Castle DynamicProxy dependency to Castle.Core 5.2.1 and adjusts related proxy/call plumbing to align with updated nullability annotations.
Changes:
- Bump
Castle.CoreNuGet dependency from 5.1.1 to 5.2.1. - Update proxy/call internals to use nullable-aware
Func<object?>?base-method delegates. - Add null-forgiving operators where the code relies on non-null runtime guarantees (e.g.,
InvocationTarget,CreateInstance).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/NSubstitute/NSubstitute.csproj |
Updates Castle.Core package reference to 5.2.1. |
src/NSubstitute/Proxies/CastleDynamicProxy/CastleInvocationMapper.cs |
Adjusts base-method delegate typing and refines guard logic using property patterns. |
src/NSubstitute/Core/ICallFactory.cs |
Updates base-method delegate nullability annotations in the public interface. |
src/NSubstitute/Core/CallFactory.cs |
Propagates updated base-method delegate type to the implementation. |
src/NSubstitute/Core/Call.cs |
Updates stored base-method delegate type and keeps call-base behavior nullable-safe. |
src/NSubstitute/Proxies/CastleDynamicProxy/ProxyIdInterceptor.cs |
Applies null-forgiving operator for InvocationTarget to satisfy updated nullability. |
src/NSubstitute/Proxies/CastleDynamicProxy/CastleDynamicProxyFactory.cs |
Applies null-forgiving operator for Activator.CreateInstance(...) to satisfy updated nullability. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
304NotModified
requested changes
Mar 7, 2026
Contributor
There was a problem hiding this comment.
I'm sorry to block this, but there is a issue in Castle.Core 5.2.1 that wasn't in 5.1.1
This will be fixed in Castle.Core 6
I will create a PR to show this issue (the test will fail with Castle.Core 5.2.1) - updated, see #950
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Change:
related: #830