-
Notifications
You must be signed in to change notification settings - Fork 161
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
Fully Qualified Type names for the Source Generator (to avoid namespace clashes) #160
Fully Qualified Type names for the Source Generator (to avoid namespace clashes) #160
Conversation
@@ -89,8 +89,8 @@ partial class {classNameWithGenericTypes}"); | |||
foreach (var (param, arg) in paramArgPairs) |
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.
shouldn't we also update similar usage in line 80?
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.
Nope namespaces don't support global::
- Only types do
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.
right, sorry I thought it can also be used for namespaces
@thomhurst Please run OneOf.SourceGenerator.AnalyzerTests and fix them (I think they should now fail) and add a test for your specific case (for the error that you encountered), could you also add "global::" prefix to |
The comparison inside Also all tests are still passing. I can look at adding a test though. |
@romfir They have also run on CI here: |
Interesting I thought that this test would fails because of the missing namespace in implicit operators |
|
Looks like the assertions aren't doing full equivalency. It seems to be doing things like checking no diagnostics, or that certain elements match? |
You haven't changed the namespace to fully qualified have you? |
They are using
I did 🥲 Could you move this new test to |
@romfir Have added a test to the analyzer project |
@mcintyre321 Any change of getting this in please? I'm blocked from using the source generator at the moment because of this |
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.
LGTM!
I've got a solution where I'm getting compilation errors because of namespace naming conflicts. Fully qualifying the types in generated code (so they begin with
global::
) should fix this.