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

SourceGenerator namespace clashes #162

Closed
thomhurst opened this issue Sep 1, 2023 · 0 comments
Closed

SourceGenerator namespace clashes #162

thomhurst opened this issue Sep 1, 2023 · 0 comments

Comments

@thomhurst
Copy link
Contributor

Say you have this namespace

My.Random.Namespace

And then you're using a library with the namespace

Random.Things

If you then try to reference a class in the library, the source generator will think you're referencing the Random from your own project and thus you'll get compilation errors.

The solution is to fully qualify named types, so they begin with global:: when generating source code, so there can never be any confusion. e.g. global::Random.Things

I've already put out a PR, but this is just to track the issue.

PR: #160

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

No branches or pull requests

2 participants