Skip to content

Commit

Permalink
covariance :docnotL:
Browse files Browse the repository at this point in the history
List<Derived> can't be directly cast to List<Base> because List<T> is not covariant, we could do a linq cast instead but that's yucky
  • Loading branch information
Govorunb committed Nov 6, 2023
1 parent 9e1a519 commit 5775ed4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SCHIZO/Helpers/StaticHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public static void CacheAll()
IEnumerable<string> names = PLUGIN_ASSEMBLY.GetTypes()
.SelectMany(t => t.GetMethods(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic))
.Where(m => m.GetCustomAttribute<CacheAttribute>() != null)
.SelectMany(m => (IEnumerable<ITriDropdownItem>) m.Invoke(null, Array.Empty<object>()))
.Select(i => i.Value.ToString());
.SelectMany(m => (IEnumerable<TriDropdownItem<string>>) m.Invoke(null, Array.Empty<object>()))
.Select(i => i.Value);

CacheValues(names);
}
Expand Down

0 comments on commit 5775ed4

Please sign in to comment.