Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Config binder generator doesn't generate code when named arguments are out of order #90908

Closed

Description

@stephentoub

This will successfully generate code:

internal void Configure(IConfiguration configuration) =>
    ConfigurationBinder.Bind(configuration: configuration, instance: this);

but this will not:

internal void Configure(IConfiguration configuration) =>
    ConfigurationBinder.Bind(instance: this, configuration: configuration);

Activity

  1. ghost added
    untriaged
    on Aug 22, 2023
  2. changed the title [-]Config binder doesn't generate code when named arguments are out of order[/-] [+]Config binder generator doesn't generate code when named arguments are out of order[/+] on Aug 22, 2023
  3. added this to the 8.0.0 milestone on Aug 22, 2023
  4. ghost removed
    untriaged
    on Aug 22, 2023
  5. added
    untriaged
    source-generator
    and removed
    untriaged
    on Aug 22, 2023
  6. layomia commented on Aug 23, 2023

    @layomia
    Contributor

    wrt. to RC 2 bug bar the closest fit is incomplete-scenario-for-new-feature. @tarekgh @eerhardt would you consider this blocking given that the generator is new & there's a workaround?

  7. tarekgh commented on Aug 23, 2023

    @tarekgh
    Member

    What would be the behavior when having this case? I understand the generator will not generate code for it but what happens then? will have any diagnostics? or such calls will use the reflection at runtime and AOT build can complain about it?

  8. layomia commented on Aug 23, 2023

    @layomia
    Contributor

    It doesn't emit a diagnostic today, but we can add one.

    The call will fallback to reflection + there'll be AOT+linker analysis warnings. So, right, this constitutes a feature gap.

  9. eerhardt commented on Aug 23, 2023

    @eerhardt
    Member

    would you consider this blocking given that the generator is new & there's a workaround?

    I guess I wouldn't initially think this is "blocking", but could be convinced if this was a common scenario.

    Would we fix this in servicing? If the answer is easily "yes", then I would try to fix it for .NET 8.

  10. tarekgh commented on Aug 23, 2023

    @tarekgh
    Member

    Would we fix this in servicing? If the answer is easily "yes", then I would try to fix it for .NET 8.

    We'll service it if someone complains and has strong reason not accepting the trivial workaround. This is very unlikely, so I expect we'll not service it.

  11. layomia commented on Aug 23, 2023

    @layomia
    Contributor

    Upon further thought I'm inclined to make a fix quickly and propose porting it in RC 2.

  12. added
    Priority:1
    on Sep 5, 2023
  13. ghost added
    in-pr
    on Sep 12, 2023
  14. ghost removed
    in-pr
    on Sep 19, 2023
  15. ghost locked as resolved and limited conversation to collaborators on Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Priority:1area-Extensions-Configurationbugsource-generator

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions