-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Support duplicated type names with src gen #58448
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
Support duplicated type names with src gen #58448
Conversation
|
Tagging subscribers to this area: @eiriktsarpalis, @layomia Issue DetailsAddresses #57349 Expected to be ported to 6.0.
|
| return attributes; | ||
| } | ||
|
|
||
| // Copied from: https://github.com/roslyn/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/CompilationExtensions.cs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it make sense to segregate all the borrowed code into its own file ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW I believe the logging generator needs to use these methods as well, so we should move to a common location. cc @maryamariyan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. The second commit does this.
| byte[] referencedImage; | ||
| using (MemoryStream ms = new MemoryStream()) | ||
| { | ||
| var emitResult = referencedCompilation.Emit(ms); | ||
| if (!emitResult.Success) | ||
| { | ||
| throw new InvalidOperationException(); | ||
| } | ||
| referencedImage = ms.ToArray(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor nit: this could have been a helper method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks; left as-is. Note there are other tests that have the same pattern.
|
Would prefer review from @sharwell before merging. |
sharwell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming this was copied in and the new test fails prior to the code change, this LGTM
|
/backport to release/6.0 |
|
Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1210809901 |
Addresses #57349
Expected to be ported to 6.0.