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

Collection Expression Generated Types miss the [CompilerGenerated] attribute #74676

Closed
TonyValenti opened this issue Aug 7, 2024 · 4 comments · Fixed by #74683
Closed

Collection Expression Generated Types miss the [CompilerGenerated] attribute #74676

TonyValenti opened this issue Aug 7, 2024 · 4 comments · Fixed by #74683

Comments

@TonyValenti
Copy link

Version Used:
VS 17.10.5

Steps to Reproduce:
Compile this code:

namespace ConsoleApp24 {
    internal class Program {
        static void Main(string[] args) {
            Console.WriteLine("Hello, World!");

            IEnumerable<string> test = ["Test"];

        }
    }
}

Then decompile the related assembly.

The class u003cu003ez__ReadOnlySingleElementList does not have [CompilerGenerated] on it, however some of its members and private types do.

Expected Behavior:
[CompilerGenerated] is present on the type.

Actual Behavior:
[CompilerGenerated] is NOT present on the type.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Aug 7, 2024
@cston
Copy link
Member

cston commented Aug 7, 2024

See also #72539.

@jaredpar jaredpar added Bug Feature - Collection Expressions and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Aug 8, 2024
@jaredpar jaredpar added this to the 17.12 milestone Aug 8, 2024
@TonyValenti
Copy link
Author

Thank you @333fred !

@333fred
Copy link
Member

333fred commented Aug 8, 2024

@TonyValenti don't thank me, thank @DoctorKrolic. I just merged the PR 🙂.

@TonyValenti
Copy link
Author

Thank you @DoctorKrolic !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants