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

global using produces unnecessary TypeRef in output file #68250

Closed
filipnavara opened this issue May 18, 2023 · 2 comments
Closed

global using produces unnecessary TypeRef in output file #68250

filipnavara opened this issue May 18, 2023 · 2 comments
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead

Comments

@filipnavara
Copy link
Member

global using nfloat = global::System.Runtime.InteropServices.NFloat;

in combination with <OutputType>exe</OutputType> always produces extra TypeRef in the output for NFloat even if the alias or the NFloat type is never used in the source code.

Repro: extra-typeref.zip

Steps to reproduce:

  • dotnet build
  • Check output with mdv bin\Debug\net7.0\extra-typeref.dll (see https://github.com/dotnet/metadata-tools for instructions on how to install mdv).
  • Observe that unused TypeRef is produced in the output: 11: 0x23000002 (AssemblyRef) 'NFloat' (#283) 'System.Runtime.InteropServices' (#20d)
@filipnavara
Copy link
Member Author

Observation suggests that it may be related to the emitted debug information. An extra confirmation would be welcome.

@filipnavara
Copy link
Member Author

Duplicate of #31192 (closed as "by design").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

No branches or pull requests

1 participant