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

File types should account for line directives #61887

Open
RikkiGibson opened this issue Jun 14, 2022 · 0 comments
Open

File types should account for line directives #61887

RikkiGibson opened this issue Jun 14, 2022 · 0 comments
Assignees
Milestone

Comments

@RikkiGibson
Copy link
Contributor

RikkiGibson commented Jun 14, 2022

https://github.com/dotnet/csharpstandard/blob/95e8d0ff3f5a85a8269173a8f5f3a3de70f5f342/standard/lexical-structure.md#658-line-directives

Line directives may be used to alter the line numbers and compilation unit names that are reported by the compiler in output such as warnings and errors. These values are also used by caller-info attributes (§21.5.5).

The line directive causes the compiler to treat the compilation unit as having a different name. It doesn't cause it to treat it as being a different compilation unit--so, thankfully, we won't have to worry about having a different "file scope" for different line directives, for example.

I think it would be reasonable for us to use the name given by the line directive when determining what file name to use in the metadata name and in symbol display. However, I don't think it's required for correctness of the implementation. I'd like to file an issue to address it after merging the feature.

Originally posted by @RikkiGibson in #61646 (comment)

Test plan #60819

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 14, 2022
@jcouv jcouv added Bug and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 14, 2022
@jcouv jcouv added this to the C# 11.0 milestone Jun 14, 2022
@jaredpar jaredpar modified the milestones: C# 11.0, 17.4 Jun 24, 2022
@jaredpar jaredpar added the New Language Feature - File-Local Types File-local types (file types) label Jul 8, 2022
@RikkiGibson RikkiGibson modified the milestones: 17.4, C# 12.0, Compiler.Next Aug 24, 2022
@jaredpar jaredpar modified the milestones: Compiler.Next, Backlog Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants