Clarify what constitutes a type conflict in CS0436 compiler warning documentation #48863
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #[issue_number] by enhancing the CS0436 compiler warning documentation to explicitly explain what constitutes a "conflict" between types.
Problem
The original issue reporter, working on the Ecma C# spec, encountered CS0436 and found the documentation unclear about what actually causes the conflict. The existing documentation showed two type declarations that differed only by a string literal in their implementations, but didn't explain whether:
This ambiguity left developers uncertain about the fundamental cause of the warning.
Changes
Added "What constitutes a conflict" section
Explicitly defines that a conflict occurs when two types have identical fully qualified names (namespace + type name), regardless of implementation differences. The section clarifies:
Enhanced the introduction
Changed from the vague "conflicts with an imported type" to explicitly state "has the same fully qualified name (namespace and type name) as a type imported from a referenced assembly."
Improved example explanation
A
types have the fully qualified nameA
(in the global namespace)A
types have different implementations. The difference in the string literal... doesn't prevent the conflict. What matters is that both types have the same fully qualified nameA
."Added "How to resolve this warning" section
Provides four concrete resolution strategies:
Impact
The enhanced documentation now clearly answers the question: the conflict is based on identical fully qualified type names, not on implementation differences. This removes ambiguity and helps developers understand that syntactic or semantic differences in the type definitions don't prevent conflicts when the types share the same fully qualified name.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
Internal previews