Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide extensions that conflict with newer .NET versions #945

Merged
merged 17 commits into from
Jun 25, 2023
Merged

Hide extensions that conflict with newer .NET versions #945

merged 17 commits into from
Jun 25, 2023

Conversation

viceroypenguin
Copy link
Contributor

@viceroypenguin viceroypenguin commented Jan 25, 2023

Properly implement solution for hiding extension methods on different frameworks by removing the this modifier.

  • Supports binary compatibility by still compiling duplicated methods. Since extension methods are implemented via syntactic sugar, as long as the methods still exist, the this modifier can be removed and callers will still be able to reach the method.
  • Does not address issues with MinBy/MaxBy per other discussions.

@viceroypenguin
Copy link
Contributor Author

PS: @atifaziz You'll have to decide how you want to handle System.Linq being referenced in unit tests, since they are required for multi-fx support for some test implementations.

@atifaziz
Copy link
Member

atifaziz commented Mar 2, 2023

You'll have to decide how you want to handle System.Linq being referenced in unit tests, since they are required for multi-fx support for some test implementations.

See 5e1d88a.

@codecov
Copy link

codecov bot commented Mar 3, 2023

Codecov Report

Merging #945 (772050a) into master (8db4bef) will decrease coverage by 2.07%.
The diff coverage is 100.00%.

❗ Current head 772050a differs from pull request most recent head cf55bab. Consider uploading reports for the commit cf55bab to get more accurate results

@@            Coverage Diff             @@
##           master     #945      +/-   ##
==========================================
- Coverage   92.59%   90.52%   -2.07%     
==========================================
  Files         113      113              
  Lines        3430     3430              
  Branches     1054     1054              
==========================================
- Hits         3176     3105      -71     
- Misses        191      263      +72     
+ Partials       63       62       -1     
Impacted Files Coverage Δ
MoreLinq/Append.cs 50.00% <ø> (-50.00%) ⬇️
MoreLinq/Prepend.cs 50.00% <ø> (-50.00%) ⬇️
MoreLinq/SkipLast.cs 42.85% <ø> (-57.15%) ⬇️
MoreLinq/TakeLast.cs 42.85% <ø> (-57.15%) ⬇️
MoreLinq/DistinctBy.cs 56.25% <100.00%> (-37.50%) ⬇️
MoreLinq/ToHashSet.cs 85.71% <100.00%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@atifaziz
Copy link
Member

atifaziz commented Apr 13, 2023

@viceroypenguin
Copy link
Contributor Author

Ah, then we don't need to hide ExceptBy; they're compatible as overloads other than when TSource and TKey are the same type. This is not a situation that's likely to happen when using ExceptBy, since the point of ExceptBy is to handle sets based on a key instead of the source value (Except being used for when the source value is used to exclude items).

…upport

Conflicts removed:

- MoreLinq/Append.cs
- MoreLinq/PublicAPI/net6.0/PublicAPI.Unshipped.txt
- MoreLinq/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt
- MoreLinq/PublicAPI/netstandard2.1/PublicAPI.Unshipped.txt
@atifaziz
Copy link
Member

Ah, then we don't need to hide ExceptBy

Reverted with 7d34122.

This reverts commits:

- Remove unused "Append"/"Prepend"supporting types:
  b9316f7

- Remove "Append" and "Prepend":
  ca3a8e2
@atifaziz atifaziz changed the title Modern framework support Hide extensions that conflict with newer .NET versions Jun 25, 2023
@atifaziz atifaziz merged commit f59f7a5 into morelinq:master Jun 25, 2023
2 checks passed
@viceroypenguin viceroypenguin deleted the multi-framework-support branch June 26, 2023 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants