Skip to content

Allow File-local type to shadow a namespace declaration in a different file#69254

Merged
RikkiGibson merged 3 commits intodotnet:mainfrom
RikkiGibson:file-type-shadow-namespace
Jul 28, 2023
Merged

Allow File-local type to shadow a namespace declaration in a different file#69254
RikkiGibson merged 3 commits intodotnet:mainfrom
RikkiGibson:file-type-shadow-namespace

Conversation

@RikkiGibson
Copy link
Copy Markdown
Member

Closes #68429

@ghost ghost added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Jul 27, 2023
@RikkiGibson RikkiGibson force-pushed the file-type-shadow-namespace branch from d57cc53 to 3a4d110 Compare July 27, 2023 17:12
@RikkiGibson RikkiGibson marked this pull request as ready for review July 27, 2023 17:26
@RikkiGibson RikkiGibson requested a review from a team as a code owner July 27, 2023 17:26
// (3,16): error CS9071: The namespace 'App' already contains a definition for 'Widget' in this file.
// file class Widget { }
Diagnostic(ErrorCode.ERR_FileLocalDuplicateNameInNS, "Widget").WithArguments("Widget", "App").WithLocation(3, 16));
}
Copy link
Copy Markdown
Contributor

@cston cston Jul 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

Consider also testing these same files, but where source1 is in a separate compilation: testing as a compilation reference and testing as a metadata reference.

@jcouv jcouv self-assigned this Jul 28, 2023
@jcouv jcouv added this to the 17.8 milestone Jul 28, 2023
Copy link
Copy Markdown
Member

@jcouv jcouv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done with review pass (iteration 1). Only minor comment to consider

@RikkiGibson RikkiGibson requested a review from jcouv July 28, 2023 19:24
Copy link
Copy Markdown
Member

@jcouv jcouv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks (iteration 3)

@RikkiGibson RikkiGibson merged commit f5b6c71 into dotnet:main Jul 28, 2023
@ghost ghost modified the milestones: 17.8, Next Jul 28, 2023
@dibarbet dibarbet modified the milestones: Next, 17.8 P2 Aug 28, 2023
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

Successfully merging this pull request may close these issues.

File-local type doesn't "shadow" namespaces

4 participants