Skip to content

More arities for tuple returning zip extension method#47147

Merged
eiriktsarpalis merged 10 commits into
dotnet:masterfrom
huoyaoyuan:zip-tuple
Jan 19, 2021
Merged

More arities for tuple returning zip extension method#47147
eiriktsarpalis merged 10 commits into
dotnet:masterfrom
huoyaoyuan:zip-tuple

Conversation

@huoyaoyuan

Copy link
Copy Markdown
Member

Closes #43702

It grows exponentially for test exhaustiveness. I'm just focusing on the third parameter.

@ghost

ghost commented Jan 19, 2021

Copy link
Copy Markdown

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost

ghost commented Jan 19, 2021

Copy link
Copy Markdown

Tagging subscribers to this area: @eiriktsarpalis
See info in area-owners.md if you want to be subscribed.

Issue Details

Closes #43702

It grows exponentially for test exhaustiveness. I'm just focusing on the third parameter.

Author: huoyaoyuan
Assignees: -
Labels:

area-System.Linq, new-api-needs-documentation

Milestone: -

Comment thread src/libraries/System.Linq/tests/ZipTests.cs Outdated

@eiriktsarpalis eiriktsarpalis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you for the contribution!

Comment thread src/libraries/System.Linq/src/System/Linq/Zip.cs Outdated
Comment thread src/libraries/System.Linq/tests/ZipTests.cs Outdated
Comment thread src/libraries/System.Linq/tests/ZipTests.cs Outdated
Comment thread src/libraries/System.Linq/tests/ZipTests.cs Outdated
public static MethodInfo Zip_TFirst_TSecond_TThird_3(Type TFirst, Type TSecond, Type TThird) =>
(s_Zip_TFirst_TSecond_TThird_3 ??
(s_Zip_TFirst_TSecond_TThird_3 = new Func<IQueryable<object>, IEnumerable<object>, IEnumerable<object>, IQueryable<(object, object, object)>>(Queryable.Zip).GetMethodInfo().GetGenericMethodDefinition()))
.MakeGenericMethod(TFirst, TSecond, TThird);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to comment saying ??= could be used to simplify this, but I see you're just following the pattern used in a bunch of other cases above. We can clean it up later.

@huoyaoyuan huoyaoyuan left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR feedbacks

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
@eiriktsarpalis

Copy link
Copy Markdown
Member

Thanks for the contribution!

@eiriktsarpalis eiriktsarpalis merged commit 6fb9985 into dotnet:master Jan 19, 2021
@Logerfo

Logerfo commented Jan 19, 2021

Copy link
Copy Markdown

Thank you! In which runtime version is this feature supposed to be available?

@eiriktsarpalis

Copy link
Copy Markdown
Member

That would be released with .NET 6 next November.

@huoyaoyuan huoyaoyuan deleted the zip-tuple branch January 19, 2021 16:07
@ghost ghost locked as resolved and limited conversation to collaborators Feb 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

More arities for tuple returning zip extension method

4 participants