`[<CompiledName>]` attribute applied to only one overload of 2 is not applied at all · Issue #19604 · dotnet/fsharp · GitHub
Skip to content

[<CompiledName>] attribute applied to only one overload of 2 is not applied at all #19604

Closed

Description

@xperiandri

Repro steps

Does not work

[<AutoOpen; System.Runtime.CompilerServices.Extension>]
module Microsoft.Extensions.DependencyInjection.OpenIddictCosmosDbExtensions

open System
open System.Runtime.CompilerServices
open System.Runtime.InteropServices
open Microsoft.Extensions.DependencyInjection.Extensions

type OpenIddictCoreBuilder with

    [<Extension; CompiledName "UseCosmosDb">]
    member builder.UseCosmosDb ([<Optional; DefaultParameterValue false>] storeScopesAndAppsInMemory : bool) = ()

    member builder.UseCosmosDb (configuration : Action<OpenIddictCosmosDbBuilder>) = ()

Works

[<AutoOpen; System.Runtime.CompilerServices.Extension>]
module Microsoft.Extensions.DependencyInjection.OpenIddictCosmosDbExtensions

open System
open System.Runtime.CompilerServices
open System.Runtime.InteropServices
open Microsoft.Extensions.DependencyInjection.Extensions

type OpenIddictCoreBuilder with

    [<Extension; CompiledName "UseCosmosDb">]
    member builder.UseCosmosDb ([<Optional; DefaultParameterValue false>] storeScopesAndAppsInMemory : bool) = ()

    [<Extension; CompiledName "UseCosmosDb">]
    member builder.UseCosmosDb (configuration : Action<OpenIddictCosmosDbBuilder>) = ()

Expected behavior

The attribute action is either applied, or a compilation error is returned

Actual behavior

The attribute action is silently ignored

Known workarounds

Use attrute in all the overloads

Related information

Provide any related information (optional):

  • Windows 10.0.26200
  • .NET 10.0.202
  • Visual Studio Insider [11709.129]

Activity

  1. added theissue type on Apr 16, 2026
  2. changed the title [-][<CompiledName>] attribute applied to only one overload of 2 is not applied at all[/-] [+]`[<CompiledName>]` attribute applied to only one overload of 2 is not applied at all[/+] on Apr 16, 2026
  3. added this to the Backlog milestone on Apr 16, 2026
  4. self-assigned this
    on May 12, 2026
  5. T-Gro commented on May 19, 2026

    @T-Gro
    Member

    @xperiandri :

    I have tested and the attribute application kicks in, that single overload is correctly renamed.
    Can you perhaps elaborate on your expectations?

    (or if the is more context to your use case, needing a different repro? The repro proving the generated IL is at #19737 )

  6. xperiandri commented on Jun 23, 2026

    @xperiandri
    ContributorAuthor

    How to track which SDK 10.0.x it comes?

  7. smoothdeveloper commented on Jun 23, 2026

    @smoothdeveloper
    Contributor

    @xperiandri AFAIU, there is no change in the compiler in #19737, it is only a non regression test, in case the behaviour of the attribute on overloaded methods would come to change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions