Browse Source

Fix warning for reuse of type parameter

CPKreuz 1 year ago
parent
commit
ea523381c4

+ 2 - 2
src/PixiEditor.Extensions.CommonApi/UserPreferences/Settings/Setting.cs

@@ -58,7 +58,7 @@ public abstract class Setting<T> : INotifyPropertyChanged
     /// </summary>
     /// <param name="fallbackValue">The value used if the preference has not been set before</param>
     /// <returns>Either the value of the preference as <typeparamref name="T"/> or <see cref="fallbackValue"/></returns>
-    public T? As<T>(T? fallbackValue = default) => GetValue(preferences, fallbackValue);
+    public TAny? As<TAny>(TAny? fallbackValue = default) => GetValue(preferences, fallbackValue);
 
     protected abstract TAny? GetValue<TAny>(IPreferences preferences, TAny fallbackValue);
 
@@ -109,7 +109,7 @@ public abstract class Setting<T> : INotifyPropertyChanged
     }
 }
 
-// Generic types would create a instance for every type combination.
+// Generic types would create an instance for every type combination.
 file static class PropertyChangedConstants
 {
     public static readonly PropertyChangedEventArgs ValueChangedPropertyArgs = new("Value");