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

Give a more specific diagnostic when file type collides with non-file type in same file #62333

Closed
RikkiGibson opened this issue Jul 1, 2022 · 0 comments · Fixed by #63829
Closed
Assignees
Labels
Area-Compilers Bug Concept-Diagnostic Clarity The issues deals with the ease of understanding of errors and warnings. New Language Feature - File-Local Types File-local types (file types)
Milestone

Comments

@RikkiGibson
Copy link
Contributor

Related to #60819

// PROTOTYPE(ft): should this diagnostic be more specific?
// the issue more precisely is that a definition for 'C' already exists in the current file--not that it's already in this namespace.
comp.VerifyDiagnostics(
// (8,12): error CS0101: The namespace '<global namespace>' already contains a definition for 'C'
// file class C
Diagnostic(ErrorCode.ERR_DuplicateNameInNS, "C").WithArguments("C", "<global namespace>").WithLocation(8, 12));

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Jul 1, 2022
@RikkiGibson RikkiGibson added New Language Feature - File-Local Types File-local types (file types) Area-Compilers Concept-Diagnostic Clarity The issues deals with the ease of understanding of errors and warnings. untriaged Issues and PRs which have not yet been triaged by a lead and removed Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Jul 1, 2022
@RikkiGibson RikkiGibson self-assigned this Jul 1, 2022
@jcouv jcouv removed the untriaged Issues and PRs which have not yet been triaged by a lead label Jul 5, 2022
@jcouv jcouv added this to the 17.4 milestone Jul 5, 2022
@jaredpar jaredpar added the Bug label Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Bug Concept-Diagnostic Clarity The issues deals with the ease of understanding of errors and warnings. New Language Feature - File-Local Types File-local types (file types)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants