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

Allow collection expressions with CreateCompilation #71134

Merged
merged 3 commits into from
Dec 18, 2023

Conversation

jcouv
Copy link
Member

@jcouv jcouv commented Dec 6, 2023

No description provided.

@jcouv jcouv added Area-Compilers Test Test failures in roslyn-CI labels Dec 6, 2023
@jcouv jcouv self-assigned this Dec 6, 2023
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Dec 6, 2023
@jcouv jcouv marked this pull request as ready for review December 7, 2023 20:51
@jcouv jcouv requested a review from a team as a code owner December 7, 2023 20:51
@jcouv
Copy link
Member Author

jcouv commented Dec 12, 2023

@dotnet/roslyn-compiler Small PR for review. Thanks

1 similar comment
@jcouv
Copy link
Member Author

jcouv commented Dec 13, 2023

@dotnet/roslyn-compiler Small PR for review. Thanks

IEnumerator<CSharpTestSource> IEnumerable<CSharpTestSource>.GetEnumerator() => throw new NotImplementedException();
IEnumerator IEnumerable.GetEnumerator() => throw new NotImplementedException();

internal class CSharpTestSourceBuilder
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be static? Or sealed at least.

@jcouv
Copy link
Member Author

jcouv commented Dec 15, 2023

@dotnet/roslyn-compiler for second review. Thanks

// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#if !NET8_0_OR_GREATER
Copy link
Member

@333fred 333fred Dec 15, 2023

Choose a reason for hiding this comment

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

Just to make sure that we don't run afoul of any weird situations (such as razor test dependencies), we should typeforward in an #else: https://github.com/dotnet/roslyn/blob/main/docs/Target%20Framework%20Strategy.md#pattern-for-types #Resolved

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the pointer. That's a useful doc

IEnumerator<CSharpTestSource> IEnumerable<CSharpTestSource>.GetEnumerator() => throw new NotImplementedException();
IEnumerator IEnumerable.GetEnumerator() => throw new NotImplementedException();

internal static class CSharpTestSourceBuilder
Copy link
Member

@333fred 333fred Dec 15, 2023

Choose a reason for hiding this comment

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

Why does this need to be a separate type? Why not just make it a static member on this type? #WontFix

Copy link
Member Author

Choose a reason for hiding this comment

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

It does not need to be a separate type, but it is customary for the collection and the collection builder to be different types, and I think it makes sense. See all the collection tests

Copy link
Member

Choose a reason for hiding this comment

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

but it is customary for the collection and the collection builder to be different types

This is a brand new pattern, there's no "customary" at all 😆. I'd just as soon keep it simpler.

Copy link
Member Author

Choose a reason for hiding this comment

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

All our collection builder tests beg to differ. The spec also calls out two different concepts: a "collection type" and a "builder type". It is clearer not to blend them and doesn't seem "simpler".
In any case, this seems a nitpick/preference, not a reason to hold this change up. Thanks

@jcouv jcouv requested a review from 333fred December 15, 2023 18:42
@jcouv jcouv merged commit 219fa7d into dotnet:main Dec 18, 2023
25 checks passed
@jcouv jcouv deleted the create-coll branch December 18, 2023 16:27
@ghost ghost added this to the Next milestone Dec 18, 2023
@Cosifne Cosifne modified the milestones: Next, 17.9 P3 Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Test Test failures in roslyn-CI untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants