Commit 07d12d1
authored
Add "type forwarders" from
Context: https://learn.microsoft.com/dotnet/standard/assembly/type-forwarding
Fixes: #1182
Related: #1177
This PR adds C# type forwarders to improve API compatibility between
the `Xamarin.AndroidX.SavedState` and
`Xamarin.AndroidX.SavedState.SavedState.Android` packages.
## Changes Made
Created
`source/androidx.savedstate/savedstate/Additions/TypeForwarders.cs`
with type forwards for the following types from
`Xamarin.AndroidX.SavedState` to
`Xamarin.AndroidX.SavedState.SavedState.Android`:
- `AndroidX.SavedState.ISavedStateRegistryOwner`
- `AndroidX.SavedState.SavedStateRegistry`
- `AndroidX.SavedState.SavedStateRegistryController`
- `AndroidX.SavedState.ViewTreeSavedStateRegistryOwner`
## Technical Details
The implementation follows the established pattern used in other
AndroidX projects (such as
`androidx.lifecycle/lifecycle-viewmodel/Additions/TypeForwards.cs`).
The type forwarders use the
`System.Runtime.CompilerServices.TypeForwardedToAttribute` to redirect
type resolution from the `savedstate` assembly to the
`savedstate-android` assembly where the actual implementations reside.
The project reference from `savedstate` to `savedstate-android`
already exists in the generated project file, ensuring proper
compilation and type resolution.Xamarin.AndroidX.SavedState to Xamarin.AndroidX.SavedState.SavedState.Android (#1183)1 parent 144efea commit 07d12d1
File tree
1 file changed
+6
-0
lines changed- source/androidx.savedstate/savedstate/Additions
1 file changed
+6
-0
lines changedLines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments