Repository navigation
Conversation
vbreuss
force-pushed
the
fix/interface-reabstraction-and-diamonds
branch
from
December 4, 2026 16:33
d51ad49 to
9468c47
Compare
Test Results 97 files 97 suites 1h 30m 52s ⏱️ Results for commit b7a2cf3. ♻️ This comment has been updated with latest results. |
🚀 Benchmark ResultsCompared to Memory
Time
CompleteWorkflowBenchmarks
BenchmarkDotNet v0.15.8, Linux Ubuntu 26.04.1 LTS (Resolute Raccoon) Intel Xeon 6975P-C 3.73GHz, 1 CPU, 4 logical and 2 physical cores .NET SDK 11.0.100 [Host] : .NET 11.0.0 (11.0.0, 11.0.26.53018), X64 RyuJIT x86-64-v4 Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15 LaunchCount=1 WarmupCount=10 MockCreationBenchmarks
BenchmarkDotNet v0.15.8, Linux Ubuntu 26.04.1 LTS (Resolute Raccoon) INTEL XEON PLATINUM 8573C 3.01GHz, 1 CPU, 4 logical and 2 physical cores .NET SDK 11.0.100 [Host] : .NET 11.0.0 (11.0.0, 11.0.26.53018), X64 RyuJIT x86-64-v4 Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15 LaunchCount=1 WarmupCount=10 CompleteUnconfiguredBenchmarks
BenchmarkDotNet v0.15.8, Linux Ubuntu 26.04.1 LTS (Resolute Raccoon) AMD EPYC 7763 2.61GHz, 1 CPU, 4 logical and 2 physical cores .NET SDK 11.0.100 [Host] : .NET 11.0.0 (11.0.0, 11.0.26.53018), X64 RyuJIT x86-64-v3 Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15 LaunchCount=1 WarmupCount=10 CompleteMethodBenchmarks
BenchmarkDotNet v0.15.8, Linux Ubuntu 26.04.1 LTS (Resolute Raccoon) AMD EPYC 9V45 3.75GHz, 1 CPU, 4 logical and 2 physical cores .NET SDK 11.0.100 [Host] : .NET 11.0.0 (11.0.0, 11.0.26.53018), X64 RyuJIT x86-64-v4 Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15 LaunchCount=1 WarmupCount=10 CompletePropertyBenchmarks
BenchmarkDotNet v0.15.8, Linux Ubuntu 26.04.1 LTS (Resolute Raccoon) AMD EPYC 9V74 2.87GHz, 1 CPU, 4 logical and 2 physical cores .NET SDK 11.0.100 [Host] : .NET 11.0.0 (11.0.0, 11.0.26.53018), X64 RyuJIT x86-64-v3 Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15 LaunchCount=1 WarmupCount=10 CompleteIndexerBenchmarks
BenchmarkDotNet v0.15.8, Linux Ubuntu 26.04.1 LTS (Resolute Raccoon) AMD EPYC 9V74 2.86GHz, 1 CPU, 4 logical and 2 physical cores .NET SDK 11.0.100 [Host] : .NET 11.0.0 (11.0.0, 11.0.26.53018), X64 RyuJIT x86-64-v3 Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15 LaunchCount=1 WarmupCount=10 CompleteEventBenchmarks
BenchmarkDotNet v0.15.8, Linux Ubuntu 26.04.1 LTS (Resolute Raccoon) AMD EPYC 9V74 3.67GHz, 1 CPU, 4 logical and 2 physical cores .NET SDK 11.0.100 [Host] : .NET 11.0.0 (11.0.0, 11.0.26.53018), X64 RyuJIT x86-64-v4 Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15 LaunchCount=1 WarmupCount=10 CallbackBenchmarks
BenchmarkDotNet v0.15.8, Linux Ubuntu 26.04.1 LTS (Resolute Raccoon) AMD EPYC 7763 2.69GHz, 1 CPU, 4 logical and 2 physical cores .NET SDK 11.0.100 [Host] : .NET 11.0.0 (11.0.0, 11.0.26.53018), X64 RyuJIT x86-64-v3 Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15 LaunchCount=1 WarmupCount=10 AsyncBenchmarks
BenchmarkDotNet v0.15.8, Linux Ubuntu 26.04.1 LTS (Resolute Raccoon) INTEL XEON PLATINUM 8573C 3.00GHz, 1 CPU, 4 logical and 2 physical cores .NET SDK 11.0.100 [Host] : .NET 11.0.0 (11.0.0, 11.0.26.53018), X64 RyuJIT x86-64-v4 Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15 LaunchCount=1 WarmupCount=10 SequenceBenchmarks
BenchmarkDotNet v0.15.8, Linux Ubuntu 26.04.1 LTS (Resolute Raccoon) AMD EPYC 9V74 2.87GHz, 1 CPU, 4 logical and 2 physical cores .NET SDK 11.0.100 [Host] : .NET 11.0.0 (11.0.0, 11.0.26.53018), X64 RyuJIT x86-64-v3 Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15 LaunchCount=1 WarmupCount=10 |
A derived interface can declare an inherited member abstract again (`abstract int IBase.Get();`), and an interface can inherit two default implementations of a member of which neither is more specific. A class implementing such an interface must implement the member itself (CS0535, CS8705). The generator treated the explicit implementations in the derived interfaces as members of the mock and as sealed members, which dropped the base member, and it left non-public members with a default implementation in place, so mocks of these interfaces did not compile. For members with pointer types or members the test assembly cannot access, it emitted a mock that could not compile, and Mockolate0002 stayed silent. The generator and MockabilityAnalyzer now share one rule: an interface member must be implemented when its most specific implementation is abstract or not unique. The mock implements such a member like an abstract one, without calling a default implementation, as there is none or more than one. When it cannot be implemented, because the member is not accessible or uses a pointer type, no mock is generated and Mockolate0002 reports the member, so auto-mocking and mock data sources agree. A mock of several types with Implementing<T>() can make a member required that no single type requires, for example two interfaces that each implement it. A public abstract member that an inherited interface implements is therefore mocked again, and when the member is not public or uses a pointer type, the combination is not generated and reported at the type argument.
vbreuss
force-pushed
the
fix/interface-reabstraction-and-diamonds
branch
from
December 4, 2026 18:05
9468c47 to
b7a2cf3
Compare
|
This branch has not been deployed
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.



A derived interface can declare an inherited member abstract again (
abstract int IBase.Get();), and an interface can inherit two default implementations of a member of which neither is more specific (a diamond). A class implementing such an interface has to implement the member itself (CS0535, CS8705), and the generated mocks did not:internalone of another assembly was not reported by Mockolate0002.Implementing<T>()of two interfaces that each implement a member (IA.CreateMock().Implementing<IB>()) failed with CS8705.Changes
Internals/InterfaceImplementations.cs, linked into the analyzers): an interface member must be implemented when its most specific implementation is abstract or not unique. The generator (Class) andMockabilityAnalyzerboth use it, so auto-mocking andMockDataSourceAnalyzeragree as well.Setup/Verifysurface, non-public ones explicitly through the surface from fix: support non-public interface members in mocks #1257. No default implementation is called; for a diamond there is none to choose.Implementing<T>(): a public abstract member that an inherited interface implements is mocked again, so combinations of interfaces that each implement it compile. When only the combination makes a non-public member or one with a pointer type required, the combination mock is not generated and Mockolate0002 is reported at the type argument.Tests
InternalsVisibleTo;Implementing<T>()with interfaces and classes), pointer diamonds and combinations.GeneratorCoverage/IReabstractedAndDiamondMembers.cswith a non-snapshot scenario and runtime tests (guarded with#if !NETFRAMEWORK). No existing snapshot changed.Open points
Implementing<T>()is reported, not supported, because each interface of the combination keeps its own default implementation.