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

Replace explicit type mentions with object pattern #751

Merged
merged 1 commit into from
Aug 6, 2020

Conversation

atifaziz
Copy link
Member

@atifaziz atifaziz commented Aug 6, 2020

This PR replaces all explicit (and now redundant) type mentions in patterns for sake of non-null testing (in addition to introducing a variable) with the object or empty property pattern {}.

From Property patterns section of the Do more with patterns in C# 8 blog entry.

One thing that remains true of all type patterns including property patterns, is that they require the value to be non-null. That opens the possibility of the “empty” property pattern {} being used as a compact “not-null” pattern.

@codecov
Copy link

codecov bot commented Aug 6, 2020

Codecov Report

Merging #751 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #751   +/-   ##
=======================================
  Coverage   93.03%   93.03%           
=======================================
  Files         106      106           
  Lines        3473     3473           
=======================================
  Hits         3231     3231           
  Misses        242      242           
Impacted Files Coverage Δ
MoreLinq/AssertCount.cs 100.00% <100.00%> (ø)
MoreLinq/Backsert.cs 100.00% <100.00%> (ø)
MoreLinq/CountDown.cs 100.00% <100.00%> (ø)
MoreLinq/CountMethods.cs 100.00% <100.00%> (ø)
MoreLinq/EndsWith.cs 100.00% <100.00%> (ø)
MoreLinq/FallbackIfEmpty.cs 90.90% <100.00%> (ø)
MoreLinq/Flatten.cs 100.00% <100.00%> (ø)
MoreLinq/PadStart.cs 100.00% <100.00%> (ø)
MoreLinq/SkipLast.cs 100.00% <100.00%> (ø)
MoreLinq/StartsWith.cs 100.00% <100.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 07bd086...8b66c50. Read the comment docs.

@atifaziz atifaziz merged commit 8b66c50 into morelinq:master Aug 6, 2020
@atifaziz atifaziz deleted the obj-pattern branch August 6, 2020 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant