Skip to content

Config generator generates uncompilable code when there are two same-named types in two different namespaces #90969

Closed

Description

@stephentoub

e.g.

namespace S1
{
    class C1
    {
        public void M(IConfiguration configuration)
        {
            var c = new C1();
            configuration.Bind(c);
        }
    }
}
namespace S2
{
    class C1
    {
        public void M(IConfiguration configuration)
        {
            var c = new C1();
            configuration.Bind(c);
        }
    }
}

results in lots of errors like:

error CS0111: Type 'BindingExtensions' already defines a member called 'Bind_C1' with the same parameter types

Activity

  1. ghost added
    needs-area-label
    on Aug 23, 2023
  2. ghost added
    untriaged
    on Aug 23, 2023
  3. added and removed
    needs-area-label
    on Aug 23, 2023
  4. added this to the 8.0.0 milestone on Aug 23, 2023
  5. ghost removed
    untriaged
    on Aug 23, 2023
  6. self-assigned this
    on Aug 23, 2023
  7. added
    source-generator
    on Aug 23, 2023
  8. layomia commented on Aug 23, 2023

    @layomia
    Contributor

    Addressing as part of #90976.

  9. removed their assignment
    on Aug 23, 2023
  10. removed this from the 8.0.0 milestone on Aug 23, 2023
  11. ghost locked as resolved and limited conversation to collaborators on Sep 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Extensions-Configurationbugsource-generator

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions