fix: harden R3 bridge generator emission#105
Merged
Merged
Conversation
Tighten ReactiveUI.Primitives.R3Bridge.Generator so R3 bridge sources are emitted only when the complete R3 observable, observer, and result shapes are visible. Add regression coverage for reactiveui/refit#2176 by compiling a generated library and generated consumer in a project-reference-style scenario, verifying the generated marker attribute remains internal and does not produce CS0436. Add regression coverage for incomplete R3 shapes so sync and async bridge sources are skipped instead of emitting code that references unavailable R3 types. Validation: dotnet test tests/ReactiveUI.Primitives.Tests/ReactiveUI.Primitives.Tests.csproj -- --treenode-filter "/*/*/R3BridgeGeneratorTests/*"; dotnet test tests/ReactiveUI.Primitives.Async.Tests/ReactiveUI.Primitives.Async.Tests.csproj -- --treenode-filter "/*/*/AsyncBridgeGeneratorContractTests/*".
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #105 +/- ##
==========================================
- Coverage 90.93% 90.93% -0.01%
==========================================
Files 651 651
Lines 20464 20467 +3
Branches 2454 2455 +1
==========================================
+ Hits 18609 18611 +2
Misses 1486 1486
- Partials 369 370 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
glennawatson
approved these changes
Jun 28, 2026
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.



What kind of change does this PR introduce?
Bug fix and regression test coverage for the R3 bridge source generator.
What is the new behavior?
R3.Observable<T>,R3.Observer<T>, andR3.Result.PrimitivesR3BridgeGeneratedAttributefrom becoming a public cross-assembly conflict again.What is the current behavior?
CS0436when a public generatedPrimitivesR3BridgeGeneratedAttributeappears in both a referenced assembly and the consuming project.R3.Observable<T>and async primitives, even though the generated code also referencedR3.Observer<T>andR3.Result.Checklist
Additional information
Addresses reactiveui/refit#2176.
Validation:
dotnet test tests/ReactiveUI.Primitives.Tests/ReactiveUI.Primitives.Tests.csproj -- --treenode-filter "/*/*/R3BridgeGeneratorTests/*"passed 16 tests acrossnet8.0,net9.0,net10.0, andnet11.0.dotnet test tests/ReactiveUI.Primitives.Async.Tests/ReactiveUI.Primitives.Async.Tests.csproj -- --treenode-filter "/*/*/AsyncBridgeGeneratorContractTests/*"passed 8 tests acrossnet8.0,net9.0,net10.0, andnet11.0.ReactiveUI.Primitives.R3Bridge.Generatorat63/63covered lines in existing Cobertura data.