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

Generated code fails to consider extern aliases #565

Closed
AArnott opened this issue May 31, 2022 · 0 comments · Fixed by #577
Closed

Generated code fails to consider extern aliases #565

AArnott opened this issue May 31, 2022 · 0 comments · Fixed by #577
Assignees
Labels
bug Something isn't working

Comments

@AArnott
Copy link
Member

AArnott commented May 31, 2022

Actual behavior

When generated code omits interop types because they are available via a metadata reference, references to those types are emitted assuming no extern alias applies. But in some more complex repos where multiple project references exist and types collide, the project may be using reference aliasing in order to disambiguate types in the various assemblies. In such a case, our generated code would need to prefix type references with the alias.

Expected behavior

Generated code should include an extern alias directive, and use that alias throughout the code whenever referencing the interop types from that assembly.
Where multiple metadata references include the same interop type, we'll have to pick one to use. This should probably come from the NativeMethods.json file.

Repro steps

See
CsWin32Sandbox_Repro.zip
for a repro.

Context

  • CsWin32 version: 0.1.691-beta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant