Skip to content

Commit 07d12d1

Browse files
authored
Add "type forwarders" from Xamarin.AndroidX.SavedState to Xamarin.AndroidX.SavedState.SavedState.Android (#1183)
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.
1 parent 144efea commit 07d12d1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
using System.Runtime.CompilerServices;
2+
3+
[assembly:TypeForwardedTo (typeof (AndroidX.SavedState.ISavedStateRegistryOwner))]
4+
[assembly:TypeForwardedTo (typeof (AndroidX.SavedState.SavedStateRegistry))]
5+
[assembly:TypeForwardedTo (typeof (AndroidX.SavedState.SavedStateRegistryController))]
6+
[assembly:TypeForwardedTo (typeof (AndroidX.SavedState.ViewTreeSavedStateRegistryOwner))]

0 commit comments

Comments
 (0)